Saturday, January 30, 2010

Google IME for Indian Languages ...

Using indian languages on a computer had never been so easy. I mean you can type directly in hindi in any windows application - notepad or word or web browser. Thanks to the google transliteration IME. You really don't need to remember the hindi key sequence (which is the case when you use window's native IME support. You can just type in the roman characters and it converts them into your native language (the same thing that happens in Gmail or in other google application. There is a free software called "Baraha" which does the same thing. I have been using this software for quite some time and I found it useful. However, its integration with other windows application is not that good.

After saying all this, I suggest you to download google transliteration IME tool from this link and see for yourself.


Also go through the installation instruction ....

Here is a screenshot of how it looks on my computer. I advise you to enable the short-cut key for enabling and disabling google IME. The google IME icon is sitting at the bottom right corner of the screen.

In fact, I can write directly in Hindi here ... for instance ... क्या आप हिंदी देख सकते हैं ? यह बहुत अच्छा है.

Thursday, January 21, 2010

Convert PS and EPS files into JPEG

I got this useful information from this link.

You can convert any ps or eps file into a jpeg using ghostscript:

gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -dBATCH -dSAFER -r300 -sOutputFile=myfile.jpg myfile.eps


This method has one flaw. It produces huge files. Depending on the eps file you may get something like 2000×3000 pixels which is slightly on the insane side. Also the file size of the JPG will be about 10 times that of the eps.
We will now need to trim and resize the file using some Image Magic tools:


mogrify -trim -resize 800x600 myfile.jpg


In order to execute this command on multiple files,  use following bash script

for k in $(ls *.eps); do b=`basename ${k%.eps}`; gs -sDEVICE=jpeg -dJPEGQ=100 -dNOPAUSE -dBATCH -dSAFER -r300 -sOutputFile=$b.jpg $k; mogrify -trim -resize 800x600 $b.jpg; done
 

Saturday, January 9, 2010

Linux on windows: Cygwin

If you use applications that work on only windows (like gtalk, voipcall clients), then you feel like having linux environment on the side, so that you won't have reboot into linux for doing your work. For these people (including me), Cygwin is a good choice. For instance you can have the bash shell, emacs, gnuplot, xfig, gvim, latex, xdvi all at one place ...  The installations is very easy.  Don't forget to install X server of cygwin (cygwin/x) during the installation process. Particularly, latex is more neat to use on cygwin than installing miktex and other tools for the same purpose.

Sunday, August 23, 2009

deprecated conversion warning for char* in GCC

g++-4.x gives following warning whenever a string with in double quotes is assigned to a char * :

warning: deprecated conversion from string constant to ‘char*’

Though there is no fix available as far as I know except for following two solutions:
1. convert 'char *' to 'const char*' whenever a string is to be assigned.
2. use a type cast to convert a string to a char*.

For example:

const char *name = "Adam Smith"
char *name = (char*) "Adam Smith"


To get rid of deprecated conversion warning, pass -Wno-write-strings option to g++

opencv on Ubuntu Jaunty

Opencv does not handle videos properly on Ubuntu Jaunty. In order to fix this, please follow the instructions given at this link:

http://gijs.pythonic.nl/blog/2009/may/3/getting-video-io-working-opencv-and-ubuntu-jaunty-/

Monday, August 10, 2009

Vim-latex suite on Ubuntu Jaunty

First install vim-latex package using synaptic packet manager. Then run following command on a terminal :

$ sudo vim-addons -w install latex-suite

Now opening a tex document with gvim should show tex related menus on the menu bar.

If this does not help, then refer to ubuntu forums for solution. For instance check this link.

Friday, July 10, 2009

Automating chmod

Task is to change the permission modes for multiple directories

$ find . -type d -print0 | xargs -0 chmod 771