利用 Java 下載 HTTP 網絡上的檔案 (Use Java to download file from HTTP)

import java.io.IOException;import java.net.ConnectException;import java.net.URL;import java.io.InputStream;import java.io.FileOutputStream;

public static void download(String source, String destination) throws IOException, ConnectException{    InputStream is = new URL(source).openConnection().getInputStream();    FileOutputStream fos = new FileOutputStream(destination);    byte[] buffer = new byte[1024];    for (int length; (length = is

Why you don't want to host your MTA machine in the cloud

So one recent tidbit of news from Slashdot is that people are shocked, utterly shocked that some bad people are using EC2 to host machines thatdo bad stuff and that Amazon is surprisingly ineffective about stoppingthis.

Well, yes. Hello, here is a newsflash: cheap or free hosting (it's freeif you use other people's credit card numbers) attracts bad people likeflies to honey, and people operating cheap services rarely (by whichI mean 'never') staff up their abuse department


面朝大海,春暖花開

在金像獎頒獎典禮上,看見 The Pancakes 唱歌,令我想起上一集《麥兜故事2菠蘿油王子》中,用上了我很喜歡的詩人海子的《面朝大海,春暖花開》。

*************

《面朝大海,春暖花開》 海子

從明天起,做一個幸福的


Where did THAT come from?

Where did THAT come from?

A quick snapshot from a family party today. It was a spur-of-the-moment picture, but I liked it. Made me chuckle when I saw it in the viewfinder... I think the beer in-hand makes the image.


時代的限制

每個人都免不了受到自己所處的時代所限制,無論是信念或行為,要帶領時代,甚至是超越自己的時代,是極其困難的事,連最講獨立思考,最注重求真的哲學家,也一樣無法完全擺脫時代的限制。就舉幾個例子吧,全都是我佩

My Sat Nite

母親大人抽中咗獎,有得去白蘭氏燕窩盛宴 (@怡和大廈怡翠軒),帶埋我去

From for blog

堅係味味燕窩喎
Continue reading...

中上環隨步

這間店都不煩他阻店面,這種包含力,不就是儒家精神的體現嘛,不過,這間店的老板好像是鬼...

隨便在街走都有三尊神級物體,不知啥名堂呢? 鬼佬就是好奇,人影相,你望乜春呢?

Continue reading...

嫌隙這條隙

兩個人之間生過嫌隙,便很難回復到從前的關係,就算口裏說「沒事了」、「不會介懷」,加上行為上都做到跟以往看來沒有兩樣,那條隙始終在那裏,可能只是幼若游絲,卻仍然是一條分隔線,而且隨時會再次擴大,甚至一觸

I think it's time to turn off automatic periodic ext3 fscks

I've noticed a pattern lately: I have a number of infrequently rebootedmachines, and every time I reboot one of those machines I wind upsitting and drumming my fingers as the machine cheerfully announces'filesystem X hasn't been checked in N days, checking for you'. It takesa while, because these filesystems are often kind of big and kind offull of things.

This is not ext3's fault; it is faithfully doing what it is configuredto do, and even with all


破解《Om Shanti Om 》經典歌舞場面 ( 轉載)

很多朋友問我為什麼會懂得找Bollywood電影、為什麼會知道Bollywood影人影事. 其實是『畫鬼腳』的追蹤方式, 讓我找到蛛絲馬跡.



兩年前, 雖然將《 Om Shanti Om 》大部份演員和背景認出來, 然而片中那數場重拍自Bollywood舊戲的場面, 我始終沒辦法真