象牙塔的問題

有些做學術研究的人會被指為活在象牙塔裏,這是批評,意思似乎簡單易明,但想深一層,便有些問題。這裏我不談「象牙塔」這個比喻的來源(在網上不出十秒便可查到),也不討論這是不是一個恰當的比喻,只想分析一下為

What I need for stream decoding and encoding binary protocols

I've recently started poking a bit at my milter project . The first part of this is to writesomething that can talk the milter protocol and thus decode and encodeits binary messages. Writing binary parsers and generators by hand isannoying; ideally you'd write a declarative description of all of thebinary messages, feed it to a package or a library, and get a codecback. So I gave it a spin with a Python package nominally intendedfor this purpose. The experience was educational but not successful


It's long since time for languages to provide sensible network IO

You may not have noticed, but stream-based network IO is famously notlike regular file IO. Well, mostly network read IO. Believing that it isis a common socket programming error .

A great deal of the time, programs and programmers do not want to careabout this. When they say 'read ten bytes', they want to get backexactly ten bytes (assuming that the stream is not closed on them) andthey do not care how long they have to wait for those ten bytes to


XD 與 LOL

我第一個接觸的顏文字是 " :) ",當時一位姨姨很興奮地跟另一位姨姨說,收到美國來的電郵,他那唸大學的兒子在結尾加了一個 " :) ",看不明,幾經探討下終於結論出這是一個笑臉,原來兒子在電郵最後加上一個笑,強

上海 - Day 13

如果每天都是出市區,實在是太累了。今天,很有意地選了一個很近的地方----吳涇。

「近」的定義,在上海來說,是可以走路到達,而走路的時間,通常以一個小時為限,這標準在香港來說,是不合理的,但上海地方大、

F100試nikon鏡皇+Leica Elmarit-R 35mm f2.8

入手了一堆平價的leica r鏡,自己改了一支做nikon mount,真的相當有勇氣呢....這對我自己來說,初次拆鏡,還把那控制光圈的小圓珠弄掉了,好在最後可以找回。

哈,有驚無險。

nikon 鏡皇,Nikon 24-70mm f2.8G ED,還有納米

Continue reading...

「國學熱」

絲路之旅後在北京留了幾天,去得最多的就是書店。我們住的酒店與王府井書店相鄰,當然是進出這書店多次了,買了書只須走幾步路便可回到酒店房間,放下書本才到其他地方遊玩,很方便。我們還到過就在附近的商務印書館

olympus-pen半格相機初試

如果以能拍半格的相機來說,就只有我手上的lomo daina f mini和這一台olympus pen,這台相機和pen f不同,不可以換鏡頭的半格相機,一卷36張的菲林可以拍72張相片,真是辛苦呀....還要是估焦的,結果拍出來,近乎沒有中焦的相

Continue reading...

The Unix shell initialization problem and how shells should work

In general, there are at least three sorts of things that you may wantto do when a shell is started: one time environment initializationsthat can be inherited in subshells, per shell things that cannot beinherited, and anything that you want to do when logging in (you mightsplit this into interactive and non-interactive things under somesituations). Depending on what a shell is being started for, you want itto do all, some, or none of these things.

A regular login shell does all


爭論民主不休

沒有人敢公然反民主,即使是最極權的地方,以民主為旗幟也是必要的,但最開明的地方,卻依然為民主而爭論不休,為甚麼?某部份的原因,在民主之於人類而言,是工具,是目的,還未共識。

如果我們試圖去解釋「民主有甚