In Apatana studio you can perform block editing. First select some lines of text and then press Command+Option+A. This will enable block highlighting mode. Now use Shift+Arrow Keys to expand or shrink the current selection. When you type in some text, all the highlighted fields will change simultaneously.
This blog covers various topics from technical tweaks to latest in computational linguistics, Artificial Intelligence, Machine Learning and Wed Data Mining.
Thursday, July 28, 2011
Friday, July 8, 2011
Synchronizing system clock (Ubuntu)
There are nice GUIs to do this if you have installed some Window managing system such as Gnome or KDE. However, if you have a server installation and have not installed any of those Window managing system and/or want to do this via command line then do the following (requires sudo access).
sudo ntpdate ntp.ubuntu.com
Thursday, June 2, 2011
Killing Zombies
Well, the word zombie means it is already dead but not quite so... This entry is about really "killing" the zombie processes.
running "top" lists up the zombie processes (marked by "Z" in status column) and also the total number of zombie processes.
To list zombie processes do:
ps aux | awk '{ print $8 " " $2 }' | grep -w Z
kill -9 pid
might also work.
Reference
running "top" lists up the zombie processes (marked by "Z" in status column) and also the total number of zombie processes.
To list zombie processes do:
ps aux | awk '{ print $8 " " $2 }' | grep -w Z
kill -9 pid
might also work.
Reference
Thursday, April 7, 2011
TexShop MacTex US letter PDFs
By default when you install MacTex and use TexShop for writing and compiling latex you will get PDFs with page size A4. This is all fine for most cases but some conferences require you to submit in US letter format and do not accept A4. This is where the problem begins and all sorts of solutions are proposed on the Web and most require you changing your entire latex configuration to produce US letter size (at least temporary until you revert those changes back to A4). Naturally, I tried those solutions (giving up the hope of finding a solution that can do this paper size change per document basis as it should be and not for the entire latex system) but failed. So I adopted the following command line approach and it works like a charm even without having to modify a single configuration file.
So I thought I would share this solution with the rest of the world.
So I thought I would share this solution with the rest of the world.
- First things first. Write your document using TexShop (producing A4 size PDFs as it is done by default) and concentrate on the content of the document. At the end of the day that is what matters most. :-)
- Now open a Terminal and type the following command to produce a dvi file.
/usr/texbin/latex mypaper.tex
Of course, the path to latex (/usr/texbin/latex) depends on your MacTex installation and this is the default installation path. This will produce the 'mypaper.dvi' file. - Now we can convert this dvi to a PDF with suitable page size (US letter in this case) using the following command.
/usr/texbin/dvipdfm -p letter mypaper.dvi
This command will produce the 'mypaper.pdf' with the US letter paper size. By the way the dimensions for those two sizes are as follows.
US letter: 215.9mm x 279.4mm
A4: 210mm x 297mm source is Wikipedia. - This does the trick! Of course you can also produce a postscript (ps) file if you want to. (Some publishers ask for this one as well.)
/usr/texbin/dvips -t letter mypaper.dvi -o mypaper.pdf
Another option to generate a pdf is from this ps file. You can use Acrobat distiller for this purpose. But then why would need to do that when you can do that directly using dvipdfm from the dvi file.
Well, at the end of the day there is no alternative to the power of the command line.... :-)
Additional Note
If you are using pdflatex and do not want to go through the above tex->dvi->pdf routine OR you are compiling with sig-alternate class in the ACM template, creating US letter size PDFs might be difficult.
A good reference is here.
The solution proposed in that reference is to put the following page size modifying lines in the preamble of the document (where you would put \usepackage commands and is prior to \begin{document} is called the preamble in a tex document.).
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
This indeed works!
Additional Note
If you are using pdflatex and do not want to go through the above tex->dvi->pdf routine OR you are compiling with sig-alternate class in the ACM template, creating US letter size PDFs might be difficult.
A good reference is here.
The solution proposed in that reference is to put the following page size modifying lines in the preamble of the document (where you would put \usepackage commands and is prior to \begin{document} is called the preamble in a tex document.).
\setlength{\pdfpagewidth}{8.5in}
\setlength{\pdfpageheight}{11in}
This indeed works!
Tuesday, February 22, 2011
Numpy Exceptions
To print all warnings in numpy do the following
import numpy as np
np.seterr(all='print')
This will print all warnings to stderr.
You can also make warnings to exceptions.
An example is shown below. The documentation is here.
import numpy as np
np.seterr(all='print')
This will print all warnings to stderr.
You can also make warnings to exceptions.
An example is shown below. The documentation is here.
import numpy numpy.seterr(all='raise') s = 10000.0 try: x = numpy.exp(s) print x except: print "That is too big!"
Sunday, January 30, 2011
How to change Figure and Table captions in LaTex
Usually figures and tables in LaTex get captions such as Figure 1 or Table 1. We can change these to other names as follows.
\renewcommand{\figurename}{Fig.}
OR to Japanese captions such as (with jarticle class)
¥renewcommand{¥figurename}{図}
¥renewcommand{¥tablename}{表}
\renewcommand{\figurename}{Fig.}
OR to Japanese captions such as (with jarticle class)
¥renewcommand{¥figurename}{図}
¥renewcommand{¥tablename}{表}
Friday, December 10, 2010
2010 MacBook Air fan speed issue
After copying my data from the 15inch MBP to my new MBA, I found that the fan runs at full speed irrespective of what processes are running. So I decided to reset the System Management Controller (SMC) and this actually helped.
What you must do is switch off MBA while it is still plugged in to the power adapter and press
ctrl+option+shift and the power button (top left corner) just once. The light on the power adapter will
turn into green and after couple of seconds back to orange. Now switch the machine on.
Further info is here
What you must do is switch off MBA while it is still plugged in to the power adapter and press
ctrl+option+shift and the power button (top left corner) just once. The light on the power adapter will
turn into green and after couple of seconds back to orange. Now switch the machine on.
Further info is here
Subscribe to:
Posts (Atom)
Continuously monitor GPU usage
For nvidia GPUs do the follwing: nvidia-smi -l 1
-
If you used Adobe acrobat to annotate a PDF file and you had Acrobat crashed or had to restart the computer abruptly during the annotation p...
-
The following set of commands will plot two data series in a file using point markers and also write the output to a eps file and further co...
-
EXPLORING WEB SCALE LANGUAGE MODELS FOR SEARCH QUERY PROCESSING Jian Huang, Jiangbo Miao, Xiaolong Li, Jianfeng Gao and Kuansan Wang CROSS...