Ordered lists with named fields for Python

I periodically find myself dealing with structures that are basically ordered lists with namedfields, where elements 0, 1, and 2 are naturally named 'a', 'b', and'c' and sometimes you want to refer to them by name instead of havingto remember their position. This pattern even crops up in the standardPython library, often with functions that started out just returningan ordered list and grew the named fields portion later as peoplediscovered how annoying it was to have to remember that the hour


How CSLab currently does email anti-spam stuff

The Computer Science department is strongly against rejecting email justbecause it might be spam (at least by default); enough people wouldrather sort through spam than risk rejecting legitimate email. Peopleare willing to have known viruses removed from their email (althoughnot executables in general).

(For clarity: the weekly spam summaries I do are not for CSLab's mailsystem.)

I once summarized CSLab's general rule is 'thou shalt not reject emailjust because it smells bad'. We can reject email


Weekly spam summary on February 24th, 2007

This week, we:

  • got 15,188 messages from 253 different IP addresses.
  • handled 21,573 sessions from 1,281 different IP addresses.
  • received 238,853 connections from at least 71,848 different IPaddresses.
  • hit a highwater of 10 connections being checked at once.

Connection and session volume is down a bit from last week . Day to day volume fluctuated up anddown through the week:

DayConnectionsdifferent

今日非常快樂




















1.

自己做生日咭給自己。如同我那個快樂的金礦(周某語),一切DIY。


2. 面對現實吧汝等!

金庸小說人物占卜

你在金庸小说中是:小龙女

小龙女几乎不食人间烟火,但是她和香香公主截然不同。在未曾遇见杨过之前,她已经

20070225網摘 – 網誌何去何從?

HK Blog

  • 20070220 詳細討論香港Blogosphere發展的種種,分析當中的討論
  • 閱報不如睇Blog Quote: 我相信Blog能大行其道,尤其在香港的原因,就是我們對於每一樣事情和討論,無論在政治,文化,生活上,都希望吸取多一點不同的意見,而

Some things to remember when implementing __getitem__

I've recently been doing some work on classes derived from list and tuple that fiddle with the behavior of __getitem__ , and ran intoa couple of surprises that I am going to write down so that I rememberthem in the future:

  • for the simple ' obj[i:j] ' case, __getitem__ is not called ifthe class has a __getslice__ method. list and tuple both do,despite the method being labeled as deprecated since Python 2.

Thesis: any server push technology inevitably breeds spam

Consider various server push technologies, where things come to youinstead of you having to seek them out: email, instant messaging,voice over IP phone server, and even text messaging on cell phones.All of them have spam problems (generally growing).

This is not a coincidence. Any server push technology will get overrunby spammers, because server push inherently gives them access topeople and is thus very, very attractive. As a consumer of server pushtechnology, your only recourse from the onslaught is to hide


The problem with browser minimum font size settings

Long ago, when I griped about Slashdot's redesign ,Oscar del Rio left a comment suggesting that I use Firefox's minimumfont size setting to cut this off. This isn't an approach that I likefor a relatively simple reason: I'm willing to have some text set small,just not the main text.

I want websites to be able to set less important things in small fontsizes, but I don't want them shrinking down the text I'm actually hereto read


Most world-editable wikis are doomed

The Linux iSCSI project keeps itsdocumentation in a world-editable wiki. I should really say kept,because it's hard to find much usable documentation in the wiki at themoment; most of the pages are overgrown with wiki spam. Some pages havehad a thousand edits in two days , all of them spam. All of this makesthe project's wiki an unfortunately excellent illustration of why mostopen wikis are doomed.

The problem is that there are just more spammers out there automatingtheir attacks than most


從Music and Lyrics想起


Music and Lyrics的故事很簡單,過氣名樂隊男主音為了再振聲威,跟失戀才女合作新歌,之後成為情侶。過程當然有很多節外生枝和笑料,但其實看慣愛情片的觀眾已可以想像這是怎樣的故事。

看這電影,驚喜不多,男女主角沒有擦出火