出中國記
A Python length gotcha
Python calls the __len__ method on your objects to implement len() , and in a few other situations (for example, as one way ofiterating through the elements of a sequence-likeobject). Surprisingly, there's an under-documented restriction on whatyour __len__ can return: objects can't be larger than sys.maxint .
In fact, it's stricter than that: your __len__ method must returna literal integer. You
without linkage
時間
雖然明顯不是海子最好的詩,但我想不同的人都被「面朝大海,春暖花開」這個押韻句意象感動過。吐氣的開口音佔絕對多數,配合著開闊的意象——一個人叉著腰在金黃的早晨大喊那樣,而音節、聲音(而非文字)尤
剪舊
這不是最精彩的一段,但短,適合分析:「只求完成
盛事
我一面撇咀道好巴閉咩,一面把聲音調低腳步放輕。
A portability gotcha with accept()
Today's excitement came from trying to bring a local network daemonfrontend up and running on a FreeBSD machine. It would spawn programswhen you connected to it, but they always exited immediately afterthey printed their greeting banner; it was as if they were seeing animmediate end of file.
FreeBSD's ktrace revealed that when the spawned programs went toread from standard input, they got an EAGAIN result. Fortunately I'vestubbed my toe on this one before: this is the exact symptom of yourstandard
讀網誌
The economics of CPU performance
Recently, Intel and AMD have been telling everyone who would listenthat single CPU performance is more or less all tapped out, and thatfuture improvements would come from various multi-* developments;multi-core, multi-processor, and so on. Ominous pronouncements haveemerged about how programmers need to bite the bullet and move to(highly) concurrent programming if they want their gravy train tocontinue.
When reading this sort of news coverage, it's worthwhile to rememberwhat sells CPUs and software. Namely:
鏡住
許寶強﹕〈為何知識型經濟那麼反智〉
統計處最近發表了《香港——知識型經濟統計透視2005》,本地傳媒抽