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

退伍軍人桿菌

“退伍军人症”是由“退伍军人杆菌”(Legionella spp)引发的急性肺炎及呼吸道感染。该病得名于1976年美国宾夕法尼亚州一次退伍军人聚会后的“浩劫”——与会的221位退伍军人中,有34人死于不明病原的肺炎。从死者肺部组织中分离出了一种相当特殊的细菌,后被命名为“退伍军人杆菌”。英国一项研究发现,司机患上该病的几率是普通人的5倍,罪魁祸首可能是车辆的雨刷。 Ref: http://www.hudong.com/wiki/%E9%80%80%E4%BC%8D%E5%86%9B%E4%BA%BA%E6%9D%86%E8%8F%8C Ref: http://en.wikipedia.org/wiki/Legionella_longbeachae

September 2, 2011 · 1 min · birdchan

storing blob into mysql through apache and php

This idea sounds easy and stuff. I agree. I assume you already got it working fine. But perhaps one day you may notice something is not working well, especially when you are dealing with bigger files. Below are a few things you want to look out for. Change your /etc/php.ini upload_max_filesize = 2M post_max_size = 8M memory_limit = 128M The default upload file size is 2M, which could be too small. If your upload file is larger than this, you will receive an empty upload file at your server side. So, increase this. While if you are using ajax to post-send, increase the post_max_size limit. Another thing to watch out for is memory_limit. If you somehow make copies of big blobs in your code, increasing PHP’s memory limit is also a good idea. ...

September 2, 2011 · 3 min · birdchan

Using ajax to do a file submit

I have read many online articles on this topic. However, they either just show how to do ajax form submission, or how to submit just files. In my case, well I bet in most real life situations, we need to submit both ordinary text/selection/radio values and files. Here is how to do it. HTML forms. Yea, whatever. Just set something up. Submit Notice I didn’t use the form tag. My philosophy here is that: since we will decide the data set during the ajax submission, there is really no need to declare a form here. ...

September 1, 2011 · 2 min · birdchan

PHP read from a mounted drive

Recently, I needed to read from a mounted drive on osx using Apache and PHP. I need to grab some file names in a certain directory using opendir or scandir, then dynamically populate a select dropdown box. The issue is, the default apache user is _www being in the _www group, while the mounted drive allows only the “staff” group to enter. In my case, I cannot change the mounted drive access permissions. ...

August 31, 2011 · 2 min · birdchan