Archive for December, 2006

December 27th, 2006

科技病毒你中左幾多?

Do you have PC?

Do you have Mac?

Do you have iPod?

Do you have Wii?

Do you have camera?

Do you have scanner?

Do you have printer?

Do you have blog?

Do you have Shure, Ultimate Ears, Sennheiser or Westone?

Do you…?

December 16th, 2006

Coming next year…?!

2007 年有 Color Wii? 賣 US$200?

我想要綠色呀…

Color Wii

December 14th, 2006

Wii 仔海鮮價

星期六

老友記話 188 四樓主機做緊 $1900。
糖街精品中心 Sports 賣緊 $290

星期日

小弟不甘寂寞,終忍唔住手,o係將軍澳買左。起初以為貴左,哈… 誰不知過埋今日我改觀哂。
主機 $2100
變壓器 $140
Sports $298
手入

星期四

Fat Lip 底受唔住引誘,諗住落 SSP 入貨;
不久後我收到佢既 SMS,哈!主機加 1 隻 Game 賣 $2900,死未!

好,報下其他價先,全部都係灣仔 188。

BLEACH – $275
Wii Remote + Wii Play package – $39x
Wii Remote + Wii Play package + Nunchuk – $57x

December 14th, 2006

The Double Checked Locking Pattern by Mark Grand

一般的 Singleton 實作如下:

public synchronized static Singleton getInstance() {
  if (_instance == null) {
    _instance = new Singleton();
  }
  return _instance;
}

使用了 Double Checked Locking Pattern 後的 Singleton 實作如下:

public static Singleton getInstance() {
  if (_instance == null) {
    synchronized(Singleton.class) {
      if (_instance == null)
        _instance = new Singleton();
    }
  }
  return _instance;
}

在 Multi-thread 的工作 環境裡,這 locking 的 pattern 明顯地減省了 java synchronized block 運行的次數,使程式運行速度加快。

December 14th, 2006

要打哂 91 個瓶,就係咁簡單!

自己點打都係最多打到九十枝,多謝 fat lip 既一條 link… 原來個秘訣係用復活蛋,keke!!