商業電台網站大混亂

真係未見過有公司咁樣 launch website 嘅,原本個 website run 得好地地,為咗推新 service,將成個 site 換咗佢,結果係搞到好多俾咗錢聽 archive 嘅人聽唔到,特別係一眾 Mac user 同非 Windows user。嗰個新推出嘅 Toolbar 又唔 support OS X,又唔 support Firefox 3。原本嗰 site 都仲有得俾 user 揀用 RealPlayer 定係 Windows Media Player (Microsoft ASF format) 來收聽 realtime 廣播同 archive,但係個新 website 淨係 serve ASF 同埋用佢個 P2P toolbar。香港公司搞 website,已經無眼睇好耐。宜家咩年代啊,做 website 竟然仲唔注意係唔係 cross-platform。雖然 Real Audio 同 ASF 都係 proprietary,但係點計 RealPlayer 嘅 cross-platform support 都好過 ASF 好多,Mac 有 client,Linux 又有,連 Unix 都有。宜家商台竟然仲廢埋 Real Audio,有無搞錯。其實商台真係好天真好傻,將個 site outsource 俾大陸公司做,大陸公司做 website 出名 IE-only,商台自己嘅 project management 又好有問題,無做好 testing 唔駛講,個 site 宜家俾人媽到飛起,俾咗錢嘅用唔到應有服務,咁都仲唔 rollback 番個舊 site 出來,又或者同時間放番個舊 site 出來一齊行,咁係咪即係話根本無諗過任何 fallback plan,無 contingency plan 嘅呢?前幾日入去商台個 website,赫然發現個 domain name 變咗 beta.881903.com,心諗,唔係唔記得改番 DNS 吓嘛,邊有人用咁嘅 domain name 架,後來先發現原來商台係認真嘅,仲喺埋個 logo 寫住 beta,懶係 web 2.0 咁,真係膠到無朋友。人哋啲 website 寫住 beta,好似 gmail 咁,alpha, beta, gamma 都無問題,因為第一,佢就算係 beta 都仍然好 stable,第二,佢無收我錢。但係商台呢個 case 唔係咁,我真係唔信竟然有人 launch beta service 俾 paid service 嘅 user 咁樣搵香蕉皮自己踩。

好,鬧完,既然俾咗錢,唯有自救,用 XCode + Applescript + shell script 寫咗個 application 俾 Mac OS 10.5 嘅 user 用(唔知 10.4 得唔得,得嘅話通知聲),可以聽得番 archive,呢度 download。Download 完記得睇 README 點樣用!為咗獲得最佳效果,請同時下載 Real Player & Flip4Mac,得閒可以順手裝埋 Perian

更新 2/7/2008 6:25pm: 如果你安裝咗 Flip4Mac,你要先響 System Preferences 度打開 Flip4Mac,make sure “Use Filp4Mac WMV Browser Plug-in” 選項無被揀中。

帝國反擊戰

看來中國的袁萌教授自從應邀拜訪微軟帝國之後倒戈一事,與 ODF 編輯 Patrick Durusau 發表支持 OOXML 公開信這兩件事,都是有關連的,不是獨立事件。這些異動在背後操作的無疑是微軟帝國。帝國黔驢技窮,提出的標準技術不行,轉而用“人事”手段收買一些沒有靈魂的人提他們出口術。

延伸閱讀:

I helped Firefox today, I’m feeling great

It’s not easy to find a reproducible bug in a stable open source software that has the exposure as large as Mozilla Firefox, which has more than 20% market share of the web browser market in Europe. But I did, and I think I’m very lucky. Not only that, this bug has been hiding in Firefox since 2003 (was it the Firefox 1.0 days?), so this bug has been in existence for 5 years, wow, I think I’m really very lucky to have spotted it.

This bug is serious, but very difficult to manifest itself. Under rare conditions, a form post will be sent to the web server twice without your notice. Say, if you’re shopping in an online e-shop, and you’re so “lucky” that you encountered this bug, you would be buying the same goods twice, or if you’re making a payment, you would be paying the amount double.

Thanks Alfred Peng for confirming the bug so that Firefox developers began taking a look at the bug. From the perspective of open source development, identifying and testing thoroughly for the existence of the bug and filing a detail bug report with reproducible steps is the task I should do. The fix for the bug is just less than 10 lines long (the test case is much longer), but it may take me days if I have to come up with a patch. Filing a bug report is something anyone who speaks English can do, so if you find a bug in Firefox, please go to their bug tracking system and submit a problem report. The more people contribute to it, the better the software will become, and by doing so, we, in turn, are helping ourselves to create a more pleasant web experience.

Is switching proxies on Mac OS 10.5 scriptable?

I often need to change the network proxies settings frequently due to the need to bypass the GFW when accessing websites that are considered “bad”, and have to set the settings back to not using any proxies when accessing “good” websites.

Doing so in Firefox is easy thanks to the little yet handy plugin called SwitchProxy, but for Safari or other applications which use the global system settings of Mac OS, one has to go through many steps in System Preferences to set them, and then go through the exact steps again to unset them. Too repetitive. I wish there is a way to set and unset proxies easily, but I cannot find one. I bit the bullet and use AppleScript (yuck) to do that, here’s the complete script (beware, this is my first AppleScript program):

I hate to use AppleScript as it simply plays back what a human does, and so the speed is slow, which takes about 5 seconds to finish. I tried to do that by shell script but I couldn’t find the right way to do so, having looked at the defaults command but seems it is not capable at what I want. Anybody knows?

Using Kai font for MacTeX on OS X

Typesetting LaTeX with CJK on Mac OS X is provided out-of-box by MacTeX, so working with LaTeX should be a breeze on Mac OS X. However, MacTeX ships with only two Chinese fonts, Arphic Ming Big5 (bsmi) and Arphic Sung GB2312 (gbsn). As I want to use Kai I have to look around for solutions.

I found this great website that explains how to use LaTeX and the CJK package on OS X. The good news is that the author of the page provides a shell script for installing any Unicode truetype fonts for TexLive so that you can use the truetype fonts in your LaTeX documents. The bad news is… it doesn’t work on my system. I tried it on both Arphic Big5 and GB2312 Kai fonts, and when I ran my LaTeX document through the latex command (or in TeXShop, for that matters), I came to this error:

Trying the shell script on the STKaiti font (/Library/Fonts/华文楷体.ttf) shipped with OS X, is even worse, because ttf2tfm gives a “Bus error” (or segfault on Linux) when parsing the truetype font, looks like a bug in ttf2tfm:

At the end, I resort to extracting the necessary files from Debian packages (hurray Debian) and put them into ~/Library/texmf, and that works!

The Debian packages I use are latex-cjk-chinese-arphic-bkai00mp and latex-cjk-chinese-arphic-gkai00mp. Since Debian packages are just ar archives, they can be extracted by the ar x command. After the deb package has been extracted, extract the data.tar.gz file, and then look for the folders called fonts and tex, move them to ~/Library/texmf, which you have to create. Now you should have a directory structure like this:

MacTex font installation

After the font files have been put in place, run these two commands (for the Big5 Kai truetype font):

$ sudo texhash
$ sudo updmap --enable Map bkaiu.map

For the GB2312 one, use:

$ sudo texhash
$ sudo updmap --enable Map gkaiu.map

It’s that easy!