Emacs Quick Capture

I like to use org-mode in Emacs; it is rather well described by its slogan, ‘your life in plain text’. When I am working in Emacs, which is quite often, my key bindings allow me to very easily take notes and add tasks to my agenda using org-capture, and then switch back to what I was doing. The following configuration allows me to access the same functionality quickly from outside Emacs.

Running Qt5 applications outside KDE

I run i3 as window manager but like to use some applications from the KDE suite, such as KOrganizer, for their maturity and customizability. Without further configuration, however, the font sizes in such applications are odd and no icons appear. It turns out this is due to a new feature in Qt5: the application theme is not set globally but inferred from the environment. An effective workaround is to use qt5ct.

Mutt: open HTML via mailcap

Some agencies insist on sending HTML email without including a decent plain text version under multipart/alternative. To users of mutt or other email clients that do not include a browser, this presents a small problem. One can automatically pipe the HTML through a text-based browser such as elinks, but for some HTML emails the result is hard to navigate and this approach does not suffice.

Symbolic manipulation of infinite-dimensional band matrices in Mathematica

There are some symbolic calculations in infinite-dimensional Hilbert spaces that can still be done entirely in Mathematica. Assume one has an operator whose infinite-dimensional matrix in some basis vanishes outside some finite number of off-diagonals, and assume there is a closed expression for the corresponding entries: then, polynomial equations in such matrices can be simplified analytically in Mathematica.

The trick is to work with finite-size matrices (sufficiently large to accomodate the finite band width) with symbolic entries, whose 'middle' column represents an arbitrary column of our polynomial equation. Since everything is symbolic and all nonzero entries can be accounted for by finiteness of the band width, this allows for analytic equation solving in Mathematica.

C++/Python: Import Eigen output to NumPy

At work our team runs Monte Carlo simulations of rather high-dimensional (900 complex dimensions) integrals over spaces of matrices. The actual simulation code running on the cluster is written in C++ and uses the Eigen library for various internal constructions. Data analysis is done in Python using Pandas and NumPy.

Bridging the two languages is easy since the C++ code outputs the simulation results in the HDF5 format, which is well supported by various Python libraries, including Pandas.

When we develop new features for the simulation, however, it is useful to debug by testing simple cases and sending the output directly to the command line. This brings me to a minor impracticality: the Eigen output is not directly readable by NumPy, so the debug output cannot easily be inspected using the existing analysis code.

Getting the i915 drivers and Xorg to work with Intel UHD Graphics 630 Mobile

When installing Gentoo on a Thinkpad X1 Extreme, I ran into some small trouble with the drivers for the integrated Intel graphics chip. Under Linux 4.14 the integrated graphics (Intel UHD Graphics 630 Mobile) were only supported by the i915 kernel module with the i915.alpha_support=yes option on the kernel command line. With this setup I ran into intermittent graphics glitches (blank / non-refreshing windows), and the wiki recommended switching to Linux 4.18 for non-alpha support. However, it turns out an additional step is needed.

DF: Burrows and accept-all stockpiles

In Dwarf Fortress, it may be desirable to restrict most of your civilian dwarves to specific burrows, e.g. to prevent your dwarves seeing the sunlight or to meet outside Fun. However, if you still want resources from outside to come in, such as wood or gathered plants, there is a slight catch with a workaround.

EBGaramond with maths and pdfLaTeX

The EBGaramond LaTeX package is pretty neat, but is sadly missing a mathematics font companion. There’s ebgaramond-maths, but it has fixed font sizes and the spacing doesn’t seem right. One could use a completely non-garamond font for the maths, but that leads to disturbing artefacts. There are options for those using other engines than pdfLaTeX, but this leads to a loss of microtype functionality. Here’s an easy alternative.

Nested macro definitions in mutt

I wanted a customizable <save-entry> command in mutt, in order to easily store my students’ homework PDFs in the appropriate folder, under the appropriate filename.

To implement this, I resorted to a nested macro. A macro definition in muttrc can itself contain <enter-command>macro (...), which is a nice way to create macros with customizable functionality.