Install flash player for firefox in ubuntu 8.04

February 1, 2009

1. Open firefox. Go to and select any video. If you havn’t install flah, a message of “Hello, you either have JavaScript turned off or an ol version of Adobe’s Flash Player. Get the lastest Flash player.”. Click on the link and you will be redirected to adobe website to download it. Select .deb for Ubuntu x.xx.

2. Let the Package installer software install it. Restart firefox and it should be working.

If it’s still not working, follow the following steps.

3. Open Terminal and input
$> firefox &
to execute firefox.

4. Go to and click on any video. It will be just like step 1 but this time you can see the error message from the Terminal. For me, the error messages say
LoadPlugin: failed to initialize shared library /usr/lib/adobe-flashplugin/ [ cannot open shared object file: No such file or directory]
The problem is not in flash player but because of a dependency lib of flash player mssing .

5. Open Synaptic package manager (System >> Administration >> Synaptic package manager) and install the missing lib (libnss3). Restart firefox and the flash should work fine.


WebDAV client with encrypted SSL connection in ubuntu

January 27, 2009

WebDAV is a set of extensions to the HTTP protocol that allow users to edit and manage files on remote www servers. Here is the installation guide.

1. #> sudo apt-get install davfs2

2. create a folder
mkdir /media/webdav

3. Mount remote webdav server by
sudo mount -t davfs https://ip_address:port /media/webdav

The index of the largest element in a 2D array in matlab

November 12, 2008

disp(['The largest element in X is' num2str(v1) ' at (' num2str(ind(ind1)) ',' num2str(ind1) ')']);

Converting images to avi file in matlab

October 21, 2008
Here is the matlab code to convert a collection of images to a video file.

%// Will open an avi file name test.avi in local folder
aviobj = avifile('test.avi');
%// the quality of this video file
aviobj.Quality = 80;
%// compression method. See matlab manual for details.
aviobj.COMPRESSION ='None';%%color image

for i =1:numOfFrames
    %// apply image processing algorithms to the image here. 
    %// image must be in size width x height x 3
    %//  in other words, color image. 
    %// add image to the end of the avi file
    aviobj = addframe(aviobj,image);
%// close the file handle.
aviobj = close(aviobj);

Click here for detail instruction on addframe function.

Keywords: convert images jpb bmp to video avi compressed codec

Using rdesktop to remotely access window XP from ubuntu/linux

August 16, 2008

First, install rdesktop if you don’t already have it. rdesktop is a client software for RDP (remote desktop protocol) which is used in various microsoft OS’s.

$ sudo apt-get install rdesktop

Open a terminal and input

$ rdesktop -f -a 16 <ip/domain name>

where -f is for full screen mode and -a is the connection color depth. -a 16 means 16 bits color depth will be used for this connection. These are the two option I used. Other two useful options are -u <username> and -p <password>.

Press Ctrl-Alt-Enter to switch between full screen and window mode.

3D mesh correspondence selection tool

July 31, 2008

This is a program that allows users to manually assign corresponding triangles between two triangular meshes. Currently it only supports triangular-only meshs. To compile the code, run make PROG=hw3c.

User has to first click on a triangle from the model on the left window and select its corresponding triangle from the model on the right. The index of corresponding facets will be stored. Press ‘w’ to save the correspondences into file “cr.txt”. You will have to backup the old cr.txt yourself.

User can rotate each model individually by moving the mouse and hold the right mouse button and zoom in/out by using the mouse wheel. If the mouse wheel is not responding, use key ‘z’ and ‘x’ to zoom in and out. Press ‘Esc’ to exit the program.

Source code can be downloaded here.

Screeshot of the program

Screeshot of the program

Displaying a sequence of images like video in matlab

July 9, 2008

images is an array of dim imageHeight x imageWidth x frameNumber

for i = 1:size(images,3)
    title(['frame# ' num2str(i)]);
    drawnow; %// this is why it works