近年,Philip K Dick 的名字越來越多人認識了,是因為越來越多電影改編他的作品,而且不乏經典:Blade Runner, Minority Report, Paycheck 等等。Philip K Dick 可以算是最多作品被改編成電影的科幻作家,而近年其小說的中文譯本也漸漸出場了。最近就看了 A Scanner Darkly
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
Podcast 講甚麼?
最近又在想如果要做一個 Podcast 的話,應該做些什麼好。我認為 Podcast 如果有一個明確的主題的話會更好,可是自己又怕煩又怕沒有恒心長/定期做一個主題,所以暫時想不如做一些幾集的「專題」的 Podcast?正所謂做生不如做熟,暫時想到
時間
雖然明顯不是海子最好的詩,但我想不同的人都被「面朝大海,春暖花開」這個押韻句意象感動過。吐氣的開口音佔絕對多數,配合著開闊的意象——一個人叉著腰在金黃的早晨大喊那樣,而音節、聲音(而非文字)尤
剪舊
這不是最精彩的一段,但短,適合分析:「只求完成
盛事
我一面撇咀道好巴閉咩,一面把聲音調低腳步放輕。
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: