Adrian's Dairy

Bless you

`Old-fashioned people still say “bless you” when one sneezes, but they have forgotten the reason for the custom. The reason was that people were thought to sneeze out their souls, and before their souls could get back lurking demons were apt to enter the unsouled body; but if any one said “God bless you,” the demons were frightened off.’

— Bertrand Russell, `An Outline of Intellectual Rubbish’

→ Read more...

· 2008/06/20 03:47 · Adrian Tam · 0 Comments

蔡李佛

近日在網上找到的片段:

http://www.56.com/w17/play_album-aid-420709_vid-MTM0NDk3MDc.html

這是一堆蔡李佛拳的演示,都是我之前學過的鴻勝(李冠雄師公流傳下來的)那種。看來像是師公傳到美國去的武館所拍的,不然都不會用英文和廣東話解說。穿拋掛捎插我還記得,但是可惜好像再不能在網上找到拳譜了,勉強只有在大陸見過雄勝門的小梅花拳譜,跟師公的版本有點兒出入。

→ Read more...

· 2008/04/13 10:55 · Adrian Tam · 0 Comments

zhrecode

最近時間分配好像好了一點,所以可以多點做自己的事。其中一件事就是完成zhrecode。

zhrecode是我在CSE時想出來的小工具,但是難度不少。雖然它的作為是替中文作內碼轉換,也就是說GNU iconv和recode都可以做到的東西,但是因為某個笨蛋想出來的漢字簡化計劃,導致iconv和recode都不能完美地作轉換,例如說,把某UTF8內碼的文章,全是簡體字,轉為只支援正體中文的BIG5內碼就有超多字辨認不到。

故此,我的zhrecode是要特別處理中文的內碼對換問題。但只限內碼對換而已,甚麼「公安」對「警察」的東西我不打算處理,反正要做的是保存內文原貌下的轉換。第一步是去Wikipedia偷師,找出一堆Phase list,去處理簡體轉正體時的多對一問題。

簡體內碼和正體內碼的對應表可在這裡找到: http://zh.wikipedia.org/wiki/Category:%E7%B6%AD%E5%9F%BA%E7%B9%81%E7%B0%A1%E8%BD%89%E6%8F%9B

→ Read more...

· 2008/04/12 03:31 · Adrian Tam · 0 Comments

The Speech by Chris Patten

This is the Governor's Speech at Farewell Ceremony of Hong Kong Handover, by Christopher Patten on 30 June 1997.

He is the greatest Governor ever in the history of Hong Kong, and established a model for a well-performed government. It is a pity that he cannot continue to manage the city and we never have one that can replace him so far (may be due to the sovereignty reason — you know, all clever people in the communist party are dead!)

When you read it, you will see what is a governor — he is not going to hide the bad things the British did to get the sovereignty of Hong Kong, and the British don’t mind this, too. Do you think the Chinese or communist can do the same? Base on our thousand-year-long ethical belief, I believe all real Chinese can. Communist? I don’t think so.

→ Read more...

中文

非熟用正體,不能察簡體之殘;非深暗文言,不能知白話之陋。反對者多,可見中華精髓斷裂之深;惡言者眾,方知九州萬民學識之淺。「革命」遺毒之廣、傳統破壞之劇,非常人所能想像。欲復文言與正體,余以為必要至極!

http://www.ahszez.cn/sh/Announce/Announce.asp?BoardID=102&ID=178

http://post.baidu.com/f?kz=75255799

→ Read more...

· 2007/12/12 09:05 · Adrian Tam · 0 Comments

12 Photography Tips

From: http://hkavmode.blogspot.com/2007/11/12.html

攝影是一門技術,同樣也是經驗的積累。下面是無數攝影師的經驗匯聚而成的12條最經典、實用的攝影技巧Tips,將其熟記於心,將幫助你應對很多難以掌控的拍攝場景。推薦收藏。

1.Sunny 16 Rule (陽光十六法則)

“Sunny 16 Rule”是在沒有測光表時,正確估算日光下曝光數值的方法,所以這條法則只有在陽光充足的情況下適合使用。將光圈設為F/16,快門與ISO同步,或者略快。如,ISO設為100時,快門應該設為1/100秒(1/125秒)。所以,根據這個法則,在海灘上攝影時,應該使用F/22光圈,在多雲時應使用 F/11光圈。

2.Moony 11,8, and 5.6 Rules (月光11,8和5.6法則)

如果你想拍攝月亮,那麼這裡有一條很好的法則。快門與ISO同步的時候,拍攝滿月用F/11光圈,弦月的時候用F/8光圈,新月則使用F/5.6光圈。

3.Camera Shake Rule (相機抖動法則)

當你手持相機拍攝時,快門的速度不能小於鏡頭焦距的倒數。如果快門速度越慢,那麼拍攝抖動時就越可能降低銳度。如果用50mm焦距的話,快門就要達到1/60秒以上為宜,只有當環境實在昏暗時,用閃光燈、腳架或者把相機放在硬物上防止抖動。

4.Anatomical Gray Card (灰板法則)

隨身攜帶18%的中灰度板是拍攝的利器。可是如果身上沒有灰度板怎麼辦呢?可以將手掌攤開面向陽光,對手掌進行測光,然後加一檔曝光。

5.Depth of Field Rules (景深法則)

當被攝無題比較深的時候,應該對焦點選擇在景深的前1/3處,因為這樣,對焦點後的景深是之前的2倍。各種光圈和焦段組合都可以使用這個法則。記住,光圈越小,焦距越短,距離被攝物體越遠,景深就越大。

6.Largest Digital Print Rule (數碼沖印尺寸法則)

如果你想把你的作品打印成大尺寸的照片時,照片的尺寸不能大於數碼圖片的長寬像素各除以200.如果你對作品要求很高,那麼至少得除以250。

7.Exposure Rules (曝光法則)

在處理數碼照片時,最普遍的法則是保證高光區曝光準確,低光區隨他去。可是當處理負片,特別是彩色負片的時候,你最好增曝一檔。

8.Quick Flash-fill Rule (快速閃光輸出法則)

當你的相機不能自動輸出控制的閃光燈時,將閃光燈的感光度設為膠卷的二被。如果對主體測光,機身選擇光圈整檔,閃光燈設為同樣的光圈。這樣,照片的陰影區會比主體的亮度低一檔。

9.Flash Range Rule (閃光距離法則)

這個法則很簡單:距離乘以2,感光度乘以4。例如,你的閃光燈在ISO 100時,有效距離為20英呎。如果你想使閃光燈的距離達到40英呎時,則需要ISO 400。

10.Megapixel Multiplier Rule (像素翻倍法則)

如果你想使數碼相機的分辨率增倍,那麼很簡單,就是要像素翻兩番。

11.Action-stopping Rule (捕捉動態法則)

這條法則是根據角度與速度的經驗公式而來的。如果物體沿著鏡頭的軸線運動你能夠用1/125的快門捕捉下,那麼它追至於鏡頭軸線的運動能用1/500捕捉下來。也就是說,如果物體沿鏡頭軸線稱45度運動,只需要1/250的快門速度。

12.Sunset Rule (日落法則)

拍攝落日時,要對落日上部測光,但是不能讓太陽出現在你的取景器中。如果想讓日落看上去比實際晚一小時,可以在曝光補償中減1。

→ Read more...

DynDNS

很久沒用DynDNS了,以前因為工作關係,有很多不同的系統在不同的地方,為方便遙控管理,所以是DynDNS的Heavy user。最近我的帳戶都因太久沒動而被砍了,但現在發覺學校不像中大般是用MAC Address固定DHCP,正因如此,DynDNS又要出動了。

我註冊了數個帳號,就是alienz.is-a-geek.{org,com,net},可供我幾個不同的Interface使用,而且還發現DynDNS的Protocol換了.....電腦呢家野真係一日千里,不好好留心,知識就落後了。

→ Read more...

· 2007/11/07 00:15 · Adrian Tam · 0 Comments

VMware Server

In the past, I used to use the VMware GSX server (my university paid a lot of money for that!). I haven’t been using it for a while but now, as I want to try out something with my new Athlon64 Dell, I picked it up again.

Some how, the GSX series is discontinued and VMware is only selling ESX. The original GSX becomes VMware Server and it is now a freeware! Great!

I downloaded and filled out an online form for a free serial number , but the vmmon and vmnet modules failed to compile for my kernel. I guess it is simply a problem of kernel code change since the VMware modules are programmed (this happens a lot in the history). After some kernel code hacking, the solutions are:

diff -uwr vmmon-only/linux/driver.c.old vmmon-only/linux/driver.c
--- vmmon-only/linux/driver.c.old   2007-09-06 17:59:54.000000000 -0400
+++ vmmon-only/linux/driver.c       2007-10-24 10:39:15.000000000 -0400
@@ -1656,7 +1656,10 @@
           current->egid == current->gid &&
          current->fsgid == current->gid) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 7)
-        current->mm->dumpable = 1;
+        /* current->mm->dumpable = 1; */
+        set_bit(MMF_DUMPABLE, &currnet->mm->flags);
+        smp_wmb();
+        clear_bit(MMF_DUMP_SECURELY, &current->mm->flags);
 #else
         current->dumpable = 1;
 #endif

and also

diff -uwr vmnet-only/driver.c.old vmnet-only/driver.c
--- vmnet-only/driver.c.old   2007-09-06 17:59:55.000000000 -0400
+++ vmnet-only/driver.c       2007-10-24 10:39:37.000000000 -0400
@@ -519,11 +519,14 @@
    int retval;
 
    unregister_ioctl32_handlers();
+   unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
+/*
    retval = unregister_chrdev(VNET_MAJOR_NUMBER, "vmnet");
    if (retval != 0) {
       LOG(0, (KERN_WARNING "/dev/vmnet: could not unregister major device %d\n",
              VNET_MAJOR_NUMBER));
    }
+*/
    VNetProtoUnregister();
    VNetProc_Cleanup();
 }

→ Read more...

· 2007/10/24 23:00 · Adrian Tam · 0 Comments

NetInstall Debian using USB devices

Yesterday, I got a computer from my school, it is:

Brand Dell Optiplex 740
Processor AMD Athlon 64
Memory 2 x 1GB DDR2 Kingston
Hard disk 250GB SATA
PeriperalsUSB x 7, Serial, Parallel

The whole point is, firstly, it is an AMD64 machine; and secondly, it has no optical drive. But anyway, what I need is just a Debian to replce the Windoze system.

To install Debian, I used a USB thumb disk. I tried with a card reader and a Sony memory stick but it doesn’t work because of the card reader seems do not support the bootstrap process. The way to use it, after troubleshooting for a long time, is: (assuming your thumb disk is /dev/sda)

# wget -nH -nd http://some.mirror/path/installer-amd64/current/images/hd-media/boot.img.gz
# zcat boot.img.gz > /dev/sda
# mount -t vfat /dev/sda /mnt
# cp debian-40r1-amd64-netinst.iso /mnt
# umount /mnt

The whole point is, you have to zcat to /dev/sda rather than sda1, because otherwise you mean to rely on the crapy boot sector on your thumb disk. If you have to do the other way, you may also use the mbr package in Debian to set a bootable boot sector.

Once you have the thumb disk ready, plug it into the Dell box and boot. Remember to set the boot device to be USB ZIP Disk.

→ Read more...

Engineering School Sucks

It was told that, in the United States, all the science and engineering schools don’t get the reputation as the arts and humanities counterpart. That’s true — that’s why people always said Harvard, Princeton, Yale, etc as the top school in the United States. MIT is an exception because there is a lot of Nobel Laureates, but how many people knows Nobel prize if there is not so much cash awarded?

Engineering is like that — we always remember Newton as the one who coined the classical mechanics, Einstein as the one who helped the invention of atomic bomb, also the people in less-useful mathematics, such as Fourier, Laplace, L’Hopital, Rene Decartes, Lebniz; but they are all European and they all lived in the age of blooming development of science and knowledge.

I have been the New York Poly for a week and what I found is that, the people who were here were great! The inventor of VCR, the inventor of microwave oven, the inventor of non-sticky pan, the inventor of baby milk bottle plastic, and a lot else. But what I feel is that, nowadays, the people are less repectful to the scientists, because they don’t know science.

This is a sad story. Science can’t help you make money but helped you to refine your method of thinking and helped you to be smart. You may not want to use science to earn a living but you can’t be totally ignorant to that. However, a lot of people do.

→ Read more...