星期三, 4月 07, 2010

[Linux] Makefile 說明

http://www.csie.ntu.edu.tw/~r91065/_cur/Studio/makefile.html

Makefile說明,推薦!!

[C++] C++ naming

http://www.csie.ntu.edu.tw/~r91065/_cur/Studio/naming.html

推薦!!

星期四, 4月 01, 2010

[Python] String to JSON轉換必殺技

http://eishn.blog.163.com/blog/static/65231820070181041204/

如果你不想裝JSON module,請服用~~~~^^
json = lambda s, encoding = sys.getdefaultencoding(): repr(unicode(s, encoding))[1:]

PS. 據說最後那行代碼很容易令人摸不著頭腦, 你不妨把json() 換成(string) escape() 來理解。
如果你用escape 來定義這行代碼, 你只能得到escape;
如果你用 json 來命名, 你得到了 JSON。

星期三, 3月 17, 2010

[Linux] time 怎麼用 GNU verison

個人常常使用time來看program跑多久,man time的說明中,有--verbose,還有format,但
# time -v ps aux
這樣都會有顯示
-bash: -v: command not found
real 0m0.001s
user 0m0.000s
sys 0m0.001s

後來才知道原來是bash這個shell中,time的指令沒有GNU版本的功能
所以怎麼跑GNU版本的time呢?
就是..
# /usr/bin/time -v ps aux

水啦~~~~^^

星期五, 1月 15, 2010

[Linux] vim 怎麼用?!

http://blog.vgod.tw/2009/12/08/vim-cheat-sheet-for-programmers/

這位部落客,把Vim常用的部份給圖形化了,這真是太屌了~~~^^
vim的指令(command)不會,上鳥哥太慢~~~^^
有PDF可以下載嚕~~~^^