Tuesday, 29 November 2016

Shell Script 1

 Shell Variable     Description
$0     The filename of the current script.
$n     These variables correspond to the arguments with which a script was invoked. Here n is a positive decimal number
    corresponding to the position of an argument (the first argument is $1, the second argument is $2, and so on).
$#     The number of arguments supplied to a script.
$*     All the arguments are double quoted. If a script receives two arguments, $* is equivalent to $1 $2.
$@     All the arguments are individually double quoted. If a script receives two arguments, $@ is equivalent to $1 $2.
$?     The exit status of the last command executed.
$$     The process number of the current shell. For shell scripts, this is the process ID under which they are executing.
$!     The process number of the last background command.

Monday, 28 November 2016

LTO & PGO (FDO/PDF)

1. LTO
Link Time optimization.
for example, we can use clang option -flto=thin  to specify the LTO type.

2. Profile Guided Optimization (PGO)
From Wikipedia, the free encyclopedia
Profile-guided optimization (PGO, sometimes pronounced as pogo[1]), also known as profile-directed feedback (PDF)[2] and feedback-directed optimization (FDO),[3] is a compiler optimization technique in computer programming that uses profiling to improve program runtime performance.

3.  IPO     Interprocedural Optimization (IPO)

4. CMO/IPO (cross module optimizations)

5. LIPO - Profile Feedback Based Lightweight IPO

Monday, 21 November 2016

程序员修炼之道读书笔记 52




Sign Your Work 为你的作品签名
We want to see pride of ownership. "I wrote this, and I stand behind my work." Your signature should come to be recognized as an indicator of quality.
我们希望看到人人都为自己的作品而骄傲的情况。 “这是我写的,我为自己的工作负责。你的签名应该成为质量的标示。
全书完。

Sunday, 20 November 2016

程序员修炼之道读书笔记 51




a document's presentation should be independent of its content.
文档的呈现方式(无论是网页还是slides或者帮助文档)应该和内容独立。严禁复制拷贝,因为很容易过时,修改麻烦,应该只有一个data model 多个view 自动生成。当model 变化是,自动更新view.

Saturday, 19 November 2016

程序员修炼之道读书笔记 50



The model is the source code: one view of the model can be compiled; other views are meant to be printed out or viewed on the Web. Our goal is always to work on the model—whether the model is the code itself or some other document—and have all views updated automatically.
代码就是MVC 模型中的M model),视图(view)可以通过编译产生出来,其他视图可以通过打印或者网页浏览到。我们的目标就是所有的工作都集中在模型上,无论模型是代码本身还是其他文档所有的视图(view)都应当自动被生成出来。 -à 何其对哉!如若如此,每个项目程序员开发都将轻松许多!