Splitting and joining files

So I bzipped a 40G file last night. I checked the timestamp and it took about an hour to finish with my 8-core cpu. Since the 40G file is a text file, the resulting file is only 1.4G large. Impressive, I went on to get my morning coffee, happy. Then when I got back, I realized a 1.4G file is still a little too big to transfer it at once. Network failure often happens, and I will need to chop up this file somehow. I did some searches and found that the old school way is to use the split command. I tried that but I got these funny xaa, xab, xac files… ok, fine, I can provide prefixes to them, but still. It’s not intuitive to know how to combine these files back. I suppose a “cat * > file” will do. But what’s the resulting filename? How am I supposed to remember after even just one day? I suppose I can keep a readme file… man, this is last century! ...

September 22, 2011 · 2 min · birdchan

Running bzip2 with multiple cores

I was trying to bzip a 40Gb file and it was taking forever. I then checked the Activity Monitor. It turns out the default bzip was only using one cpu core!!! If you really want to make use of your other cpu cores while doing bzip’ing, here is a nice way I found. Go to http://www.zhuk.fi/pbzip2-action/ and download PBZIP2 Automator action and workflow/service for Mac OS X. Once you have the tbz2 file, double click, then you will see a folder with two files insides. Double click on each file to install the necessary programs. ...

September 22, 2011 · 1 min · birdchan

How to cancel a Wells Fargo personal check?

This is how to cancel a Wells Fargo check as of Sept 21, 2011. Login to your WF account. Click “Account Services”, it’s among the top tabs the 5th one counting from the left. On the next page, Under “Account Services”, find “Stop Payment on a Check”, should be the 9th link. Then just follow the steps. You will need to have the info on the check #, the amount, payable to, and signed date. ...

September 21, 2011 · 1 min · birdchan

selecting checkboxes

Say you have a few checkboxes, defined as below: Item 1 Item 2 Item 3 Basic stuff. Now you want to get those that are checked. In PHP $cb_arr = $_POST["items"]; In javascript, or jquery var cb_arr = $(".my_cb:checked"); Notice the cb_arr above is not a js array. You need to use .each() to iterate through the items. To pass that to php via ajax, you can serialize it like this: var cb_arr_str = $(".my_cb:checked").map(function() { return this.value; }).get().join(','); My point here is this. The ids turn out to be quite useless when dealing with checkboxes. ...

September 16, 2011 · 1 min · birdchan

JQGrid Word wrap

While playing with jqGrid, I have no idea why word wrapping a line is so difficult to do. Here is a few steps to enable word wrapping in the cells. Open up ui.jqgrid.css Search for .ui-jqgrid tr.jqgrow td Change “white-space: pre;” to “white-space: normal;” You are done! ;) Ref: http://2centtech.blogspot.com/2009/12/jqgrid-header-and-cell-value-word-wrap.html

September 12, 2011 · 1 min · birdchan

US Debt Crisis

[youtube &w=560&h=345]

September 9, 2011 · 1 min · birdchan

File transfer

Ref: http://xkcd.com/949/

September 9, 2011 · 1 min · birdchan

水調歌頭 - 蘇軾

明月幾時有,把酒問青天。 不知天上宮闕,今夕是何年。 我欲乘風歸去,又恐瓊樓玉宇,高處不勝寒。 起舞弄清影,何似在人間。 轉朱閣,低綺戶,照無眠。 不應有恨,何事長向別時圓。 人有悲歡離合,月有陰晴圓缺,此事古難全。 但願人長久,千里共嬋娟。

September 8, 2011 · 1 min · birdchan

Are jobs obsolete?

This article is very interesting in that, while everyone is talking about the unemployment rate and using that as a measurement on the economic health, the writer Douglas Rushkoff argues that the decline of jobs is actually a direct product of the advancement of our technology. If that’s true, then creating jobs may be a funny thing to do, pretty much for the sake of creating them. URL: http://www.cnn.com/2011/OPINION/09/07/rushkoff.jobs.obsolete/index.html?hpt=hp_c1 ---—————————————————- ...

September 8, 2011 · 6 min · birdchan

尾牙

尾牙是商家一年活动的“尾声”,也是普通百姓春节活动的“先声”。每年月的初一、十五或者初二、十六,是台湾商人祭拜土地公神的日子,称为“做牙”。二月二日为最初的做牙,叫做“头牙”;十二月十六日的做牙是最后一个做牙,所以叫“尾牙”。 Ref: http://baike.baidu.com/view/131868.htm

September 2, 2011 · 1 min · birdchan