IPython adds Web Interface to Python Programs or HowTo Run AICCM (ab initio Cyclic Cluster Model) from a Webbrowser

This December, the long awaited version 0.12 of IPython [1], an interactive Python shell has been released. The major highlight of this release is the IPython Notebook, an interactive Python
interface running in the browser, that connects to a running IPython Kernel. In principle, this adds a web interface to every Python program. To understand how amazing this is, just imagine how much it costs to develop a professional web interface for an application, called Notebooks. The only thing you need is the Tornado Web Server [2].
I will quickly demonstrate how to install Tornado and IPython and then show how to run a Python program from the web interface by running a quantum chemical calculation  with AICCM.
AICCM (ab initio Cyclic Cluster Model) [3] is an open source, object oriented,
educational quantum chemical program written in Python with C extensions. It is developed by me and my colleagues in the group of Prof. Bredow at the Mulliken Center for Theoretical Chemistry at the University of Bonn. In the following HowTo it is assumed that AICCM is installed on your system. For download and installation instructions on AICCM please go to the AICCM website.
1. Installation of Tornado:
– Get the latest version (2.1.1) of Tornado from the Tornado website.
wget https://github.com/downloads/facebook/tornado/tornado-2.1.1.tar.gz
– Then unpack and install it.
tar -zxvf tornado-2.1.1.tar.gz
cd tornado-2.1.1
python setup.py clean config build install –home=$HOME

– If you haven’t already done so, you need to add lib/python to your PYTHONPATH.

export PYTHONPATH=”$HOME/lib/python:$PYTHONPATH”

To make this permanent, add this line to your .bashrc or .zshrc, depending on the shell you use.

2. Installation of IPython
– Get IPython 0.12
wget http://archive.ipython.org/release/0.12/ipython-0.12.tar.gz
– Install IPython

tar -zxvf ipython-0.12.tar.gz
cd  ipython-0.12
python setup.py clean config build install –home=$HOME

3. Start IPython with enabled web interface
ipython notebook
IPython starts a webbrowser displaying the dash board where all Notebooks are listed.

Click on new Notebook. A new window opens where you can enter your Python code.

4. Running a calculation
A minimal input for AICCM calculating the Hartree-Fock total energy of the Nitrogen molecule is:

import ase
import aiccm
molecule = ase.Atoms(‘2N’, [(0., 0., 0.), (0., 0., 1.1)])
calc_AICCM = aiccm.aseinterface.AICCM()
e_molecule = molecule.get_potential_energy()
print ‘Total Energy: %5.2f Hartree’ % e_molecule

Copy and paste this into the shell into the browser. The code is executed by pressing CTRL+ENTER.

If the session is saved it appears in your IPython dashboard after you hit the reload button!

This is awesome! A big thanks to the developers of IPython!

[1] http://ipython.org
[2] http://www.tornadoweb.org
[3] http://aiccm.de

Update to Ubuntu 11.10 breaks i386 applications (Crossover Office, Skype, etc)

The reason is that there are x86_64 packages for applications like Skype, Crossover Office, etc that are in reality for the i386 architecture. Ubuntu does not know how to resolve the dependencies.
One solution is to use the i386 packages and try to let Ubuntu resolve the dependencies.
The second solution, which is the one I tried is to enable multiarch. And this is how it is done:

echo foreign-architecture i386 | sudo tee /etc/dpkg/dpkg.cfg.d/multiarch

Then install the required libraries for the i386 architecture:

sudo apt-get install libxss1:i386 libqtcore4:i386 libqt4-dbus:i386

Logitech MX1000 bluetooth mouse fails after system update

My good old bluetooth mouse “Logitech MX1000 Laser” stopped working after the last system upgrade to Ubuntu 11.10. I had this already after the last system upgrade and this time I decided to blog about it so it might help others.
The problem is, that the dongle switches to bluetooth mode and somehow the system does not manage to successfully pair it.
This is why it might be best to disable bluetooth for this mouse. Mine is very old, so I wonder if this is better for newer models.
If one gets tired of disabling bluetooth in the applet everytime with the help of a second mouse 😉 just do the following:

1. As root edit the file:

sudo vim /lib/udev/rules.d/62-bluez-hid2hci.rules

2. Find the lines:
# Logitech devices
KERNEL==”hiddev*”, ATTRS{idVendor}==”046d”, ATTRS{idProduct}==”c70[345abce]|c71[34bc]”,
  RUN+=”hid2hci –method=logitech-hid –devpath=%p”

and change them into:
KERNEL==”hidraw*”, ATTRS{idVendor}==”046d”, ATTRS{idProduct}==”c70[345abce]|c71[34bc]”,
  RUN+=”hid2hci –method=logitech-hid –devpath=%p”

After a reboot everything should be fine!

Winner of the Nobel Prize in Physics 2011 Saul Paulmutter in Bonn

The American astrophycicist and winner of  the Nobel Prize in Physics 2011 Saul Paulmutter visited Bonn as part of the collaboration ‘Supernova Factory’ in that
Prof. Marek Kowalski of the Institute of Physics in Bonn is being a part of.
He gave a stunning lecture in the overcrowded Wolfgang Paul Lecture Hall.
It was his first public lecture after receiving this outstanding award together with
Brian P. Schmidt and Adam G. Riess “for the discovery of the accelerating expansion of the Universe through observations of distant supernovae”.

Strange behavior of the numpad in the Vi editor if using the RXVT virtual terminal

I recently changed my default terminal to rxvt. It spawns really fast, can be run in server-client mode and is higly configurable. I think it might be the best terminal currently around.
But I experienced strange behavior of the numpad while running the Vi editor.
And this is how it can be fixed. Please note that i map only the numbers and not the arrow keys, because I use the Neo keyboard layout, where great arrow keys are available on Level 4.

1. Create/open a file in your home directory called .Xmodmap:

vim .Xmodmap

and add the following lines:

keycode 63 = KP_Multiply
keycode 79 = KP_7
keycode 80 = KP_8
keycode 81 = KP_9
keycode 82 = KP_Subtract
keycode 83 = KP_4
keycode 84 = KP_5
keycode 85 = KP_6
keycode 86 = KP_Add
keycode 87 = KP_1
keycode 88 = KP_2
keycode 89 = KP_3
keycode 90 = KP_0
keycode 91 = KP_Decimal
keycode 112 = Prior
keycode 117 = Next

2. Create/open a file in your home directory called /.xinitrc:
vim ~/.xinitrc
and add the following lines:
xmodmap ~/.Xmodmap

3. Open your .zshrc or .bashrc depending on the shell you use:

vim .zshrc

and add the following line:

export TERM=ansi

And you’re done! Note that you might need to restart the terminal.

Installing Amazon MP3 Downloader

Today, the new Supershirt album “Kunstwerk” was released. I wanted to purchase it on amazon, because they have a Linux client. But I run a 64 bit Ubuntu and the amazon mp3 downloader is only available for 32 bit systems.

There is a simple solution to that. First download the 32 bit client from amazon:

Install 32 bit libraries:
sudo apt-get install ia32-libs

Then install it ignoring the architecture:

sudo dpkg -i –force-architecture AmazonMP3DownloaderInstall.deb

Download the getlibs script:

wget http://frozenfox.freehostia.com/cappy/getlibs-all.deb 

Fetch missing libraries:

sudo dpkg -i getlibs-all.deb sudo getlibs /usr/bin/amazonmp3
sudo getlibs -p gvfs sudo getlibs -w http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-date-time1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-filesystem1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-iostreams1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-regex1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-signals1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/universe/b/boost/libboost-thread1.34.1_1.34.1-16ubuntu1_i386.deb http://ftp.osuosl.org/pub/ubuntu/pool/main/i/icu/libicu40_4.0.1-2ubuntu2_i386.deb 

Make the libs known to the system:

sudo ldconfig

Now you’re good to go!

Kile 2.1

Kile 2.1 was released and there is a ppa for it!

sudo add-apt-repository ppa:kile/stable

sudo aptitude update
sudo aptitude full-upgrade
No more beta!

Installing TeX Live 2011 on Ubuntu

Debian and Ubuntu provide very good packages of Tex Live. But it takes some time untile they switch to newer versions. The current stable Ubuntu 11.04 (Natty Narwhal) comes with Tex Live 2009 and this is not going to change for Ubuntu 11.10 Oneiric Ocelot.

If you’re a version-number-junkie like me and you do not want to wait I have written a little tutorial how to install the latest TeX Live on Ubuntu.

To my knowledge there is currently no ppa available. So the installation has to be done manually.
Doing this, you are additionally able to use the command “tlmgr’, giving you better control of upgrades and which packages will be installed.

Basically, there are two options.

The first is, removing the Tex Live 2009 that comes with Ubuntu, doing the manual installation and then telling the system, that the installation was done manually and dependencies are met for other packages, e.g. Kile or other LaTeX editors. According to the listing, the package is a dummy package whose only purpose is to install a decent selection of dependencies. So it is in principle possible to install the texlive-full package without installing any of its dependencies.

The second, and possibly easier solution is to simply let the one that comes with the system installed and install the new version side by side. This wastes a lot of disk space, but that should not be an issue on modern machines. And if you do this right, you get the new features without running into the risk that the upgrade may break some dependencies from other packages. It is also much easier to go back. If something goes wrong you simply delete the directory where you installed it. And that is what the purpose of the /usr/local directory is. Install TeX Live to /usr/local/texlive using the installer, ensure that /usr/local/texlive…/bin path appears before /usr/bin in your path settings and that TEXMFCNF points to the right place. By doing this you simply ignore the system installation of Tex Live and are able to revert to it if necessary.

Therefore this tutorial goes for the second option.

Installing TeX Live over the Internet

1. Dowload the TeV Live installer.
Open e terminal and type:

2. Extract the installer

tar -zxvf install-tl-unx.tar.gz

3. Run the installer with super user privileges

cd install-tl-20110812
sudo ./install-tl

The installer should automatically detect the correct settings. It wants to do a full installation to /usr/local which is exactly what we want. So press “I” to start the installation. This may now take a while. Don’t worry about some connection errors. It will automatically retry.

4. Path settings

Add the following to your .bashrc if you use the bash or .zshrc file if you use the zshell with your favourite editor:

export PATH=”/usr/local/texlive/2011/bin/x86_64-linux:$PATH”
export MANPATH=”/usr/local/texlive/2011/texmf/doc/man:$MANPATH”
export INFOPATH=”/usr/local/texlive/2011/texmf/doc/info:$INFOPATH”
export TEXMFHOME=”/usr/local/texlive/2011/texmf”
export TEXMFCNF=”/usr/local/texlive/2011/texmf/web2c”

Then source the file or restart the shell and you’re done!

Updating Eclipse

Eclipse 3.7 Indigo has been released! I had a lot of add-ons and did not want to reinstall all of them.

Is an update from 3.6 to 3.7 possible?

Yes! Simply go to “Install Software” and add 


to “Available Software Sites”. Check existing repositories and change them from “Helios” to “Indigo”. Then check for updates.

It worked like a charm!