Ubuntu: Javadoc

The Javadoc tool is used to generate documentation from comments in Java source code. To generate documentation in Eclipse, choose ProjectGenerate Javadoc. You may be required to provide the path to the javadoc binary in the Javadoc command field. This is typically /usr/bin/javadoc.

On a typical installation of Eclipse in Ubuntu 9.10 (Karmic Koala), you may not find the javadoc binary. To get this binary, install the openjdk-6-jdk package.

Ubuntu: Launchy

I cannot use Windows without a launcher application, I am so used to it. On Windows XP, I use Launchy and on Windows 7, I use the new Start menu Search box.

On Ubuntu, I am now using Launchy to do the same. Launchy does not seem to be included in any Ubuntu repository. So, it needs to be installed manually.

I tried the stable 2.1.2 version of Launchy available here. But, it was a bit buggy and could not launch commands which had parameters (for example: firefox %u). To get around this, I use the 2.5 Beta version of Launchy from here. My preferred shortcut to launch Launchy is Ctrl+Space.

To install Launchy, download the .deb file from the above sources and install using the GDebi Package Installer (usually invoked by double-clicking or right-clicking the file).

Tried with: Launchy 2.1.2 and 2.5 Beta

Ubuntu: Removing Linux Kernel Boot Entries from GRUB

Ubuntu sometimes updates itself with a new Linux kernel version. Such kernel updates also create new entries in the GRUB bootloader screen which is displayed at bootup. I am not doing any kernel development and am confident enough that Ubuntu folks are updating me to safe stable versions. So, if I do not have any problems with the new kernel version, I find it irritating to see older Linux kernel entries cluttering up the GRUB screen.

Ubuntu now uses GRUB2, which is significantly different from the older GRUB. To remove Linux kernel entries from the GRUB bootloader screen, just un-install the related Linux kernel packages using the Synaptic Package Manager. And voila, the GRUB entries for that are auto-magically removed!

For example, to remove the GRUB boot entries of Linux kernel v2.6.31-20, I searched for 2.6.31-20 in Synaptic. I found the packages linux-headers-2.6.31-20, linux-headers-2.6.31-20-generic and linux-image-2.6.31-20-generic. I un-installed them, and their boot entries are gone! :-)

Tried with: Ubuntu 9.10 (Karmic Koala)

LaTeX: KOMA-Script

KOMA-Script is a LaTeX package that introduces modern updates to the classic document classes that LaTeX uses by default. Not only are the styles in the old document classes outdated, they are also set for the letter paper size. The letter paper size is used only in the USA, with the rest of the world having moved on to the ISO A4 size a long time ago. The KOMA-Script layout is noticeably larger, using more of the space in the A4 paper size. The size comparison of the default LaTeX document class with that of KOMA-Script can be seen in the figure above. KOMA-Script also uses a different set of fonts for these document classes, which in my opinion looks fresher.

Using KOMA-Script for your LaTeX documents is very easy. First, download and install the koma-script package. Next, replace the standard document classes (article, book, letter, report) with those provided by KOMA-Script (scrartcl, scrbook, scrlttr2, scrreprt). That is it! :-)

Wondering why the document class names have a prefix of scr? KOMA-Script is the successor of an older package which was named Script, which introduced the scr prefix.

If you are using TeX Live (in Ubuntu for example), KOMA-Script can be found in the texlive-latex-recommended package.

(Via Top 10 LaTeX Modules by Nico Schlömer)

LaTeX: Footnotes

A footnote is a note placed at the bottom of the page that references text in the page above it. Footnotes can be added to a LaTeX document using the TeX \footnote macro.

For example, the above footnotes can be obtained by:

Footnotes\footnote{A note at the page bottom.} are frowned upon in the \LaTeX community\footnote{No idea why!}.

I personally do not like this style. I find it distracting to put the footnote text in the middle of the referencing text. An alternative is to provide a footnote mark in the referencing text and place the footnote text later. This can be done using the LaTeX \footnotemark and \footnotetext commands.

For example, to obtain the footnotes as shown above:

Footnotes\footnotemark[1] are frowned upon in the \LaTeX community\footnotemark[2].

\footnotetext[1]{A note at the page bottom.}
\footnotetext[2]{No idea why!}

If you are using only a single footnote, then the footnote number argument can be skipped:
Footnotes\footnotemark are frowned upon in the \LaTeX community.

\footnotetext{A note at the page bottom.}

Reference: Section 4.5 Footnotes from the book Digital Typography Using LaTeX.

Mercurial: Repository with No Working Copy

Mercurial engenders an easy distributed working style. But, for important projects you might like to have a central repository that everyone pushes to and is backed up regularly. Since this central repository is backed up, it is irritating to have a working copy of files in it (which is the default behavior of Mercurial).

To have a central repository with no working copy, clone your existing central repository using the --noupdate (or -U) option:

$ hg clone -U FoobarCentralRep FoobarNewRep

Let everyone working on projects clone from this new repository and push their changes back to it:

$ hg clone FoobarNewRep MyFoobarExperiments

Eclipse: Add Java


I use the Eclipse IDE for C/C++, primarily for working with Python using the PyDev package. I recently had to try some Java code. Here is how to update Eclipse IDE for C/C++ to build Java:

  1. Make sure all the existing components of Eclipse are updated. To do this choose HelpCheck for Updates.
  2. To install Java, choose HelpInstall New Software. From the Work with dropdown, choose EPP Packages Repository. Expand the Uncategorized section below and choose EPP Java Package. Click Next and navigate through the install wizard to the finish.

CanoScan LiDE 30 Scanner

In a bid to digitize all the bills, documents, forms and papers lying around, I decided to buy a scanner. I wanted a simple, cheap flatbed scanner. But, the market seems to be full of expensive high resolution flatbed scanners or the printer-scanner-copier combo units that are too big and useless for me. So, taking the advise of a friend I bought a used CanoScan LiDE 30 flatbed scanner from the VR-Zone forums.

This scanner seems to be in good condition, though it looks a bit worn down. I downloaded and installed the drivers and the CanoScan Toolbox software. The scanner worked without any hitches with my Windows XP laptop. The scanner head moves a bit slow though. One advantage of this model that I noticed is that it draws power from its USB cable, so it does not even use an extra power cord. One less hassle! :-)

Picasaweb: Keyboard Shortcuts

Keyboard shortcuts are useful for browsing through the hundreds of photos friends share in their Picasaweb albums. Picasaweb seems to be sorely neglected by Google when it comes to keyboard shortcuts. One can only move to the previous or next photo. Shortcuts to zoom in/out and pan on a photo would have been useful.

  • Next photo: Right arrow key / j / n
  • Previous photo: Left arrow key / k / p

I find the easiest to use are the left/right arrow keys to flick through the photos.

LaTeX: Longtable

Tables are commonly created in LaTeX using the tabular environment. For example, a simple 2 column table:

\begin{tabular}{c c}
Tea & Coffee\\
Coke & Pepsi\\
\end{tabular}

These tables are treated as unbreakable by LaTeX. Thus, a long table will not be broken across a page break, but will be moved into the next page. If you want a table to flow across pages, by being broken across page breaks, the longtable package can be used to achieve that.

Load the longtable package:

\usepackage{longtable}

Replace tabular with longtable:

\begin{longtable}{c c}
Tea & Coffee\\
Coke & Pepsi\\
\end{longtable}