2011年3月29日 星期二

白蘭氏五味子芝麻碇

剛剛花旗打來促銷, 我沒有答應,去網路查到這篇,覺得很忠肯,問題不在於有效沒效

http://kunghc.pixnet.net/blog/post/27933260

不過真的有很多說有效的, 不過我覺得所謂有效, 已經把他當作藥了, 病的成因並沒有解除, 一但不吃, 還是會再回來, 甚至更快, 歸根究柢, 多運動多休息還是癥結, 當營養補充, 可吃可不吃, 千萬不要當藥了

2011年3月24日 星期四

Append text to file from command line

http://stackoverflow.com/questions/4640011/append-text-to-file-from-command-line-without-using-io-redirection

其實最簡單的就是
$ export lines="text you want to append"
$ echo $lines >> file
$ echo "" >> file

2011年3月18日 星期五

Try eGalax USB Touch for tslib

There are three kernel modules support USB eGalax Touch device
1. inbult usbhid module for HID touch device
2. Inbult usbtouchscreen module for non-HID touch device
3. eGalax Touch tkusb module for both HID and non-HID touch devices

Item 3 is not in consideration list for inbuilt modules in kernel being more convenient. Usbhid and usbtouchscreen conflict and I use usbhid finally.
As for the application interface, there are X11 and tslib. X11 is too big and often is used on desktop. tslib is a thin software interface and ready for Qt. I decide to focus on tslib.

Step 1. Root File System with tslib
Make sure tslib in buildroot has been checked. Find the eGalax plugin patch from
http://repository.timesys.com/buildsources/t/tslib/tslib-1.0/
I modify and combined to 4 patches.
tslib-1.0-A1_svn_updates-r50-r78.patch, tslib-1.0-Z4_egalax.patch, tslib-1.0-no-cxx.patch, tslib_add_finddef_and_inputattach_utils.patch
Notice that patches are used by alphabetic sequence.

Step 2. Linux Kernel with usbhid
Follow the menuconfig on kernel,
(Notice that USB Touch Driver has to be unchecked.)
$ Make menuconfig
Device Drivers --->
Input device support --->
<*> Event interface
// [*]Touchscreens --->
// <*>USB Touch Driver
HID Devices  <---(Handy: Try All to Yes)
[*] /dev/hidraw raw HID device support
[*] /dev/hiddev raw HID device support

Step 3. test tslib
Make sure /dev/input/event0, /dev/hidraw0 is there.

Test by
# export TSLIB_TSDEVICE=/dev/input/event0
# export TSLIB_FBDEVICE=/dev/fb0

# vi /etc/ts.conf
module_raw input
module_raw galax

# ts_calibrate
# ts_test

Step 4. Qt with qt-mouse-tslib

[Host]
$ ./configure -embedded arm -xplatform qws/linux-arm-g++ -qt-mouse-tslib
$ make
//deploy to Target
[Target]
# export QWS_MOUSE_PROTO=Tslib:/dev/input/event0
# cd /usr/lib/
# ln -s libts-1.0.so.0.0.0 libts-0.0.so.0
//Test qt application with touch