ACCU World of Code
-
Matrix is the only (chat) game in town
On my phone and computer I use WhatsApp, Signal, Slack, Keybase, Discord, IRC, XMPP/Jabber and Element/Matrix. In addition, I occasionally use the messaging features of Mastodon, Twitter and even LinkedIn. I’ve never used Telegram, Line, WeChat, Sessio…
-
Writing Snake in Terraform Video
This was quite a challenge, and I nearly gave up, but I managed to write a Snake game in Terraform: Slides: artificialworlds.net/presentations/snake-terraform Source code: gitlab.com/andybalaam/snake Slides source code: gitlab.com/andybalaam/videos-sn…
-
Suspending the computer using Kupfer
I have recently started using Kupfer again as my application launcher in Ubuntu MATE, and I found it lacked the ability to suspend the computer. Here is the plugin I wrote to support this. To install it, quit Kupfer, create a directory in your home dir…
-
Uploading to PeerTube from the command line
PeerTube’s API documentation gives an example of how to upload a video, but it is missing a couple of important aspects, most notably how to provide multiple tags use form-encoded input, so my more complete script is below. Use it like this: # First, m…
-
vidmini – limit webcam resolution
Being fed up with the limited configurability of some of the more widely used software used for video conferencig, I have put together a small LD_PRELOAD-able shared library that limits the available resolutions a webcam reports. Have a look at the REA…
-
vidmini – limit webcam resolution
Being fed up with the limited configurability of some of the more widely used software used for video conferencig, I have put together a small LD_PRELOAD-able shared library that limits the available resolutions a webcam reports. Have a look at the REA…
-
Republishing Bartosz Milewski’s Category Theory lectures
Category Theory is an incredibly exciting and challenging area of Maths, that (among other things) can really help us understand what programming is on a fundamental level, and make us better programmers. By far the best explanation of Category Theory…
-
Visual Lint 8.0.1.337 has been released
Visual Lint 8.0.1.337 is a recommended maintenance update for Visual Lint 8.0. The following changes are included: If the Visual Studio plugin is selected for installation and the Visual Studio Debug Console (VsDebugConsole.exe) is running, the insta…
-
Visual Lint 8.0.1.337 has been released
Visual Lint 8.0.1.337 is a recommended maintenance update for Visual Lint 8.0. The following changes are included: If the Visual Studio plugin is selected for installation and the Visual Studio Debug Console (VsDebugConsole.exe) is running, the insta…
-
Python virtual environments with pyenv on Apple Silicon
Apple’s recent transition to the new architecture for its Mac computers has caused rather predictable problems for developers whose workflow depends on certain versions of pre-compiled libraries for x86 architecture. While the latest releases of Python come with a universal installer that allows to build universal binaries for M1 systems …
-
Python virtual environments with pyenv on Apple Silicon
Apple’s recent transition to the new architecture for its Mac computers has caused rather predictable problems for developers whose workflow depends on certain versions of pre-compiled libraries for x86 architecture. While the latest releases of Python come with a universal installer that allows to build universal binaries for M1 systems …
-
Using atomics for thread synchronization in C++
In my previous blog post I wrote about spin locks, and how compilers must not move the locking loop above a prior unlock. After thinking about this done more, I realised that is not something specific to locks — the same issue arises with any two…
-
Can non-overlapping spinlocks deadlock in C++?
There has been discussion on Twitter recently about whether or not the C++ memory model allows spinlocks to deadlock if they just use memory_order_acquire in lock and memory_order_release in unlock, due to compiler optimizations. The case in question i…
-
Announcing I-DUNNO 1.0 and web-i-dunno
It’s hard to believe it’s already a year since the release of RFC 8771 (The Internationalized Deliberately Unreadable Network NOtation), which for me at least made me think about IP addresses in a whole new way. So, it seems fitting for the anniversary…
-
Automatically filling in the UK COVID test results page with Selenium IDE
Lots of people are filling in the extremely detailed UK government COVID test result page twice every week. It asks you to fill in a very large list of details, most of which are the same every time, but it doesn’t remember what you typed last time. I …
-
Visual Lint 8.0 has been released
The first public build of Visual Lint 8.0 has just been uploaded to our website. As of today, Visual Lint 8.0 replaces Visual Lint 7.0 as the current supported Visual Lint version. As such Visual Lint 8.0 licences (as well as upgrades for Visual Lint 6…
-
Visual Lint 8.0 has been released
The first public build of Visual Lint 8.0 has just been uploaded to our website. As of today, Visual Lint 8.0 replaces Visual Lint 7.0 as the current supported Visual Lint version. As such Visual Lint 8.0 licences (as well as upgrades for Visual Lint 6…
-
Toggle window decorations on Linux GTK3 with Python3
The Internet is full of outdated Python code for doing things with windows, so here is what I got working today in a Python 3, GTK 3 environment. This script toggles the window decorations on the active window on and off. I have it bound to Ctrl+NumPad…
-
Ticket Maps
It has been an increasingly common scenario that I’ve encountered where you have some ID that’s monotonically increasing, such as a subscription or connection index, or user ID, and you need your C++ program to hold some data that’s associated with tha…
-
Questions about RFC 8771
During my work on RFC 8771 The Internationalized Deliberately Unreadable Network NOtation (I-DUNNO) I have come across a number of questions. I am documenting them here so I can send them to the authors and try to improve my understanding of the intent…
-
Announcing Rust I-DUNNO
At the ACCU Conference last week I learned about RFC 8771 The Internationalized Deliberately Unreadable Network NOtation (I-DUNNO) from Jim Hague, and thought it would be fun to knock up a Rust implementation. The project is here: gitlab.com/andybalaam…
-
Letter to my MP on Yemen
Sent via WriteToThem on Monday 1 March 2021. Dear Ben Spencer, Your experience on the front line in medicine means you are probably much more able than I to imagine the human impact of the situation in Yemen. On Sunday OCHA stated that 16 million peopl…
-
Visual Studio crashes when docking windows (TL;DR: it wasn’t us)
We’ve all done it. You prepare a new build, install it, start testing before releasing it and then…it crashes. The immediate thought is always “What have we done…?”. Exactly that happened to us recently when testing a Visual Lint build – all we did…
-
Visual Studio crashes when docking windows (TL;DR: it wasn’t us)
We’ve all done it. You prepare a new build, install it, start testing before releasing it and then…it crashes. The immediate thought is always “What have we done…?”. Exactly that happened to us recently when testing a Visual Lint build – all we did…
-
Making Smolpxl work on phones and tablets
I’ve added the first features intended to make Smolpxl games work well on touch interfaces like phones and tablets: I’ve added a button bar at the bottom (and moved the navigation buttons to the top). I’m looking for feedback on this: Does it work on…
-
Limiting the number of open sockets in a tokio-based TCP listener
I learned quite a bit today about how to think about concurrency in Rust. I was trying to use a Semaphore to limit how many open sockets my TCP listener allowed, and I had real trouble making it work. It either didn’t actually work, allowing any number…
-
Recommendation against the use of WhatsApp in your company
Here is the email I just sent to the organisation I volunteer for. Feel free to adapt and use in your context. Dear [organisation leaders], Much of the tech industry (e.g. [1]) is warning against the use of WhatsApp due to its policy of collecting and …
-
Streaming video with Owncast on a free Oracle Cloud computer
I just streamed about 40 minutes of me playing Trials Fusion using Owncast. Owncast is a self-hosted alternative to streaming services like Twitch and YouTube live. Normally, you would need to pay for a computer to self-host it on. Owncast suggest this…
-
Pinephone update
I got a Pinephone for Christmas! Here is quick summary of my experience with it. (Originally published on mastodon.) Update on the pinephone as promised. I love it, but I would definitely not recommend expecting to use it as your actual phone. I have …
-
Is your program a function or a service?
Maybe everyone knows this already, but for my own clarity, I think there are really two types of computer program: A function: something that you run, and get back a result. Example: a command-line tool like ls A service: something that sits around wa…
-
Shutdown order consistency: how Rust helps
Some Java code with bugs Here’s my main method (in Java). Can you guess the bug? Db db = new Db(); Monitoring monitoring = new Monitoring(); Monitoring mon2 = new Monitoring(); Billing billing = new Billing(db, monitoring); monitoring.setDb(db); runMa…
-
Edge computing providers
I’m looking into Edge computing at work. By Edge computing I mean running WASM programs in lots and lots of smallish computers in places near to actual people (rather than in huge cloud data centres). I think it’s cool because I love Rust, and Rust is …
-
Schema upgrades should be reversible (also other transformations, actually)
Are you writing schema upgrade code? Then I humbly suggest you take the time to write schema downgrade code too. “Why would I do that?” you might well ask, “I won’t ever need to downgrade.” Now, I imagine you’re expecting me to say you actually will ne…
-
Make levels for Rabbit Escape using the level editor!
You can make levels for Rabbit Escape!
-
Announcing Smolpxl Scores – a high score table for your game
It’s a very early beta for now, but I’m ready to announce Smolpxl Scores, which provides high-score tables for Free and Open Source games. Each game can have multiple high-score tables – for example, you might want one for each level. At the moment it’…
-
Dovecot not working after upgrade to Ubuntu 20.04.1 (dh key too small)
I upgraded to Ubuntu 20.04.1 and chose to keep my existing config files, and my mail server stopped working. In the log I saw: Nov 25 09:07:57 machine dovecot: imap-login: Error: Failed to initialize SSL server context: Can’t load DH parameters: error:…
-
Letter to my MP on the overseas aid budget.
Letter I sent to my MP today on the overseas aid budget. Let’s not be foolish. Dear Ben Spencer, Please use your influence to persuade the government to maintain our overseas aid budget commitment at 0.7% of national income. I believe that changing th…
-
Profile a Java unit test (very quickly, with no external tools)
I have a unit test that is running slowly, and I want a quick view of what is happening. I can get a nice overview of where the code spends its time by adding this to the JVM arguments: -agentlib:hprof=cpu=samples,lineno=y,depth=3,file=hprof.samples.tx…
-
Planning is Inevitable
Like most programmers I’ve generally tried to steer well clear of getting involved in management duties. The trouble is that as you get older I think this becomes harder and harder to avoid. Once you get the mechanics of programming under control you m…
-
Planning is Inevitable
Like most programmers I’ve generally tried to steer well clear of getting involved in management duties. The trouble is that as you get older I think this becomes harder and harder to avoid. Once you get the mechanics of programming under control you m…
-
Reality is not what is seems
is an excellent book by Carlo Rovelli (isbn 978-0-141-98321-9) As usual I’m going to quote from a few pages. It doesn’t describe where there is a particle but how the particle shows itself to others. It isn’t things that enter into relations…
-
Reality is not what is seems
is an excellent book by Carlo Rovelli (isbn 978-0-141-98321-9) As usual I’m going to quote from a few pages. It doesn’t describe where there is a particle but how the particle shows itself to others. It isn’t things that enter into relations…
-
Pair Programming Interviews
Let’s be honest, hiring people is hard and there are no perfect approaches. However it feels somewhat logical that if you’re hiring someone who will spend a significant amount of their time solving problems by writing software, then you should probably…
-
Pair Programming Interviews
Let’s be honest, hiring people is hard and there are no perfect approaches. However it feels somewhat logical that if you’re hiring someone who will spend a significant amount of their time solving problems by writing software, then you should probably…
-
Why a Free Software web games site?
Recently I’ve been having a lot of fun working on Smolpxl, which is a web site featuring some little retro web games that are all Free and Open Source Software. Here’s a sneak preview of the game I am working on: Why do this? Apart from the fact that …
-
Letter to Anneliese Dodds MP: Support for the Labour Left
Dear Anneliese Dodds MP, I have voted for you in the last two elections, as a proxy for my support for Jeremy Corbyn, though your attendance and performance at the hustings arranged by the Stop the War Coalition was a reason for my suppor…
-
The Ascent of Man
is an excellent book by Jacob Bronowski (isbn 0-7088-2035-2) As usual I’m going to quote from a few pages. Evolution is the climbing of a ladder from the simple to the complex by steps, each of which is stable in itself. The turning point to…
-
The Ascent of Man
is an excellent book by Jacob Bronowski (isbn 0-7088-2035-2) As usual I’m going to quote from a few pages. Evolution is the climbing of a ladder from the simple to the complex by steps, each of which is stable in itself. The turning point to…
-
Fast Hardware Hides Many Sins
Way back at the beginning of my professional programming career I worked for a small software house that wrote graphics software. Although it had a desktop publisher and line-art based graphics package in its suite it didn’t have a bitmap editor and so…
-
Fast Hardware Hides Many Sins
Way back at the beginning of my professional programming career I worked for a small software house that wrote graphics software. Although it had a desktop publisher and line-art based graphics package in its suite it didn’t have a bitmap editor and so…
-
TDD – Romanes Eunt Domus!
-
TDD – Romanes Eunt Domus!
-
What is Life?
is an excellent book by Paul Nurse (isbn 978-1-788451-40-6) As usual I’m going to quote from a few pages. Cells repair these mutations, but they are not completely successful. If they were, all individuals of a species would be identical and evo…
-
What is Life?
is an excellent book by Paul Nurse (isbn 978-1-788451-40-6) As usual I’m going to quote from a few pages. Cells repair these mutations, but they are not completely successful. If they were, all individuals of a species would be identical and evo…
-
Code your first game: Snake in JavaScript (on Raspberry Pi)
Welcome! We are going to code a whole snake game. It’s going to look like this: It doesn’t matter if you have never written any code before: I am going to try and explain everything from scratch. I’m going to assume you are using a Raspberry Pi. but y…
-
Sapiens. A Brief History of Human Kind
is an excellent book by Yuval Noah Harari (isbn 978-0-099-59008-8) As usual I’m going to quote from a few pages. Whereas chimpanzees spend five hours a day chewing raw food, a single hour suffices for people eating cooked food. Since long inte…
-
Sapiens. A Brief History of Human Kind
is an excellent book by Yuval Noah Harari (isbn 978-0-099-59008-8) As usual I’m going to quote from a few pages. Whereas chimpanzees spend five hours a day chewing raw food, a single hour suffices for people eating cooked food. Since long inte…
-
The Culture Code
is an excellent book by Daniel Coyle (isbn 978-1-847-94127-5) As usual I’m going to quote from a few pages. Much of the connection happens around the dinner table, as Popovich is obsessed with food and wine. One misconception about highly succ…
-
The Culture Code
is an excellent book by Daniel Coyle (isbn 978-1-847-94127-5) As usual I’m going to quote from a few pages. Much of the connection happens around the dinner table, as Popovich is obsessed with food and wine. One misconception about highly succ…
-
Play and create little retro games at Smolpxl
I love simple games: playing them and writing them. But, it can be overwhelming getting started in the complex ecosystems of modern technology. So, I am writing the Smolpxl library, which is some JavaScript code that makes it quite simple to write simp…
-
shareon.js.org now has a Share to Mastodon button
I was looking for the right way to make a “Share This”-style button for my tiny games site Smolpxl, and I found shareon which worked exactly the way I wanted (load the JavaScript and call a function to display the buttons, with no privacy concerns), an…
-
Coding a tiny game in JavaScript video
I’m working on a little JavaScript library called Smolpxl. It aims to make it really easy to create retro-style pixellated games that run well in the browser, using simple JavaScript. This is me live-streaming writing a tiny “game” using Smolpxl: To …
-
short – command line tool to truncate lines to fit in the terminal
Sometimes I run grep commands that search files with hugely-long lines. If those lines match, they are printed out and spam my terminal with huge amounts of information, that I probably don’t need. I couldn’t find a tool that limits the line-length of …
-
Mutant algorithms
The word “algorithm” has caused a storm in recent news in the UK. Due to COVID-19 school children were not able to sit their exams. This left 16 and 18 year olds waiting to see how they would be assessed, and had obvious implications for their ac…
-
Mutant algorithms
The word “algorithm” has caused a storm in recent news in the UK. Due to COVID-19 school children were not able to sit their exams. This left 16 and 18 year olds waiting to see how they would be assessed, and had obvious implications for their ac…
-
Online Concurrency Classes
With all the restrictions brought upon us by COVID-19, many C++ conferences are moving online. This includes Cppcon and NDC Tech Town, both of which are being run as 100% virtual conferences this year. I will be running my More Concurrent Thinking clas…
-
Set the date (EXIF) of a photo on Linux
To set the date when a photo was taken, install ExifTool e.g.: sudo apt install libimage-exiftool-perl # If on Ubuntu sudo dnf install perl-Image-ExifTool.noarch # If on Fedora And modify the photo with a command like this: exiftool -DateTimeOrigina…
-
How to send an SMS using netcat (via SMPP)
SMPP is a binary protocol used by phone companies to send text messages, otherwise known as SMS messages. It can work over TCP, so we can use netcat on the command line to send messages. A much better way to understand this protocol is to use Wireshark…
-
Simple Tables From JSON Data With JQ and Column
My current role is more of a DevOps role and I’m spending more time than usual monitoring and administrating various services, such as the GitLab instance we use for source control, build pipelines, issue management, etc. While the GitLab UI is very us…
-
Simple Tables From JSON Data With JQ and Column
My current role is more of a DevOps role and I’m spending more time than usual monitoring and administrating various services, such as the GitLab instance we use for source control, build pipelines, issue management, etc. While the GitLab UI is very us…
-
Weekend Maintenance as Chaos Engineering
I was working on a new system – a grid based calculation engine for an investment bank – and I was beginning to read about some crazy ideas by Netflix around how they would kill off actual production servers to test their resilience to failure. I reall…
-
Weekend Maintenance as Chaos Engineering
I was working on a new system – a grid based calculation engine for an investment bank – and I was beginning to read about some crazy ideas by Netflix around how they would kill off actual production servers to test their resilience to failure. I reall…
-
Letter to my MP on racism in the US and UK
Here is the text of a letter I wrote to my MP today via writetothem.com: Dear [], I am writing to you to express my growing horror at the ongoing police violence and brutality Black protesters are facing in the US, and the UK’s disturbing silence on t…
-
Clang-Tidying up the house
If there is any single consolation amidst the circumstances we are all having to cope with at the moment it is that many of us have lots of time to fill – not only with unproductive things like binging Netflix (I really should get around to watching Di…
-
Clang-Tidying up the house
If there is any single consolation amidst the circumstances we are all having to cope with at the moment it is that many of us have lots of time to fill – not only with unproductive things like binging Netflix (I really should get around to watching Di…
-
Victory in Europe (VE) Day in Churchill’s Toyshop
My grandfather, Norman Angier, worked at Churchill’s Toyshop (M.D.1) as the head civilian engineer during WWII. On VE day “Norman Angier felt it was an occasion for fireworks. He therefore acquired a large batch of quite big rockets and proc…
-
Victory in Europe (VE) Day in Churchill’s Toyshop
My grandfather, Norman Angier, worked at Churchill’s Toyshop (M.D.1) as the head civilian engineer during WWII. On VE day “Norman Angier felt it was an occasion for fireworks. He therefore acquired a large batch of quite big rockets and proc…
-
Example Android project with repeatable tests running inside an emulator
I’ve spent the last couple of days fighting the Android command line to set up a simple project that can run automated tests inside an emulator reliably and repeatably. To make the tests reliable and independent from anything else on my machine, I want…
-
Tizen on Orange Pi PC
Made some significant progress for running Tizen on an Orange Pi PC (and hopefully any other SBC with a similar Mali GPU). Main issue was that alignments in TBM (Tizen Buffer Manager) weren’t in sync with what the actual GPU driver expected. With that …
-
Tizen on Orange Pi PC
Made some significant progress for running Tizen on an Orange Pi PC (and hopefully any other SBC with a similar Mali GPU). Main issue was that alignments in TBM (Tizen Buffer Manager) weren’t in sync with what the actual GPU driver expected. With that …
-
Creating a tiny Docker image of a Rust project
I am building a toy project in Rust to help me learn how to deploy things in AWS. I’m considering using Elastic Beanstalk (AWS’s platform-as-a-service) and also Kubernetes. Both of these support deploying via Docker containers, so I am learning how to …
-
SIGCHLD si_pid Linux kernel bug
While trying to get Tizen working on my Orange Pi PC, I noticed some strange behaviour in the Linux kernel in that SIGCHLD signals sent to the parent process don’t always set the “si_pid” field correctly. I tracked this down to a bug in the Linux kerne…
-
SIGCHLD si_pid Linux kernel bug
While trying to get Tizen working on my Orange Pi PC, I noticed some strange behaviour in the Linux kernel in that SIGCHLD signals sent to the parent process don’t always set the “si_pid” field correctly. I tracked this down to a bug in the Linux kerne…
-
COVID-19 Lockdown Blues
A corner of the roof of our office building. Even though the sea is just over 350m away to the left, sadly it’s currently off-limits. 2020 is not turning out to be what we expect as – like much of the world – the UK is locked down right now as a resul…
-
COVID-19 Lockdown Blues
A corner of the roof of our office building. Even though the sea is just over 350m away to the left, sadly it’s currently off-limits. 2020 is not turning out to be what we expect as – like much of the world – the UK is locked down right now as a resul…
-
Life, the Universe and Everything
is an excellent book by Douglas Adams (isbn 978-0-330-49120-4). As usual I’m going to quote from a few pages. He would insult the universe. That is, he would insult everybody in it. Individually, personally, one by one, and (this was the thing t…
-
Life, the Universe and Everything
is an excellent book by Douglas Adams (isbn 978-0-330-49120-4). As usual I’m going to quote from a few pages. He would insult the universe. That is, he would insult everybody in it. Individually, personally, one by one, and (this was the thing t…
-
Keeping track of podcast times with a simple bash script on Linux
I was recording some podcast audio tonight and wanted to be able to press a single key when I reached a significant moment, so I could add the times to the show notes. I couldn’t find anything that already did this, so I wrote a tiny bash script. I ran…
-
The Restaurant at the End of the Universe
is an excellent book by Douglas Adams (isbn 978-0-330-49121-1). As usual I’m going to quote from a few pages. There is another theory which states that this has already happened. The story so far: In the beginning the Universe was created. Thi…
-
The Restaurant at the End of the Universe
is an excellent book by Douglas Adams (isbn 978-0-330-49121-1). As usual I’m going to quote from a few pages. There is another theory which states that this has already happened. The story so far: In the beginning the Universe was created. Thi…
-
Can a decision tree tell us about wine categories?
I previously wrote an overview showing how decision trees work: http://buontempoconsulting.blogspot.com/2019/07/decision-trees-for-feature-selection.html This time, let’s build a decision tree with some data. There are many freely available data …
-
Can a decision tree tell us about wine categories?
I previously wrote an overview showing how decision trees work: http://buontempoconsulting.blogspot.com/2019/07/decision-trees-for-feature-selection.html This time, let’s build a decision tree with some data. There are many freely available data …
-
The Hitch Hiker’s Guide to the Galaxy
is an excellent book by Douglas Adams (isbn 978-0-330-49119-8). As usual I’m going to quote from a few pages. Far out in the uncharted backwaters of the unfashionable end of the Western Spiral Arm of the Galaxy lies a small unregarded yellow sun…
-
The Hitch Hiker’s Guide to the Galaxy
is an excellent book by Douglas Adams (isbn 978-0-330-49119-8). As usual I’m going to quote from a few pages. Far out in the uncharted backwaters of the unfashionable end of the Western Spiral Arm of the Galaxy lies a small unregarded yellow sun…
-
Custom Bash tab completion for my program
I love Bash tab completion, and I want it for the command I am writing, so it can automatically complete parts of the command line when I run my program. Code Here is the script (install-bash-completion) I wrote to set it up (no need to be root – it in…
-
Invariants and Preconditions
I tend to think about invariants and preconditions a lot. Pretty much every class has invariants, and most functions have preconditions. I don’t think they are complicated concepts, but somehow they seem to confuse people anyway, so I decided it was ti…
-
Struggling with Rust to figure out the right types for a function signature
I am loving writing code in Rust. So many things about the language and its ecosystem feel so right*. * For example: ownership of objects, expressive type system, compile to native, offline API docs, immutability, high quality libraries. One of the thi…
-
Rock Pi S Review
Got a $20 voucher code for a review of a Rock Pi S SBC. Although the cost of the board is only $13.90, with shipping at just over $8, it’s a bit over $22 in total. When the board arrived, I did actually wonder if shipping could have been made a bit mor…
-
Rock Pi S Review
Got a $20 voucher code for a review of a Rock Pi S SBC. Although the cost of the board is only $13.90, with shipping at just over $8, it’s a bit over $22 in total. When the board arrived, I did actually wonder if shipping could have been made a bit mor…
-
React Concepts Video
I tried to describe the main ideas that will help you write decent React code. Maybe it will help you understand the docs a bit more when you read them… Slides: React Concepts slides