Saturday, June 20, 2009

Chinese font configuration in ubuntu 9.04

I prefer YaHei font, due to its good mix of Chinese and English
1. Download from http://rs54l33.rapidshare.com/files/34563809/5101584/YaHei.Consolas.1.11b.zip
2. Copy the ttf file to ~/.fonts
3. fc-cache -fv (to refresh the font list)
4. Right click on desktop -> Change Desktop Background -> Fonts. Change all to YaHei ....

Done.

Thursday, June 18, 2009

watch video in ubuntu 9.04

1. Remove totem media player.

Remove totem media player from synaptic.
sudo rm /usr/share/applications/totem.desktop

2. Install mplayer, codec and plugin for firefox

sudo apt-get install mplayer mplayer-fonts mozilla-mplayer
download all-20071007.tar.bz2 from http://www2.mplayerhq.hu/MPlayer/releases/codecs/
tar jxvf all-20071007.tar.bz2 /usr/lib/codecs/

3. Fix realplayer codec: drvc.so

sudo apt-get install libstdc++5

4. Add restricted video format

sudo apt-get install ubuntu-restricted-extras

5. Also better to do the following:

sudo wget http://www.medibuntu.org/sources.list.d/jaunty.list --output-document=/etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo apt-get install w32codecs


Enjoy now!

Saturday, May 23, 2009

config ubuntu

My laptop has little resources(Thinkpad T41) so I need to shut down all the desktop effect as follows:
1. Don't use compiz.
2. gconf-editor:
1)/apps/panel/toplevels, for all the panel, clear "enable_animations"
2)/apps/metacity/general, mark "reduced_resources"
3)/apps/panel/global, clear "enable_animations"
4)/desktop/genome/interface, mark "accessibility"
3. sudo vim ~/gtkrc-2.0, add: gtk-menu-popup-delay = 0
4. (important)
sudo vim /etc/hosts:
change: 127.0.0.1 localhost
127.0.1.1 your-laptop
to: 127.0.0.1 localhost your-laptop
127.0.1.1 your-laptop
5. sudo vim /etc/default/console-setup
ACTIVE_CONSOLES="/dev/tty[1-6]" -> ACTIVE_CONSOLES="/dev/tty[1-2]"
cd /etc/event.d/
for each tty3-tty6, comment lines start with "start on runlevel".

Sunday, May 3, 2009

Saturday, May 2, 2009

eps file issues in latex

EPS file is the most commonly used figure type in latex.

Two issues involved:
1. Decide bounding box and output a neat graph.
Use the shell program here to get it done: http://www.gnuplot.info/scripts/files/fixbb

2.Solve the eps-pdflatex conflict.
If you want to directly generate pdf file from tex file. Add following lines:
\usepackage{epstopdf}
before your:
\begin{document}

Also, simply use command: pdflatex -shell-escape yourfile.tex to compile your tex file. Final pdf will be built.
The reason is it will automatically generate yourgraph.pdf and use it in your tex file.

Friday, May 1, 2009

Vim+latexsuite in ubuntu 9.04

After struggling a whole day, I finally got vim+latexsuite work in ubuntu 9.04.

Here is the points(at least work for me):
1. DON'T download the latex-suite file from http://vim-latex.sourceforge.net/ and unzip into ~/.vim/. It just simply doesn't work because vim-addons cannot find it, even if ~/.vim/ is in the runtimepath of vim. I don't know why.
2. USE sudo apt-get install vim-latex to let ubuntu install it for you. Also do sudo apt-get install vim-addons-manager if you haven't.
3. sudo vim-addons -w install latex-suite
4. vim-addons
5. You should see
#name User Status System Status
latex-suite installed(or removed, doesn't matter) installed
6. put your own tex.vim file in /usr/share/vim/addons/ftplugin/
7. In .vimrc, add:

set runtimepath+=/usr/share/vim/addons
filetype plugin on
set grepprg=grep\ -nH\ $*
filetype indent on
let g:tex_flavor="latex"


8. sudo vim yourfile.tex
9. you will see an error involved with remoteOpen.vim. But latex-suite works.

Right, it's wierd that I need to use sudo to launch vim. If I only type vim yourfile.tex, the remoteOpen.vim error will also occur and latex-suite will not be called.

Update:


1. I eliminate those error by commenting out the specific lines in remoteOpen.vim
2. The reason that I can only use sudo to launch latexsuite is because the privilege of .vimrc is superuser. I "chown" it to my own user and get it done.

Saturday, March 7, 2009

Universe will expand or collapse?

I have a question about the modern physics.
According to some theory, the universe will first expand then collapse if its mass is less than some constant C. We also know that the value of an object's mass is different if we observe it in different inertial reference systems. Suppose there is a small universe and two observers in different inertial reference systems. One finds that its mass is larger than the constant C and he will observe an expanding then collapse. The other finds that its mass is smaller than C so he observes an forever expanding. Is it possible?