There is such a thing as too much SQL (a reminder to myself)

This is a very small war story.

I've spent part of today working on generating some reports from our IPtraffic accounting system. We have multiple internal networks that getNAT'd out different gateways, and what we want is a report (or a set ofreports) of the topindividual traffic sources for each gateway that did more than a certainamount of aggregate traffic in the day.

Our traffic accounting data is held in a PostgreSQL database. Since atypical day has around six to eight million records


Converting between IPv4 addresses and 32-bit integers in Python

When you write code that deals with IPv4 addresses, every so oftenyou wind up in situations where you want to convert addresses inconventional text form to unsigned 32-bit integers and manipulatethem in various ways (and then convert the results back to normalnotation). This is something I've been dealing with recently , so I've been working on this today.

Python doesn't have any standard library functions that directly dothese conversions. You can write your own code for this (but


破碎的擁抱


Broken Embraces 在香港譯成《情婦的情夫》而不依原名譯為《破碎的擁抱》,我認為是相當離譜的低劣手筆,簡直不可原諒。

西班牙大導演 艾慕度華 (Pedro Almodovar,一譯阿莫多瓦)這齣愛情片的確拍出深情,也拍出深度,我一直以來都喜歡他的作
Continue reading...

學術招牌的意義

梁文道近日有一篇 文章 批評中國的學術界和高等教育,有幾句說話真是拳拳到肉:

「我們今天有誰能夠保證一個中國重點大學博士的資格,一部大學出版社出品的水準呢?國家最高學術機構的成員可以涉嫌抄襲,重點大學的教授

EVA 2.22 DVD 歌曲歌詞

拿了之前預購的 EVA 2.22 破 DVD,贈品未有,先看影片,發現片中兩首歌除了有翻譯之外,竟然還是可以用廣東話跟著唱的,有點驚喜!(不過我忘了戲院看時是否一樣?)

《今天說再見》 希望到永久 當邊際給跨過後 仍是你最親


The great irritation of hidden access controls

One of the things that I really hate about modern desktop environments,specifically their graphical system administration tools, is thatthey are increasingly completely hiding their access controls andauthorization systems. I know that they have them, because theyhave some mechanism for doing various operations that require rootpermissions without bothering to ask me for the root password. Butit's become just about impossible to find them; what was once at leastvisible in PAM configurations has vanished into what I believe is atwisty mess of Kits (PackageKit,


lightroom初手

本來我的mac機是有lightroom的,但太少用了。lightroom是相片管理軟件,我又不愛交給軟件管理的,所以就沒怎用。當然,lightroom還有好強的相片編修較果。

在討論區看到别人用lightroom批量修相的方便,忍不了手,在我部window機下載了。

官方下載連結,

Continue reading...

反思的反思

陳雲早幾天在《明報》寫及Claude Lévi-Strauss的名著 Tristes Tropiques (中譯《憂鬱的熱帶》),又是 一篇文化反思的小文章 。我不會說這種文章沒有價值,因為反思總是好事,提醒人去反思也是好事;不反思,就難以意識到自己可能有的偏見和

何秀蘭:新世代公民社會

人們要罵長毛語言暴力,沒有問題,但議員代表人民,發言的時間很寶貴,為什麼只顧在罵同事說話惡毒,但卻忽視了真正要罵的制度暴力?

何秀蘭沒有激動言詞,有條不紊地道出香港現行制度的缺陷、新世代新公民社會的形成


照片日系風格初試

第一個在網上找來的

1.先複製一個新的圖層,名圖層2。 2.圖層2,濾鏡->扭曲->擴散光暈(數值看清況而定)「不透明度50-70%)」 3.再用底圖弄一個圖層3,濾鏡->模糊->高斯模糊(模糊層次看自己喜

Continue reading...