Dangerously over-broad error catching

One of the stock pieces of advice about writing Python code is thatbasic error checks should be handled by catching the exception thattrying to do the operation generates, instead of through explicitchecks beforehand. For example, if you are getting the value for a keyfrom a dictionary (what some other languages call a hash), you don'tbother checking to see if the key is in the dictionary beforehand; youjust try to get the value.

This code might be written like this (especially in examples)


Some quick CBL stats

Last night I shuffled our antispam rules to put checking the CBL before everything, including our per-IP-address greylisting.

Since 3:20am this morning, 83% of the connect-time SMTP rejectionswere due to the CBL, for 88% of the IP addresses (4,180 out of 5,000rejections from 3,038 different IP addresses out of 3,455).

So the simple recommendation seems to be: if you can


火爆!賈樟柯連載完結篇

遲鈍的知識份子.被昇華的女性——「這個現代化到來的時候,傷害了很多人,為什麼知識份子反應會慢,這裡面會不會有其他的原因。」

人的病/體制的病——「太生也有在『玩』的成分,他不是為了利益,阿群能夠改變他的

如有需要...


Photo
Originally uploaded by chi_hung .

假如你是座輪椅的,有日在行商場時好急好急,需要去小小或便便.但當你搵到個廁所時見到廁所門上寫著這些字,你會如何? 我? 第一時間一定係講粗口的!

這種情況其實在我的輪椅朋友來說,是經常出現的

吃豬肉的豬

廣告時間
蘇小豬終於開blog大吉了

吃豬肉的豬
https://blog.yam.com/sopigso

大雨也澆不熄的火!賈樟柯連載之四

親密的人.陌生的階層——「《小武》我寫作、拍攝的時候就想像,這是拍給我初中的同學、朋友他們看;《站台》時的那種語言狀態就好像寫給父親一樣,『我的父親他會懂』。寫給一個有生命經驗的人,不用講那麼清楚,他

好天氣還會來

在此謹向為連續天雨而感到沮喪的人們發言:我知道你們過去幾天很沮喪。而好天氣還會來,今天有太陽了,你們的正常生活會繼續,可以晾曬衣服,掃除霉菌,重新整理美好的想像,進行戶外活動。而我希望告訴你們的是,在

Some spam stats at June 25th, 2005

Another Saturday, another set of spam statistics. This week I stoppedputting in IP-level blocks for high-rate connection sources so that Icould gather more accurate statistics on the various DNS blocklists thatwe use here.

Most of the statistics are from about 3:20 am Sunday the 19th, whenlogs rolled over; some are from about 6:10 am that Sunday, when thesystem rebooted. (Note that many figures are somewhat rounded off.)

The basic statistics are stark:


PKD 機械人

pkd 在芝加哥舉行的 NextFest 展覽,是一個展示未來科技的地方,包羅了全世界各地科研成果,如機械人、太空穿梭機、概念汽車、光學迷彩等等。而今年很有趣的是,會有一個 Philip K Dick 機械人

Philip K Dick 是有名的科幻作家,很多作品已被改編


地鐵非禮記

基本上,o係擠迫既地鐵車廂內,被人摸pat pat掃大脾擦胸邊都係一般女生「司空見慣」既事。

今日,我又領教左一種新奇既非禮手法。

話說我握住地鐵車廂中央既扶手較低位置,一名男子同時亦都握住扶手,慢慢將佢既下半身貼