Testing in the face of popen()

Suppose that you have a program that runs another program and uses itsoutput; for example, you have a high level analysis program that runsa low level state gathering command (or several commands) to gathervarious information.Here is something that I have recently learned the hard way:

You really want to give your high level program an option to getthis status output from a file instead of by running the commands.

Doing this saves you from having to recreate a specific scenarioeach time you want to test how your


The White Ribbon(白色恐懼) ------ 自身產生的恐懼

























Film: The White Ribbon (2009)
Directed by Michael Haneke
Written by Michael Haneke
Narrated by Ernst Jacobi
Starring Christian Friedel/ Ulrich Tukur/ Josef Bierbichler
Running Time: 144mins


1. 看此戲絕對地因為導演是Michael Haneke,他之前的作品令觀眾所產生的恐懼完全是內在而生的(睇過"Benny's Video", "Hidden", "Funny Games US"都知佢

眼見未必真

昨天有個同事用電郵傳了一張演講的宣傳海報給我,我看到講者的名字印錯了,應是"Perelman",海報上卻是"Percelman"。於是我立即回電郵告知同事,誰知他說海報上分明印的是"Perelman",還順便指出其實我們的眼睛時常會作弄我們。我

The Last Station(最後車站) ------ Love Vs Freedom

























Film: The Last Station (2009)
Directed by Michael Hoffman
Written by Screenplay:Michael Hoffman/ Novel:Jay Parini
Starring Christopher Plummer/ Helen Mirren/ James McAvoy/ Paul Giamatti/ Anne-Marie Duff/ Kerry Condon
Music by Sergey Yevtushenko (Russia)
Running Time: 113mins

1. 其實我對於Leo Tolstoy(托爾斯泰:1828-1910)這個人一無所知,看過此片後才知

AJAMI(以巴火藥庫) ------ 作為半Documentary,比"Hurt Locker"更出色!

Film: Ajami (2009)
Directed by Scandar Copti/ Yaron Shani
Written by Scandar Copti/ Yaron Shani
Starring:  Fouad Habash/ Ibrahim Frege/ Scandar Copti/ Shahir Kabaha/ Eran Naim
Music by Rabih Boukhari
Country: Israel/ Germany
Running Time: 120mins








1. 今年HKIFF我第一套看的戲,是個不錯的開始!

2. 其實我對國際政局所知有限,看這類型片子是有點

Tkinter sometimes has a busy-wait main loop (more or less)

One of my always-running programs is a little Tkinter-based Pythonapp. For a while now I've noticed that it was accumulating a surprisingamount of CPU time and would sometimes show up on top as active,despite me not doing anything with it. Today I finally got around tofiguring out why, and the answer is that Tkinter's main loop effectivelybusy-waits in some Python environments.

The standard way for Tkinter-based programs to operate is to make all ofthe Tkinter calls to


通識教育

香港學生為甚麼需要通識教育?我記得自己做學生時,老師最有力的說法,就是指很多大學生連公仔麵也不懂得煮,見微知著,雖然通識科不教家政,但肯定他們需要通識教育。

可惜通識教育注定難以成功。

我們其中一個相當重

我的第一次。。。去SPA by MTM活動「見人」

今天,歷史性地,去了一個要見人的活動 —— SPA by MTM 最新Home Spa Sensation系列發佈會。


From for blog


眾所周知,我有極嚴重的社交恐懼症(你地信我啦好冇?),每逢見到大堆陌生人,便會開始自閉發呆玩手指,完全不懂應酬,問你死未?

再加
Continue reading...

夏蟲不可語冰

我沒有熟讀過《莊子》,只看過〈逍遙遊〉和〈齊物論〉等較著名的幾篇,但《莊子》裏的一些故事和語句我還是挺喜歡的,尤其是〈秋水〉的那句「夏蟲不可語冰」(註)。

當你向別人解釋一些事情時,由於對方受經驗、學識

美麗誤會 《金髮奇女子》(Eccentricities of a Blond Hair Girl)


王晶眾『追女仔電影』當中, 曾出現一組對白:『幻想美麗, 現實殘酷!』 , 頗為精警. 相信Manoel de Oliveira深諳此道.

都說一見鍾情不可信. 偏偏男主人翁被窗外倩影深深吸引, 從此不能自拔. 金髮女子於他, 猶如來自異國的香羅小扇
Continue reading...