Posts

Showing posts from January, 2012

[Linux] .bashrc vs .bash_profile

.bashrc: profile for non-login shells ex. use terminal .bash_profile: profile for login shells  ex. use local console, ssh most people create .bash_profile the way as the below: (1) if [-f ~/.bashrc]; then source ~/.bashrc fi (2) or create a symbolic link to ~/.bashrc

[生活] Entrepreneur 必須學會的九個特質

從 Techchrunch 讀到的, 覺得講的不錯, 紀錄一下... 1. Failure     我想這是要說 to risk failure, 要有不害怕失敗的勇氣. 2. Prophetic     我覺得這句話很棒: I thought it is only a matter of time until home viewing is as easy and economical as desirable. 對未來有所規劃的話, 一切都只是按部就班而已. 3. Flexible      當然啦, 規劃是隨時間而做調整的... every entrepreneur recognize mistake quickly and transition their business accordingly. ( The catch-phrase is that the entrepreneur know hot to "pivot" ) 4. Productivity     But how? 末段寫的不錯, 重點在於時間規劃, 之前我也是這樣做, 但只是做一半... = =      Wake up early - do your work before others stop showing up at your doorstep, on your phone, in your inbox, etc.     Leave off point - leave off the point right when you are most existed to continue. Then you know it will be easy to start off next day. (但這前提是, 別明天就怠惰了... ) 5. Avoid outside stimulus    這個實在太重要了... 作者也有切身經歷... 每天我們都會犯一個錯誤而不自知: 認為收email、上twitter、facebook、yahoo bid、bbs、寫blog comment這些不會花太多時間, 可每次一看就是1~20分鐘... 這樣一個loop, 每天約重複5,6次, 也就是說我們一天花了120分鐘再這些地方, 這還不包括因為打斷了正再進行中的工作而得重

[OS]Strong reference/Weak reference

剛在看 iphone manual 看到 strong pointer / weak pointer 這部分, 應該就是指GC處理時常見字眼: strong reference / weak reference, 這裡複習一下. 每個object都會有個 counter 來紀錄它被reference幾次, 然後GC根據counter決定是否回收記憶體. counter 有三種值: Null, 0, P(>0) 當 counter = P, strong reference 當 counter = null, GC 已回收 當 counter = 0, weak reference 一般疑問是為為什麼需要weak reference?  這篇說得很詳細{ .net記憶體管理之弱參考 } 簡言之就是希望物件在被GC回收前, 給他機會轉為 strong reference, 而不是馬上領便當. 不過除了這考量外, 我在想是否這個機制也適用"在限制的記憶體下, 要求大量的記憶體做計算"時使用? 畢竟常常在處理影像時, 可能有好幾G的影片, 要針對每個Frame取label 卻又懶得自己釋放, 這時候將物件宣告為weakref, 這樣好處多多. 應該是可以吧?! 哈  有機會再試試.

[Travel] 馬六甲二日遊

名稱  Self-guided Travel in Melaka 時間  12/31-01/01 地點  Melaka, Malaysia 內容  待補

[Travel] 泰國六天自助

名稱  Self-guided Travel in Bangkok 時間  12/22-12/26 地點  Bangkok, Thailand 內容  待補