倉皇




我不過想
每次道別都更為完整
比完整更完整,至於無限
永不再來

Why I wish Python had assignment in conditionals

There's a lot of times where a function wants to return more than aplain boolean; for example, validation routines often want to returnsome sort of explanation of the validation error (if there is one).At the same time, the most natural way to use the function is oftenin the flow of a conditional:

if blah(o):    ....elif not validates(o):    # whoops, lost the error reason

There's a variety of traditional answers to this,


取全文 Greasemonkey Bloglines 版

MySinaBlog 的 RSS 圖片問題又引來 ,因此我快速地將原本用在 Google Reader 取全文 Greasemonkey Scripts Port 了一個 Bloglines 版本:

請到 Gresemonkey 取全文

用法差不多,在 Bloglines 的內容版面上,按 “j” 會將文章 highlight,然後再按 “g” 就能取得全文。現時支持: hk yahoo blog, my sina blog,


EVA新劇場版預告

官方的還未有,偷拍的有一個: 估計G社會放正式的預告出來,大家就等著吧! 相關連結: EVA Zone – 新劇場版預告片

好心做壞事


什麼是青少年成長中最不安的問題?我覺得,是在學習階段不斷聽到別人說什麼學問“有用”,什麼知識“沒有用”,並漸漸聽到大人標籤什麼人“有用”,什麼人“沒有用”。我不敢妄斷任何學問或人“有用”或者“無用”,

翅膀三種

1. 思潮作動: 什麼都談之陳耀成

2. 下文刪成670多字登在上星期日明報,應該是第一次寫劇評,手忙腳亂的——鄧正健說《臨流鳥》引發他一直存在的困惑,見說便心裡一凜,想要好好寫出更有條理和深度的才貼出來——

Thinking about the Python equivalents of C's !! double negation

C's !! double negation idiom is a way of compressing all non-zerovalues of an expression down into a 1. There's a number of things thatyou can use to get the same effect in Python:

  • if you know that your result is always zero or positive, you can use cmp() . I'm ambivalent about whether this is obscure usage; you'reat least making it clear what you're doing, although probably not why.

    (If your result can be


為甚麼你去clubbing的時候沒有男人埋身

久不久就會收到一些留言:「Cher~~~ 我夠成日去clubbing啦,又唔見次次有男人埋身?唔好話你作大!」

每次也很想回應一句:「因為你生得太醜。」

但這就是事實的全部嗎?我隱約覺得不對。

和歷史悠久的神主牌 (註:神主牌這詞

巴黎愛漫遊 – 計較不計較

《巴黎愛漫遊》的主題並非浪漫愛情,也還是一齣「法國風情畫」,而且頗為陰暗,篇幅也不少。不過,我就不論本片如何探討法國。事實上,我真的為男主角 Jack 感到難為。他與女友 Marion 來到巴黎,他就渾身不自在,加上語言不通


就是這篇文章令電腦小氣

「家貧.命苦.電腦壞」是我大學時想出來的口號,那時住在中大,身邊只有一堆四體不勤五穀不分的中文系/學生報男生,每逢電腦一壞便感走投無路,就想脖子上掛一「家貧.命苦.電腦壞」的牌子往工程大樓門口跪地賣身