Blog

Unified Filesystem Operations with Python's Pathlib Module

Filesystem operations in Python can feel clumsy, because the relevant operations are distributed over so many different modules in the standard library: some are in os (itself very large and bloated), some in os.path, then there is shutil, and you may also need either glob or fnmatch. Why does this need to be so complicated?

Turns out, it isn’t. Python’s pathlib module provides unified access to a complete set of filesystem objects and operations. Unfortunately, the pathlib module itself can appear a bit daunting. But in reality, it’s really very simple.

Building Regular Expressions with Emacs

Wouldn’t it be nice to have an environment in which to see the effect of a regular expression on a set of target strings? Ideally such that changes in matching immediately reflected, as one changes and experiments with the regular expression itself? The re-builder functionality built into Emacs does exactly that.

The polyfill.io Sign-In Phishing Incident on janert.me

For a brief time, starting after 01 June 2026 (when there was no apparent problem) and 18 June 2026 (when the problem first came to my attention), visitors to this site were faced with a spurious “Sign-In” pop-up, identifying itself as “polyfill.io”.

This was a (late) consequence of the 2024 polyfill.io supply chain attack. If, by chance, you entered any credentials, you may want to change them where necessary.

The content and hosting of this site was (to my knowledge) never compromised.

Schrödinger Equation in a Wedge Potential: Exact and WKB

The Schrödinger equation in a wedge potential is one of the “standard” problems in Quantum Mechanics — standard, but not routine, as its solution involves the Airy equation, which is likely to be unfamiliar, at least until this precise moment.

Because of this, it seemed interesting to look into this problem, and to find both its exact solution (involving the Airy function), but also to solve it using the WKB approximation: another topic that is “standard” in Quantum Mechanics classes, but less often seen in the real world. Here it provides an additional benefit, as a way to avoid the Airy function and to express the solution in terms of “elementary” functions.

An Ideal Math Curriculum for Physics Students

I occasionally fantasize about an “ideal math curriculum” for Physics graduate students, based on my experience, in school and out. Which topics make sense, which don’t, what should count as reasonably expected knowledge, what is actually useful?

There are also some textbooks, several of which having been published after I left school, that I would like to use (actually: like to have used) in the appropriate classes.

A Simple Approximation for the Airy Function

Besides the Normal Distribution Function, I occasionally need the Airy Function Ai(x): it arises in perturbation theory and some other contexts. This function is most definitely not part of most standard numerics libraries! While high-quality implementations of it are part of most “serious” numerics libraries (such as SciPy or GSL), these libraries are not always available or convenient.

Here is a really simple numerical approximation: it is numerically “good enough” for casual work, and simple enough to be implemented on the fly as needed.