How to install Octave on OS X

I am taking Andrew Ng’s Stanford Machine Learning Class. It is required to install octave for the class assignments. For the benefit of everyone, I want to type out all the steps I took to install octave on my osx El Capitan. Certainly you could just download the pre-built binary at the official octave site, but only if your internet connection is fast and stable. I am taking the homebrew path. Oh… you have Xcode right??? Um… if not, install it first at the Mac App Store. Be warned Xcode is quite large and will take some time to install… ^^; ...

June 10, 2016 · 1 min · birdchan

這10種員工!在李嘉誠眼中是「黃金鑽石」員工!

李嘉誠在香港是個鼎鼎有名的商人, 他從小就是個做生意頭腦的人, 公司該用什麼人? 往往是企業會面臨的事。 李嘉誠會成功 也是因為他喜歡用這 10種人才, 是上班不遲到、不早退?品行好?有禮貌? 通通不是… 到底是哪10種呢? 趕快來看看吧… 李嘉誠用人哲學 李嘉誠有別於一般中國商人, 他既勝在經營,也勝在管理。 特別是在人力資源管理方面,的確有他獨到之處。 在用人上,李嘉誠的核心理念是“長江不擇細流”,“有容乃大”。 他說,假如今日,如果沒有那麼多人替我辦事, 我就算有三頭六臂,也沒有辦法應付那麼多的事情, 所以成就事業最關鍵的是要有人能夠幫助你, 樂意跟你工作,這就是我的哲學。 李嘉誠最喜歡用以下10種人, 來看看你是不是其中一種…. 1、自信的人 自信是通往成功路上的指明燈。 無論做什麼事首先要有信心, 相信自己是最優秀的,最棒的, 這樣才能把自己最大的潛能發揮出來。 2、效率高的人 效率是當今社會必不可少的生存條件, 只有辦事效率高的人才能脫穎而出。 如同在同一起點上起跑,最快到達終點就是贏家。 3、頭腦靈活的人 讀書學習好壞,與工作賺錢完全是兩碼事。 書讀的好,工作不一定做得好,出來社會,更需要頭腦靈活, 只有聰明的人才會慢慢摸索出一條適合自己的生存之道。 4、有冒險精神、辦事果斷的人 人生本身就是一次冒險。不敢冒險,才是人生最大的風險! 如果機會久久沒有降臨於你頭上, 這時候就需要你自己去創造, 創造其實就是冒險的本身,然後抓住機會, 決策果斷,憑膽量論成敗! 5、拋棄"面子"的人 摘一段李嘉誠先生的錄語: 當你放下面子賺錢時,說明你已懂事了; 當你用錢賺回面子時,說明你已成功了; 當你用面子能賺錢時,說明你已是人物了; 當你還在那裡喝酒吹牛,啥也不懂還裝懂, 只愛面子時,說明你這輩子就這個樣子了。 6、不安於現狀、刻苦耐勞的人 "一天三頓飽,老婆孩子熱炕頭", 一輩子捧著"鐵飯碗"的人,永遠沒有賺錢的機會, "夠用就行,要那麼多錢幹嘛", 這句話是那些賺不到錢的人聊以自慰的"名言"。 7、善於抓住機遇的人 在我們的身邊往往有很多的機遇, 只是由於疏忽而沒有發現讓機遇溜掉, 或者是讓別人發現實施了, 所以平時生活中對周圍的事物多看、多想、多做, 對自己發現和創造機遇有很大的好處。 下面這種人是老闆的最愛…. 8、珍惜時間的人 浪費時間就等於浪費財富! 對於經商的人來說"時間就是金錢", 賺錢靠的是珍惜時間,利用時間, 天天早睡晚起做懶漢,財富是不會進你袋的。 9、眼光獨到、堅持己見的人 做生意第一要決就是眼光獨到, 想別人未想的事,走在別人前面,讓別人在後面追。 而後在一片反對聲中堅持自己的見解, 因為經驗告訴我們:真理總是掌握在少數人的手裡。 ...

January 21, 2016 · 1 min · birdchan

你和成功人士的能力其實相差不大

你和成功人士的能力其實相差不大,只是… (1) 你在賴床,他在健身,所以他比你健康 (2) 你應付工作,他用心工作,所以他晉升比你快 (3) 你在完成今天的計劃,他在策劃明年的計劃,所以他比你掌握更多先機 (4) 你在找藉口,他在解決問題,所以他比你事業有成 (5) 你在計算自己利益,他在考慮對方利益,所以他的人脈比你廣泛 (6) 你在消費,他在理財,所以他比你富有 改變,就在這一刻開始!

August 11, 2015 · 1 min · birdchan

jQuery vs React.js

Coming from a jquery background, I really like this article which highlights the strength of React.js. React.js Introduction For People Who Know Just Enough jQuery To Get By

July 13, 2015 · 1 min · birdchan

Centering a “position: absolute” element

Sometimes we have a one-line div, having 3 elements. One floats to the left, one floats to the right, and one in the middle. The one in the middle often gets pushed around by the left/right element, resulting off-centered. related question. [code language=“html”] \[/code\] The fix is to give the following css to the center div. [code language=“css”] position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0; [/code] Thanks to the following link. =) ...

July 8, 2015 · 1 min · birdchan

iTunes Connect Screenshot Size

Just to re-post this. iPhone 3+4 (3.5 Inch) 640 x 960 iPhone 5 (4 Inch) 640 x 1136 iPhone 6 (4.7 Inch) 750 x 1334 iPhone 6 Plus (5.5 Inch) 1242 x 2208 the phone scales them down to 1080 x 1920 iPad (Air and Mini Retina) 1536 x 2048 Apple Watch 312 x 390 pixels http://stackoverflow.com/questions/25756589/itunes-connect-screenshots-sizes-for-all-ios-iphone-ipad-apple-watch-devices http://appstoreoptimization.at/itunes-connect-screenshot-size-iphone-6/

July 7, 2015 · 1 min · birdchan

Error establishing a database connection

Try this: sudo service mysql restart If you can successfully restart your mysql service, but still cannot see your wordpress, then I wish you good luck.

June 17, 2015 · 1 min · birdchan

Jason Fried: Why work doesn't happen at work

[youtube &w=640&h=360] can’t agree more

June 7, 2015 · 1 min · birdchan

Missing code to include staticfiles

If you are reading Writing your first Django app, part 6, the code won’t work until you put in the following code from https://docs.djangoproject.com/en/1.8/howto/static-files/ (in the section named Serving static files during development) to the urls.py file. from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) Basically your urls.py needs to know where to route the static file requests. =) ...

June 1, 2015 · 1 min · birdchan

Django using TIME_ZONE to display local time

It took me a while to figure out how to do this correctly. There is too much noise from google search… Here are my settings for everything to display correctly in my admin site w/ Django 1.8. settings.py USE_TZ = True TIME_ZONE = 'US/Pacific' HUMAN_TIME_FMT = '%Y-%m-%d %H:%M:%S %p' HUMAN_TIME_FMT is optional, I put it there for my own usage. models.py from django.conf import settings from django.db import models from django.utils import timezone class Sync(models.Model): sync_start = models.DateTimeField('sync starts') sync_end = models.DateTimeField('sync ends') def __str__(self): fmt = settings.HUMAN_TIME_FMT my_dt1 = timezone.localtime(self.sync_start).strftime(fmt) my_dt2 = timezone.localtime(self.sync_end).strftime(fmt) return 'From ' + my_dt1 + ' => ' + my_dt2 More to read: # https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-TIME_ZONE # http://en.wikipedia.org/wiki/List_of_tz_database_time_zones # http://strftime.org/ ...

May 29, 2015 · 1 min · birdchan