Why your main program should be importable

When I first started coding in Python, I didn't know what I was doing.So I structured my Python programs the way I would write Bourne shellscripts or Perl programs, writing functions as necessary and usefulbut otherwise putting all of the logic and code in the program's fileoutside of functions (in what I now call 'module scope').

This is a perfectly rational structure for Python programs, and evenworks; my programs ran fine and were perfectly functional. But it wasalso a


轉載自明報副刊
安裕周記﹕勇敢的抉擇

Barcamp HK 2008

上年沒有去的 BarcampHK ,今年終於有去了,可是星期六上午要工作,下午才能到。我聽了:

Open Source + Microsoft

剛剛到達,此時已是 Q&A 時間,所以聽不出所以然來… 望各位補完…

FCKE ditor

這是一個通常會 embed 到 blog、CMS 等等的 Rich Text Editor,因為聽了十分鐘


勢必過氣小混混《處刑的房間》


處刑的房間 》(1956) 不是 市川崑 的 最佳作品, 卻是「太陽族電影」的鼻祖. 同類型題材的電影之中, 《處刑的房間》名氣不及《太陽的季節》(1956) 和《瘋狂的果實》(1956) , 卻與大島渚於「松竹新浪潮」

大家都來寫

身邊的文化小資朋友不大談投票。或者只建議人去投票,彷彿已經算是盡了公民責任。當暗地裡有以 單程證利誘投票 這樣令人髮指的事發生,為何我們明地裡不可以像球迷講波、書迷談書、師奶格價一樣,標明自己的投票意向?

鬱悶

在澳門這個平靜但恐怖的地方循規蹈矩地生活還要讀過一點書喜歡講道理不肯橫蠻無力靠惡真的非常鬱悶而這就是我們的宿命因為這個地方的賤民代代如此他們已經習慣了而我們只有慢慢地把自己一點一點地磨平讓自己低賤地過

Why negative DNS caching is necessary

DNS software in general has two forms of caching, which I've seen called'positive' and 'negative'. Positive entries hold actual answers obtainedfrom authoritative servers (theoretically, see Dan Kaminsky's DNSattack), while negative entries mark entries that (theoretically) don'texist. Positive entries are cached for their TTL value; negative entries don't have a TTL themselves, but more or lessinherit a TTL from the zone's SOA record.

(The details are complicated .)


澳洲幫坐冷板櫈

心血來潮, 老是想起《La Femme Nikita》(1997-2001), 改篇自Luc Besson《墮落花》(Nikita, 1990) 衍生的電視劇集. 記得在00年閒來無事, 在明珠台收看到, 立即喜歡上了她. 當時《La Femme Nikita》已播到Season Three. 後來忙於學業, 沒
Continue reading...

留 言 對 答


最 近 的 是 非 新 聞 報 道 後 , blog 多 了 很 多 留 言 。 如 常 , 有 支 持 我 的 , 也 有 攻 擊 我 的 。


我 想 借 專 欄 深 入 地 回 應 各 個 質 詢 我 的 留 言 。


留 言 1 : 平 心 而 論 … … 人

Continue reading...

Something to remember when using DTrace on userland programs

As mentioned before , Solaris's DTraceis fundamentally a kernel debugger; in order to extract informationfrom userland programs, you need to copy it to kernel space (generallyusing DTrace's copyin() function) before you can start printing it orotherwise use it.The most important thing to remember about this is that you wind updealing with two sorts of pointers: userland pointers, which is whatare in all of those data structures you copy in from your program, andkernel pointers, which is what