12/12/2009

Portfolio activity, November 2009

As of 12-December-2009, my portfolio allocation is shown below.
CurrentTarget
Equity100%75%
US43%27%
EU018%
JP06%
APEJ16%9%
REIT010%
SG19%5%
CN22%0
Fixed Income025%
Global010%
Asia05%
SG010%

I only bought VTI ETF in Feb. Therefore, in 2010, I will buy EU, JP, REIT and Fixed Income ETFs in Feb and Oct.

8/30/2009

Fast Reading Method

a good Blog article about fast reading: http://roman-rytov.typepad.com/miles/2006/11/how_to_read_fas.html

8/18/2009

Solve USB Problem in VirtualBox (Fedora)

1. create a group "vboxusers" and make user your current user is in the group "vboxusers"

2. check the group id of "vboxusers", for example, 501

3. Add the following line at the end of /etc/fstab:

none /sys/bus/usb/drivers usbfs devgid=501,devmode=664 0 0

4. reboot

5. start VirtualBox

7/29/2009

USB Application Programming in Windows

1. MSDN - USB device driver
http://msdn.microsoft.com/en-us/library/ms790518.aspx

2. USB Windows Library
http://libusb-win32.sourceforge.net/#documentation

3. AVR USB Software Packages
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4199

4. Easy HID package
http://www.protongeeks.com/index.php?option=com_content&task=view&id=136&Itemid=30

5/30/2009

Linux RS232 Programming

1. http://www.avsforum.com/avs-vb/archive/index.php/t-838364.html

At the simplest level, if you don't mind the command line (which is where the power of Linux lies anyway, so not using the command line when setting up a powerhouse HTPC is like not using the Tiptronic mode of your new Acura), you can control a serial device with two steps:

1. set the baud rate
stty -F /dev/ttyS0 [[]baud rate[]]
i.e.
stty -F /dev/ttyS0 115200
stty stands for set teletype
/dev/ttyS0 is the UNIX equivalent to COM1 in Windows

2. send the control string
printf "blahblah" > /dev/ttyS0
i.e.
printf "Input 02\r\n" > /dev/ttyS0
printf "\x08\x0f" > /dev/ttyS0
\r\n prints a Windows-style newline, in case your device requires such a newline after a command. \x lets you use hexadecimal bytes directly, as my Plus projector required, for example.

To go beyond one-way control, there is a program called chat or expect or something like that, that can run scripted conversations with your devices. It was designed for handling logins to dial-up Internet/network access back in the day. Beyond that, you can write something in C/C++, perl, bash, or any other language to do your bidding.

2. S-Jinn
S-Jinn is a free, lightweight, open-source Linux application written in C. It is a simple command-line tool designed for sending & receiving data from PC controlled TIA/EIA-232 (RS-232) test, measurement, and control devices.

3. A Linux serial port test program

4. Serial Programming Guide for POSIX Operating Systems

5. Linux Serial Programming Howto

5/26/2009

JavaScript Tween 算法

1. JavaScript Tween 算法及缓动效果 (http://www.cnblogs.com/cloudgamer/archive/2009/01/06/1369979.html)

2. 图片切换效果 (http://blog.csdn.net/wtcsy/archive/2009/05/24/4213118.aspx)

5/22/2009

Inversion of Control (dependency injection) in OOP

1. Inversion of Control Tutorial (http://www.martinfowler.com/articles/injection.html)

2. One famework using IoC: Spring (http://www.ibm.com/developerworks/cn/websphere/library/techarticles/0603_fanggw/)

3. Another framework using IoC (dependency injection) (http://code.google.com/p/google-guice/)