Putting a pleasant Python surprise to use

Although I've been programming in Python for a few years now, it keepssurprising me with little bits and pieces. Here's a neat Python languagefeature that I recently used for the first time (discovered originallythrough Bram Cohen's LiveJournal).

A common programming pattern is 'search for a something to work on, butstop if you don't find anything'. In Python one might write it somethinglike this (taken more or less from DWiki 's source):

found = False

Pitfalls in generating Last-Modified:

Every HTTP reply from a web server can include a Last-Modified: header, which theoretically tells interested parties when the web pagewas last modified. This is really something that works best when theweb server is just sending out static files; when it is generatingdynamic content, like DWiki does, things get interesting.

The major use of Last-Modified: is to decide when a browser already hasa current copy of the web page and doesn't need to fetch it again. Thus,with dynamic pages


廣告兩則

1. inmedia少男出賣肉體

inmedia的硬銷行動實在令人啼笑皆非,六四當日開檔籌款的紀念文章一篇接一篇緩緩出現,繼小西之後, 後生領男 也來一篇〈 撞爆頭,為籌款 〉——今日已經6月14日,六四硬銷已經有足夠時間成為歷史遺跡了

網絡指令

typing

不知道大家有沒有使用 Command Line 的經歷,我當初第一部電腦用的是 DOS 6.22 ,雖然配上 Windows 3.1 ,但其實也要經常到 DOS 去進行 Disk Operation,而且那時候要玩電腦遊戲,也一定要懂得如何使用 Command line ,否則便連遊戲安裝也成問題。

由 Command Line Interface 進


I can't stop my tears

我討厭下雨天。

每次看到雨絲,看到雨點打在玻璃窗上,總會莫名其妙的想哭。

中午時獨自一人在辦公室吃午餐,看著窗外灰暗的天,忽爾整顆心都好像掉落了,覺得好寂寞好寂寞。

然後聽到滴嗒滴嗒的聲音,我以為是一雙手按

再見,謝謝你的魚

剛剛看完《星際快閃黨 The Hitchhiker’s Guide to the Galaxy 》,玩轉銀河系,相當痛快!影片開頭有一首歌,講述在地球第二等智慧生物海豚 (人類只是第三等) ,不斷向人類發出地球即將被毀滅而徒勞無功,唯有向人類講聲道別: So long and thanks for all


Why a Blog?

Honesty compels me to admit that part of why I am trying blogging isthat I coded a bunch of blog features into DWiki , my wiki-thing, and Iwould feel kind of stupid if they never got used. (The blogdir codehas a clear usage case, but the blog code does not quite so much.)

But that's not all of it. Web pages cry out for a linking structure,an organization, a taxonomy, just like we are supposed to sensiblyorganize directories on our computers


Making a Python mountain out of a molehill

DWiki is the software that runs CSpace , including this blog . It'swound up much bigger than I expected and wanted it to be. This is sortof the story of how (or why) that happened.

DWiki started out with a simple goal: serve up (revision controlled)wiki-text documentation as HTML pages. It didn't have to edit thepages; we'd do that in a real editor in a real environment. The coreprogram model was simple: pages would be generated


合理使用

港燦 的 Blog 最近碰上了相片的版權問題,事原有一些該圖片的原拍攝者投訴港燦什麼也沒有通知便引用了。而事實上,事情不算太複雜,只要加上圖片來源便可以了。

我的 Blog 也用不少的圖片,主要是自己文筆差,所以希望用些圖片


趣味網站

最近有兩個中國網站,依照原裝 Boing Boing 的宗旨,由網友各自投稿,收集網絡上的新鮮有趣事,分別是 Pose Show Boing Boing in China ,兩個網站。

我自己很喜歡看 Boing Boing ,新聞夠有趣,也貼近大眾,而且真是什麼題材也有,只是有時因為很多是外國