The importance of understanding Python's implementation

Joel Spolsky likes to talk about leaky abstractions ,how the lower level details underneath abstractions inevitably leakthrough and affect your work with those abstractions. High levellanguages like Python are no exception, because how their abstractionsare implemented has significant effects on how fast different sorts ofcode will run.

For instance, let's take lists and tuples, both of which CPythonimplements as arrays of objects. This has a number of consequences:

  • indexing a list element is cheap, and all list elements are equallycheap to access.

How doing relative name DNS lookups can shoot you in the foot

DNS-based host name lookups can be what I'll call 'relative', whichlook for the host name inside some domain, or 'absolute', whichassumes that the host name is fully qualified and starts right fromthe root DNS. (For clarity, absolute names are often written with atrailing '.'; this can often be used to make resolver libraries treatthem as absolute.)

Once upon a time, we had an interesting mail explosion. The campuswide mail servers started sending our


沒有地獄的 Doom

doom

Doom 毀滅戰士》又是另一齣由同名遊戲改編的電影,我當年也有玩 Doom 系列,到前些年推出的第三集也有捧場。《Doom》屬於殿堂級的遊戲作品,在技術和遊戲性上都有顯注的突破。在遊戲裏,只要夠好玩,大部份玩家都不會理會遊


20051109網摘 – 我們不要現代義和團

Comments

Web Development


土豆詩燴。在暴力與喧囂逞其豪強之處,詩恒常在。

在暴力與喧囂逞其豪強之處,詩恒常在—邀請函
邀請人:洛謀、鄧小樺、譚棨禧、李維怡

日期:13/11/05 星期日晚
時間: 7:30pm地點:旺角金輪大廈八樓
協辦:學聯社會運動資源中心(八樓)
出席詩人:鄧阿藍、陳

Using Python introspection for semi-evil

One of the things I write in Python is network daemons. Because it worksso nicely, network daemons usually take input as text lines that startwith a command word and have whitespace separated arguments. There'sa certain amount of eye-rolling tedium in writing code to check thatthe command word is valid and has the right number of arguments. WhenI wrote a program that does a lot of this, the tedium finally got tome and I sort of snapped and automated all of the validation throughPython'


Google Blog Search 繁簡不分?

想到網上找找其他《NANA》電影的評論,所以在 Google Blog Search 裏找 NANA 字眼,出來的結果全是英文,所以到 Advanced Blog Search 收窄範圍,先選取了 Traditional Chinese 來搜尋, 沒有結果 。再選用 Simplified Chinese , 有結果了 ,全是中文的,但奇怪的是裏面有繁有簡,看來 Google Blog Search


NANA – 總有你鼓勵

nana_b2

之所以會看《NANA》,完全是因為其讚譽。入場時有點擔心,自己沒有看過《NANA》漫畫,會不會看得不明不白呢?結果這些疑慮是多餘的。電影裏兩個女生相遇相知,感情細膩,叫人感動。她們在人生和感情路上,都經歷不同的波


20051108網摘 – 香港的 Yahoo! Blog

web development


Fun with DNS: a semi-obscure problem

I just helped a friend troubleshoot a DNS problem he was having on oneof his home Linux machines. The specific problem was that Firefox wastaking a long time to start connecting to web sites; he believed itwas DNS problems.

I ran down some standard guesses:

  • maybe one or more nameservers in /etc/resolv.conf weren'tresponding, and Firefox was having to wait for lookups against eachto time out. But straight lookups with dig weren't delayed, so itwasn't that.