Thumbnail for {{ page.title }}

Articles

Articles are single-page pieces that give a whirlwind tour of a specific topic.

They’re different from series, which go very in-depth, taking many detours.

August 2019

Huffman 101

Let’s play a game: your objective is to guess a word, but you can only ask yes or no questions. You should also aim to ask as few questions as possible.

You might have played a variant of this game before, guessing famous actors or musicians. You’d usually ask questions like “Are they alive?”, or “Have they won an Oscar”? And that would allow you to narrow down the possibilities, until you finally resort to a list of direct guesses (“Is it Amy Adams?”) or simply give up.

And now for a bit of an announcement

Hey all, thanks for checking in!

After much soul searching, I have arrived to the following conclusion:

  • Teaching folks about stuff is my jam.

I’ve been writing multiple articles that sort of read like course material, if there was no dress code, maybe?

In 2013, I organized a 1st year Computer Science student project. Instead of making them implement “control tower software” for a fictional airline, I decided to go for something real - the BitTorrent protocol.

July 2019

Rust modules vs files

A while back, I asked on Twitter what people found confusing in Rust, and one of the top topics was “how the module system maps to files”.

I remember struggling with that a lot when I first started Rust, so I’ll try to explain it in a way that makes sense to me.

Important note

All that follows is written for Rust 2021 edition. I have no interest in learning (or teaching) the ins and outs of the previous version, especially because it was a lot more confusing to me.

May 2019

Celebrating Mario Maker

I’ve been watching a lot of Super Mario Maker videos this past month. Probably a hundred hours! This game is like a world onto itself, and it was fascinating to learn its design language and patterns.

With Super Mario Maker 2 coming out soon, I thought I’d show off some of the cool stuff I’ve seen, to celebrate Mario Maker.

We’ll start with some basic elements of Mario Maker (with screenshots), and then move on to a lot of video clips showing cool stuff.

Rust generics vs Java generics

In my previous article, I said I needed to stop thinking of Rust generics as Java generics, because in Rust, generic types are erased.

Someone gently pointed out that they are also erased in Java, the difference was elsewhere. And so, let’s learn the difference together.

Java generics

I learned Java first (a long, long time ago), and their approach to generics made sense to me at the time.

Recursive iterators in Rust

I’ve been looking for this blog post everywhere, but it doesn’t exist, so I guess it’s my turn to write about Some Fun with Rust.

The task at hand

Let’s say you have a recursive, acyclic data structure, like so:

struct Node { values: Vec<i32>, children: Vec<Node>, }

This allows you to represent a tree-like structure:

[1, 2, 3] /\ / \ / \ / \ / \ [4, 5] [6, 7]
December 2018

2018 Retrospective

The year is drawing to a close, and I’m going off on a much-needed holiday next week. This seems like a good time to look back at the past twelve months!

I can’t believe that shipped

2018 was the year of foundational work. As far as “work work” is concerned, I spent the first 9 months finishing up my largest project ever, the itch v25 rewrite.

January 2017

Efficient game updates

A little while ago, I wrote an article on things that can go wrong when downloading, it listed a series of reasons, from network problems to invalid content to imperfect hardware that may occur when initially installing a game.

This article discusses what methods we can use to upgrade a game to a later version, when an older version has been successfully installed.