Blog

The Newsvendor Problem

The “Newsvendor Problem” is a classic problem in inventory and supply-chain management: how much product to carry in stock in the face of uncertain demand?

The problem is obviously of interest in its own right, but it is also an archetypical problem, meaning that variations of it arise frequently and in different contexts. It is therefore valuable to know “how to think about” this kind of problem; in particular, since in its simplest form, it has a closed-form, analytic solution.

Read Again: The Art of UNIX Programming by Eric S. Raymond

In a moment of nostalgia, I picked up my copy of “The Art of UNIX Programming” by Eric S. Raymond (esr) and flipped through it again. It’s a book I’ve had since when it came out in 2004, and that I’ve always been quite fond of. I was looking forward to a review of “the way the future was”, as viewed from the early 2000s. So, it came as a bit of a surprise to me to find that the book seems to have aged rather poorly.

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.

A Comparison of Pixel-Art Scalers

I recently got interested in algorithms for scaling pixel art images, such as icons or video game sprites. The Wikipedia page on the topic lists a handful of different algorithms that have been developed for that purpose.

Running a GUI Application in a Docker Container: Users, Permissions, Dockerfile

In a previous post, I explored the possibilities of running a GUI application inside a Docker container. In the current post, I will continue where we left off before, adding some details to make the process more convenient.

A Fix for Pysolfc on Linux Mint 21 Vanessa

There are problems playing the pysolfc solitaire game on the latest release of Linux Mint 21 (Vanessa).

The game requires the formatter module from the Python Standard Library, which had been deprecated since Python 3.4, and has been removed in Python 3.10.

An easy, but ad-hoc workaround goes as follows:

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?

A Look at the HDF5 Format

I occasionally see references to the HDF5 file format, but I have never encountered it in the wild. But a recent project generated multiple data sets simultaneously, in addition to metadata. Was there a better way than maintaining a collection of flat files? This prompted me to look at HDF5.

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.