是否具有可讀性?

++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++<<<<<<<<<<<<<<<<-]>>>>>>>>>.<<<<<<<<<>>>>>>>>>>>>>+++.+++<<<<<<<<<<<<<>>>>>>>>>>>>>>+++-.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>+++-.++++<<<<<<<<<<<<<<>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<>>>>.<<<<>>>>>>>>>+++.+++<<<<<<<<<>>>>>>>>>>>>>+.-<<<<<<<<<<<<<>>>>>>>>>>>>>>>+++-.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>+++-.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>+.-<<<<<<<<<<<<<<<>>>>+.-<<<<.
»

Change commit time stamp in GIT

由於寫 code 專用的 VM 有時候會被我 pause, 然而 resume 後時間往往會跑掉, 這時候要是做了 commit 就會出現新 commit 的時間比舊 commit 的時間更早的怪事, 像這樣:

* ee0daaf 2013-10-16 | swap method2 and method3 (HEAD, master) [kfei]
* a1544cc 2013-10-21 | completes VD Center setup (origin/master, origin/HEAD) [kfei]
* 0a4e123 2013-10-03 | modify env check process about qemu [kfei]
...
»

悲哀且沉重的事實

當真正的天才們不再做研究寫程式改變世界, 而紛紛進了 Hedge Fund. 這才是既悲哀且沉重的事實… Reid Barton 絕對是 IMO/IOI 史上最強的參賽者, 絕對是數十年難得 »

TERM environment variable not set

腳本部署出來的機器通通遇到這個怪問題, rsync -e ssh 或 scp 往裡面丟東西時會出現: TERM environment variable not set. 這個錯誤訊息, 檢查一下 server/client 都有 TERM=linux 這個環境變數了, 那這個錯誤原因 »

The query builder in MongoDB Java driver

一直都習慣先在 Mongo Shell 裡邊寫邊測 query, 所以寫進 Java code 時自然也就習慣了用 DBObject 這種 document 樣式的 query 寫法. 例如:

DBObject query = new BasicDBObject( "x", new BasicDBObject( "$lt", 1 ) )
                .append( "y", new BasicDBObject( "$gt", 10).append( "$lt", 90 ) )
                .append( "z", new BasicDBObject( "$in", Arrays.asList( 1, 3, 5, 7 ) ) );
»

How to protect your Ruby code?

前陣子寫了一包產品部署配置的 Ruby 腳本, 老闆問: 混碼了沒? 老闆什麼都想混碼! 於是簡單 survey 了一下確實發現有一些作法, 不過也不太成熟就是了. 但這整件事 »

名言啟示

> Program testing can be used to show the presence of bugs, but never to show their absence! – Edsger W. Dijkstra »

Batch download YouTube videos via youtube-dl

Recently I spent lots of time watching lecture videos on YouTube. But in China, I have to VPN tunneling back to Taiwan, and the network condition is usually not so good such that the streams are always buffering… So it’s a good idea to write a script that can batch download all the lecture videos, and then put them into my iPad thus I can watch everywhere and watch later. Thanks youtube-dl. »

Reordering windows in GNU Screen

對於一個重度 Screen 使用者來說, workspace window 一開十幾個是很常見的事, 然而視窗一多, 愛整理工作環境的毛病就會犯, 這時候就需要把 Screen 裡的視窗重新排序分類一下了. 在 Screen 裡可以透過 number [n] 指令來更改當前視窗的編號:

C-a :number NUM

Hint: 如果想把一個視窗”釘死”在最右邊, 可以用 C-a :number 999 這樣的小技巧!

»