January 2012
2 posts
My first homebrew formula
Homebrew is easy to work with. Its formulae were written in ruby––you don’t have to learn tcl just for creating package. It’s managed by git. What a smart ass. Here is my first homebrew formula, which installs FastCGI library. https://github.com/mxcl/homebrew/pull/9707 I need this library because I have to build the WebObjects FastCGI adaptor so that WebObjects play nicely with...
Jan 21st
1 note
Another possible catch about NSIndexPath
Since NSIndexPath is not unique and shared, we cannot test the equality using ==. However, according to someone’s experience, using isEqual: to test the equality of two NSIndexPaths may be wrong due to a bug which had been fixed in iOS 5. That is, if you want to target old system, you’d better not invoke isEqual: or use NSIndexPath as a key in NSSet or NSDictionary. I didn’t...
Jan 12th
1 note
December 2011
4 posts
我也是個見過風浪的男兒
最近有件事被同事當作笑柄,事情是這樣的: 因為姊姊今年生日意義重大,家人間我平常都沒在送什麼生日禮物的,想說這次就送個比較特別的禮物紀念一下。想起他之前去看過愛馬仕工匠展之後大為讚賞,就想說買個愛馬仕的東西送他好了。對於這個只在「電車男」裡聽過的品牌,我實在沒什麼概念,所以在我姊生日前一天,下班後就和平常一樣穿著短褲和拖鞋,闖進貴婦百貨 Bellavita 的 Hermes 專櫃。 當我和小姐說明,我想買禮物送人,預算是 X 萬,他居然這麼說:「那您可以看看鑰匙圈和零錢包,這是我們這裡比較便宜的東西喔!」 我的天啊!五位數只夠買鑰匙圈和零錢包!!!這就是與我遙不可及的貴婦世界!!!!也許見慣大人物的櫃台小姐看到我這個邋遢的窮酸小子還以為我是來大冒險的呢! 總之,就在一陣胡搞瞎搞後,我獲得了「在 Hermes 買東西」的成就。(不要看我這樣,其實我滿厲害的呢!居然還解開過「在...
Dec 30th
2 notes
LOL
「Android手機打fuck居然會自動幫你校正成duck 哪門子的設計啊?」 「Duck Typing。」
Dec 22nd
NSIndexPath gotcha!
Although it’s documented like this, NSIndexPath objects are uniqued and shared. If an index path containing the specified index or indexes already exists, that object is returned instead of a new instance. Test equality of two NSIndexPaths with == is SO WRONG. The uniqueness is not guaranteed. Sometimes, there will be two distinct NSIndexPath objects with the same index.
Dec 21st
請放心 hypo 不賣保護殼 →
Steven Levy talk about Steve Jobs When I pulled out my iPod—I was using it as a recording device—he was horrified to see that it was covered by a plastic case, something that he considered an abomination. He urged me to discard it. “I think the stainless steel looks beautiful when it wears,” he told me. “Probably it’s like us. I mean, I’m going to be 50 next year, so I’m like a...
Dec 15th
November 2011
4 posts
平衡木
平衡木 (Chinese) = 平均台 (Japanese) = Balance beam 平衡木 (Japanese) = 平衡樹 (Chinese) = Balanced Tree
Nov 23rd
Phantom Types
Phantom Types 是一種 parameterized type (例如 java/C++ 中的 generic ),但傳進來的 type 和真正的資料並沒有關係。 例如 這個例子裡,Biography 和 Comic 只是一種 metadata,來標示 Book 物件的狀態或特性。我們可以利用 compiler 作 type checking,來設計出不易出錯的 API。 本例中,若是讓 Marvel 出版 Isaacson 寫的 Steve Jobs 傳就會發生 compile error。 當然,讓 Comic 和 Biography 繼承 Book 就好了,同樣也可以達到目的,用 Phantom Types 的好處在哪裡呢? Phantom types 的好處是他可以用多個 parametric type 組合出更複雜的標示。例如我可以製造出...
Nov 23rd
Nov 23rd
73 notes
Nov 11th
2 notes
October 2011
3 posts
Using iOS 4 SDK with Xcode 4.2
原來在 Xcode → Preferences → Downloads → Components 就可以選 iOS 4 SDK。 這樣(應該)就不用裝三套 Xcode 了吧! (還是要裝兩套,因為 PPC support 只有 Xcode 3 才有)
Oct 23rd
Oct 6th
1 note
想像力
長大以後常常怨嘆自己缺乏想像力。回想起一些往事: 大約十年前,有人問我一個問題,大概是你覺得未來最重要的電腦科技是什麼。我那時好像是回答了可以讓軟體元件無縫互相協助運算、擴展功能之類的狗屁。對方耐心聽我講了一堆工程師的鬼扯蛋後,回我幾個字,他認為是語音操控電腦。我聽了以後大吃一驚,像天主教會的人聽到哥白尼散播的邪道學說地球繞太陽一樣,急忙和他說雖然已經有語音操控的產品,但是都還很不成熟,必須用固定的詞彙而且辨識度很差,電腦不可能了解自然語言,這絕對是死路一條,勸他回頭是岸。 Wolfram 發表了 alpha,除了高度整理過的人類知識外,不需要複雜的查詢語言就能夠給出各種比較、統整資料。 IBM 不只打敗棋王,甚至還在 Jeopardy!...
Oct 5th
4 notes
September 2011
1 post
日本遊小記事
有天在日本的藥妝店,突然看到一個很可愛像蛋一樣的東西,這造型有點眼熟卻又說不上來在哪看過,我滿好奇是什麼,就盯著看了一下。沒想到這一看居然也引起了 sffish 和他妹以及他妹同學的注意。此時我發現尷尬了,看到關鍵字,我想起來之前在 AVNO1 看過。 是這個東西。 三個女生圍著這玩意兒看,天啊,糗到爆炸……
Sep 27th
August 2011
2 posts
NSCollectionAddition →
I know everyone has his own version of this because Objective-C somehow is a bit verbose. So here is my version. If you haven’t start using similar extension, you may consider use this. It let you: ARRAY(a, b, c) instead of [NSArray arrayWithObjects: a, b, c, nil] DICT(k1, v1, k2, v2) instead of [NSDictionary dictionaryWithObjects: v1, k1, v2, k2, nil] SET(x, y, z) instead of [NSSet...
Aug 31st
2 notes
就算滄海桑田不變的是超合金魂
EVA 的駕駛年齡是 14 歲。 國見比呂在夏季甲子園以直球三振了橘英雄的那個夏天,他們高三。 鬼塜英吉當上 GTO 時 22 歲。 和迪奧在埃及對決時,承太郎和花京院是高中生,波魯那雷夫 23 歲。 對於要踏入駕駛艙拯救世界,28 歲的我也許已經有點太遲。看著身邊的朋友一個個從當年夢想是天下第一武道大會冠軍的小男孩轉變為在職場上奮鬥成熟顧家的好男人,我卻不長進地拒絕進入大人滿嘴股票、分紅的世界。 大人和小孩子的差別,在於小孩子不知道現實條件,他們相信他們做得到,也因此只有他們才做得到。隨著年齡漸增,馬齒徒長,對於信念和自己的能力不免開始感到一絲懷疑,我成了不是大人也不是小孩子的滑稽生物。 但我仍渴望有這麼一天,十幾年沒見面的朋友突然聯絡,不是為了直銷,而是夥伴之間:「地球面臨危機了,我們一起把那個標誌搶回來吧!」 ...
Aug 20th
2 notes
July 2011
1 post
Jul 2nd
228 notes
June 2011
1 post
WatchWatch
Kanulu Terichina
Jun 12th
April 2011
2 posts
Broken HTML5 on mobile safari
The video/audio is broken on mobile safari. You can’t preload them, seek them, concurrently play them, change the volume of them using javascript. It’s likely that there will be intolerably indeterministic lag after you issue the play() on audio objects.  You want to have instant audio feedback to user input, but you will get that in several seconds later. That makes iOS web games...
Apr 20th
Cleaning up MacPorts
neoesque: 剛剛檢查硬碟的空間大小才發現原來 MacPorts 升級的時候不會幫你移除舊的套件 實在啾甘心 (誤 有個小小 script 可以刪除舊的套件 port installed | grep -v "(active)" | while read i; do sudo port -f uninstall $i; done I use  sudo port uninstall inactive
Apr 7th
March 2011
1 post
Mar 16th
385 notes
February 2011
3 posts
3 tags
Localization Notes
直接拷貝 zh_Hant.lproj/xxx.string 然後 open with editor,全選,用 service menu 繁簡轉換,會把 string file format 搞爛。 要從第二行開始選起才 ok。
Feb 22nd
Feb 13th
Feb 13th
January 2011
1 post
Scala 詭異語法筆記
Function type 其實是一個 trait, trait Function1[-T, +R] extends AnyRef {   def apply(v1: T): R } 而 anonymous function 就是以類似這樣的手法來實作的: val f = new Function1[Int, Int] {   def apply(x: Int) = x + 1 } 而 Scala 有一個特殊寫法,Function1[Int, Int] 可以寫成 (Int Function1 Int)。 http://stephen-tu.blogspot.com/2010/09/another-use-of-scalas-implicit-values.html 這裡用到了一大堆技巧,implicit parameter, implicit conversion, …
Jan 9th
December 2010
2 posts
Dec 30th
2 notes
Compiler 相關的技術
最近在 survey 一些 code editor 的相關資料,想達到這些功能: syntax highlighting auto-completion code indent 想了幾天,有些粗淺的心得和疑問,先從看起來最簡單的 syntax highlighting 來談起。 查了像 TextMate 以及 Espresso 這種可以自定義語法的 editor,他們的作法基本上都是用 regex 為基礎的 match rule 替各字串加上 tag (TextMate 中稱為 scope, sugar 中稱為 zone)。這些 rule 可以互相或自我參照,做出成對括號批配之類、原本用 regex 做不到的事情。雖然這只能處理某 CFG 的子集,某些極端狀況無法處理,但就實用上來說這方法表現得還不錯。 如果要真正得到完美的 syntax highlighting,就得去...
Dec 29th
November 2010
4 posts
SQL
要改 foreign key,需要無視 constraint 的時候,可以這樣做: BEGIN; SET CONSTRAINTS ALL DEFERRED; UPDATE xxx; UPDATE yyy; COMMIT;
Nov 16th
被哭爸界的前輩
最近友人 T 和我抱怨,做軟體服務好累,整天被人哭爸,感覺很差。然後聊到我身上,T 說,「你是被哭爸界的前輩啊!」 想想也是。我也沒寫過幾套軟體,Nally Touch 被哭爸也就算了,畢竟有收錢嘛,還一年沒更新(喔,對了,當初買 TextMate 我花了多少歐元,結果 TextMate 2 哩?)。記得當兵放假回來看到 App Store 上惡評如潮,加上三小時後就要收假,心情簡直糟糕到不行,好想要摔槍拖哨掉40榴120迫擊砲。 不但如此,沒收錢、開放原始碼的 Nally 還被人罵說「小心此人 藍xx 道德 低落 我看 他裡面 一定 有 放病毒」。天啊,怎麼可能有人會說出這種沒常識的話?病毒?有是有啦,我看這傢伙應該是感染了 T 病毒了吧? ...
Nov 12th
5 notes
Code Coverage with Bamboo and Xcode
Setup Code Coverage and Bamboo To setup the coverage test with Xcode, use gcc and follow the instructions here and here. (Sadly, llvm doesn’t support gcov compatible result yet.) If you like to use Bamboo to do Continuous Integration for xcode project, be sure to check the setup in this article for Hudson: it’s almost the same for Bamboo. You may find it helpful installing git...
Nov 7th
2 notes
そんな装備で大丈夫か? →
PTT 最大的挑戰是在 performance,記憶體/IO 非常吃緊。用 Python 這種語言真的沒問題嗎? zonble: 用 Python 重寫 PTT BBS。 呃,這年頭還有人繼續在寫 telnet based BBS,也不知道該說這是件很熱血的事情呢,還是一件很奇怪的事情。話說連 KKCity 都要收了。
Nov 6th
October 2010
5 posts
yllan.org has dead
My website yllan.org has dead for a while due to server hard drive failure. After a month of hesitance, I realized that I don’t have enough time to maintain the server. Consider moving to tumblr or some virtual host. Any recommendation?
Oct 19th
2 notes
日本行的遺憾
完全不會日語。 Kamikaze Style 的衣服沒有買多一點(看看那精美的大丈夫だ、問題ない) 宇治沒吃到刨冰,宇治川真的好美啊,可以早一點去。 Jump Shop逛了卻沒買東西!!! 沒吃到拉麵。 取消了回轉壽司的茶碗蒸。 最後一夜,想去便利商店站著看色情雜誌結果失敗。倒不是因為恥力不足,而是因為……書架前滿滿的都是人根本擠不進去啊!!!
Oct 19th
Oct 7th
日本14日心得
關西熱情、關東冷漠是真的感覺到了,在關西遇到很多親切友善的好人幫忙呢。 秋葉原是給御宅族去的,像我這種都沒追熱門新番的人來說還真不太好逛呢(也許該開始看 K-On! 之類的了)。Animate、虎之穴雖然有大量同人本,但我也不想買。比較想要特別奇怪的周邊,只是那種印在墊板或皮包上的就很弱。還是 Jump Shop 比較適合我們這種觀光客呀! なると還滿有趣的 E罐!就是要這種東西啊! 巫女好萌! 日本的服務精神果然很一流,無論到哪家店幾乎都覺得很愉快。 東京駅也是有看到人隨地吐痰(穿西裝…)(囧) 浴衣很可愛,但是穿起來難以行動!穿げた走起來腳好痛…(汗) 牛乳找對地方買,超便宜! 去京都,遇到日本史上九月最高溫記錄 (39.9℃) 去箱根,遇到颱風,關東で記錄的大雨 執事喫茶:聽不懂日文,我們遇到的執事太愛笑,沒有威嚴感(……)。 ...
Oct 1st
Oct 1st
August 2010
1 post
Aug 22nd
June 2010
3 posts
這次是特別悲傷的收假
在收假前一刻聽到 Luke 走了的消息。
Jun 4th
Plurkim, iPhone app →
Yet another example of GDD - Girlfriend Driven Development.
Jun 4th
“For real progress to be made, ancient wisdom had to be forgotten, buried deep in...”
– “Turing,” the novel written by C. H. Papadimitriou.
Jun 3rd
May 2010
2 posts
1 tag
大白,好走。
大白是常常在我們營區流連的一隻狗。牠從什麼時候就在營區的,我不知道。我只知道,如果按照年資來排,我們這些兵會被大白給電到飛天:牠甚至被學長們給畫進營舍的壁畫中。 我想大白可能認得我們這些阿兵哥的衣服了吧,牠從不對我們吠,對於我們的逗弄也都不閃不理,感覺是個慵懶的好好先生。每次我們出去跑步的時候,大白都會跟著部隊一起跑,剛開始我以為只是湊巧,沒想到後來發現,牠跑一跑總是會回頭看我們,跑太快了會停下來等我們跟上,又和我們一起回營區。這時我才相信,牠真的是連上的一份子。有時候站機動班看到大白捲成一團睡覺,就會有種平靜的感覺。雖然我不喜歡逗弄它,總是說狗毛會沾到褲子,但討厭狗的我心裡已經默默接受大白。 我想,在大白的意識裡,也許認為自己是個人,不是隻狗。因為牠從不咬人吠人,卻會和營區外面那些愛對人狂吠的野狗對峙打架。這也許是牠守護營區的方法吧? ...
May 7th
WatchWatch
My Birthday Gift - The Next Generation iPad
May 1st
April 2010
2 posts
這次收假回來聽到爺爺去醫院檢查,腎臟功能衰退,心情就沒有很好。之前檢查說大腦萎縮的結果也是一樣啊,令人覺得時間的流逝真是不可抵抗。
Apr 17th
在湖口北測
這禮拜很幸運,只用操四天就可以放假了。 你有沒有想我呢?當兵時你對我無微不至的關心是我撐下去的動力。「這些都是為了你……」就好像回復魔法,讓我 HP+10 唷。 再過幾天就可以見到你了!加油!加油!
Apr 6th
February 2010
3 posts
RetroKeyboard v1.2
就是那個讓你打字的時候發出惱人聲響的小玩意兒。賣點是我錄了手上的 Mac 512K 電話線接頭鍵盤的聲音! 因為到了 10.6,要支援 64-bit 得把 Carbon 的部份拿掉,加上以前的 code 沒有放上 github,利用放假重寫了一番,順便練習一下 Snow Leopard 上的新東西,例如 ObjC 2 的 block 怎麼用。 (只要一段時間沒寫,就會很不熟) 因為我的 web server 掛點,所以直接上 github 專案頁去下載吧。
Feb 16th
Feb 14th
6 notes
Listen最近在找一首歌,但不知道怎麼搜尋。很有名啊……
Feb 4th
January 2010
3 posts
當兵當 120 天了
也就是說,現在驗退,就可以不用當兵了。 神啊!快告訴我身上有沒有什麼病痛是可以驗退的吧!
Jan 12th
“It’s funny, people always used to ask Omni to make an e-mail client. Now...”
– wilshipley
Jan 11th
1 note
iPhone development: pointer being freed was not... →
去年九月就被困擾了。Duplicate rdar://problem/7025404 zonble: 看一個錯誤訊息看了老半天,錯誤訊息發生在 UIImage dealloc 的地方,自己 trace 個不出所以然來,就去看了 stack overflow。就有人這麼說: If I change the build target to 3.1, the errors in the simulator go away. If I run the code on the device, the errors don’t appear. Possibly a bug in 3.0 My advice is to test with 3.1 as your target, and if you want, you can build for 3.0 for release and...
Jan 7th
1 note