Apr 25 2007

Web Design Survey 2007

I took it! And so should you.
I took it! And so should you.

填完才知道有抽獎。

漏了連結:http://www.alistapart.com/articles/webdesignsurveyCT


Apr 13 2007

Online form Security

我想做個調查,了解大家做 web application 時如何做保安。

例如一張簡單 online form,是 form to mail 或者 form to DB,收集的不是個人敏感資料。大家在做這個 application 時會否做保安設定去防止 malicious usage?若有,會做到甚麼程度?

A. 甚麼也不做
B. 會 filter user input
C. 會 check HTTP referer
D. 使用 CAPTCHA
E. 使用 SSL
F. 會 Encrypt Mail / DB

歡迎留言說你的選擇,可以的話,請說一下你的理由。若有其他保安上的做法,亦歡迎補充。CT


Feb 22 2007

@media 將在港舉行

@media 07 AsiaHappyDesigner 得知,雲集 WaSPMollyJeremy KeithCSS Zen Garden 的 Dave Shea 等 Web Standards 界猛人的 @media 首次蒞臨亞洲,將會於5月31日在香港舉行為期兩日的研討會。

老實說看到 @media 會選擇在香港舉行這個網頁設計界中的盛事,真的很意外。因為正如 Jacky 所說,香港絶對是 Web Standards 的荒蕪地,知的人少,懂的人更少。自從上年無病呻吟的發過點窂騷後,我不斷向別人說及 Web Standards 的重要性與好處,可惜反應一如既往的差。有點技術背景的還好,一般 user 更難說過明白,像極對牛彈琴。我承認我不懂更有效地說服別人採納 Web Standards,往往說得太 geek 只會給人覺得是 standardista不設實際。另外 CSS 排版等技術的 learning curve 過高,不易掌握也是一個難題,個人經驗見過有人運用 CSS-based layout,也因而弄得四不像,徒添繁鎖的頁碼,是為知其言而不知其所言,為做而做。

@media 選擇在港舉行,雖有說想提高一下香港等相對落後的地方對當代網頁設計的認知,但我怕他們會失望而回,始終香港人只會做 follower,要香港企業或香港政府有遠見地承擔責任去推行 Web Standards,根本是天荒夜譚,相信他們連想去暸解 Web Standards 為何物的基本動力也没有。我想是次研討會香港的參與者會少之又少,可能一個也沒有*。我不期望一些私人機構會突然關注 Web Standards 發展,但希望政府至少可以推廣一下,藉著是次活動令更多香港機構去暸解何謂 Web Standards。

*我很想去,但票價 US$645 兼要請兩日假,成本很高。或者考慮網上籌款吧。 :)

Update 23/2/2007:
經過一夜考慮,我應該會去。(這篇原本昨夜已發佈,但不知為突然變成 private post.)

延申閱讀:@media 07 在香港CT


Jan 31 2007

蘋果臭蟲

成為 switcher 後首遇蘋果臭蟲。 XD

話說我的 Mac mini 的 wireless connection 時常斷線又不懂得 reconnect,完全減低其作為 always on machine 的 utilization。試了很多方法亦不得要領,終於在蘋果的論壇找到同樣的受害者。原來主因在於 WPA re-authentication timeout,每當時間一到,就會踢走 Mac box。這個預設值為一小時,若設定為兩分鐘,那 Mac box 就只能上線兩分鐘。但最奇的是這個問題只會發生在 OS X 10.4.8 及所有 ZyXEL 品牌的 wireless router 這個組合上。而我,就是使用這個組合… orz

據論壇說已有人向蘋果滙報這個 bug,但蘋果方面仍未有解決方案。ZyXEL 的 router 也不能 disable 這個 timeout,只能把其設定為最大值 9999 秒 (不足三小時)。CT


Jan 11 2007

JavaScript: Create hyperlinks on the fly

Challenge: A traditional media organisation publishes various press releases daily via a central system to different channels, e.g. fax, data terminal and internet. As some special reasons, the system is not able to markup the content for the internet version. It can only change the line break to <br> and consecutive spaces to &nbsp; i.e. No hyperlinks even if there are any URLs or e-mail addresses written in the articles. It is definitely not user-friendly for internet readers and something should be made in order to improve usability.

No way to intervene the publication system but it is able to add post-publishing logic to the external JavaScript file included in the HTML output.

I decide to solve it by JavaScript regex but badly my regex sux! Theoretically it can be done by two lines of regex replace code (one for URLs and another for e-mail addresses) but they crash when replace globally at the same time. (e.g. ‘chiunam.net’ of ‘no-reply@chiunam.net’ – MY REGEX SUX!)

Finally I made it by scanning the article from start and create hyperlink for matched pattern once. It is clumsy but it works pretty good.

See my code in action.CT