Multilevel list comprehensions in Python

Python has recently (at least for some values of recently) grown 'list comprehensions' ,which let you easily iterate over a list to transform or selectentries (or both). List comprehensions can be thought of as syntacticsugar for map and filter operations, but they're actually morepowerful.

One reason is that you can write a multilevel list comprehension,which effectively iterates over multiple levels of lists. Take thecase where you have a list within a list and want to return all of thelow-


Spam breakdown by SBL listing, July 31st 2005

This is roughly speaking a table showing the top N SBL listings thatare spamming us over the past 28 and change days. I generated it bygrabbing all rejected IP addresses, looking them up in the SBL, andcounting how many hits each SBL listing accumulated.

Refused connectionsSBL listing
232 SBL26860
208 SBL23039 (Rokso: Randy Forman)
190 SBL21425 (listed since 28 Nov 2004)

神奇四俠的一場意外

f4

在一連串的英雄片相繼推出後,跑出來的有 Spiderman、X-men、Batman 等等,這些片的成功點,在於除了講英雄的表面風光,還會探討英雄身份,為主角們帶來什麼樣的改變,和他們的心理變化等等,這使電影真真正正創造一個立體的角式


Spam storm aftermath, July 30th 2005

The spam storm seems to have died down nowand it's a Saturday night, so time for a wrapup and a look at theoverall stats this week.

This week's total is 295,000 SMTP connections from at least 38,000different IP addresses. In hindsight, the spam storm was probablyalready dying on the 26th, since we got only about another 60,000 SMTPconnections since then (which is more or less average)


自助網摘 Textile Bookmarklet

本站在寫文章時是用 Textile 的,在寫文時可以相當方便地可以寫連結,而不用打 HTML 碼。不過,在開始試行網摘時,要將大量的連結寫成 Textile 的格式就很痛苦了。我通常都會將我在 del.icio.us 365Key 收到的網址,用 RSS 聚合 ( FeedJumbler ),將


早晨七點半

前兩天上班,見到 《AM730》 的牌子,不過沒有人派,心想原來 《AM730》 已經創報了?今天早上班見到有人在派了,拿了一份來看,不過看到最後的「讀者回應」欄,才發現原來手上的這一份就是第一份的 《AM730》 了


Briefly doing DNS queries in Perl

As a companion to PythonDNSQueries , here is the sameprogram to query the SBL in perl, using the CPAN Net::DNS package.

#!/usr/bin/perl -wuse strict;use Net::DNS;my $sstr = ".sbl.spamhaus.org";my $res = Net::DNS::Resolver->new;foreach my $ip (@ARGV) {	$ip = join('.', reverse(split(/\./

廣告時間=當被遺忘的遇上

安仔是 「觸映份子」 的朋友,影片 《看不.看見》 的編劇及主角。
2005年他的新製作

書名: 當被遺忘的遇上
作者: 鄺頌安

銷售地點:05年07月20日起,於香港書展及各大書店有售
定價:HK$35.00

故事簡介:富商

20050730網摘 – 今年書展我無去

網絡發展

IE7 Beta 不得人 (Developer) 心?

Firefox


甜美生活

我的世界=Dry