Archive for the ‘Informatics’ Category

How to easily sort out bad pictures

Mittwoch, Mai 23rd, 2007

If you take many pictures from events or sport matches you certainly know the problem of separating the good pictures from the trash. Most image manipulation programs like are too heavy to use them for sorting the pictures. However, there exists a very light-weighted tool for Linux (and Solaris and FreeBSD): qiv, Quick Image Viewer. Although the download has only about 100KB (provided that gtk+/gdk and Imlib are installed), it offers an incredible number of functions.

Under Ubuntu the installation of qiv is very easy sudo apt-get install qiv. After the installation, qiv can be started using the command qiv where path can be a file or a folder whose content should be displayed. In addition to this pure paths, operators like the * are also possible, for exampleqiv *.jpg opens all .jpg-files in the current folder.

When qiv is the current window and displays an image, many commands (use man qiv for an exhaustive list) can be used. Actually I use only a few of them. The most frequently used commands are:

  • space bar: display next picture
  • backspace: display previous picture
  • Page Up: go five pictures forward
  • Page Down: go five pictures backward
  • d: delete the currently displayed image
  • u: undelete the previously deleted image
  • q: close qiv

When you delete an image it is actually not deleted but moved to a folder .qiv-trash (in the folder of the pictures), so it can be recovered later. At the end of the sorting, it is quite wise to delete this folder using rm -rf .qiv-trash to save some space.

Using qiv I have managed to considerably speed up the tedious task of sorting the images before editing and publishing the good ones.

Zattoo for Linux

Freitag, Mai 18th, 2007

ZattooFinally Zattoo is available for Linux! Today I’ve got a newsletter from Zattoo telling me that Zattoo can now be downloaded for Linux. With Zattoo 43 TV-channels are available for free. You simply have to register (which means: indicate the email-address and choose a password), download and install the software (for Windows, Mac and Linux), start it, login and choose the channel. It is very easy to use and the quality is surprisingly high. There are more channels than we get with Cablecom and it is free. The software is available in English, Deutsch, Dansk et Français (la versione italiana e la versiun romontscha mauncan aunc…).

I immediately downloaded the .deb-package of Zattoo (rpm’s are also available) for Linux and installed it on my Ubuntu Edgy Eft. The installation was very easy, however it did not work on the first try: When executing the command sudo dpkg -i zattoo-2.2.8.5561-i386.deb the installation failed with the message Package libgtkglext1 is not installed. I therefore installed this missing package with sudo apt-get install libgtkglext1, then re-executed the command sudo dpkg -i zattoo-2.2.8.5561-i386.deb and after a few seconds everything was fine.
Using the terminal I could start Zattoo with the command zattoo_player & (it could also be started using the menu Multimedia and then Zattoo player, but personally I prefer the terminal), log in and choose the channel and enjoy the new TV. It works!

Tables in LaTeX

Donnerstag, Mai 17th, 2007

Have you ever created any tables in LaTeX? In my opinion tables are definitely one (the only one) of the weak points of this wonderful typesetting system. With LaTeX most common tasks (write a „normal“ report, standard formatting etc) are extremely easy, but creating tables with seems to be an occasion to tear one’s hair. Really? No!
Edit table in OOo-CalcIndeed there is a wonderful trick (thanks to Jutta for this hint) to easily add wonderful tables to your document: simply create it as a spreadsheet in the spreadsheet program of your favourite office suite (I recommend OpenOffice). Do not format the table, this is pure waste of time as all formatting will be lost later.
After you are done, save the table as Text CSV (.csv). Instead of saving the file with the standard CSV options, modify these options as follows: set the field delimiter to & and remove the text delimiter. This creates a .csv-file, in our example it is
expenses&2006&2007
replacement of dishes&300$&14$
fines for speeding&3500$&0$
fines for dodging paying the fare in trains&0$&600$
bail to be released after drug tracking&400$&1400$

Open this .csv-file in a text editor and copy its content to your favourite LaTeX editor (e.g. Kile). Now you simply have to modify this code to change it into a correct LaTeX table: add \\ at the end of each line of the table, add a \hline where you want a horizontal line, escape special characters (e.g. in our example the $ sign) with a backslash \ and add (i.e. copy it from another document) the surrounding code like \begin{tabular}:
\begin{table}
\begin{center}
\begin{tabular}{|l|r|r|}
\hline
expenses&2006&2007\\
\hline
replacement of dishes&300\$&14\$ \\
\hline
fines for speeding&3500\$&0\$ \\
\hline
fines for dodging paying the fare in trains&0\$&600\$ \\
\hline
bail to be released after drug tracking&400\$&1400\$ \\
\hline
\end{tabular}
\label{tab:expenses}
\caption{Personal Expenses in 2006 and 2007.}
\end{center}
\end{table}

Table Created with LaTeXEven though the above code still seems to be complicated (it isn’t as you will realise when taking a closer look at it), this trick really simplifies the task of creating a table in LaTeX. When using it, the creation of tables in LaTeX does not become the easiest part of LaTeX but it is no more tedious and the countless advantages of LaTeX over Word make editing a report fare more efficient with LaTeX despite the rather cumbersome creation of tables.

I will talk about the advantages of LaTeX in a later post, so just look back later (or better: subscribe to my RSS-Feed).

New Thunderbird in Action

Sonntag, April 22nd, 2007

ThunderbirdThunderbird 2.0, the new major release of the free opensource email-client has now been out for a couple of weeks. Yesterday I finally decided to upgrade to this new version. Already after a few hours I can say that the new release definitely has some advantages over the old one and that Thunderbird has now become even better.

Let’s first talk about installation of the new version of Thunderbird. Actually the installation under Linux was extremely easy: I simply replaced the Thunderbird-folder (i.e. the folder in my home directory where I have installed Thunderbird – the mail data is stored in another folder, namely ~/.thunderbird) with the untared files of the new version of Thunderbird. I then started Thunderbird which automatically updated all installed extensions (now called add-ons) and the installation was done!

In my opinion, Thunderbird 2.0 has some strong advantages over its predecessors, and obviously even more advantages over the rivals. Some advantages are:

  • New, better interface.
  • The search tool which was already great before has become even better. It is now really fast to find a message by searching after a keyword. Additionally, Thunderbird now dynamically updates the search results, i.e. the result list is permanently updated while typing the key word.
  • The notification has been considerably improved: In older versions of Thunderbird there was a small window popping up in the bottom right corner saying that there was a new message. However, this notification did not work under Linux, so I just heard the sound and then had to switch to Thunderbird to see whether the newly arrived message was worth reading. Now this notification also works under Linux and displays useful information: sender, subject and the beginning of the message. Thus I can decide about the appropriate treatment of the new message without having to switch to Thunderbird.
  • The Spam filter is not really an improvement over older versions of Thunderbird as it was already integrated. However, this adaptive filter is an important reason for me why I use Thunderbird. Every day it filters out between 100 and 200 Spam messages. False negatives (i.e. it does not filter a Spam message) are rare, false positives (i.e. a message is filtered although it should not) hardly ever happen.
  • Dictionaries can be installed as add-ons. When editing messages, these are automatically corrected. The language can be chosen in a small dropdown-menu, without having to go to a preferences menu. Especially for people like me who often write emails in different languages, this feature is extremely useful.

Mail View Toolbar Button For me, the new release of Thunderbird has only a single, small disadvantage over its predecessor: the mail view toolbar button has disappeared and has to to be activated manually (go View->Toolbars->Customise and drag it to your preferred place). However it can not be placed where it used to be in older versions. I have now placed it in the top menu bar, just on the right of the Help-menu entry. I will first have to get used to that.
The main problem here is that this button does not really work as I expect it: when changing the selection this does not have an immediate effect on the list of messages displayed. When I change it from „Unread“ to „All“, there are still only the messages displayed that are unread. The only effect it seems to have is that the search also finds messages that are read. I will try to find out how I can change this strange behaviour…

These are only some of the good points of Thunderbird, the release notes give you more reasons to immediately uninstall Outlook to replace it with Thunderbird.

How to easily print code

Donnerstag, April 19th, 2007

For the first-year project in computer science at the University of Fribourg (where I am working as an underassistant) I had to correct exercises handed in by the students. 5 groups handed in their solutions, for each group I had to print out 7 files containing programming code (written in the Lisp-dialect Scheme). Opening all them in DrScheme takes a lot of time – too much as I decided.
I therefore searched the web for an easy solution and found it in the unix (terminal) tool enscript. For me it is the perfect solution for printing code. It includes syntax highlighting for numberless programming languages, including Scheme. For example the command

enscript -2 --highlight=scheme -r -d diufpr06 switch.scm

prints the file switch.scm on the printer diufpr06 (option -d), printing two sides per page (option -2) in landscape-format (option -r). The –highlight-option allows to indicate the programming language for which the syntax should be highlighted. The list of available languages can be displayed by typing enscript --help-highlight, it might be usefull to add | less to the command, otherwise the list is not really readable.
With the option -G (not used here) quite fancy headers are printed. All options can be displayed using man enscript. The installation of enscript is very easy under Ubuntu: just type sudo apt-get install enscript and within a few seconds everything is done. Under MacOS enscript is even installed by default.