Archive for 四月, 2008

浪漫九龍塘

2008/04/29

我沒有到過九龍塘,史釗域道的百佳倒去過很多次,可惜都是跟雷小姐去。還記得第一次時,十分徬徨,打了電話給幾個爆過房的朋友,才敢手震震地推開那道磨砂玻璃門。才見識到甚麼是麻雀雖小,五臟俱全。唯獨係,時常客滿之餘,從來沒有在走廊上見過其他人。

很喜歡這首歌,道出了心底話。

二十出頭,血氣方剛,似是很開放,有甚麼不敢想?係唔敢做啫⋯

2.0

2008/04/27

凍啡走甜 1.0

已經有這念頭一段時間,然而人懶。

其實最簡單的方法是換走頂頭那張900×200的banner,雖然我很喜歡Avignon,但是看得多也會悶。事實上很難改,在自己的相片裏找一張能裁成banner好相已經不易,有時顏色又不配。每每想到要也整個color scheme改動,就立刻投降。

Sidebar上面有太多東西,太花太亂,一直都想改。但,想來想去,還是有太多東西要放在siderbar上,所以又放棄。

我喜歡把營火幕切做兩半,一邊打字一邊上網,尤其是打留言覆留言,最忌半路瀏覽器掛掉,所以通常在textedit上打好,然後copy and paste。但是macbook只有1280×768,對分之下每邊只餘下640,太窄,容不下大部份網頁

同時如果一行文字太長,也不容易讀。col-width達五百已是極限。

在幾十個wordpress的theme裏,大多都嫌太花巧,這個叫White as Milk,簡單到不得了,像一張白紙,很喜歡。

又覺得純文字太悶,想加點點圖,但又不希望用死一幅圖,想久不久就換畫,於是就要想辦法。wordpress不支援javascript,換圖很麻煩。如果用了個很naive的方法,不過又要搵位裝那段script。現在一分鐘換一次畫。

一向都不太會做graphics design,每見這樣的工作就必然拋給別人,於是由選色到css都完全不會。一向最怕別人知我讀computer science後叫我教寫網頁,寫詩我就會,設計網頁真的投降。每次要改css,哪怕只是些微的變動,都要花很多時間google,慢慢試。

所條長長的連結很長,問題是証據顯示click的人不多,那就把他收埋好了。

不要小看現在的跟white as milk的原版只有些毫分別,已花了我整整兩天時間。

改版真的很煩,要試勻firefox safari 和IE,可惜,我沒有IE,冇得試,如果有甚麼叉錯,就請見諒。

The Fatal Consequence of Masturbation

2008/04/25

For those who do not understand the subliminal message, here is the reason.

Published by the French in 1844.

There has been an eternal cultural conflict between the Brits and French since the Hundred Years’ War, masturbation was regarded as a fatal act (yes, I know, as soon as you’re born you start dying, every act is a fatal act…), no wonder there are condom vending machines in metro stations in Paris, and the French people accept a multi-affair prime minister. Therefore, the British authority’s decision is completely reasonable.

Here is the full story.

看圖識字

2008/04/24

張某傳來疑似不雅圖片乙張。

講真,讀左七年男校,七年以來既午飯都在咸濕笑話中度過,如果冇能力响短時間內將一樣野同性扯上關係,跟其他同學溝通就會好有問題,處理得唔好既話甚至會比人排擠。

一睇呢幅圖,心諗:「嘩,乜個designer咁大整古!」那個政府機構既官員又未免太過戇直,冇奶油咁都睇唔出。

呢樣野叫Subliminal message,就係將啲想宣傳既野收响其他媒界入面,正常黎講好難發現,之但係我地個腦度事實上又儲住左呢啲message,慢慢心底裏就無意識地潛而墨化咁信左果樣野。

二千年美國大選,布殊對戈爾,响布殊既競選廣告裏面曾經閃過RATS幾個字,之後出現過一些爭議,指控布殊試圖洗人腦。最簡單既藉口當然係話純粹巧合啦,但係佢地選舉用幾千萬美金做宣傳,花左咁多錢請顧問,咁都發現唔到真係搵鬼信咩!

不過都好,就咁樣,我呢個遠在天邊既人都知道前宗主國有個部門叫Office of Government Commerce.

掟蛋糕

2008/04/23

是日下午,謝某傳來新聞一則。

BrownDailyHerald: Times columnist pied in face by activist

被掟的是寫The world is flat的Thomas Friedman。掟人的是個環保份子,大概係妒忌佢本書印左幾十版,浪費紙張。

然後跟同學談起,他說有個組織叫Bakers without Borders,是Doctors without Borders的蛋糕版,專門負責掟蛋糕。

曾經何時搞笑電視節目都很喜歡掟蛋糕,被批評浪費食物,不環保,現在已少見這條環節。

歷史裏最出名的應該是Bill Gates在布魯塞爾給人掟蛋糕

以我對這間學校既理解,那學生將不會有甚麼問題。

DPS Lt. Rick Lombardi told The Herald that no party wishes to press charges.

如果這事件在邵逸夫堂發生,曾鈺成在演講,有人掟Med can特產檸檬批,又會有咩事發生呢?

搶米立立雜

2008/04/22

明報:美民搶買糧 超市限額售米

還以為美國此等富裕的國家,只會出現搶購iphone搶購ps3的新聞,想不到竟然都要搶米。

這段新聞再吸引我因為它提及「新英格蘭」地區,時常見的新聞,美國西岸只有加州和西雅圖,東岸只有紐約華盛頓波士頓。那天民主黨在羅德島初選,我還熱切地尋找報紙裏關於這裏的報導,我只找到俄亥俄和德州。羅德島雖然細,一個鐘都唔使就足夠由西南駛到東北,都唔使隻字不提啫!

一向貪方便subscribe了meal plan,雖然有時好鬼難食不過勝在分量夠多。今日上網查下年度的費用,嘩頂佢加價加足足一成,千一加到千二!大佬我呢啲低收入既研究生,每個月交租已經冇左近半份糧,仲未計買書買餸,都係要再考慮下食唔食meal plan好。

美國呀美國,你生性下啦!幾年前你都曾經風光過格!零五年港幣對歐羅曾經九個半都唔使,偏偏到我賺美金時,就跌到十二個半,足足貶值左兩成半!怪唔知得你啲iphone同ipod咁好賣啦。

喺我既眼中從來米都係唔值錢既野,於是我會好唔鐘意一碗白飯可以賣到十幾蚊既貴價酒樓。我亦從來諗唔到大米响文明世界都會出現短缺既問題,美國喎!冇飯食,點解唔食burger king?

友人成日話上年股市炒得性起時,又有邊個諗到最後竟然五香肉丁會跑贏大市!係,冇錯,肉丁既存倉費係貴啲,但係佢起碼三五年先到期,時間值跌得慢個窩輪多多聲喎!

Hate Week

2008/04/20

If there was hope, it lay in the proles!

from cnn.com

The proles, normally apathetic about the war, were being lashed into one of their periodical frenzies of patriotism. As though to harmonize with the general mood, the rocket bombs had been killing larger numbers of people than usual. One fell on a crowded film theatre in Stepney, burying several hundred victims among the ruins. The whole population of the neighbourhood turned out for a long, trailing funeral which went on for hours and was in effect an indignation meeting. Another bomb fell on a piece of waste ground which was used as a playground and several dozen children were blown to pieces. There were further angry demonstrations, Goldstein was burned in effigy, hundreds of copies of the poster of the Eurasian soldier were torn down and added to the flames, and a number of shops were looted in the turmoil; then a rumour flew round that spies were directing the rocket bombs by means of wireless waves, and an old couple who were suspected of being of foreign extraction had their house set on fire and perished of suffocation.

On the sixth day of Hate Week, after the processions, the speeches, the shouting, the singing, the banners, the posters, the films, the waxworks, the rolling of drums and squealing of trumpets, the tramp of marching feet, the grinding of the caterpillars of tanks, the roar of massed planes, the booming of guns–after six days of this, when the great orgasm was quivering to its climax and the general hatred of Eurasia had boiled up into such delirium that if the crowd could have got their hands on the 2,000 Eurasian war-criminals who were to be publicly hanged on the last day of the proceedings, they would unquestionably have torn them to pieces–at just this moment it had been announced that Oceania was not after all at war with Eurasia. Oceania was at war with Eastasia. Eurasia was an ally.

1984, George Orwell

好好玩的面試

2008/04/15

跟門口的金髮姐姐登記過後,她叫我到旁邊的沙發等候。
IMG_0050.JPG
噢,原來這是面試的第一回合,Guitar Hero。雖然我沒有音樂感,但玩得較身旁的西人好,若干回合後,那位hr哥哥終於到來,胡謅了幾句,他帶我去搭車到另一棟建築物去。

第二回見試內容基本上都是那些可遇見的題目,例如你做過甚麼project、遇過其麼困難的事、為甚麼揀我地公司等等,然後是技術問題:implement一條唔知幾大,indexed by integer既list,好簡單,不過唔知點解我一開始諗起Pascal String,於是就整左一條好慢既linked list。面試官梗係覺得怪,又問我呢個algorithm有咩問題,於是我補飛,話整多個index咁可以做binary search⋯⋯冇穿冇爛又過左一關。

第三回係最好玩果個回合,果條友仔超過癮。其中一個技術問題係,佢比一個prototype我,同埋佢既black box,叫我估究竟個program做乜既。個prototype係:

int f(char* s1, char* s2);

我可以不斷咁比input佢,佢會比個答案我。最最最正路見到都好應該估佢係一個string comparison既function,但愛玩野既我又點會咁簡單,於是我比左下列既test case比佢:

f(0,0);
f(0,1);
char *s = new char[10];
f(s,s);
f(s,s+1);
char *ss = new char[5];
f(s,ss);

佢都知我玩野,佢話可以係一可以係零,因為c唔會initialize任何野,於是我又再黎:

memset(s, 1, sizeof(s));
memset(ss, 1, sizeof(ss));
f(s,ss);
s[1] = ss[1] = 0;
f(s,ss);
f(s,s+5);
....

最後我估呢個function係做strcmp,如果兩條null-terminated既string係一樣就return 1,否則就return 0。

佢話差唔多喇,佢話呢個係string matching既function,s2係個pattern,例如
f('hello', '*he*') = 1
f('hello', '*ll' ) = 0

佢又問我會點test,咁我又玩啦:
f('*','*');
佢話assume s1唔會有*
f('', 0);
佢話assume 0 係個invalid address:
f('', 1);
佢話好會出error
f('a','******************a');
我話一個蠢既implementation如果唔識做optimization會好慢,佢問我仲有冇其他case
f('hlhlhlhlhl', 'h*l*h*l*h*l*h*l');
我話有可能會好慢,佢話perl既regex慢就係呢個原因,去到呢個位,我兩眼發光,開始覺得好玩。
char s[12] = '*****hello';
f(s+5,s);

我解釋話因為有啲茂利會懶醒咁想慳memory而劃花人地啲野之後改番岩然後扮有事,如果兩條string係overlap就有機會奶野。佢滿意又問有冇其他。
f('abc','');
正常啲啦呢個。佢話正常黎講有三種testcase,叫我寫曬出黎。我肴左一肴,响邊道黎三種?讀書都冇教過既!亂寫條正常啲啦:
f('hello world', '*hello wo*l*');
佢就話得,我已經一次過demonstrate曬三種test case出黎。頂,原來咁淺。

然後戲肉到喇,佢叫我將f寫出黎。嘩!我O左一下嘴,一向好怕做呢類題目,有唔容易既case analysis,實會錯。咁梗係第一時間問可唔可以用perl/python啦,人地天生識得個regex,佢話sure, but you will need to do it in a hard way, you have to assume you don’t hv the regex component, so i guess you will prefer using C。都預左,之不過,人地話就算唔識做都起碼試下,咁我就話:I will use a DFA。佢笑,話想睇我點用dfa,佢話通常啲人都用recursion。其實去到果個位,我都唔係好知點寫,不過見步行步。

畫左個automata出黎之後,我先發覺,原來係個NFA黎,麻煩過dfa好多(我都知理論上佢地係相通,但係nfa可以exponential of the size of dfa喎!),如果呢個世界真係有parallel universe幾好。我擰轉身,同佢講,oh, it is a NFA, i will do it with a recursion,同時我心裏面大概已經有個點做recursion既概念。但佢話,no, keep it as a DFA, i want to see how you will do it。我諗左一點七秒之後發覺,超,整條queue咪得囉,recursion/stack/queue從來都係同一回事啫,十分鐘之後,就寫好左一個佢滿意既pseudocode。

之後同佢吹左好耐,佢指python同perl都係用recursion黎處理regex既,然後互相吹左好耐點解dfa/nfa好難做matching。超好玩,interview之餘仲有野執,呢一個鐘,過得超快。

其餘既,差唔多啦。愈見愈高級咁囉。尾二果個間房有三個mon三部電腦一部xbox,最尾果個間房得一個mon同一部laptop,仲有張梳化,好明顯最後呢個完全唔使寫code啦。

超級快有回音,番到酒店,上網,就已經收到email。

也算是吐了年多前的一口冤氣。

%d 位部落客按了讚: