## Thursday, December 18, 2008

### Dont make a pointer to vector members

It's very dangerous to make a pointer to member of vector. That's because if you add or move a member from vector, then all the reference or pointer to this vector will become invalidate.

If you want to keep the address of the member , a good way is to allocate memory for every member using "new". The vector just save the pointers to the address of these members. Don't forget to "delete " all members if you don't use this vector anymore.

An example:
[code]
//allocate
vector vec;
for(int i=0;i<3;i++) { int * a =new int; *a=i; vec.push_back(a); }
//deallocate
for(int i=0;i{
delete vec[i];
}
[/code]

## Wednesday, December 17, 2008

### Three points about c++ class and structure

In last few years , I read lots of c++ books . But I did not do much program work for C++. One reason is lazy that I think I dont need. Second reason is I dont have project which need it.

Now I find it 's useful . But some problems have came.
Today , I learn two points:

1, you can not give value to variable in the class which is forbidden:
class myclass {
int x=5,y;
}

2, You need delete the class(structure)pointer if you dont use it anymore:

myclass *mc * mcc;
mc=new myclass;
mcc=new myclass[2];// a vector

delete mc;
delete [] mcc;

It's same to structure data;

3,for structure, it can not contain itself when you build it
like
structure st{
int x;
int y;
st itself;
} ;

That's forbidden in c++; But as a tip you can make a pointer to itself:

like:
structure st{
int x;
int y;
st* itself;
}

When you want get a chain of data , you need this tip..

## Tuesday, December 16, 2008

### no method can solve all problem

Yes, in this world ,there is no one can do anything. You can not solve every problem .No theory can explain all situations.
So first try solve it in a simple way, second try free some constraints.....No end ....But for clever people , they should know when he/she must stop and do something else which is more important.....

## 卡尔曼滤波器 Kalman Filter

2．卡尔曼滤波器的介绍
（Introduction to the Kalman Filter）

3． 卡尔曼滤波器算法
（The Kalman Filter Algorithm）

X(k)=A X(k-1)+B U(k)+W(k)

Z(k)=H X(k)+V(k)

X(k|k-1)=A X(k-1|k-1)+B U(k) ……….. (1)

P(k|k-1)=A P(k-1|k-1) A’+Q ……… (2)

X(k|k)= X(k|k-1)+Kg(k) (Z(k)-H X(k|k-1)) ……… (3)

Kg(k)= P(k|k-1) H’ / (H P(k|k-1) H’ + R) ……… (4)

P(k|k)=（I-Kg(k) H）P(k|k-1) ……… (5)

4． 简单例子
（A Simple Example）

X(k|k-1)=X(k-1|k-1) ……….. (6)

P(k|k-1)=P(k-1|k-1) +Q ……… (7)

X(k|k)= X(k|k-1)+Kg(k) (Z(k)-X(k|k-1)) ……… (8)
Kg(k)= P(k|k-1) / (P(k|k-1) + R) ……… (9)
P(k|k)=（1-Kg(k)）P(k|k-1) ……… (10)

0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}} }" border="0" height="327" width="510">

clear
N=200;
w(1)=0;
w=randn(1,N)
x(1)=0;
a=1;
for k=2:N;
x(k)=a*x(k-1)+w(k-1);
end

V=randn(1,N);
q1=std(V);
Rvv=q1.^2;
q2=std(x);
Rxx=q2.^2;
q3=std(w);
Rww=q3.^2;
c=0.2;
Y=c*x+V;

p(1)=0;
s(1)=0;
for t=2:N;
p1(t)=a.^2*p(t-1)+Rww;
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv);
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1));
p(t)=p1(t)-c*b(t)*p1(t);
end

t=1:N;
plot(t,s,'r',t,Y,'g',t,x,'b');

## Friday, November 28, 2008

### Install Orocos on RTAI/LXRT linux system (Ubuntu 8.04)

Today I install Orocos on RTAI system.
There are many errors on the screen. But after I download and install many libraries , finally it is working now.
For Ubuntu 8.04 Hardy system, I did not do this work as
"The OROCOS Real-Time Toolkit Installation Guide " .
They said I should do like:
$cd src$ sudo apt-get update$apt-get source orocos-rtt$ sudo apt-get build-dep orocos-rtt$sudo apt-get install devscripts build-essential fakeroot dpatch$ cd orocos-rtt-1.4.0$dpkg-buildpackage -rfakeroot -uc -us$ cd ..$for i in *.deb; do sudo dpkg -i$i; done
But I have a problem when I "sudo apt-get build-dep orocos-rtt ". It gives me errors about " 'xenomai". It 's very strange because I use RTAI/LXRT ,not xenomai.

So I change my idea and go the normal way to install it.
1, You should check the RTAI/LXRT setting("The OROCOS Real-Time Toolkit Installation Guide 2.3.1")
2,before you install orocos, make sure you have installed Boost,gcc, xerces,ace&tao,cppunit,cmake
4, Start install Orocos following "The OROCOS Real-Time Toolkit Installation Guide 1.3.3"
  mkdir orocos-rtt-1.6.0/buildcd orocos-rtt-1.6.0/build../configure --enable-corba --with-lxrt [--prefix=/usr/local][--with-linux=/usr/src/linux]5.You will see some error information when you configure it.That's let you know what library you need install.
6.after configure.do:

cmake ..
ccmake ..

cmake is to build makefile in build file. ccmake will let you change some option,like the directory of linux source(/usr/src/linux) and RTAI library(/usr/realtime).. Before you use this ,you should know how to use ccmake.

If there is no errors, you can continue.
7, do:
make
sudo make install

Then that's all.

If you want to install OCL , you should download tar ball with KDL and BFL.
Before installing OCL ,first you should install kdl and bfl. They need more libraris, such as ltilib , readline, docbook, etc..
When you install these library, you should always use "ccmake" to change some configuration about the folder directory or OROCOS_TARGET=LXRT.

SEE more:
http://people.mech.kuleuven.be/~orocos/pub/stable/documentation/rtt/v1.6.x/doc-xml/orocos-installation.html#install-debian

Finally I finished it..^_^

## Thursday, November 27, 2008

### Ubuntu can not shutdown as NetworkManager 's problem

last time when I compiled the kernel, I choose disable ACPI in Power Management ,so that my computer can not shutdown as NetworkManager can not reply the system or using bus to send signal.
I have tried two method:
2,disable NetworkManager
It still can not solve the problem.
Afterwards, I find I disable ACPI which has some functional things about managing the power for bus and others. I have a look at the guide book from
RTAI and find I need enable ACPI.

So today I recompiled the kernel and enable it. Now it's working!!!

About how to disable and enable NetworkManager:
sudo /etc/dbus-1/event.d/26NetworkManagerDispatcher stop/startsudo /etc/dbus-1/event.d/25NetworkManager stop/start

## Monday, November 24, 2008

### RTAI on Ubuntu 8.04

Today I compile the RTAI on the new computer which has 4 cores.
I find a good tutorial "How to Install RTAI in Ubuntu Hardy" .
I do it by that guided book.
Three parts need to be changed:

1, In the kernel configure menu, I need turn off "cpu idle PM management" and select ACPI and deselect APM).
2,In the RTAI configure menu, I need set"General > Linux source tree =/usr/src/linux".Not the headers directory.
3, Add path" /usr/realtime/bin " to the environment. I need add the command to /home/usrname/.bashrc or /root/.bashrc.(like "export PATH=$PATH:/usr/realtime/bin") ### Remove kernel version Sometime you have two or more kernel version, these versions need more disk space . If you want to save disk space, you need remove them. For ubuntu, I do: ## .deb based distro - Debian or Ubuntu Linux Again find out all installed kernel version: $ dpkg --list | grep linux-image
Output:

ii  linux-image-2.6.24-19-generic              2.6.24-19.41                      Linux kernel image for version 2.6.24 on x86ii  linux-image-2.6.24-21-generic              2.6.24-21.43                      Linux kernel image for version 2.6.24 on x86

Now remove linux-image-2.6.24-19-generic with apt-get command itself:

# apt-get remove linux-image-2.6.24-19-generic

OR

$sudo apt-get remove linux-image-2.6.24-19-generic More information is in: http://www.cyberciti.biz/faq/debian-redhat-linux-delete-kernel-command/ ### Do update after installing new Ubuntu system Every time you need install ubuntu system, please remember updating and upgrading your system. #apt-get update #apt-get upgrade If you dont do that, sometimes you can not find new library when you want to "search" or "install" it. ## Wednesday, October 8, 2008 ### read and save video file by opencv I spent two days to test the program as one of my friend want to save frames in video file. I find that opencv work on video things by FFMPEG library.So before you install opencv ,you mush check if you have install ffmpeg and libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg62-dev libtiff4-dev. After that ,you can recompile the opencv : ./configure make sudo make install If when you do ./configure ,you can see "ffmpeg yes", then it said opencv can work on ffmpeg.. When I do recompile the source code of opencv , I find something interesting. Afger configure,I find opencv can find ffmpeg..but it still can not read and write video files. but after I change something in highgui's source code and do recompile again, it's working.. I think maybe that's because if you dont change anything in the source code .It does not refresh the library... More information about opencv and Ubuntu http://dircweb.king.ac.uk/reason/opencv_cvs.php ## Friday, September 26, 2008 ### Switch in c++ Today I start use switch to do something . But I missed a important thing , that's the term 'break' in Switch just make program get out "switch". I have though "break " just work for loop ,like "for" and "while". Now I know it also work for "switch". switch(flag) { case 1: //here break just make program get out switch ,dont check case 2 and 3. break; case 2: //do sth, if you dont add break , the program will go to case 3 to check; case 3: break; } ## Wednesday, September 24, 2008 ### Problem: How to group points on segment curves?? It's a interesting question .. ## Thursday, September 11, 2008 ### choose octave editor from emacs to gvim To be honest, I don't familiar with emacs. Gvim is my favor editor under linux. Now I want to choose gvim as default editor. Just one command line: # export EDITOR=gvim It seems octave use environment variable to decide which editor it should use. I add this line to ".bashrc" to make sure it always work after start my pc; ## Tuesday, September 9, 2008 ### Scp's error information When I use scp to copy one file from server to laptop, it gives me a error, said: pemission denied(publickey,password......) lost connection But ssh works , so I google for a while and find the resolution . If you work on a server ,don't do : scp -r usr@ip(server):path usr@ip:path because maybe you don't have right to transfer files on ip server. So you can do: scp -r path usr@ip:path Because the path is on your local folder, so it works for me.. ### Use Octave instead of Matlab I don't want to pay money for Matlab, so I am using Octave which is a open source math tool for Linux and Windows. I tried it today. Its command very like Matlab and convenient. ## Friday, September 5, 2008 ### Linker and compiler In the Makefile, if you want to get object file ,you just need headfile and cpp file. If you build the execute file ,you should add lib files . ## Tuesday, September 2, 2008 ### Check swap in Ubuntu When you install Ubuntu,first thing is partition one part of disk to give swap for Ubuntu system. The swap part will be used if system memory is not enough for running some programs. The size of swap should be better between one time memory and two time memory. How to check if it's working?$fdisk -l
//check the disk information,it will show the size of the swap
$free //it will show you the information about memory and swap. ## Saturday, August 30, 2008 ### How to change internet ip under ubuntu The fast way should be$cd /etc/networks/
$sudo vi interface then you can add your ip address to this file$sudo /etc/init.d/networking restart

### dual boot vista and ubuntu

If you install vista first, then you can install ubuntu directly. Ubuntu can add vista system to the Grub boot loader automatically.
If you install ubuntu first and want to get vista, you should be careful . Because vista dont add ubuntu to its bootloader.
Before install vista, you should save your boot information. It's in /boot/grub/menu.lst.

To save that file just let you remember the partition of the hard drive, for example, I install ubuntu in the 6th partition on the first hard disk (ONLY ONE) and vista in the 2th partition on the same disk. It should like:

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=3ee4ca11-0ceb-4071-8854-b43f86bf25f8 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,6)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=3ee4ca11-0ceb-4071-8854-b43f86bf25f8 ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,6)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda3

Because vista rewrite the MBR which is a headfile in the disk. MBR will tell computer whereis the booter. Vista will erase the MBR, so it can not find ubuntu. So we need write boot information in MBR by Ubuntu's boot loader :"grub".
So we do:
2,restart from cd
3,choose "try ubuntu without any change to your computer"
4,open a terminal
5, in the comand line ,type:
$sudo grub grub>root (hd0,6) //here you need know which partition is your ubuntu stand. grub>setup (hd0) //here setup MBR file. grub>quit$reboot
6,after reboot computer, you will go into the ubuntu system, now do:
$cd /boot/grub$vi menu.lst

root (hd0,2)
savedefault
makeactive

then restart...

## Friday, August 29, 2008

### Host key changed by using ssh

When you use ssh to connect the host, the host should give its hostkey (in /etc/ssh/ssh_host_rsa_key.pub) to you, and your computer will check "$HOME/.ssh/known_hosts",compare their hostkey, if it can not find this host in "known_hosts",it will ask you if you want to add it. If you are sure this key is correct, then you can add it. If it find the matched name in known_hosts, but the host key is not matching with that key the host has gived. It will failed to connect. If you are sure the hostkey has been changed and want to use new hostkey, then you can delete the old hostkey in "known_hosts",and do "$ssh username@ip" again, this time you have choice to add new hostkey to file.

In the "ssh_host_rsa_key.pub" and "known_hosts", the key is writen in unreadable format. If you want to see it or regenerate new key, you should use command "ssh-keygen". For example, you can use "ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub" to see the readable format of the key. For detail information ,do "man ssh-keygen".

There are three different key file, rsa,rsa1 and dsa. You can choose different protocal to connect host. But normally, it should use rsa.

## Thursday, August 28, 2008

### Suspend problem for ubuntu hardy

A great guy gets the solution for this problem ,just run :

#echo SUSPEND_MODULES=\"ehci_hcd\" > /etc/pm/config.d/WORKAROUND

I don't know why,but it works...

## Monday, August 18, 2008

$:ssh [username]@[ip] then if it ask you yes or no,just say yes, type your password. If you want get x-window, use:$ ssh -x [username]@[ip]

If you want to copy file from another computer:
$scp [username]@[ip]: /from/file1 /to/file2 If it's a directory,then use:$scp -r [username]@[ip]: /from/directory1 /to/direcotry2

## Friday, August 15, 2008

### Two weeks playing on debian

It's awfull to play on debian etch..

I spent almost two weeks to solve debian system problems and upgrade the kernel from 2.6.8 to 2.6.18.

It's first time for me to play linux as a root, also first time for me to touch the heart of computer-kernel...

The first problem is no higher resolution for my new LCD.

The second problem is no mouse been found.

The third problem is ungrade failed.

I write the problem and solution here for me and other guys who have same problem.

1,for higher resolution.

All x-server information was setted in /etc/X11/xorg.conf. Before you want to change it ,you should save it in a copy file,like xorg.conf_old.

First you should know your graphic card information, of couse ,sometimes you don't know ,becouse you are not the guy who build it. If you want to know it ,the best way should be to look /var/log/Xorg.log.0. There you can see many information about the xserver.

From log file ,I see my graphic card is nVidia, which need nv driver. And I see the best resolution 1280*1024..You also can see why some mode of resolution can not be used by xserver..(such as frequence much more than maxmimum 144MHz). For Lcd, YOu don 't need big frequence, 60Hz is ok. If there is no right mode , you can add modeline in xorg.conf by yourself.

For example:

Section "Monitor"
DisplaySize 380 300
HorizSync 31-64
Identifier "Monitor[0]"
ModelName "P19-1"
Option "DPMS"
VendorName "FUS"
VertRefresh 59-76
UseModes "Modes[0]"
EndSection

Section "Modes"
Identifier "Modes[0]"
Modeline "1280x1024" 108.88 1280 1360 1496 1712 1024 1025 1028 10
60
Modeline "1280x1024" 106.97 1280 1360 1496 1712 1024 1025 1028 10
59
Modeline "1280x1024" 105.15 1280 1360 1496 1712 1024 1025 1028 10
59
EndSection

In fact , my problem is that I choose wrong driver "vesa" for gcard.

I do :(# as root)

#dpkg-reconfigure -phigh xserver-xorg

It show me to choose driver,so I choose "nv". Now restart x server by type "startx" in shell or CTL+ALT+BACKSPACE.

This time I can not use mouse anymore.

I use old input setting for the mouse and restartx. This time it works. I can see the higher resolution in Desktop->preference->screen resolution. Then I choose higher resolution. I get it.

2, no sound .

Old kernel version is 2.6.8, but my debian is etch which should be has 2.6.18 or newer version .

In linux ,alsa is a tool to manage the sound setting.

For 2.6.8, alsa is a part of kernel. But in etch ,it need more modules .

I install alsa-base and alsa-util by "apt-get install alsa-base alsa-util".

Now it works.

3,update you kernel in etch.

Fisrt you should update package database and install all needed package:

#apt-get update

#apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential

one way is from debian kernel, you can do:

#apt-get install linux-souce-2.6.18

If you want to know the new version of linux-souce, you can do "#apt-get search      linux-souce".

#cd /usr/src/

#wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2

I use second method.

#cd /usr/src/

#tar -xjf linux-2.6.18.tar.bz2

#ln -s /usr/src/linux.2.6.18 linux

#cd linux

#make clean && make mrproper

Then copy old configure file to here if you want to use old configure file, otherwise    skip this. 'uname -r 'is your old kernel version,for me it's 2.6.8-386

#cp /boot/.config-'uname -r' ./.config

This command will show a menu, you need choose "Load an alternate configuration file" and it will show you ./config, choose it and type "yes","exit".If it ask you if save the configure file ,you choose "yes".

And

#make-kpkg clean

wait about one or two hours.

After it finish, if there is no errors:

#cd /usr/src

Now install these deb file, as it's deb file ,so somebody call it's in debian way.

#dpkg -i linux-image-2.6.18-custom_2.6.18-custom-10.00.Custom_i386.deb

After that, do:

#cd /boot

#apt-get install module-init-tools initrd-tools procps

#mkinitrd -o /boot/initrd.img-2.6.18-custom 2.6.18-custom

#cd /boot/grub

Add "initrd /boot/initrd.img-2.6.18-custom" in the file like this:

## ## End Default Options ##

title Debian GNU/Linux, kernel 2.6.18-custom
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-custom root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.18-custom
savedefault

title Debian GNU/Linux, kernel 2.6.18-custom (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-custom root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.18-custom
savedefault

title Debian GNU/Linux, kernel 2.6.8-2-386
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/sda1 ro
initrd /boot/initrd.img-2.6.8-2-386
savedefault

title Debian GNU/Linux, kernel 2.6.8-2-386 (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.8-2-386 root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.8-2-386
savedefault

#shutdown -r now

You will see new kernel and old kernel when you start the computer. You can choose anyone whatever.

When I update the kernel to 2.6.24, it tell me that it can not find sda1.

I go to /lib/modules/2.6.24-custom, there I didn't see ata_piix sata_via libata sd_mod scsi_mod etc modules which were needed by SATA.

I get answers from google, that because the configure file is different between 2.6.8 and 2.6.24.

For 2.6.8, in configure file it like:

CONFIG_SCSI_SATA=y
CONFIG_SCSI_SATA_SVW=m
CONFIG_SCSI_ATA_PIIX=m
CONFIG_SCSI_SATA_NV=m
CONFIG_SCSI_SATA_PROMISE=m
CONFIG_SCSI_SATA_SX4=m
CONFIG_SCSI_SATA_SIL=m
CONFIG_SCSI_SATA_SIS=m
CONFIG_SCSI_SATA_VIA=m
CONFIG_SCSI_SATA_VITESSE=m
CONFIG_SCSI_BUSLOGIC=m

But in 2.6.24,it likes:

CONFIG_ATA=m
# CONFIG_ATA_NONSTANDARD is not set
CONFIG_ATA_ACPI=y
CONFIG_SATA_AHCI=m
CONFIG_SATA_SVW=m
CONFIG_ATA_PIIX=m
CONFIG_SATA_MV=m
CONFIG_SATA_NV=m
CONFIG_SATA_QSTOR=m
CONFIG_SATA_PROMISE=m
CONFIG_SATA_SX4=m
CONFIG_SATA_SIL=m
CONFIG_SATA_SIL24=m
CONFIG_SATA_SIS=m
CONFIG_SATA_ULI=m
CONFIG_SATA_VIA=m
CONFIG_SATA_VITESSE=m
CONFIG_SATA_INIC162X=m

So if you use old configure file for 2.6.8 to configure 2.6.24, you should notice this difference.

Before you copy ,first you should change the name from CONFIG_SCSI_SATA to CONFIG_SATA.("m" is modules loaded by kernel, "y" is built in the kernel)

## Monday, August 11, 2008

### Don't fear death

"Why should I fear death? If I am, death is not. If death is, I am not. Why should I fear that which can only exist when I do not?"
-- Epicurus

### the difference between .bashrc and .bash_profile

When you "man bash", debian will show you the difference between bashrc and bash_profile. But one word make me confuse, what's the login? Login the xwindows or terminal ?

When I log in the xWindow , I change the environment "PATH" IN .bash_profile, but it doesn't work. If I change the "PATH" in .bashrc, it works..It's suprising .

In fact .bashrc can work whatever you login termainal or xwindow.
The reason is you will find follow command in .bash_profile:

# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

So if you want create or add the environment variable ,it should be better to change .bashrc.

For example:

export PATH=$PATH:/home/username/lib:/usr/lib ### Install firefox 3 on debian Debian always support icewheal.. When I type firefox on the terminal , it show me icewheal windows. At the beginning , I don't know what' wrong. When I do :$ whereis firefox
firefox: /usr/bin/firefox /usr/lib/firefox /usr/X11R6/bin/firefox /usr/bin/X11/firefox /usr/share/man/man1/firefox.1.gz

I go to /usr/bin/
and
$ls -al firefox firefox -> ../lib/iceweasel/iceweasel Now I get it..The problem is Debian build a soft link from firefox to iceweasel. So we need build a new soft link to the real firefox . I do:$ mv firefox firefox.old
# ln -s " /home/my/firefox/directory/firefox"

so let 's see what happen in /usr/lib

$ls -al firefox firefox -> /home/my/firefox/directory/firefox When I run firefox ,it turn out "need gtk2,10" Debian just has gtk2.8. I goolgle it and download gtk2.10 ..It' s deb file , so I just need$dpkg-deb -x libgtk2.0-0_2.10.13-2~bpo.1_i386.deb ~/lib/gtk2-10

As deb is a specil file, you just need extract it by dpkg and it will install by itself.

If you download the tar.gz file ,you need configure and make install manually.

Now we need tell firefox where is the gtk 2.10.

go to ~/firefox/
do:
$vi firefox add #!/bin/sh # export LD_LIBRARY_PATH="/home/panda/lib/gtk2-10/usr/lib" Now restart the firefox, you can use it now.. I also want to get icon on the debian panel. So I go to Applications/Debian/App/System/KMenuEdit Use this tool to add new icon. Highlight the "Internets"column type File/new items/ But after I do this, I still can't see new icon on my Application/Internet I don't know why. But I find that I can change the old icon,such as iceweales and opera.. So I change iceweales to firefox and save it. Now the iceweales icon become firefox icon.. ### How to find the shared library Sometimes after you install the software on linux, when you run it,, it will warn you # cannot open shared object file: No such file or directory For example , I can not find the opencv library "libcv.so.1", so I type: ~$ whereis libcv.so.1

libcv.so: /usr/lib/libcv.so.0 /usr/local/lib/libcv.so.0 /usr/local/lib/libcv.so.1 /usr/local/lib/libcv.so

~$locate libcv.so.1 /usr/local/lib/libcv.so.1 /usr/local/lib/libcv.so.1.0.0 you can open "/etc/ld.so.conf" if you can not find /usr/local/lib in that file, you should add this file as root. else if you see it in , you can do: ~# /sbin/ldconfig you run ldconfig to update share library link. Maybe you worry about if the opencv library work because you see old version in /usr/lib, the new version in /usr/local/lib,and the ld.so.conf contain two directory . Don't worry about that, because the linux 's shared library is linked dynamically. You can go to /usr/lib and type: ~$ ls -al libcv*
You will find:

lrwxrwxrwx 1 root root 28 2006-07-23 16:21 libcvaux.so.0 -> /usr/local/lib/libcvaux.so.0
lrwxrwxrwx 1 root root 25 2006-07-23 16:16 libcv.so.0 -> /usr/local/lib/libcv.so.0

so they link with each other now. Linux can find the new version automatically (by name ).

We learn that after we install shared library, we should update dynamic link in the system by "ldconfig". Before do this , you should check if the shared library's route in the "/etc/ld.so.conf"

## Tuesday, August 5, 2008

### How to change the resolution under Debian system

Now i have a new computer which has debian system ,a kind of Linux system but has some different aspects with suse and red hat.
The nice thing is I have right to do everything on the computer, not like just a user.
Original screen resolution is 1024*768, but I get a better Lcd screen which need 1280*1024 to show image .

First I google many method to do it.
Second I want to know which Gcard I am using .
lspci to see the pci card.

lsmod

go to /etc/X11,and find xorg.conf. here you can set the x server system ,such as mouse ,monitor,screen etc..

If you want to see what's wrong when the system is doing by this xorg.conf, you can go to
#var/log/Xorg.0.log

to see what happen ..

if you just want to check error and warning things , you can add
egrep '^$$EE$$|$$WW$$' /var/log/Xorg.0.log

In fact , I install the wrong driver for my graphic card
I reconfigure the x server.. and choose nv instead of vesa..

Now I can get higher resolution, but I can't use the mouse. I copy old file's mouse setting to new xorg.conf. So it works..Although I get some warning information in my log file ..

### some thing about motor encoder

A new word is odometry , which is geometry parameter you can get from robot control, such as x and y position after robot moving.

If you want to calculate odometry automatic , you should need encoder on motor .\

Encoder Resolution=PI*Diameter/PulsePerRotation/gearRatio.

First time , I didn't get what gear ratio mean, so I get the wrong encoder resolution.

## Thursday, July 24, 2008

### Vision odometry

It's also interesting because it uses optical flow to get the trace of robot...
It's also new in vision field..

Hopefully I can use it in the next step work.

To see:http://www-robotics.jpl.nasa.gov/publications/Mark_Maimone/rob-06-0081.R4.pdf

### Holonomic Brain Theroy

It's surprising me..also very interesting....!!!!
If it's true,,,Then we store information in the wave frequency type in our brain..The brain cells are different just because they are just stimuli by the certain frequency. The information was transform from space-time to frequency field.
For example, in vision work, the information of the object is holograph image on the front of eyes. But after project by our eye lens , it becomes 2D image on our retina .But the image is not saved directly in the brain, before it is restored , it will be transformed again to holograph.. The brain save this holograph of the object in the certain field ..

If it's true, it will be easy understood that some guys can feel other guys' feeling or can communicated with each other by special wave or other things like that;

But some guys think it's Pseudoscience .not theroy.because there are no enough evidence to support that..

To see:http://en.wikipedia.org/wiki/Talk:Holonomic_brain_theory

## Wednesday, July 23, 2008

### How to copy and manage other computer by shell on linux?

If you want to use your computer to do program work under other computer , you can do :

If you want copy one file to other computer by internet, you can:

I learn it from a beautiful PhD girl....^_^

# Douglas E. Comer

## Monday, July 14, 2008

### create:

tar -cvf mystuff.tar mystuff/
tar -czvf mystuff.tgz mystuff/

### extracting:

tar -xvf mystuff.tar
tar -xzvf mystuff.tgz

### testing/viewing:

tar -tvf mystuff.tar
tar -tzvf mystuff.tgz

-c, –create create a new archive
-z, –gzip, –ungzip filter the archive through gzip
-v, –verbose verbosely list files processed
-f, –file=ARCHIVE use archive file or device ARCHIVE

-t, –list list the contents of an archive

See more:

http://linuxbasiccommands.wordpress.com/2008/04/04/linux-tar-command/

## Wednesday, July 9, 2008

### learn doxygen to document my code

Irene is really very nice girl who work very hard..

She works with me..I am very happy that I can learn so much from her as she graduated from computer science...

She know much program skill that I need.

Today

I learn how to use doxygen to document my code .
That will make my program more beautiful and easy to understand.

As I use suse Linux , it has installed doxygen, so I don't need to install it again.

Just do:

1,comment you file.
If this file is .cpp or .h, you need add /*! \file  "file's name"*/ to this headfile or source code file. If you don't do that ,you can't document it;
if you want to document some variable, you just need add /*!<"some comment"*/ after this variable.
you can use /def + macro name to document the definition of macro.
you can use /param or@param + [in/out]+"parameter's name" to document the function's document;
As in my head file, I will do this before a function:
/*!
"Detail comment"
or
*/
Of course
you can use \fn to document a function, but you need write the function again. If you change function 's name or parameters , you also need remember to change the comment.so it's not convenient;

2,build configure file and html file
doxygen -g <your configure file's name which contain many setting informations. you can give a name or nothing.if nothing, then doxygen will build Doxygen file in present directory>

doxygen <configure file name>

then you can see html file in your directory.
open it and use firefox or other web browser to see it...
you will find your code is so beautiful....
I really enjoy it..

## Tuesday, July 8, 2008

### Rihanna Take A Bow

<embed src="http://www.metrolyrics.com/scroller/scroller2.swf?lyricid=2147468740&border=6&bordert=0&bgfont=0xFFFFFF&bg=http://www.metrolyrics.com/scroller/bgs/Rihanna_4.jpg&filter=0x202020&filtert=27&txt=0xFFFFFF&fontname=arial&fontsize=10&speed=1" quality="high" width="180" height="210" name="scroll" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /><br /><a href="http://www.metrolyrics.com/rihanna-lyrics.html">Rihanna Lyrics</a><br /><a href="http://www.metrolyrics.com/">Take A Bow Lyrics</a></embed>

<object width="250" height="206"><param name="movie" value="http://www.youtube.com/v/op0mNl52EZo&hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/op0mNl52EZo&hl=en" type="application/x-shockwave-flash" wmode="transparent" width="180" height="148"></embed></object><br /><a href="http://www.metrolyrics.com/rihanna-lyrics.html" title="Rihanna Lyrics">Rihanna Lyrics</a>

## Wednesday, July 2, 2008

### How to add your own signature if you use ThunderBird under Linux

Today I find you can add signature following this way:

1,use vi or other edit tool to build a empty file
2,write your signature in it and save it in any directory. It should be best to save it in .txt file.
3,open your thunderbird and do edit/Account Settings, you will see add signature file. Then you can add the txt file.
4,when you build a new email, you will see you signature now...

## Thursday, June 26, 2008

### How to open .djvu files under linux

Under linux, you can open djvu file by web browser . Bust you need install plug in.

Second you need do :

./configure - -prefix=$path where you want to install$

make

make install

Third open Konqueror, select "Settings->Configure Konqueror" and check "Plugins". If you can't see $prefix path$/lib/netscape/plugins, you need type new and add this file in.
Then you can type scan for new plugins. After that ,you type "Plugins", you will see the file $/lib/netscape/plugins/nsdejavu.so there.. If you want to use Opera, you can do: cd /home/username/.opera vi pluginpath.ini After open "pluginpath.ini", you can add "$$/lib/netscape/plugins/nsdejavu.so=1" to that file. Work very nicely. Ok, congratulation, you can see djvu by konqueror now.... More information, you can get from: http://linux.derkeiler.com/Mailing-Lists/Fedora/2007-01/msg00091.html (This is very useful) http://djvu.sourceforge.net/ (This website is very bad I think..Because you can't find how to install the plugins to web browsers) ### "How is it that little children are so intelligent and men so stupid? It must be education that does it." Alexandre Dumas "How is it that little children are so intelligent and men so stupid? It must be education that does it." ## Saturday, June 21, 2008 ### The lower level vision is more difficult than higher vision I think so especially when you work on industry product developing . ## Friday, June 20, 2008 ### Happy about failed things I spent too much time on the parallel curve. It seems very simple. so when I can't finish it perfectively , I feel so sad... Today, I check many papers to find that no one can do it perfectly for any situation and any image. Many professors and Doctors do it many years to improve their work... I feel happy about that there are so many people stand with me...^_^.I am not alone. In scientific field , there are no problem can be solved perfectly. We just can get a better answer under special situation and presumption.. What I need learn is to grasp the most important thing and find the nearer way to get the goal. Although it's not perfect, but it can be better and better. ## Tuesday, June 17, 2008 ### parallel curve (The parallel curve of parabola is not parabola) It's very interesting that the parallel curve of parabola is not parabola..you can draw a parabola on your paper and use pen to go on by the line; you will see the parallel of the parabola will cross itself, so that's true the parallel of the parabola is not parabola; It's same to circle and sin curve; Here is a useful formula to calculate the parallel curve and curvature and the radius of the curvature: $X[x,y]=x+\frac{ay'}{\sqrt {x'^2+y'^2}}$ $Y[x,y]=y-\frac{ax'}{\sqrt {x'^2+y'^2}}$ Here y=f(t);x=g(t); X and Y are coordinate of the parallel curve. See more: http://en.wikipedia.org/wiki/Parallel_curve http://www.jstor.org/stable/3027202?seq=5 ## Monday, June 16, 2008 ### If you range the data by the loop in C++ Rember that it 's a wrong way to do this like: Increase range: for(int i=0;i<100;i++) { int x=a[i] ; for(int j=i+1;j<100;j++) { int y=a[j]; if(y<x) { int t=a[j];a[j]=a[i];a[i]=t;} } } Why that's wrong?? The reason is a[i] in the loop has been changed, but the x isn't changed. so It's wrong ! you can do it correctly like: for(int i=0;i<100;i++) { for(int j=i+1;j<100;j++) { int x=a[i] ; int y=a[j]; if(y<x) { int t=a[j];a[j]=a[i];a[i]=t;} } } or for(int i=0;i<100;i++) { int x=a[i] ; for(int j=i+1;j<100;j++) { int y=a[j]; if(y<x) { x=y; int t=a[j];a[j]=a[i];a[i]=t;} } } ### Conference ISVC(4th Int Sym Visual Computing). DeadLIne: JUly 21 IMPORTANT DEADLINES July 21, 2008 Paper submissions due September 1, 2008 Notification of acceptance September 15, 2008 Final camera ready papers due December 1-3, 2008 Symposium ## Friday, June 13, 2008 ### How to match pair of braces in gvim?? you can use % to find a pair of {} or () // etc..... see more :http://www.moolenaar.net/habits.html O-Town : All or Nothing Spice Girls : 2 Become 1 2 Become 1 Lyrics Spice Girls Lyrics 2 Become 1 Lyrics ## Tuesday, June 10, 2008 ### Programmer you always need change............... improve............ ## Monday, June 9, 2008 ### Fine Frenzy - Almost Lover ## Saturday, June 7, 2008 ### Welcome to Beijing 2008. ### Never had a dream come true ### Bleeding love ( Leona Lewis) ## Friday, June 6, 2008 ### Tired time Tired time for me is 3:30 Pm everyday.... Now I only want to sleep..... But works on the table are waiting for me .. So... just still living and working.. ## Thursday, June 5, 2008 ### Image coordinate and World coordinate If you want to show a world coordinate image by OpenCv or Matlab, you need to know the difference between Image coordinate system and the world coordinate system. The main difference is the original point, which is uper-left in image coordinate and bottom-middle in IPM (Inverse projection mapping)world coordinate. ## Wednesday, June 4, 2008 ### Copy and cat the string (Char*) in C++ char* newname=new char[100]; char* new="new"; char* name="name"; //first you need strcpy to copy content to newname. You can't use strcat instead of strcpy first. strcpy(newname,new);//newname="new" //Now you can use strcat to cat the string. But be careful about the string length.. Max length is 100-1.. strcat(newname,name);//newname="newname" if(newname) {delete[] newname;} ## Friday, May 30, 2008 ### Save you gvim set You can add code to .rimrc (in /home/user/); such as: syntax on set shiftwidth=4 set cindent NOte: Don't add ";" to the end of above sentence. But I am using the susx linux...You can't find .rimrc under directory /home/user. That's because it's under /etc/... Unfortunately I don't have right to change anything under the etc file.. So I create .rimrc under /home/liu Add some codes to it;; Now It works very well; ### cvConvertImage ,cvCvtColor and cvFlip First: How to convert a gray image to a 3 channel color image cvCvtColor() can do GRAY2RGB The other method,you can use it to filp image: cvConvertImage(ori,dst,flag); ori is original image; dst is destination image; flag is CV_CVTIMG_FLIP or CV_CVTIMG_SWAP_RB; here if you just want to convert image to color , you can set flag=0; Second: How to flip image by x axis or y axis. Method: cvFlip cvFlip(src,dst,flag) here flag=0,Positive value or passive value.. See more:http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html ### 缘起 －－写这段博文是应了一个博友的要求：“您可否结合自己在国内、国外读书，自己做研究、指导学生的经历具体的说一下国内的研究生教育都有哪些欠缺？要成长为一个qualified的研究者,我们需要在哪些方面多下功夫？” 研究生应当学到些什么？(转载) 缘起 －－写这段博文是应了一个博友的要求：“您可否结合自己在国内、国外读书，自己做研究、指导学生的经历具体的说一下国内的研究生教育都有哪些欠缺？要成长为一个qualified的研究者,我们需要在哪些方面多下功夫？” 这 个命题出现在我的博文《博物馆里的研究生院》的评论中（1），起因是我对谭宝林《国外的科研经历》博文的一个评论（2）。博友的名字叫“兔子”。我的研究 的一部分涉及哺乳动物啮形类的起源、演化等等。啮形类包括了啮齿目（耗子）和兔形目（兔子）两大类。看在“兔子”跟我的缘份上，就决定写这篇东西。这个命 题很难讲清楚，因为每个人的具体情况不同，我更多地是把它作为My life来写。 题外话 -- 我不是很习惯－或者说是刚习惯－别人叫我老师。最初有人叫我老师的时候，我身上会起鸡皮疙瘩。总觉得自己起步晚，一直都在念书，一年又一年总是个学生，叫 惯了老师们老师。忽然之间天翻地覆，有点慨而慷不起来。骨子里面顾忌的不光是误人子弟，更恐怕自己从此就老了去。直到今天，很多应当叫我老师的同事也很给 我面子，对我都是直呼其名，或是“哎，那个谁…”。是朋友最好。 大道理 -- 研究生的教育过程不光是选了几门课，做一篇研究论文，答辩通过了就算完。这只是最基本的内容，它让人有一定的知识和技能，并能以所学来做研究为生。教育还 有更广泛的内容，包括思想的交流；人性的理解；让自己知道在社会中的位置和责任；为人处事的举止行为；科学的世界观；团队精神；能够尊重、容忍、同时具有 批判的精神；虚心听取别人的看法，但又不盲目崇拜；懂得批评别人很容易但做出超过别人的实际工作很难；有解决问题并把事情（哪怕是一件小事）做成、做好、 做到最好的意识和努力；知道科学研究不光有关思想，同时也取决于细节；要以学术上做得更好来超越别人而不是靠打压别人来抬高自己，等等。这些东西很多都不 是课堂上能学到的，而是一点一滴领会于生活、工作、以及与人相处的环境中。所以研究生的教育在两个地方完成：课堂上和课堂外。大话说完，下面我就讲一点自 己的经历。 去美国留学 -- 我82年9月在中科院研究生院念书，84年11月拿到硕士学位，同时也开始申请出国念书。85年5月先后拿到Michigan和Columbia大学研究 生院的接收信，我选择了去后者。我的导师叫麦肯纳，是我现在工作博物馆的研究员，同时也是哥大地质学系的教授和哥大董事会成员。他和我所在的研究所以及国 内的导师周明镇先生有工作关系和私人交情。哥大还没有拿到我的GRE成绩就收了我，不知是否有走后门的嫌疑。不过等我的成绩单来了后我补交给了学校。我应 当在85年9月到哥大报道，但麦肯纳让秘书给我寄了一张地形图复印件，是他在怀俄明（Wyoming)夏天的野外工作区域， 他们在那一带做野外发掘。地图上的工作地点旁标了一个电话号码和一个人的名字，麦肯纳让我7月初到那儿去找他们。 我兜里揣了300美 元元，从北京飞到加州三藩市，住在加大一个朋友家，然后乘灰狗巴士从奥克兰到怀俄明东南角的首府夏安。 巴士连夜开，上厕所和吃饭会停一下。我吃了一路的汉堡，那是我唯一知道点的美国饭。路过犹他州的一个小镇，车站边就有吃角子老虎机，我好奇扔了四个25分 币去摇了几把，全军覆灭。到了夏安，在车站打电话联系接头的人。我的英文是二把刀，加上当地人的口音和当初学的英文有些差距，电话里的人话我听不大懂。反 复打了几次后才明白，说麦肯纳给我的电话已经disconnected， 我顿时就傻了眼。那时已是下午五点左右，我一人带了两个箱子一个包，站在空无一人的车站上，彷徨。后来我发现车站上有“黄页”（这个黄不是那个黄），是当 地的电话薄，就在上面找老板留给我的那个人名字，没想到就让我给找到了。按电话号打过去，居然真就是他。对方给了我一个他女儿的电话，说她知道麦肯纳的电 话。几经周折终于联系上了我们的营地，他们派了一辆车来接我。见到麦肯纳后给他说了我来的经过，他说凭你能找到我们，我就该你一个PhD。 我 们野外工作的地区在一个美国农民或者说是农场主的地盘上。此人叫查理.沃克，一个很憨厚的人。每天开着他的皮卡到处转。驾座边上总有两盒六瓶装的啤酒，一 边开车一边喝，美国法律在他的地盘上体现不出来。每次到我们营地前，跳下车就在车那边对着车轱辘撒尿，一边还跟我们打招呼，让我开了一回眼。我大概是查理 头一次见到的外国人，他就专门邀请我去他家玩。他有一个很大的房子，里面给我留下印象的是两样东西，一是他吃剩下的比萨饼，摊在茶几上。是微波炉烤出来的 那种，那个烂样子我觉得狗都不会吃。再就是一个巨大的玻璃罐，里面有上百公斤的一分钱分币，他说是从二战时就开始攒起来的。然后他让我开他刚买的一个大拖 拉机，参观他的车间。他的车间规模之大，工具之齐全让我膛目结舌。当时国内一个县城或者一个小城市里都很难见到这样的车间。他说除了发动机，他可以自己在 这里加工拖拉机上的任何部件。但他很孤独，他的两个儿子早就离他而去，十几年都没有回家来过。所以他很想跟我说话，而我是半懂不懂假装懂，就让他对牛弹琴 好了。这是我第一次体会到美国人物质上的富裕和情感上的贫乏。 野外完了以后，我去了麦肯纳在丹佛附近山中的庄园。麦肯纳的母系是美国 有名的卡内基家族，他们家在丹佛附近有很多资产。庄园的土地是其中一部分。园中有三幢小楼，在绿水青山中，他自己一家，他父母和给他们看庄园的“下人”家 各一幢，相隔三、四公里。站在巨大的玻璃窗前，他指着视线中的山岭，森林，湖泊和河流对我说，这些都是我家的，你到这里来要了解的一件事就是我们和你们在 所有制上的差别。记得当时和他的小儿子布鲁士有一段对话。其中说到我要好好学习，work hard。他说应该是：work hard, work smart（可以翻译成苦干加巧干）。他的话让我觉得中国人比较实干能吃苦，而美国人比较会投机取巧偷奸耍滑。很多年后，我的这个看法有了很大的转变。 哥大学习 -- 哥大原是纽约的“国王学院”，1754年10月31日，经英国国王乔治二世颁发特许状后成立，以“推进文科教育，阻止已经在这个殖民地流行的共和原则的增 长”。尽管如此，自由主义传统最终成为哥大的真正标志。此外，哥大是最早接受中国留学生的美国大学之一。早年的中国校友有顾维钧、郭秉文、陶行知、胡适、 徐志摩、陈公博，闻一多，蒋梦麟、马寅初、冯友兰、唐敖庆、吴文藻、宋子文、何炳棣、金岳霖等。仅从地质科学的角度来说，著名地质和古生物学家，德裔美国 人葛利普（Amadeus William Grabau,1870-1946）来华前任哥伦比亚大学地质系主任。他到北大后的善教影响到中国早期地学界的许多人，比如孙云铸、杨钟健、乐森璕，李四 光、黄汲清，丁道衡等。葛利普1946年逝世于北京，安息在北京大学校园里，进北大西校门往南的荷花池边。这些历史的千丝万缕让我对哥大很有好感。而这些 微妙的地方往往会不经意、但深刻地影响到人的心理，自信，以及对自我标准的要求。 我的专业是哥大和美国自然历史博物馆共同支持的。我 在哥大上课，在博物馆做研究，办公室在馆里，但住在学校附近。第一次选课时，我去征求麦肯纳的意见，他说你选什么课问题都不大，但有一门课你必须要选：微 积分。我很纳闷，我的专业是古生物，需要学的主要是生物和地质两方面的课，基本都是描述性的东西，工作中也从来不会用到微积分。我就问他为什么。他说：我 希望你能理解地球是一个削圆了的立方体。因为我在北大学过微积分，按学校的要求我不用再选这门课。但麦肯纳的回答让我悟出一些道理。他又对我说：你到这儿 来不是因为我能教你什么，你也不要指望我教你什么。我过去有很多的学生，也不是因为我教了他们什么；是你所在的这个环境，它在教你。这一点我当时不是很明 白，但后来明白了。 最后他说，有时间你到七楼库房去自己找一个博士论文课题吧。我们这个楼里有八层都是标本库房，收藏了好几十万件标本，七楼有最多的门类。我那时对专业基本 上是两眼一摸黑，什么都不知道，在接下来的一两年中，把几百个抽屉搜了一遍，最后找了一个论文题目的材料。现在看来，这个论文很普通，如果导师用心指点， 也许会找到更好的论文，而且会省很多时间。但这个过程确实也有助于我自己的独立研究能力。我不能确定哪种方式更好。一个训练好的学生不怕换研究轨道，他可 以同样做得好。但现在的很多情况是PhD研究论文本身就可能决定一个学生的命运，让人没有太多选择、调整和显示自己能力的机会和时间。对我自己来说，如果 当初麦肯纳为我指定一个题目，有可能会是一篇更好的论文，但我现在也许就是另外一个人了。 刚开始上课是不可能都听懂的，能有一半就不 错。下课后借美国学生的笔记来看，花很多的时间自己来补。这种状态在一年以后开始好转。我们这个学科要求45个基本的学分，大约平均下来是15门课。有些 我想学的课哥大没有，我就到纽约州立或市立大学去上。这些学校之间有一定的可以互选的课程。每个PhD候选人要做至少两个学期的助教。这一是对学生的训 练，二是以工换奖学金（否则学校得花钱去雇助教）。同时要把PhD论文的研究方案（proposal）做出来，在学分达到基本要求后，进行博士资格答辩。 答辩时学生介绍自己准备要做的论文。委员会五个成员，其中至少一位是本专业外的教授，每人至少30分钟提问，问题有关论文相关的内容，但更多的是关于背景 知识，问题五花八门。我记得我当时有这样一些状况。一个教授拿了几页纸，上面有几百个普通地质学方面的简单问题（他用同样的单子对付别的学生，教授偷懒的 一种），他在上面随便找问题问，要求我的回答就一个字，不用多说。比如“海底地壳是平的吗？”我答No.“地球背面和纽约相同纬度的城市有？”答 Beijing。等等。有位教授拿一张地形图，让我在上面找到我们工作的点，并说明它的坐标等参数。然后又是一张地质图，要我根据图选择一条剖面线，能够 最好地控制图中的地层。最后又拿出一块沉积岩石，让我根据它说明上下关系，沉积环境和类型，以及相关环境中可能出现的生物类群。麦肯纳问了我一些关于论文 的问题，然后背着我从口袋里拿出一个蹄兔的头骨标本，两手捂着标本的大部分，让我从看到的头骨部位鉴定是什么哺乳动物。然后，把标本放到桌上让我谈蹄兔系 统发育有什么样的问题，当前有些什么新的研究，谁做的，发表在什么地方，有什么看法，等等。 有回答不上的问题很自然。教授们并不是想让你难堪来开心，他们是测试你的知识范围和深度，看你是不是具有了去做博士论文研究的基本能力和知识。通过答辩 后，委员会给我一个评估，告诉我那些方面需要加强，以后可以去选有关的课程或自己读一些相关的书或者文章，当时就给了几篇参考文献。获得博士生资格后，基 本就进入博士论文阶段，时间会比较有弹性一点。 我的奖学金只有九个月，夏天没有钱。有一段时间（大概半年）我到曼哈顿下城打过一段时 间的工。每个周六做一天，帮人卖东西，看铺子。一天下来35元美金。一是为了挣点饭钱，二是体会一下打工生活。我到美国来最遗憾的一件事就是没有机会到餐 馆里去打过工。那是一个特别的环境和文化，很多中国学生都有的经历我错过了。 我在哥大也选了很多杂课。我喜欢美术，同时也和我的形态 学研究有关。从科学院研究生院回所后，我就参加过两个素描的夜校班，自己掏钱。在哥大时我又选了三门美术课，素描、油画和木刻，都是晚上的课，成绩还都不 错，记得木刻还是A加，印象最为深刻。西方美术中的一个核心内容是人体，所以开课后一上来就是画裸体模特儿。头一回看见漂亮MM摆个姿势在那里有点让人透 不过气来。而另外一个模特儿是个干瘦的老翁，一身青筋骨头满身的褶，几乎有点吓人。老师一堂课上就在不停的念叨“beautiful， beautiful 。”我才体会到美术家对美的看法不光是“好看”，这在一定程度上影响到我对科研的看法。那门课的老师英文次得不行，是位前苏联的雕塑家，可能还是成名人 物，自称摸过斯大林的头骨。我们的一堂课是在他Soho的家里上的，那是我最初对Soho区的认识。我的素描是半专业水平，课堂上大量的线条图，班上的同 学说应当拿到街上去摆个摊卖。其实他们不知道在纽约地区学美术的中国学生有多少。 博物馆的日子 —— 学分挣够后，我大部分时间就在博物馆里度过。博物馆的研究人员有一个自己喝咖啡的地方，圆形的屋子，有一个从来不用的壁炉，正面窗户对着中央公园。这是博 物馆中我最怀念的一个地方。博物馆研究人员每个月第一个星期一下午的例会就在这里举行。每天中午这里有免费的咖啡，研究人员，访问者，学生都可以来这里喝 咖啡，聊天。所以，这个地方可以说是研究人员的活动中心。这里也曾经是《支序系统学》（cladism)的真正发源地。当初在形成这个学说的时候，这里总 是硝烟弥漫，充满火药味。大家对很多的理论，概念，方法，哲学争论得十分的激烈，黑板上画得一塌糊涂，拍桌子打板凳互相较劲也时有出现。我去做学生的时 候，已经到了打扫战场的阶段，高潮已经过去。当然，我也受到这个争论的影响，学到了一些东西。尽管仍然有缺陷，支序系统学现在已经是生物学中的一个主流的 方法之一。这个学说和方法本身以及它的形成过程在科学上表现出来的进步主要在两个方面：1)从50-60年代以遗传学，生物种群和生物进化内容形成的、以 物种内研究为主的生物系统学，演变到种上系统的研究。2）把科学哲学（主要是Popper的假说证伪）系统地引人生物学研究中。 现在看来这当中是有缺陷的，生物学毕竟不同于物理学。但这些缺陷不仅是生物学的问题，哲学的贫乏也是一方面。但这个过程中最重要的精髓是打破了过去权威说 了就是真理的传统，而更讲究科学的证据，无论你是名教授还是名不见经传的学生。我自己对这些理论问题曾经很感兴趣，常常觉得一个念头冒出来后自己得到了真 理，晚上睡不着觉想写东西，但把那些想法写在纸上要成为有严密逻辑关系的文字时，却又怎么都说不清。最后做了一个选择，放弃理论的东西，专注具体实际的研 究课题。理论的研究太难了，而且也会因为不容易出文章影响到以后找工作，不太适合我这样英语非母语，起步比较晚的人。对我来说是自己学术当中一个决定性的 选择。 我的第一篇英文研究论文是在我做博士论文期间完成的，它和我的论文没有关系，完全是在一个偶然的机会中发现的一个题目，觉得有 意思，就做了出来。当我把写完的文章交给老板看过后，他在英文上修改了一些地方，然后写上“excellent paper” 两个字。我的一个师兄感到好奇，说麦肯纳从来不说人好，就把我的稿子拿去看。我本来是把麦肯纳的名字放到文稿上的，但他说他没有做任何事情，说: “That’s your baby.”所以我的第一篇英文论文是我单独发表的。 我在博物馆时曾经组织过一个非正式的研讨会，每个礼 拜五中午进行。大家带了午饭，一边吃一边听一边聊。一个人主讲，是学生也可能是研究人员或者是世界上任何地方来的访问者。题目杂且随意，不一定是成熟的研 究。当时来参加的人不少，比如史蒂文.J.古多尔（Stephen J. Gould)有时会来听我们的讨论。他看上去个子不高，是个很和善的人。 1972年他和N.Eldredge两人提出“间断平衡”（punctuated equilibrium）的学说而成名。 他们两人都是从从哥大拿的PhD,专业也是古生物。当年在做研究生时，史蒂文也做过一些早期哺乳动物的研究，后来没有怎么做研究，但写了大量的科普文章和 书籍，成为进化生物学最近这二、三十年的代言人，2002年去世。N.Eldredge身体很好，还在我们系里上班做事，也写了不少的科普文章。跟他们在 一起的感觉是平淡，普通的人，普通的日子。 等到博士答辩时，和博士资格答辩的感觉就完全不同了。两者的差别在什么地方呢？简单地说， 博士资格答辩时，台上的是学生，要回答下面坐的教授的问题，基本情况是考试。博士论文答辩的时候，坐在下面的教授是学生，答辩过程是答辩者显示自己的舞 台，基本情况是答疑。一篇博士论文要达到的基本目标是通过做论文研究把一个学生训练成可以独立做研究的人，而且是在这个课题内容上的权威，他在自己这个具 体研究课题上要达到研究的最前沿。当然，这个研究课题可能只是一个很窄小的研究领域，甚至只是其中的一个方面。但答辩者在这个时候应当要比教授们对论文里 的研究内容知道得更系统、全面、深入，并且有新的、超越前人的、教授们不懂的内容。如果没有做到这一点，那么，一个博士学位就欠了点火候。 博 士以后 —— 拿到博士学位后，一直在做博士后。差不多有五年的时间中都处在找不到工作要改行的巨大压力中。但我一直也都在努力的工作。到了96年的春天，忽然发现有两 个工作在等着自己，我才体会到过去的坚持和努力没有白费。我的第一个工作是麻州大学生物系助理教授。我不担心自己的研究，但对教课没有把握。我教的第一门 课是哺乳动物学，我没有学过这门课，加上英语不是母语，很担心教不好，所以很用心地去备课。我上第一堂课时，有上百个学生，各个专业的都有。很多人是来看 看这门课是否适合他们，并非一定会选这门课。我对学生说，无论你们选不选这门课，我有下面几句话要对你们说：1）人的知识结构应当是“T”字形，有一门深 入的专业，但也要有其它广博的知识。2）“Get things done”。无论做什么大事小事，一定要把事做成；事情做不成，什么好的想法都只是空谈。3）“Don’t give up”。不要轻言放弃，什么事情都要尽自己的最大努力，即使不成也不会后悔。第一个学期下来，我被学生们选为当年的最佳教师奖获奖人。但我的系主任找我谈 话说，系里从来没有给第一次开课的人最佳教师奖的，他把奖给了名单上第二顺位的人，是一位我尊敬的女老师。我在做学生时她就是教授了。我并不在乎那个奖， 但我很高兴自己在教学上的能力得到认可。我也体会到，课堂上老师的主要功能是介绍，解释基本的概念，方法和课程内容中存在的未解或最新出现的前沿课题，启 发学生如何寻找问题，让他们对一门学科产生兴趣。太多的零碎是浪费时间，而且容易让学生失去兴趣。具体的、细节上的内容，学生在需要的时候，会很容易自己 找到。概念和方法等等，学生也不是不能自己去理解或自学，但那要花比较多的时间。所以，教课的一个实际效果，是让一群学生在最短的时间对授课的内容有一定 程度的理解。这是社会教育比较有效率的体系，但不是唯一的教育方法。至少对我来说，我觉得我在课堂上学到的东西有限，多半都是自学而来。但周围的环境很重 要，常常在不经意中学到或领悟一些比掌握一门技术要重要得多的思想。 对于做研究，我就不多说了。我从来都是把我的博士生、博士后看作 同事。我们共同讨论问题，争论问题，有时会很激烈，但我们彼此尊重，我也从他们那里学到东西，很多时候他们是老师，我是学生。但我可以在很多方面对他们有 所帮助，这应当是学界的一个基本规律：做学生的时候你需要别人的帮忙，做了教授后你应当帮助别人。从多年的学生生活和找工作的艰难困苦中走过来，我能深深 体会这句话的含义。 99年我拿到了现在的位置，也是我的第二个工作，应当说是努力加运气的结果。我的办公室就在麦肯纳办公室隔壁，我的感觉就好像历史在这里碰了头。这是一个压力很大的位置，因为占有较多的资源，圈内的人对你的期望值就比较高。当然，这些是我要去面对的问题。 结语 －－ 打了一通太极后，回到原来的问题：国内的研究生教育有哪些欠缺？成为一个合格 的研究者需要在哪些方面下功夫？ 对第一个问题，我的回答是：欠缺一个思想活跃，有自由空间，少一点权术，多一点学术的环境。 第 二个问题和第一个问题相关。回答是应当在“大道理”里面的方方面面花功夫。但这又受制于环境的缺陷，所以这几乎是一个没有解的两难。但如果能明白这个道 理，每个人总能根据具体的情况找到一个最好的自己。一代一代的努力，总会出现一个好的环境。而每个人的生活别人是没有办法教的，只能自己去过，去努力 ## Thursday, May 29, 2008 ### Q:How to use valgrind to detect the memory leak in sub-function? Today I use the valgrind to find the memory leak in my application. But it just gives me such information: ==4323== ==4323== 856,984 bytes in 2 blocks are indirectly lost in loss record 7 of 7 ==4323== at 0x4021259: malloc (in /usr/lib/valgrind/x86-linux/ vgpreload_memcheck.so) ==4323== by 0x403ADB9: icvDefaultAlloc(unsigned, void*) (cxalloc.cpp:49) ==4323== by 0x804A95F: main (liuIpm_biLinear.cpp:72) ==4323== Here liuIpm_biLinear.cpp is sub-function which was used in main(). I can't get the information about the wrong position in subfunction. Liu ### Allocate/Release Memory function in opencv Today I find I forget to release the Mat data.....This problem is result in running out of memory.. Allocation Release cvCreateImage/cvCloneImage cvReleaseImage cvCreateMat/cvCloneMat cvReleaseMat cvCreateData cvReleaseData Dynamic structures: cvCreateMemStorage cvMemStorageAlloc cvReleaseMemStorage cvClearMemStorage ### How to detect Memory leak 1, The simple way must be use mtrace() at the first line of the main() function, and add muntrace() at the end line of main() function. You should include <mcheck.h> in the source code. Then you can do it like: setenv MALLOC_TRACE /home/liu/tmp/trace.txt g++ -g -o yourPro yourPro.cpp ./yourPro.cpp mtrace youPro /home/liu/tmp/trace.txt Then you will see the report in trace.txt.. Memory not freed: ----------------- Address Size Caller 0x0804f0c0 0x35 at 0xb7c88327 0x0804f100 0x11 at 0xb7c88327 0x0804fd08 0x28 at 0xb7c88327 0x0804ff50 0x40 at 0xb7edcdba 0x08050000 0x40 at 0xb7edcdba 0x080500c0 0x94 at 0xb7edcdba 0xb6f9b008 0xc6268 at 0xb7edcdba 0xb7062008 0xc6268 at 0xb7edcdba 0xb71ad008 0x5d230 at 0xb7edcdba As you see, I get some ASCII codes. It's not readable...and not like some other guys said it will be output by character. Of course ,you can find its meaning by looking for the ascii table. The table comes from http://www.cplusplus.com/doc/ascii.html 2,using valgrind.. It's a tool for detecting the memory leak and other errors.. If you use the suse linux, you need not to download and install it.. Because it's a library in linux system. If you want to know more you can "man valgrind" or to see "http://www.valgrind.org/"..The simple way to use it is : valgrind --leak-check=yes ./YourApp Then you will get a lot of informations about memory using. In addition, there are many method to detect and trace the memory. You can see "http://users.actcom.co.il/~choo/lupg/tutorials/unix-memory/unix-memory.html#tools_leaks" ## Wednesday, May 28, 2008 ### How to do adaptive threshold? 1. Convolve the image i.e. the mean or median. imageCon=imfilter(imageOri) or medfilter() 2. Subtract the original from the convolved image. imageDif= imageOri-imageCon; 3. Threshold the difference image with C(constant). imageThr=imageDif-C; 4. Invert the thresholded image. imageEnd=imcomplement(imageThr); See More:"http://homepages.inf.ed.ac.uk/rbf/HIPR2/adpthrsh.htm" Matlab code:"http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=8647" ### Canny's Two Thresholds void cvCanny( const CvArr* image, CvArr* edges, double threshold1,double threshold2, int aperture_size=3 );In the up sentence, the threshold1 is lower threshold, the other one is higher threshold. Canny edge detection contain three steps: First: Gaussian filter...Smoothing the image and filter the noise..Second: find the edge strength by taking the gradient of the image.Third: Use the two threshold to determine which pixel is edge.If the edge gradient below the first threshold, it's set to zero(nonedge). If the magnitude of edge gradient is above the high threshold, it 's madean edge. And if the edge gradient between lower and higher threshold, then it's set to zero unless there is a path from this pixel to another pixel that havea edge gradient above higher threshold.see more "http://www.pages.drexel.edu/~weg22/can_tut.html" ### edge detection in OpenCv(sobel,laplace,canny) void cvLaplace( const CvArr* src, CvArr* dst, int aperture_size=3 );void cvCanny( const CvArr* image, CvArr* edges, double threshold1,double threshold2, int aperture_size=3 );void cvSobel( const CvArr* src, CvArr* dst, int xorder, int yorder, int aperture_size=3 ); The important point is that the src image in three above funtctions must be 1 channel (gray). So you need use cvCvtColor() to change the image from BGR to Gray. The depth of dst image in cvCanny and cvSobel can be 8u and 1 channel.But the output image of cvLaplace can't be 8u too.. It just can use 16s or 32f. I use 16s here, and it can work very well..I dont know why.... ### How to manage the image in memory? Both of cvLoadImage and cvCreateImage would allocate a new memory space for image.. After you use that two function, you need cvReleaseImage funtion to release that. Before you release them , a good habit is to use if(image) to detect if it's NULL.. Also..new and delete is allocating and release function in cpp.Please remember that new function will return a pointer..so you can't use it like this : int a =new int; for example: int* a=new int; delete a; for array: int *a=new int[100] delete[] a; ## Tuesday, May 27, 2008 ### How to install 1394 camera on linux system? Here is a method: http://www.linux1394.org/start_install.php But you need to check you kernel version... you can do that by: uname -r ### How to find magic number in pnm or pgm images...??? A simple way, you can use vi or cat to see the image 's head file... But I also try using the "identify", it gives me some image informations. Unfortunately, that's not what I want... ### copyright Before I post this subject, I dont know the copyright on the internet.... After search informations by google about copyright.. I know I can't copy a whole of webpage in that way.... So I will write this blog in my own words..... ### Static, Shared Dynamic and Loadable Linux Libraries There are two kinds of library in Linux: static library(.a) and dynamic library(.so) The difference between them is 1, static library will link with and become a part of application. But the dynamic library just be used when compile and tied to application. 2, Many setup can use a same dynamic library at a same time. But linux just load them once. 3, You can load,unload and link dynamically library with application by system function How to build the static library: ar -cvq libliutest.a cliutest1.o cliutest2.o List it: ar -t libcliutest.a Link it: • cc -o myprogram progLiu.c libcliutest.a • cc -o myprogram progLiu.c -L/path/to/library-directory -lcliutest How to build the dynamically library:  gcc -Wall -fPIC -c *.c gcc -shared -Wl,-soname,libcliutest.so.1 -o libcliutest.so.1.0 *.o mv libliuctest.so.1.0 /opt/lib ln -sf /opt/lib/libcliutest.so.1.0 /opt/lib/libcliutest.so ln -sf /opt/lib/libcliutest.so.1.0 /opt/lib/libcliutest.so.1 see more website:"http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html" ### How to set gvim format for programming? 1,syntax on; It will make your gvim window seems more colorful; 2,set cindent; It will make your programming in c style; 3,set shiftwidth=4; It will set the distance between two level sentences. ### Program Library HOWTO # Program Library HOWTO version 1.20, 11 April 2003 This HOWTO for programmers discusses how to create and use program libraries on Linux. This includes static libraries, shared libraries, and dynamically loaded libraries. Link: http://www.faqs.org/docs/Linux-HOWTO/Program-Library-HOWTO.html ## Monday, May 26, 2008 ### How to change environment variable>>??? As my shell version is tsch.. so here is a method to change environment variable under linux... There is a file named " .tcshrc" under your root file(/home/liu)... you can use vi to open and edit it.. so you should change the PATH and PKG_CONFIGX_PATH..... NIce.. Thanks to IRENE... My opencv can work again For debian, the shell version is bash so we need add command in "./bashrc" Note: maybe you want to change something in .bash_profile. but this file can not work under xwindow. so it should be better to change bashrc, as it can work when you log in the termainal or xwindow. ### How to set path in environment Because my shell is tcsh.. so here is a method to set the path..\ But the fault is that you just can use this path this time. If you relog in, then it can't work.. set path=($path \$pathWhichYouWantToAdd .)

If you dont want to set it everytime when you login, you can gvim .tcshrc under you root.
I will post it later..

### find files in linux

code

find -name whatYouWantToFind

see more:http://www.wallpaperama.com/forums/how-to-find-files-with-linux-shell-command-locating-file-by-name-look-search-t1207.html

### How to use CvSaveImage to save pgm images in raw format??

If we use the cvSaveImage to save images in .pgm file, we will see the size of the image is very big...That's because it's plain(P2) but not raw(P5) format...
If you want to save image in pgm which is raw format, then you should do following:
1, find the grfmt_pxm.cpp under the opencv software package. In 332 line you will see GrFmtPxMWriter::WriteImage()
3, set IsBinary from false to true.
4,rebuild the library...\

how to rebuild the library..
sorry
But you can reinstall opencv...(how to reinstall it??? if you dont know , please google)
then you will get the .pgm image file in raw format...

see more:"http://tech.groups.yahoo.com/group/OpenCV/message/39625"

### Memory cost of images

see more:"http://www.scantips.com/basics1d.html"

Large images consume large memory and make our computers struggle. Memory cost for an image is computed from the image size.

For a 6x4 inch image at 150 dpi, the image size is calculated as:

(6 inches × 150 dpi) × (4 inches × 150 dpi) = 900 × 600 pixels

900 × 600 pixels is 900 × 600 = 540,000 pixels.

The memory cost for this RGB color image is:

900 × 600 × 3 = 1.6 million bytes.

The last "× 3" is for 3 bytes of RGB color information per pixel for 24 bit color (3 RGB values per pixel, one 8-bit byte for each RGB value, which totals 24 bit color).

Different color modes have different size values, as shown below:

 Image Type Bytes per pixel 1 bit Line art 1/8 byte per pixel(1 bit per pixel, 8 bits per byte) 8 bit Grayscale 1 byte per pixel 16 bit Grayscale 2 bytes per pixel 24 bit RGB 3 bytes per pixelMost common for photos, for example JPG 32 bit CMYK 4 bytes per pixelFor Prepress 48 bit RGB 6 bytes per pixel

### Desktops: KDE vs Gnome

What Linux Desktop is the Best? Gnome, KDE or something completely different?

# 1. What is a desktop anyway?

The term desktop refers to the graphical environment where you do your work. The desktop usually consists of a workspace (called the root window) with pretty icons and quite possibly a menu that pops up when you click on it, usually a panel on the top or the bottom and/or top of the screen with a menu and a lot of other practical services you may never even notice.

The most important part of any desktop is the window manager, this is the application that handles window placements and movements. The window manager is what draws a border (or no border) around your windows and makes them maximize, minimize, moves and behave according to your preferences.

# 2. KDE vs Gnome, What is the better desktop environment?

KDE and Gnomeare complete desktop environments that consist of a large number of tightly integrated yet still separate pieces of software. Gnome uses a window manager called metacity, KDE uses kwin. Both these desktops can be used with any other window manager if you do not like the default choice.

Linux is like Lego. You can build your own desktop environment. Both KDE and Gnome are just big packages with software aimed to look and feel the same way, work well together and generally give you a nice experience. If you dislike a component, then replace it with something else. It's that simple.

Application that are "made for gnome" or "made for kde" can be used with any desktop. This only means that that the program use a set of library functions found in their underlying gnome-libs or kdelibs. You do not need to use the actual desktops to use the applications, software made for KDE and Gnome can be used with any window manager / desktop as long as you got the proper libraries installed. There is no reason to use only applications made for the desktop you prefer, the "best software" for one task is made for KDE, the best for another task is made for Gnome. Use the best from both worlds.

Both KDE and Gnome can be customized to behave exactly the way you want. What desktop you prefer is your own choice and preference. When in doubt, try to learn both. Or experiment with other desktops. Remember, *nix applications are not locked to the desktop they are made for, Gnome applications can be used in KDE and vice versa.

There is no "best desktop", but there is a desktop that's best for you. It's a matter of preference, and hardware.

# 3. The Future is Freedesktop

Freedesktop.org is a software project aimed at developing shared technology standards for the X Window System. They provide common protocols like System Tray Protocol Specification, standard that allows developers to write a program that will work in KDE, GNOME, Fluxbox and other desktops who follow the Freedesktop recommendations.

is a free software project to work on interoperability and shared technology for desktop environments for the X Window System. The most famous X desktops are GNOME and KDE but any developers working on Linux/UNIX GUI technology are welcome to participate.

# 4. Hardware requirements

 Desktop Required RAM Required CPU fluxbox/idesk 48 100 MHz XFCE4 128 200 MHz Gnome 1.x 256 500 MHz Gnome 2.x 384 800 MHz KDE 3.x 512 1 GHz

These values are general rules of thumb. KDE will start on computer systems who should have been moved to museums long ago, like a Pentium 100 with 64 MB RAM, but it will run horribly slow. Any computer box can be used for the right purpose if you select software according to it's capacity. A Pentium 100 will let your write email and surf the Internet if you choose the MUTT email client and the web browser Lynx.

For a hot new box with lots of RAM and a fast CPU I recommend KDE 3.x or Gnome 2.x. Gnome is bloated and KDE is even more bloated. This is great, but all those fancy features demand more CPU and ram.

XFCE4 is a very nice complete fast and lightweight Desktop Environment and is probably the best choice for old, but not ancient hardware. The ROX desktop is another good light choice.

For really old hardware you should use something simple to draw icons on your desktop (like idesk) and a fast window manger like fluxbox (based on blackbox), waimea or icewm

# 5. The Best Desktop

Again: Try them all. This is your choice. There are plenty of Live-CD Linux distributions that let you try both KDE and Gnome without installing anything at all. Knoppix is a nice alternative.

Some people claim KDE is the best choice for beginners.

Desktop Overview

Complete Linux Desktops:

• GNOME
• Complete Linux desktop.
• KDE
• Complete Linux desktop.
• XFCE
• Light Linux desktop.
• ROX
• "Light" Linux desktop. The ROX filemanager Filer is clean and nice. ROX Panel and the Filer are excellent and can be used with other desktops.

Popular Windows Window Managers:

• ION
• Untraditional window manager using frames and floating workspaces, this helps you use the available on your screen more efficiently.
• Fluxbox
• Excellent Window manager, tabbed windowing, layers and more.
• EvilWM
• Minimalistic no-fuzz window manager with all basic features, excellent if you like borderless windows.

Copyright (c) 2000-2004 Øyvind Sæther. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ["GNU Free Documentation License" http://www.gnu.org/licenses/fdl.html].

### C++ convert int to string

First: output

#include <sstream>

int i = 5;
std::string s;
std::stringstream out;
out << i;
s = out.str();

Second: C++ function  itoa(int, buffer,num)

 #include <stdio.h>#include <stdlib.h>int main (){  int i;  char buffer [33];   printf ("Enter a number: ");  scanf ("%d",&i);  itoa (i,buffer,10);  printf ("decimal: %s\n",buffer);   itoa (i,buffer,16);  printf ("hexadecimal: %s\n",buffer);  itoa (i,buffer,2);  printf ("binary: %s\n",buffer);  return 0; }

## Friday, May 23, 2008

### Interpolation---biLinear method

In mathematics, bilinear interpolation is an extension of linear interpolation for interpolating functions of two variables on a regular grid. The key idea is to perform linear interpolation first in one direction, and then in the other direction.

see more: This information come from:http://en.wikipedia.org/wiki/Bilinear_interpolation

## Thursday, May 22, 2008

### important point about double and int data when they are divided

Today when I am programming a small program, I make a small mistake about the double and int data;
The important point is :

int=int/int;

so I can't get a 0.75=4/3 use int data ;
but we could get that through:

double=double/int;
or
double=double/double;

## Tuesday, May 13, 2008

### What can I do???

As a Chinese, when I see this picture, I am crying.
They are so young, so beautiful, so unfortunately.....
Who can tell me why,,,,
Why the god takes these young life away the world... They almost have not eat good food , have not seen beautiful scene on this world, have not find their lover since they come to this world.....
The earthquake took their life, took the people 's lover, sons, sisters, brothers......
I transfer the money to Red-Cross, but it can't bring the younger life back.
I just can bless..bless the living people, wish them can get out that place earlier, wish them should give some flowers and candies to the unfortunate children .

### Famous words for researcher

Nothing will ever be attempted, if all possible objections must be first overcome.

- Samuel Johnson, 1759.

The perfect is the enemy of the good.

- Voltaire, 1772 (though presumably he wrote it in French).

### work

I find many useful website about Urban challenge by DARPA, which is hold every year.

to see

It's fine

### First blog

I want to write somethings about my work and research.
My interesting fields are computer vision, image processing, machine vision and learning , pattern recognition etc..
I also want to find more friends who care about these fields.