Rooted Tree Isomorphism with Prime Numbers: A Practical Python Solution

Introduction Graph isomorphism asks whether two graphs have the same structure. This is the same as asking if it’s possible to relabel vertices of a graph to make it equal another graph. Determining whether two graphs are isomorphic is a computationally challenging problem. It’s one of two problems known to be in NP but it is not yet known whether it lies in P or is NP-Complete. The most naive (and computationally expensive) algorithm for determining if two graphs are isomorphic is a brute-force algorithm....

November 26, 2024 · 696 words

Event report: ObservabilityCON "On the Road" London 2024

Last week I travelled down to London for Observabilitycon On The Road London. The event was organised by Grafana Labs and covered all their latest developments. I was one of over 200 attendees watching the single-track of talks. These talks were mainly delivered by Grafana Labs employees, with a couple given by Grafana Cloud Enterprise customers. In this post I’ll highlight the talks I thought were the most interesting. The talks showcased a mixture of improvements to existing features and brand-new features....

October 25, 2024 · 2041 words

Simplifying Complex Filtering Logic with Predicate Functions

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 · 687 words

Solving Conversion Problems with 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 · 1242 words

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 · 22 words

Less Complex Parsers, More Maintainable 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: Less Complex Parsers, More Maintainable Code Part 2: Checking refactoring with graph isomorphism (not yet posted) Simplifying the parser I used the PyParsing module to parse the user-provided grammar....

January 26, 2024 · 699 words

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 · 2426 words

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 · 1180 words

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 · 831 words

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 · 2935 words