How to sort parent nodes before child nodes? - Topological sort

Tutorials

Dependencies between things are common, but they can be tricky to manage in code. You might think of using a graph to model your system, but how can you ensure that thing A happens before thing B? This is where the idea of a topological sort comes in.

This article …

Continue reading »

abracadabra: How does Shazam work?

Tutorials

Your phone's ability to identify any song it listens to is pure technological magic. In this article, I'll show you how one of the most popular apps, Shazam, does it. The founders of Shazam released a paper in 2003 documenting how it works, and I have been working on an …

Continue reading »

Build a snake game on the BBC micro:bit

A detailed tutorial (simulator included)

Tutorials

By the end of this tutorial, you'll have built your very own game and learned not only about game development, but Python and the BBC micro:bit too. What's more, you don't even need to own a micro:bit to follow along!

Continue reading »

Easy Python speed wins with functools.lru_cache

Tutorials

Recently, I was reading an interesting article on some under-used Python features. In the article, the author mentioned that from Python version 3.2, the standard library came with a built in decorator functools.lru_cache which I found exciting as it has the potential to speed up a lot of …

Continue reading »

Better parameter validation in Flask with marshmallow

Tutorials

Recently I've had two Flask projects with endpoints that take lots of parameters. While working on the first project, I noticed that I was writing a lot of code for validation in each method, and it ended up looking ugly and probably full of bugs. When I started the second …

Continue reading »

Subscribe

No spam, just new posts. Choose what you receive and unsubscribe whenever.

Which posts do you want to receive?