Blog

Command Line Arguments with Python's Argparse Module

Processing command-line arguments in ad-hoc python tools is one of those areas where I tend to just hack it together from scratch — simply because the effort of learning and understanding the relevant library packages not only seems to be more work than it is worth, but also and in particular more effort than “just doing it” by hand. I don’t want anything fancy, after all. I just want to get it done.

Running a GUI Application in a Docker Container

Containers are not usually associated with GUI applications, but there may be times when one might still want to run such a program inside a container, for example to isolate the application’s dependencies. Installing a GUI application in a container means that not only the application, but also all its specific dependencies are encapsulated inside the container (respectively, the container image), and can therefore reliably be removed from the system in a single step.

Using Xsession to Set an Environment Variable Without a Shell

The freedesktop project, arguably the most important Linux organization you’ve never heard of, has (among many other noble deeds) done an admirable job clearing up the mess of local cache and config files in one’s home directory. But how does one override their defaults, if this requires setting environment variables globally, for all processes, and outside an explicit shell environment?

The Heilmeier Catechism

George H. Heilmeier, director of DARPA (the advanced-technology research agency of the US Defense Department) from 1975 to 1977, formulated a set of questions to help evaluate research proposals.

A Strictly Geometrical Proof of the Altitude Theorem

The Altitude Theorem or Geometric Mean Theorem is a result from high-school geometry. In a right triangle, the altitude $h$ on the hypotenuse divides the hypotenuse into two segments, $p$ and $q$. The theorem now states that $h^2 = pq$ or, equivalently, $h = \sqrt{pq}$: the altitude equals the geometric mean of the segments of the hypotenuse.

The content of this theorem is a bit surprising, because the altitude and the hypotenuse segments seem geometrically somewhat “unrelated”: it’s not clear how one could (geometrically) be transformed into the other. And although the theorem can be proven in many different ways, many of the proofs are at least partially algebraic, and therefore do not provide an intuitive, geometric sense why it is true. But it turns out that a very elegant, strictly geometric proof of this proposition can be constructed.