2010年3月4日 星期四

Building qemu-kvm

KVM is integrated into linux kernel, It may help virtualizaion of QEMU( QEMU is emulation only ).

the first step is install the kernel module and get the qemu-kvm source code( a modified qemu )

1. modprobe kvm
2. modprobe kvm-intel

3. step into the source code of qemu-kvm,  ./configure --target-list=i386-softmmu

if lack of libpic ,    install the pciutil

then make to get the qemu

2010年2月4日 星期四

eclipse didn't work on opensuse11.2

export GDK_NATIVE_WINDOWS=1 

before you launch eclipse.   GJ!!

2010年2月3日 星期三

Today I see two python pitfalls

The first one is in the com.lang.python google group article:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/fe6430e7980e2a96?hl=en#

 if brief . the python import statement may search module in current path first, and files in the same module has very weak relation such as the followiing example that email.py was used in two place and python finds  the wrong one

 bash$ touch email.py
   bash$ python
   ...
   >>> import smtplib
   Traceback (most recent call last):
     File "", line 1, in
     File "/usr/lib/python2.5/smtplib.py", line 46, in
       import email.Utils
   ImportError: No module named Utils


the second is about generator expression, the variable in the clause is not evaluated or stored immediately and may lead a lot of error. To avoid this, list comprehension or closure are the solutions.
http://yz.mit.edu/wp/2010/01/14/bitten-by-python-scoping/

As I use python much, I always can find something strange as I use it :<

2010年2月2日 星期二

Use hdaps in X200S in opensuse11.2

Follow  the following links , The idea is clear

http://www.thinkwiki.org/wiki/Tp_smapi#Installation_on_openSUSE

http://forums.opensuse.org/hardware/laptop/417254-tp_smapi-lenovo-thinkpad-t400-t500-w500-step-step.html#post2005932

The main idea is search the build package in opensuse website , just search tp_smapi and hdapsd.  with them , we can perform these commands to turn hard disk protection.


modprobe tp_smapi
modprobe hdaps
/etc/init.d/hdaps restart

check by
smartctl  -a /dev/sda | grep Load_Cycle

2010年1月27日 星期三

Although RE is a common tool..

http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions

grep cannot handle extend regrlar expression,

I think , alias grep as egrep is a good idea

As readding the article,   I now understand why vim is so inconvinence that using \( \) as group.

Throwing an exception cause process terminate in c++

If the function signature specify A exception, and the function implementation throws B exception, The process will fail event it explicitly catch exception B. However, if the function signature didn't specify anything about exceptiot, the exception throw by the function won't make the entire process crash.

There is a format for Change Logs

My colledge ask me to fill out the change log, Due to vim help my highlight the file. I found a change log has format too !!

http://www.gnu.org/prep/standards/html_node/Change-Logs.html

However, the previous change log written by others didn't follow the format. So, I can't follow this article!!