Teddy 的 Pair Programming 之旅
Pair programming 用2個人做一個task,productivity減半,點解重要做?用手術團隊做比喻,當「品質(人命)」比「速度 (生產力)」來的重要,pair programming係make sense。
如何优雅的设计和使用缓存?
- When do you need cache?
- Function with high CPU usage
- Function with high DB usage
- What need to be considered
- Process cache
- Lock (not a problem in node.js)
- Expiry algorithm
- Time / Frequency
- Features
- Library size
- Persistancy
- Cluster mode
- Distributed cache
- Data structure
- Persistancy
- Capacity
- IO speed
- Process cache
- 3 layer cache
- App, Redis, MySQL
- Why need process cache
- Prevent cache avalanche
- Better performance
- What does process cache good at
- Small size
- Less frequent update
- Because it is different to invalidate process cache
- Can trigger update with Redis pub/sub
- Don’t update cache, delete cache
- Prevent race condition on concurrency update of cache
- Update DB first, and then delete cache
- Need to have error handling on fail to delete cache, avoid invalid cache problem
- Cache problems
- Cache penetration
- Query record not exists, which is not cached, causing DoS
- Solution 1: cache not exists record, but have a shorter expiry time
- Solution 2: Bloom filter
- Cache breakdown
- Many concurrent query on same record, multiple query fire to DB before cache ready
- Solution 1: Distributed lock
- Solution 2: Async update popular record, instead of delete cache
- Cache avalanche
- Large amount of cache expire or cache service not avaliable, making a large amount of request on database
- Solutions:
- Increase cache avaliability with monitoring and scaling
- Use multilayer cache, with different expiry time
- Use random cache time
- Cache penetration
- Serialization
- When we update the data structure and deploy, new version of code get data in old version, crash the app
- Solution:
- Add version to cache key
- Need to use double add new version of cache before deploy
- Prevent cache avalanche when deploy new version
- Monitor cache for expiry time tuning
Why China’s Payment Apps Give U.S. Bankers Nightmares
由於Payment apps唔經銀行處理,搞到銀行收唔到手續費,做成損失。
US一年有成90 biliion美金嘅手續費收入,如果俾tech firm攻佔左個市場,會對銀行業做成好大影響。
Why Rich Kids Are So Good at the Marshmallow Test
有另一個實驗指出,可以延遲享受嘅,大多數係有錢嘅細路。令到日後成就更大嘅成因,未必係延遲享受嘅能力,而係家底比較好。
以下無需重讀
Why all world maps are wrong
由於球體嘅表面唔可以攤平做一個平面,所以好難畫到一個長方形嘅地圖。數學家用圓柱體投影法去將地球表面transform做長方形。
由於地圖只係一個projection,所以係有失真。
Mercator projection係一個常用嘅projection,雖然土地嘅面績失真,但係可以保留方向嘅正確性,所以係航海界入面,係重要嘅projection。
Winkel tripel project係一個比較平衡嘅projection,但係依然失真。
冇所謂錯誤嘅projection,岩唔岩取決於你想點樣用
Pointing and Calling Japanese Safety Standard at Railway Companies & Toyota
日本車長會用手指住並用口講出指令,可以幫助集中,避免錯誤。
What makes something “Kafkaesque”?
卡夫卡嘅書描述官僚主義,同埋人係官僚主義唔理智嘅諗法。例如「波賽頓」中,波賽頓要處理大理嘅paper work,令到佢冇時間去睇佢管理嘅水域。個問題由佢唔肯delegate野俾人嘅自尊做成。環境由人創造,而人往往囚禁住自己而不自知。
東方文化只有「拼經濟」才是成功,造就教育只要你當社會齒輪、不在乎你是誰
- 成功的定義
- 歐洲人對於成功的定義,是對於「個人存在的意義」實現了多少?
- 這也是他們教育的目的,必須思考:我是個怎樣的人?我要過怎樣的生活?我要怎麼讓自己更快樂?
- 華人地區,所謂成功的定義,有著群體社會的集體標準,華人教育的目的,是確認這個人在群體社會裡,所扮演的角色是否符合群體想像
- 對於家庭,他是不是一個好孩子?他是不是一個理想的丈夫與父親?是不是一個符合期待的妻子與母親?
- 對於國家社會,他是不是能夠提供各種產值與各種實用利益?
- 歐洲人對於成功的定義,是對於「個人存在的意義」實現了多少?
- 師生關係
- 歐洲
- 教師是站在同等地位協助者的角色
- 教師本身是一個「未知者」
- 他跟學生一樣對人性感到無知與脆弱,試著去理解學生的需要,去了解跟自己不一樣的人他的需要,然後根據學生本身調整教學計畫,非常個人。
- 亞洲
- 教師是站在「已知者」的長輩身份去指導晚輩,告訴他「你該怎麼努力」才能達到我們所已知的,關於這個社會的群體期待
- 歐洲
- 為什麼亞洲和歐洲教育如此不同
- 在華人地區,從來沒有發生過以個人思想情感為本位的、大範圍的思想革命
The importance of a breakdown
Nervous breakdown is not an illness, but an indicator to change your current life, to growth. Good mental physician should help you resolve the problem, instead of giving you medicine only.