Visual Basic in Excel

I have to create a table to present some complicate data at work.  The different sections in the table are included or excluded depends on different configurations.  It would be too overwhelming and confusing to write a static table and then ask the user figure out which piece of data he need on his own.   My solution is to write a dynamic table that will only show the necessary piece of information.  At first I wanted to write the table using HTML and Javascript, which I am quite familiar with.  Unfortunately, the ancient Microsoft Office 2000 at work doesn’t support embedded javascript.  Since including seperate HTML file in the document is not a standard work flow in my company, it would be too much trouble work around the doucument control system.  So I decided to write the table using Excel spreadsheet instead.  I never done programming in Excel before, but to my surprise the Visual Basic support for Excel is very easy to use.  Using just the reference in the help document and some webpages on Excel tips, I manage to create the table in just a day.  Actually, using Excel and Visual Basic script is less programming work than using HTML and Javascript.  It even worths my effort to learn a new programming language.

The World is Flat 世界是平的 – Thomas L. Friedman

The world is flat 二十一世紀是全球化的年代﹐隨著科技和交通發達﹐在世界兩個各角的地方隔離縮短了﹐隨著緊密的政治經濟合作關係﹐國與國之間的圍牆也倒下了。不論在那裏生活的人﹐無論是在發達國家還是第三世界﹐也無可被免要適應全球化的大趨勢。「世界是平的」這本書正好為讀者解說全球化的來龍去脈﹐分析發達國家與第三世界在全球化遇到的問題﹐以及展望未來全球化的方向。這本書在零五年出版後便一直高踞紐約時報暢銷書排行榜﹐去年更獲推薦為香港電台十本好書。其實在這本書出版以前﹐全球化這個詞語早已深入民心。若平時有看經濟或企管雜誌﹐對書中的內容相信不會陌生。不過這本書把有關全球化的知識有系統地整理出來﹐對新手是一本很好的入書藉﹐亦可以讓老手溫故知新﹐重新思考在全球化中自己的定位。

這本書分為三個部份﹐第一部細說全球化的歷史﹐列出十件直接加速全球化的大事。從東德柏林圍牆倒下開始說起﹐隨著東西冷戰結束﹐讓分列的世界慢慢整合。網景Netscape公司上市標誌著互聯網的掘起﹐使到遙距通訊不再是難事。工序流程軟件的開發﹐可以讓公司更加準確地分工。開放程式碼軟件與及公享知識的興起﹐打破了大公司和政府對知識的壟斷﹐讓知識可以自由流通﹐顛覆傳統由上而下的權力架構﹐由下至上無窮的創意。當然不能不提全球化對一般人影響最大的﹐工序外判與工作移至海外﹐這兩項正正發揮經濟學上的比較優勢﹐若大大提高全球的經濟生產力。隨著商品生產地與最終消費者的距離增多﹐有效率的運輸供應系統應運而生 ﹐讓運輸成本大幅下跌﹐遠在大海彼岸的供應商﹐也可以與本土供應商競爭﹐通過競爭而提高服務質素。公司一邊廂把工序外判﹐另一邊廂則把工序內判﹐把最佳的服務供應商與公司整合﹐讓大公司可以也有小公司的靈活。知識就是力量﹐搜索引擎如Google的發展﹐讓人民隨最隨地也可以得到最新的資訊。最後一項是流動電話網絡電郵的發展﹐讓人不論何時何地也可與整個世界連結在一起。這一切一切的發明與歷史事件﹐讓世界各地的人大至上也站同一條起跑條上競爭。雖然己發展國家還有承繼下來的優勢﹐不過第三世界很快就會追上來。

這本書的入者是美國人﹐讀者也是針對美國市場﹐所以第二部份探討美國在全球化中面對的問題。雖說書中用美國作為例子﹐但這些問題是已發達國家皆要面對的﹐香港也不例外。以前美國的父母會對孩子說﹐要用功讀書﹐你用中國和印度的孩子沒有飯吃多可憐。現在美國的父母則說﹐要用功讀書﹐中國和印度的孩子來搶你的飯碗啊。在過去因為貿易保護政策﹐國內低技術的工人因沒有競爭﹐人工也可以不錯。在全球化低下﹐第三世界有數以億計的低技術工人﹐國民若想保持生活水準﹐就必須要轉型為高技術人材﹐或者成為工作不可能流向外國的專材﹐才能夠保持競爭力。而然美國最大的穩憂的科學研究的人材嚴重不足﹐高中生寧可志願當球星也不願當科學家。從事科學研究大量依靠外國移民﹐長遠而言國家的競爭力是由科技發展所決定。若現在不致力培育科研人材﹐美國的優勢將在一代之內就會完全消失。

第三部份展望全球化的未來﹐全球化對全人類有益還是有害﹐在乎第三世界如何面對和適應全球化。第三世界國家(如中國印度)可以選擇擁抱全球化﹐ 利用全球化的機會大幅改善人民生活﹐有望在不久的將來脫離第三世界﹐晉身已發達國家的行列。全球化把國家間的經濟命脈連結起來﹐成為一張錯縱複雜再也分不開的網﹐減少國家間戰爭的機會﹐令世界更加和平﹐因為開戰的成本太大﹐未打已經兩敗俱傷。書中舉出一個有趣的例子﹐從來沒有兩個開有麥當勞的國家打過仗。麥當勞是全球化的標誌﹐有麥當勞等同與全球經濟接軌﹐身處於同一個脆弱的經濟系統下﹐沒有國家有能力或願意開戰。誠然有些第三世界國家(如北韓中東)因種種歷史因素﹐選擇築起圍牆把自己隔離在全球化以外﹐他們的人民固然生活得不到改善﹐亦可能民族自卑或妒忌其他國家的成功﹐而催生恐怖主義。諷刺的是全球化讓世界緊密連結起來﹐亦同時擴大恐怖襲擊對全世界的傷害。不過有一點可以肯定﹐不論是已發展國家還是第三世界﹐只要不抱著守舊過時的觀念﹐懂得變通進取吸收學習外來文化的優點﹐全球化可以是雙贏。作者特別寫了一章來探討中東全球化的問題﹐在亞洲或前東歐地區全球化步代或快或慢﹐但方向大至上正確﹐但中東因為回教保守文化拖累﹐對全球化采取抗距態度﹐若中東的回教文化不改革開放﹐將會危害到世界穩定和經濟增長。

全球化的影響深遠﹐不論是國家﹐公司﹐還是個人﹐也必需要適應全球化帶來的轉變。全球化帶給世界無限的機會和可能性﹐只要有理想有幹勁有創意﹐不論身在美國還是中國印度﹐誰也可以是全球化的贏家。當然那些不思進取的既得利益者﹐只顧著懷緬過去的光輝﹐而忽略開創更美好的末來﹐在全球化下無可避免會成為輸家。最後想說說關於這本書的題目﹐說世界是平妨忽世界間的距離就縮短了。不過心水清的朋友就會看出﹐就算地球不是球形而給壓成平面﹐兩點之間的距離其實沒有改變﹐只不過若站得夠高﹐就可以從一地看到另一地罷了。不論全球化如何發展﹐人與人國與國間始終還是會有距離﹐這算是對全球化的少少諷刺吧。

P.Eng

After waiting for almost half a year, I finially received the title of professional engineer.  (P.Eng.)  I thought I would recieve a welcome letter and the registration package to inform my credential is approved, instead it is the invoice of the registration fee notify me my application is approved.  I will receive a certificate and my engineer seal too, but would take a few weeks for the association to prepare.  P.Eng is relatively easy to get.  All you need is a engineering degree and 4 years of work experience.  You have to take a law and ethics seminar and write an exam, but that is a piece of cake.  After that, it is lots of paper work, you have to fill in the application forms and prepare a 10 pages work summary.  The trickiest part is to hurt down four P.Eng who has supervised your work as your reference.  After the paper is completed, you just have to wait a few months for the association to review your application, then one day you will reiceve the invoice for the registration fee.  The good thing is this title follows me for life, as long as I pay the membership due every year.  Now I can proundly say that I am an engineer.  The bad thing is that this title is absoluately useless to me as an computer engineer, except I can sign the passport photos of my friends.  I have spent almost $1000 in total to get the title of P.Eng, on average $200 per character.

香港三部曲 – 陳冠中

HK Triology

我在網上書店郵賺陳冠中的「我這一代香港人」 時﹐發現很多讀者也同時訂購了他的另一部小說「香港三部曲」。在網上好像也看過這小說的介紹﹐說寫得不錯﹐反正要賺物滿一定限額才可以免郵費﹐想不到購買什麼其他書的情況下﹐便順手買了這本小說。原本以為小說名稱叫三部曲﹐一定會是本長篇小說﹐寄到後才發現全書不足二百頁﹐只不過是三篇沒有關連的短篇小說的結集﹐有點被騙錢的感覺。陳冠中擅長寫香港文化﹐「我這一代香港人」的性質半散文半論文比較嚴肅﹐「香港三部曲」則以輕鬆的手法﹐從側面去描寫香港文化的轉變。書中的三個故事分別發生在崇洋風氣漸起的七十年代﹐經濟起飛的八十年代﹐以及回歸後老懵董的年代。三個故事的主角都不屬於香港社會的主流文化﹐從某程度上他們是主流眼中的失敗者。然而作者借用他們三人的眼睛﹐從他們的另類價值觀出發﹐與主流意識作一個對照﹐讓讀者從字裏行間中反思自己的價值取向。

第一篇小說「太陽膏的夢」描寫七十年代的社會面貌﹐主角是從外國回來不務正業的二世祖﹐每天到淺水灣游水曬太陽。整篇小說描述他終日無所事事時﹐在腦中漂過的那些想法。整體上談算不上有什麼故事﹐全篇只是東講一點西講一點﹐給讀者一個很凌亂的感覺。第二篇小說「什麼都沒有發生」佔的篇幅較長﹐描寫主角在臨死前回憶一生﹐講述他小時候從大陸走難到香港﹐長大後行船放洋工作北上搞生意﹐在經濟起飛的年代賺大錢的經歷。主角以不願責任的生活態度為人生哲學﹐扮到好像看通世情不理瑣碎俗事﹐卻又是個要追求生活品味的享樂主義者。這篇小說從主角自鳴清高﹐常對身邊庸俗的眾人冷諷熱嘲﹐讀者環顧現實中相同特性的親友時﹐會為陳冠中一矢中的的幽默批判發出會心微笑。第三篇小說「金都茶餐廳」從一個茶餐廳的救亡運動開始﹐見證回歸過後經濟泡沫爆破的後遺症。

這本書收錄的三篇小說故事性不強﹐每一篇都是無頭無尾沒有高潮沒有結局﹐像日常生活中抽一段出來寫般平淡。不過陳冠中以輕鬆吸引的文筆與豐富學識彌補故事上的不足﹐雖然沒有起承轉合的主線﹐但閱讀起來也毫不沉悶。這本小說讓我認識香港非主流的另一面歷史﹐驚覺原來除了視之為理所當然的主流思想外﹐還有其他與主流不相容的另類想法。而從這些角度為出發點﹐去批判主流思想也不完全沒有道理。作家也斯為這本小說寫序﹐企圖分析三篇小說的主旨﹐我認為有點兒劃蛇添足。讀者看了會有先入為主的觀念﹐反而影響親身感受作者想表達的想法。若還未看此書的朋友﹐我建議先跳過序言不讀﹐待看過全書咀嚼品味字裏行間的味道後﹐才回頭看是否認同也斯的觀點。

Lock Picking

lock picking A couple of weeks ago, Pat carelessly locked herself outside her home.  She have to call the lock smith to open the door.  It is about 5 minutes of work from the lock smith and he charged a ridiculous price $50.  It doesn’t look that hard and I think I can do it myself.  Then last week I read from the news that in HK, people can get lock picking tools and learn to open locks in a few hours. The HK government is talking about outlaw the buying and selling of lock picking tools to unlicensed locksmiths.  This two events combined get me really interested in learning lock picking.  First I can save money in the future, second I am geniunely interested in anything is on the legal gray area.  In Canada, it is very convinient to order lock picking tools from the internet.  I got a set of 14 pieces lock picking tools, come with a cut away practice lock showing the cylinders and a CD-ROM on lock picking basics.  Lock picking will be the next odd skill I am going to learn by myself, adding to the list of juggling, simple magic, baloon twisting, etc.

Bluetooth Headset

Plantronics 510 My new Treo 680 has built-in bluetooth connection, which is pretty much a standard feature of all new cell phones. To get the most out of my new phone, I set out to buy a bluetooth headset so that I can talk wirelessly. I browsed alot bluetooth headsets and eventually decidded to get the Plantronics 510, which is PC Magazine editor’s choice. The 510 looks quite stylish, unlike other bluetooth headset with a big chunky module clip to the ear, the hardware module of the 510 is very light, compact and hidden nicely behind the ear. Just like any other bluetooth headset, the 510 is very easy to use, just fully charge it, turn it on, pair it up with the phone and you are ready to go. The voice quality is very clear and it has a good range. I can walk around my apartment without losing connection. Using the wireless headset is more natural than holding the phone or with a wired headset. It feel like talking face to face instead of on the phone. I can even have noodle soup and talk at the same time without feeling awkward. You will never go back to the old way once you had experienced a wireless headset.


Orz

Maybe I am a bit out of date about the internet culture of this generation. I have seen the word “Orz” used here and there, I sort of know it express the feeling of frustration and depression. Today, I finally know its true meaning when I come across the wiki page dedicate to this word. To be exact, “Orz” is a pictograph representing someone down on his knee, defeated, feeling life is totally miserable, and probably yelling “why, why, why me?” sadly. The O is the head, the r forms the upper torse and the arm and the z is the knee on ground. To give a better illustration, to “Orz” is making a pose like the guy in the picture belove. This word can be used as a noun, verb, adjective or even replace a whole sentence. Emoitioncon is really an efficient way to communicate.  It only use 3 characters to express the complex feeling otherwise would require a few paragraph to describe.

Orz

生日快樂

Happy Birthday 看「生日快樂」這套電影的觀眾有兩類人﹐第一類被故事深深感動﹐在散場時還會哭成淚人。第二類人在整套戲中也呵欠連連﹐差點沒有被過慢的劇情悶死﹐很不幸 我是後者。這套電影改編自劉若英的短篇小說﹐不過原著是什麼不重要﹐重要是張艾嘉編劇﹐馬楚成執導。讓我期待著這套電影會是繼「心動」 後﹐另一齣精緻愛情小品的經典。不過很可惜礙於劇本先天性不足﹐這齣電影只能拍出一場場浪漫的情景﹐但觀眾不夠把感情思緒連接起來組成動人的故事。故事主 線沒有預告中細水長流的感情﹐只有兩個感情白痴的主角﹐拖拖拉拉的藕斷絲連長達十年之久。若果最後結局出人意表寓意深長﹐還可以挽救這整套戲的沉悶﹐騙自 己說不是電影拍得不好﹐只是我不懂欣賞。結局竟然是最老土俗套的絕症橋段﹐先前細心經營的淡淡憂鬱氣氛一下子消散了﹐換上防暴警察用催淚彈﹐欺騙眼淺觀眾 的熱淚。

故事內容在電影簡介已經完全交待清楚了﹐古天樂和劉若英在大學時原本是對情侶﹐後來大家出國留學分開了﹐約定每年生日也會向對方說一聲生日快樂。兩 人明明分開了﹐但不知何解又有些暖昧關係﹐仍然喜歡人又不肯說出來﹐硬是要故作瀟灑扮好朋友。兩個人明明已有新的另一半﹐還要當著另一半前邊若無人地調情 ﹐也不怕另一半會吃醋演六國大封相。前半部回憶大學時兩口子的拍拖生活﹐兩個中年人扮年輕裝大學生很嘔心﹐劉若英保養好遠鏡還可以騙到人﹐古天樂則左看右 看也是超齡﹐帶起金絲眼鏡就當有書卷氣﹐不過他演出來似是黑社會姑爺仔多些。男主角古天樂的演出只是一般﹐反正他也只有那個木訥裝帥的模樣﹐唯一演得比較 好就唱歌走音那幾場戲﹐有理由信相那是他真正的歌藝。女主角劉若英的演出則一百分﹐她能演能唱還彈得一手好琴﹐是娛樂圈中少見的氣質型美女。全靠她那聲線 非常優美的獨白﹐金馬演后級演技的內心戲﹐我才沒有在看戲時悶到睡著了。說穿了我看這齣電影﹐一半是因為看張艾嘉﹐另一半就是因為看劉若英﹐聽了主題曲十 分喜歡才想到後補看電影。這電影除了古天樂不行外﹐其他的配角的演出也十分出色。當劉若英父親的吳耀漢﹐當好朋友的曾寶儀和暗戀者的那個男演員﹐雖然出場 不多﹐但都能恰到其份地襯托出那段沒結果的戀情。父親見證女兒感情路上的起伏﹐好朋友嫁人當幸福媽媽與主角的孤獨形成強烈對比﹐暗戀者則是主角二人溝通的 橋樑﹐亦負責在鏡頭外擔當解述。

劉若英在劇中感情生活坎苛可以說是疚猶自取﹐與古天樂拍拖時好端端的要玩分手﹐不是古天樂做錯什麼﹐只是他太受女生歡迎沒有安全感。分手後又要當好 朋友﹐又要掛念著他﹐等待每年那一句生日快樂﹐都不知道她是不是喜歡古天樂。身邊又不是沒有追求者﹐也不是沒有新男朋友﹐古天樂出現時又隨傳隨到﹐連男朋 友也可以不理﹐去追一個不切實際的夢想。偏偏這個夢想不是遙不可及﹐只要她點下頭就可以夢想成真﹐她只是不願意先付出那點的感情。其實古天樂留學回來時就 該馬上捉住他﹐結婚生仔把他縛得死死﹐就不怕沒有安全感了。敝開最尾古天樂忽然患上絕症那段不談﹐他對劉若英其實很自私殘忍﹐明知自己出現會為她帶來困擾 ﹐既然做不成情侶就該安份守已﹐不要再曖暖昧昧的做情聖﹐也不想想這是對新女朋友很不公平。如果最後古天樂不是患絕症死﹐而是乖乖地結婚後從劉若英的世界 消失﹐倒也不失是一個完美的結局。

最後想補充一點﹐在戲中劉若英開Mini Copper﹐我身邊的女性朋友也有開這車。不知道是否感情空虛的單身女性﹐都愛開這型號的跑車﹐把跑車當成男朋友的代替品呢﹖

Kung Hei Fat Choy

Today is the Chinese New Year.  I wish all the readers of my blog a prosperous year of pig.  Here in Vancouver, we don’t really have the atomsphere for celebrating of Chinese New Year, except that the Chinese TV is showing special new year program all day long, the Chinese radio is playing those boring new year songs and we will say “Kung Hei Fat Choy” to friends.  Without the 3 days long public holidays as in HK, the Chinese New Year is just seem like a normal weekend to me. This year is the year of pig, however the TV stations in China refrain from showing the lucky pig on TV.  Out of political correctness, some stupid officials in communist government think showing the sign of pigs will offend the Muslim minority in China, thus may cause social unrest.  First of all, although Muslim regards pig as unholy, the officials are simpily worrying too much.  The enlightened Muslim would know to respect the Chinese culture and lives peacefully in the year of pig.  There may be a few retarded Muslim consider the year of pig offending, but they are the one should change their mind.  The majority should not bend to a few obscured mind minority.  In the matter of fact, other than some random writing from an ancient book, the Muslims has no reason to dislike pig in the first place.  Rather than forbidding showing pigs in TV, the Chinese governmetn should call to moderize Muslim in China, encourage the Muslims to embrace pig by correcting the obvious mistaken teaching regarding pigs in Koran.  Just like we have a chinese style socialism, which is essentially capitalism, we should also have a chinese style muslim, in which the believers can enjoy pork and alcohol.

S60

I have the regular maintance for my Volvo and the dealer gave me a 2007 S60 as the service car.  It is nice able to test drive a S60.  The S60 is smaller than my S70.  Actually it is so small that it doesn’t feel like a Volvo.  The handling and control is very Volvo like, a big car with lots of momentum.  I don’t like the interior design.  The middle section with the radio control panel and gear shift is too big.  The interface for the AC and radio is not very user friendly.  The buttons and knobs are too small and left too much empty space on the panel.  S60 pretend to be stylish by making the top of the car narrower than the body, as a result the inside of the car is not very roomy.  There is a very interesting feature of this car.  There is button to fold down the head rest of the back seats, so it won’t block the rear window.  When the head rest is release by unlocking the spring, so it can snap forward.  If someone is sitting at the back, his head will be spanked.  I tried it during lunch time when I was giving a ride to my friends.  I guess it is quite a useful feature to spank the naugty kids at the back.  In short, I found the S60 is not very comfortable.  Although my S70 is a older model with the box-shape design, I think it is a much better car than the new S60.