Floating Points Numbers, Down to the Bit

Floating Point Memory Format The general idea behind floating point numbers is the same as behind scientific notation: write a mantissa, combined with an exponent to move the decimal point. E.g. $1.093 \times 10^5 = 10^5 \sum_{k=0}^3 a_k 10^{-k}$ with $a_k = 1,0,9,3$. The exact same thing can be done...  Continue Reading…

Advanced Array-Passing in Fortran

There are instances where one wishes to change the rank (the number of dimensions) of an array as it is passed to a subroutine. Maybe you want to call a library routine that expects to get a vector, but you have the data to be passed stored in a matrix....  Continue Reading…

PDF Bookmarks with LaTeX

The combination of pdfpages, hyperref, and bookmark allows for a very neat way of adding an outline to an existing pdf file. For example, we can use the following tex file to add a (partial) outline to my diploma thesis. \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{pdfpages} \usepackage[ pdfpagelabels=true, pdftitle={Optimization of a Controlled Phasegate...  Continue Reading…

Creating Combined tikz/png Plots

In order to create truly high quality plots, you can have gnuplot write tikz files. Wheres the latest CVS development version of gnuplot have the tikz terminal included, I’m still using the patch by Peter Hedwig for gnuplot 4.2. Generating tikz code from gnuplot works very nicely for “standard” plots,...  Continue Reading…

Accessing GMail through Python

Over the last couple of years, I’ve made several attempts at efficiently interacting with Gmail through Python. There were a number of motivations: Filtering mail: Putting emails into folder based on more elaborate rules than the server-side filters Gmail provides. Processing mail: Modifying emails, for example decrypting gpg-encrypted mails, or...  Continue Reading…