Let's write a ring buffer in Python! OK, that's not particularly exciting. Let's use test-drivent development, that should make things a bit more interesting. In this blog post I will go over the individual steps and my train of thought, because TDD requires a certain discipline and mindset. Why a ring buffer? A ring buffer is not quite trivial to implement because it has a couple of edge cases, but at the same time it is not hard to implement either. This is a post to follow along at home, so grab your text editor and let's get going.
Sometimes I like to play video games. Sometimes these games have issues, or they can be improved upon. Sometimes these issues are so severe that the game is virtually (or even literally) unplayable. Fortunately some really smart people have done a fantastic job reverse-engineering parts of these games, their file formats, or found workarounds for engine limitations. Unfortunately too often that knowledge never gets written down and just keeps rotting in someone's head.
I have written a small Python script which patches the game files of Anno 1503 to run at higher resolutions. There is already a widescreen patch out there ready to use, so why create a patcher? Download links die, knowledge gets forgotten and people lose interest and move on. Without preservation of knowledge the patch will be lost and impossible to reproduce without trial and error all over again. My patcher exists both to be useful, and as executable documentation for posterity. There is also the possibility that if you patch the DLL file that came with your own game instead of using someone else's it might run more stable (not all builds of the game are identical), but that's just a blind guess.
The term “user-friendly” gets thrown around often, but what does it even mean to be “user-friendly”? Clearly we can say that something is more user-friendly the fewer defects it has. But beyond that? Is a GUI application more user-friendly than a text-based application? Is a lower learning curve more user-friendly than a steep learning curve? Is a product which has many features built-in more user friendly than a barebones product or an extensible product?
A few days ago I wanted to re-install Sid Meier's Civilization III on my machine and play it again. This blog post is a summary of the tricks I had to use to make it work it work well; I am writing it down for posterity, maybe someone else will find it useful. That someone might even be future me.
Over the last couple of years I have been noticing two trends among internet videos, especially on YouTube: videos that could easily be three to four minutes long are stretched to over ten minutes in length, and thumbnails where people are making stupid faces. This comes from YouTube's recommendation algorithm favouring thumbnails with people's faces, and videos needing to be at least ten minutes long to be eligible for advertising revenue. At least those used to be the rules back then, they might have changed since, but the videos still follow the same pattern.
Recently I had the misfortune of a data loss, so I had to re-instally my OS again. But even worse: I also had to re-install Unity on GNU/Linux, which has been an exercise in frustration and trial & error. In this post I will outline what I had to do, in the hope that it will be of use to other people.
When I develop Grid Framework I need Unity3D to generate project files for Omnisharp to pick up in order to provide me with tooling like auto-completion, linting and refactoring support. Normally doing so requires me to have VSCode installed, but there is a simple way to trick Unity into generating those files anyway.
I have been watching a tutorial on GraphQL recently (YouTube link) where the lecturer uses MongoDB for persistent storage. He instructs viewers to sign up for a service that hosts a database, but I wanted to run a local instance on my machine instead. MongoDB is not available in the Void repos, but fortunately it is available in the Guix repos. However, running the Mongo deamon requires a little tweak first.
Unix has a clever trick for hiding a file from being displayed by the
lscommand or other file browsers: just prefix the file name with a period character. Many applications use this fact in order to place hidden files or directories in the user's home directory, usually containing settings, cached files, persistent data and whatever else developers might come up with. This practice has always struck me as just plain wrong, and I am glad that my sentiment was confirmed by Rob Pike years ago.