Filtering from a subset of predicates

To search for jobs after finishing university I build a job board scraper. The backend (F#) of this site scraped the individual job listings, and a frontend (Vue.js) showed the jobs and allowed filtering by the attributes scraped by the backend. One of my favourite parts of the system is implementation of the filtering mechanism. Naive implementation The first two filters were binary, like a checkbox they were either on or off....

April 24, 2024 · 4 min

Currency exchanges and the Floyd–Warshall algorithm

Imagine the following situation: You have a big pile of money in a variety of currencies. You have access to currency exchanges where you can convert between currencies, but individual exchanges only convert between a subset of currencies. Exchanges offer a rate, this is the fraction of the target currency you obtain after exchanging a unit of the source currency. Naturally, rates are restricted to be greater than zero. Exchanges offer conversions between currencies but the rate in one direction is the reciprocal of the other direction....

April 8, 2024 · 6 min

Kubernetes's Tenth Rule

Any sufficiently complicated deployment system contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Kubernetes. Inspired by Greenspun’s tenth rule.

April 1, 2024 · 1 min

Simple Parser, Simple Code

ALeRT is one of my projects. It’s designed to show the properties of a grammar graphically. It was started out as a command-line script, I then added a website to allow anyone to run it. The website was still using the original script and now I want to refactor it to make the program more flexible. This series of posts will cover insights from that refactoring: Part 1: Simple parser, simple code Part 2: Checking refactoring with graph isomorphism (not yet posted) Part 3: Using the debug console to determine types (not yet posted) Simplifying the parser I used the PyParsing module to parse the user-provided grammar....

January 26, 2024 · 4 min

The Rise of Scripting Languages

This was written as a piece of coursework for my Principles of Programming Languages module, where we had free choice to write an essay about programming languages. I opted for a critque of some predictions made by John Ousterhout. The essay suffers from a netural/skeptical academic tone. Despite this I think the points are still valid so I might restructure some of it into a more passioniate article later. Introduction Programming language paradigms provide a way to classify programming languages....

November 9, 2023 · 12 min

Creating an online Caddyfile formatter with Go

When writing the last blog post I wanted to format my Caddyfile. I didn’t have a terminal open and I couldn’t find a website to do it. So I made one. caddyfmt.online Source code here What and why When writing the previous blog post the Caddyfile I wrote wasn’t formatted nicely. Caddy warns if the file isn’t formatted canonically and it looked pretty ugly. Normally you’d fix it by running caddy fmt, this runs the built-in formatter over the file and outputs to stdin....

January 13, 2023 · 6 min

Serving DokuWiki with Caddy

I use DokuWiki as a personal wiki: a private blog, somewhere to jot down ideas and plan out projects. I’m currently running Dokuwiki on my Windows laptop from DokuWikiStick but wanted something more permanent. I’ve started self-hosting some applications on an old HP desktop computer and want to expand this setup. DokuWiki is a good candidate for moving onto my server. However, hosting the wiki on that could cause a chicken-and-egg situtation if the server is down and I need access to the information....

January 12, 2023 · 4 min

Second Year Group Project Retrospective

A retrospective of a second-year group project. Our brief was simple: create a system to manage the mentoring of new employees. On paper, it seemed easy enough: a standard user system, a clever algorithm to match mentees to mentors and crud for meetings. In reality, it was a disaster. We had 8 weeks to develop the system. We spent the first two weeks analysing requirements and producing a system design. Happy with our design, we were looking forward to turning clear, well-defined requirements into our final system....

April 18, 2022 · 14 min

Generate realistic data with Faker.py

Does this sound familiar? You make the perfect UI, add a few entries to the database and deploy. And then? CSS carnage. Once you start adding more and more entries to the database the UI falls apart. This has happened to me too many times before so I started looking for a solution Initial solution I started filling out my forms manually a bunch more times. This didn’t scale well, it quite frankly bored me....

March 17, 2022 · 3 min

A Contained Introduction to Docker

This is a shortened version of a talk I gave to University of Warwick Computing Society. Introduction What is Docker? From the official Docker webpage: “[Docker lets you] package applications as portable container images to run in any environment consistently from on-premises Kubernetes to AWS ECS, Azure ACI, Google GKE and more” Docker is a tool which lets you bundle your application up into a self-contained image which can run in many environments with exactly the same results....

March 16, 2022 · 7 min