Skip to main content

Posts

Showing posts from 2008

ls in ubuntu emacs

Emacs shell mode can be executed using (M-x shell). When doing a listing using 'ls', the control characters mixed in with the listing. The solution is to unalias ls bash> alias ls alias ls='ls --color=auto' bash> unalias ls bash> ls

skype on 64 bit ubuntu 8.10

I was not able to use skype on ubuntu 8.10 due to audio issue, e.g. ALSA lib ../../../src/pcm/pcm.c:2156:(snd_pcm_open_conf) Cannot open shared library /usr/lib32/alsa-lib/libasound_module_pcm_bluetooth.so The solution I use is bash >> sudo killall -9 pulseaudio

Installing SRILM 156 in Ubuntu 8.04

0. untar the source distribution in SRILM_DIR 1. set the environment variable bash> export SRILM=SRILM_DIR 2. check the gcc version and the location of tcl library e.g. bash> gcc --version bash> which gcc bash> whereis tcl 3. edit the common/Makefile.machine.i686-gcc4 bash> chmod u+rwx Makefile.machine.i686-gcc4 bash> emacs -nw Makefile.machine.i686-gcc4 # GCC_FLAGS = -mtune=pentium3 -Wreturn-type -Wimplicit # CC = /usr/local/lang/gcc-4.2.2/bin/gcc $(GCC_FLAGS) # CXX = /usr/local/lang/gcc-4.2.2/bin/g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES GCC_FLAGS = -mtune=pentium3 -Wreturn-type -Wimplicit CC = /usr/bin/gcc $(GCC_FLAGS) CXX = /usr/bin/g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES ... #ADDITIONAL_INCLUDES = ADDITIONAL_INCLUDES = -I/usr/include/tcl 4. Make bash> make 1> logFile 2> errFile 5. That is it

Semi-supervised Learning

Ways of Doing Semi-supervised algorithm Transductive SVM ( minimize the risk directly ) Co-training and Tri-training ( using two/three different view of the same datasets) Genetic Algorithm Non-parametric approach ( modified KDE convergence algorithm ) Parametric approach ( modified EM algorithm ) Graph-based approach

Display and Print Source Codes

One can use either "a2ps" or "trueprint" to print source codes. Today, I am going to experiment with "trueprint". A decent source code printing program should have the following requirements: Indentation is done correctly. Smart Spacing to avoid leaving out one-two lines of codes in previous page. Be able to convert to pdf or ps Be able to print two pages on one side The following are several examples of using the "trueprint" function: bash >> trueprint --portrait --language=cxx --intelligent-line-wrap --four-up --page-break-after-function --no-cover-sheet --output=EMMUtil_cpp.ps EMMUtil.cpp bash >> ps2pdf EMMUtil_cpp.ps EMMUtil_cpp.pdf bash >> rm EMMUtil_cpp.ps Please read the man page for further explanations. good day !!!

Boston Celtic is the NBA 2008 Champion

The sixth game between Celtics and Lakers was over a moment ago. I , as a KG's fan, was very excited to see KG get his first ring, and I truly hope this ring is the first of many to come. Many explanations can be found on why Celtics got their 17th banners. Personally, I think the Celtics and the Lakers have about the same offence and defence powers. I do believe that the main difference is because the Celtics have two game 7 in this playoffs (one with the Hawks and another one with the Cavaliers). On the other hands, the Lakers have never gone to game 7 this year, thus, they have less understanding of the anger/urgency/pressure of being pushed to the brink of failure. No one like that kind of feeling. But, I am convinced that kind of mindset is very important to get something worthwhile done. That is all, folks. Let's see next year if the Celtics and Lakers meet again.

Copy and Paste between Acrobat Reader and Emacs

Copy and paste between Acrobat Reader and Emacs under Linux can only be done once. If you copy and paste from Acrobat and Emacs the second time you will get the same result. Moreover, the “automatic-copy” from selecting does not happen when in Acrobat, and the “Ctrl+V” version of paste doesn’t work in Emacs. I have tried the following (failed) solutions: Use Glipper or Klipper to control the cut and paste history Use kghostview The solution I recommend Use xpdf

Executing Matlab from command line

Passing an argument from command line to Matlab script can be tricky because There are two solutions I can think of right now: Set the environment variables before starting Matlab Using BASH shell, one may set the environment variable using the command: a=1;b=2 Start Matlab using the command: matlab -nojvm -nosplash Inside matlab script one can get those variables using the command: a=getenv(a); b=getenv(b). Using the argument "-r" matlab -nojvm -nosplash -r "a=1;b=2; aScriptName;"

Celtics close out Cavaliers in Game 7

Boston won I am a Celtic fan, mainly due to Kevin Garnett. Many of the game recaps on Celtics and Cavaliers game 7 can be read online. Here, I am just going to point out two highlights of the game. First, the game was nearly turned on one play, as James stole the ball from Pierce and raced down the court for a dunk that cut the deficit to 89-88 with 2:20 to play. Next, James missed a 3-pointer, and P. J. Brown hit a 20-footer to give Boston a 3-point edge with 1:21 left. In the next cavaliers' possessions, it was 88-91, James could have taken another 3-point instead he passed to his fellow teammates, and the rest is history. If that one went in then the series will be different today. Second, Lebron James is indeed a winner but he has to remembered that Pierce waited nine years for Kevin Garnett and Ray Allen to arrive. Similarly, Kobe Bryant can play with Paul Gasol only this year. Anyway, Pistons and Celtic are in Eastern Conference Final 2008. This conference final is Pistons...

LaTeX command for writting a matrix

One can use either array environment or matrix environment provided by amsmath package for writting a matrix in LaTeX. The main difference is that the array environment can hold as many columns as you want, but matrix environment can hold at most 10 columns. Depending on what kind of delimiters you want, the amsmath package provides 5 matrix environments, i.e. for pmatrix (parentheses), bmatrix (square brackets), Bmatrix (curly braces), vmatrix (vertical brackets), and Vmatrix (double vertical braces).

Installing and using Emacs, AUCTeX, RefTeX, preview-latex

Typing Latex in Emacs is easier with the help of AUCTeX, RefTeX and preview-latex Installation of AUCTex, RefTex and preview-latex Using Most commonly used command: C-c ( ; it is used to label an object. C-c ) ; it is used to reference an object. C-c [ RET keyword; it is used to find the reference \cite C-c = to explore table of content C-c C-p C-d; it is used to turn on preview-latex C-c C-p C-c C-d; it is used to turn off preview-latex

Installing Ubuntu 8.04 (Hardy Heron)

I have done clean install on Ubuntu 8.04. The bug I have encountered so far are as follows: Rythmbox crashes when musics are played, the solution found is to disable all of the plug-in. Firefox-3 is not stable yet, so uninstall it and move ~/.mozilla into ~/_mozilla as a backup. Personalized bookmark is located in ~/.mozilla/firefox/*.default/bookmarks.html. Then install firefox-2. Good luck !!!