2013年8月13日 星期二

vim spell check

:set spell
]s 跳到下個錯字
[s 跳到前個錯字
z= 顯示建議字詞
zg 新增正確拼字
zug 刪除正確拼字
zw 新增錯誤拼字
zuw  刪除錯誤拼字

python 取得區域變數 locals() 與全域變數 globals()

locals()
globals()


× locals is read-only, globals is not

>>> x = 1
>>> locals()['x'] = 2
>>> x 
>>> globals()['x'] = 3
>>> x 




Reference :



python get function parameter


>>> help('func')
寫在函式裏的註解說明會被顯示出來

>>> inspect.getargspec(func)
Get the names and default values of a Python function’s arguments.





Reference :
27.13. inspect — Inspect live objects — Python v2.7.5 documentation
How can I find the number of arguments of a Python function? - Stack Overflow

2013年8月9日 星期五

auto create, update time in sqlalchemy

Column('creation_date', DateTime, default=func.now()),
Column('last_modified', DateTime, onupdate=func.now()),

2013年8月2日 星期五

滷大腸

去腥
1. 在市場買到已翻好的大腸,將大腸在鍋子內,加入麵粉與白醋將雜質揉出來,然後用清水洗淨
2. 起滾水,加入薑、蒜、大腸,煮至大腸可用筷子戳過 (約 1 小時)





滷鍋
1. 將冰糖與少許油炒至糖融化、變色
2. 蔥、薑、蒜、辣椒(去籽)、香菜頭用刀子拍過,洋蔥切片,炒香
3. 加入醬油、紹興酒煮滾 30 分鐘




滷大腸
滷鍋煮滾,加蓋滷 30 分鐘,然後開蓋泡 10 分鐘





Reference :
美食鳳味 郭主義 滷大腸食譜 - YouTube