December 2009 Archives

Continuity 是個給網頁應用程式所用的函式庫 (library),它很魔奇地處理了「session」這個概念,讓寫程式的人可以不必特別管理 session 內容的存放。

由於我常用 console.log 來 debug javascript,所以總是會失誤把 “console.log(…)” 送進 git 裡。如果又一不小心被 deploy 到 production 上的話,那可就麻煩了。為了及早避免,可以使用 git 的 pre-commit hook 來做檢查。

Dancer

| 2 Comments | No TrackBacks

Dancer is a minimal web-framework for Perl world, which is entirely inspired by Sinatra in the Ruby land.

試用 Mac Bumptop

| No Comments | No TrackBacks

Bumptop 這個軟體是種最有意思的 3D 桌面環境。約一年前出了 Windows 版本,最近開始發出給 Mac 的測試版 (目前到 0.5 版)。

底片相機

| No Comments | No TrackBacks

這週日做勞作,完成了這台相機:

Plurk is copied by Microsoft, line by line.

| No Comments | No TrackBacks

It was first read on the plurk official blog, then on techcrunch, and then Washinton post, Microsoft is copying Plurk frontend code, nearly line-by-line.

While this evidently emotionally compromised plurk fans / plurkers, I step backword and think.

Copying javascript code this way is not something new, one Taiwan-based company copied facebook.com about 2 years ago.

Since what makes Web today is based on its public nature, it seems impossible to completely prevent people from copyng your javascript / HTML code without tools like jsmin, packer, yuicompressor, and google closure compiler, which can only increase the difficulties, but not eliminate the possibilities.

Clone the same function of micro-blogging is neither something new. It is actually something people has been doing these years. Neither it is possible to prevent people from doing so. People have been re-inventing wheels and cars since the day Tim Oreilly declared Web 2.0. It is e

Being the giant of IT, Microsoft has been doing so much leading researches in many domains of software development, including Desktop app and Web app. They decided to do their own micro-blogging service, that certainly means something. However, I personally would have expect something more original from this decision. Being a copy cat might be OK, but not something Microsoft should be doing.

You let people down, big man, seriously.

Plurk, on the other hand, has been doing great increasing the volume of members in Asia, specifically Taiwan, this year (2009). The official Plurk API came out just this month. It is expected to see some nice apps coming out soon.

This is probably the biggest thing this year. We shall sit back and watch to see how this event evolves.

Git Graphing

| No Comments | No TrackBacks

Once in a while I see this sort of git commit graph in my gitx window:

git commit graph

Which is beautiful. Then I suddenly had this idea to draw this Taipei MRT route map with git, such that it can be viewed with gitx:

routemapNH.jpg

Possible ? Definitely.

檢查所有 perl 源碼的語法

| No Comments | No TrackBacks

這個指令可以檢查 foo.pl 的語法:

perl -cw foo.pl

#=> foo.pl syntax OK

寫 application 的時候,會把源碼整理成許多 .pm,這時卻沒辨法使用 perl -cw *.pm 一次做所有檔案的文法檢查。因為 perl 只預期第一個參數是程式名字,剩下的全成了程式的參數 (@ARGV) 了。

這時要加上一些 shell scripting 來簡化麻煩的事:

find lib -type f -name '*.pm' | xargs -I % perl -Ilib -cw %

zsh 可寫:

foreach i (`find lib -type f -name '*.pm'`) { perl -Ilib -cw $i }

為求方便,我另外寫了個 perl-check-syntax 程式來做這件事:

#!/bin/zsh
for f in $*
perl -Ilib -cw $f

使用方法如

perl-check-syntax *.pm
perl-check-syntax lib/*.pm

試用 Brackup

| No Comments | No TrackBacks

Brackup 是個通用的備份工具,它能將備份檔案到近端或遠端 (s3, ftp, sftp)。並且提供類似 Time Machine 時回復機制。可以將取出任一備份的時間點的檔案。

試用過後發現幾個特點:

  • 容易設定
  • 檔案會切成小塊 (Chunked) 存放。有利異地備份的傳輸
  • 漸進式備份。變動小的時侯,備份過程也比較快。
  • 可以只回復單一檔案
  • 可以回復到任一備份的時間點

但在執行效率方面似乎有待加強,利用 sftp 備份時的傳輸速率是出乎意料的慢。s3 的部份到是還可以接受。