Who are you?

“Do not let the roles you play in life make you forget who you are.” — Roy T. Bennett

August 23, 2017 · 1 min · birdchan

人生最浪費時間的四件事

擔憂 庸人自擾是為難自己,讓自己每天神經緊繃、憂心忡忡只會使自己身心俱疲。 生活裡總會有變數、總會有風雨,任誰都無法提前預知一切。 所以,讓自己焦慮煩擾不如讓自己釋懷輕鬆地過每一天,順其自然,淡定坦然地面對一切,不要讓擔憂禁錮你的身體、束縛你的內心。 抱怨 充滿抱怨的人生會與快樂漸行漸遠。 對環境不滿、對別人不滿、對命運不滿、對現實不滿,最後對自己的選擇和決定給不滿……抱怨會削弱你奮鬥的力量,會阻礙你前行的腳步,會讓你陷入負面情緒無法自拔。 試著讓自己勇敢坦然地面對一切風雨,接受自己做出的每一個決定,即使這個過程充滿艱辛,但也不要輕言放棄,更不要裹足不前、自怨自艾。 埋怨 遇事先責備別人,不順先埋怨條件,這是一種消極被動的人生態度,是一種缺乏擔當的表現。 埋怨根本於事無補,只會讓你看不清自己的問題、意識不到自己的錯誤。 聰明的人會懂得先反省自己​​,從自己的身上找答案,只有用這種積極的態度去面對生活中遇到的問題,才能夠讓你吸取教訓、增長經驗,讓你在今後的生活中越走越順利。 比較 生活重要的是自己。自己覺得快樂不快樂,滿足不滿足,幸福不幸福,才是正理。 不要陷入跟別人不斷的比較之中,不要因為別人擾亂了自己的步伐。每個人都有自己的機遇和福分,也會遭遇自己的坎坷和波折,不要拿別人的成就榮耀與自己比,不要盲目追隨、模仿別人的生活方式而忘記了自己的初衷和追求。 多傾聽自己的內心,多思考自己的需要,走自己的路,過自己的人生。 珍惜時間,順其自然!

July 26, 2017 · 1 min · birdchan

javascript multiple binds

In javascript, if we bind multiple times, only the first bind takes in the provided this value. That is because the bind function returns a new function which doesn’t have this anymore. Subsequent binds won’t have any effect on the original this. [code] // NOT the real bind; just an example Function.prototype.bind = function(ctxt) { var fn = this; return function bound_fn() { return fn.apply(ctxt, arguments); }; } // no more ’this’ in my_bound_fn my_bound_fn = original_fn.bind(obj); [/code] ...

July 8, 2017 · 1 min · birdchan

How https works

Here is a nice cartoon to demonstrate how https works. http://sudhakar.online/programming/2015/08/09/https.html

June 28, 2017 · 1 min · birdchan

The Secret to Learning

That is the way to learn the most, that when you are doing something with such enjoyment that you don’t notice that the time passes. ref: https://www.brainpickings.org/2013/06/14/einstein-letter-to-son/

June 25, 2017 · 1 min · birdchan

Cheat Sheet of Machine Learning and Python (and Math) Cheat Sheets

Get them at this link: https://unsupervisedmethods.com/cheat-sheet-of-machine-learning-and-python-and-math-cheat-sheets-a4afe4e791b6

June 12, 2017 · 1 min · birdchan

Photo realistic surrealism

Check out these photos from Erik Johansson, I am speechless. Erik Johansson Photo

June 10, 2017 · 1 min · birdchan

Javascript function call/apply

[code] function Person(name) { this.name = name; } Person.prototype.getName = function() { return this.name; } name = ‘global’; let peter = new Person(‘peter’); let john = new Person(‘john’); // what are the outputs? john.getName(); john.getName.call(john); john.getName.call(peter); john.getName.call(null); [/code] You should get: [code] john john peter global [/code]

June 7, 2017 · 1 min · birdchan

Implicit structure

Every company has a structure. If you don’t explicitly define your structure, then you are left with an implicit one, and that can stifle productivity. We had hoped that being flat would let us move faster and be more creative, but as we grew, we ended up with an unspoken hierarchy that actually slowed down our ability to execute. ref: https://wistia.com/blog/ditching-flat

June 7, 2017 · 1 min · birdchan

Error starting host: Error getting state for host: machine does not exist.

If you ran minikube start and got that error, below could be the steps to fix it. I assume you have already installed minikube (v0.19.1), kubectl (v1.6.4), and virtualbox (v5.1.22). If not: [code] curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.19.1/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/ curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.6.4/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ [/code] Then download and install virtualbox at: https://www.virtualbox.org/wiki/Downloads Now, see if you have the minikube dir ...

June 5, 2017 · 2 min · birdchan