Rotors: A practical introduction for 3D graphics

 17 Apr 2023

When putting 3D graphics on a screen, we need a way to express rotations of the geometry we’re rendering. To avoid the problems that come with storing rotations as axes & angles, we could use quaternions. However quaternions require that we think in 4 distinct spatial dimensions, something humans are notoriously bad at. Thankfully there is an alternative that some argue is far more elegant and simpler to understand: Rotors.

Windows drag-and-drop: No admin!

 20 Jan 2023

Recently I was building a small tool to help me do some processing on image files. Naturally this meant it needed to be able to open files, so I added a button that would launch the usual Windows built-in “Open a file” dialog.

That works, but it’s more clicks. Wouldn’t it be great if I could open files via drag-and-drop?

ZFS Snapshots: The case of the vanishing disk usage

 3 Jun 2022

I have a home server that runs on TrueNAS (which is FreeBSD) using ZFS for its storage filesystem. I recently ran into the common issue of not knowing where my disk usage was going, discovered that disk usage accounting for snapshots is more complex than for regular filesystems, and thought I’d write it up. Hopefully others find it helpful and/or enlightening.

Generating integers uniformly distributed over an range

 21 Nov 2021

You may have seen that there was recently a submission to the Swift language’s standard library with an interesting title: “An optimal algorithm for bounded random integers” by Stephen Canon. I found the idea intriguing and this post is a summary of my little expedition into the world of bounded pseudorandom integer generation.

Hidden friends with compile-time benefits

 28 Aug 2021

Recently I’ve been thinking about how I could reduce the compilation time of my C++ code (aren’t we all). I also recently saw some people discussing the so-called “hidden friend” idiom in C++ and its various benefits. One of the claimed benefits of hidden friends is that they simplify the compiler’s job, speeding up compilation. I thought I’d investigate.

FreeBSD Service Configuration: A primer & example

 19 Jun 2021
They say you should blog about problems you’ve solved. So here is a blog post about today’s problem: Figuring out how to configure FreeBSD services. We’ll break down the configuration for a simple service, linking you to all the relevant docs along the way. The service The service we’re setting up is syncthing, which I use to synchronise files across my devices via my home server. It works very well and I wholeheartedly recommend it.

Memory Alignment in 2021

 16 May 2021

I recently saw a small argument on the internet (shocking, I know) about whether it is important to care about memory alignment on modern computing hardware. One party claimed that alignment is not something you need to worry about in 2021 and that code which works to ensure it is correct is just getting in the way. The other party was arguing that such code is an important part of ensuring your program’s correctness.

From G to Fast: A short story about email

 12 Jul 2020
Here’s an opinion you’ve probably heard before: Google has too much reach on the internet. They manage most of the search, most of the email, most of the video content and most of the browsers. In an ideal world where all companies work for the benefit of humankind rather than just their shareholders, this would probably be fine, helpful even. Sadly though, we do not live in such a world. So here is the latest chapter in my meagre effort to depend a bit less on Google and its services.

Implementing DNS: RFCs can be sneaky

 28 Mar 2020
We’ve all seen DNS at work. You probably used it to get to this site (if not then who are you and why do you know the IP for my site off-hand?). But how does it work? Sure there are high-level descriptions of it in most Computer Science courses the world over and certainly the internet has no shortage of hand-waving descriptions. When we get down to the finer details though, how does one really create a client that talks directly to a DNS server to get IP addresses from domain names?

Randomly valuing property: A Machi Koro investigation

 26 Dec 2019

In addition to the various computer-ey things that I do, I also like to play boardgames with my friends sometimes. One such game that I like to play is Machi Koro. Machi Koro will be the topic of today’s post so if you’ve never played it, you may want to watch a lets-play of it or something before continuing.