Binary Rain

Most programmers young and old have seen the cyberpunk sci-fi film The Matrix. One of the most outstanding parts of the movie is the closing scene where Neo sees the Matrix when battling the Agents: The visual effect with the code running along all the surfaces is iconic. Seems other people thought so too to the point that the effect has a name: Matrix Digital Rain. Wouldn’t it be neat to create a terminal screensaver that mimicked the effect seen in the movie? ...

July 23, 2023 · 6 min

A CLI Base Converter

When debugging an embedded system, it’s common to work with raw data requiring conversion between decimal, hexadecimal, binary, and sometimes octal number systems. The Python REPL and printf shell utility do the job but are tedious to use for the simple task of base conversion. It would be nice to drop the overhead of format specifiers and fear of numerical limits. To ease the pain, I decided to write a command line utility that made conversion between positive binary, decimal, octal, and hexadecimal numbers of arbitrary size. ...

July 8, 2023 · 6 min

Huffman Coding

Implementing a Huffman Tree is a fun afternoon project for anyone interested in learning about data compression. A Huffman Tree is a type of binary tree that sees use in the compression of an arbitrary data file. Developing a command line utility to compress/decompress a file using Huffman coding is a good CS101 challenge. Breaking It Down Into Steps This project starts where many do: Wikipedia. The Huffman Coding wiki article gives a nice breakdown with examples of the data structure and associated algorithms. In particular, the “Basic Technique” section covers the algorithms for compression and decompression. You need three key data structures to implement the big Compress() and Decompress() routines: ...

July 4, 2023 · 12 min

Digital Image Steganography

There’s a neat Computerphile video discussing the topic of steganography. In the video, Mike Pound talks about a technique for steganography on digital images: least significant bit substitution (LSBS). The effectiveness of LSBS in concealing a secret image is surprising. This article puts least significant bit substitution to use in a command line tool for embedding one image within another. A Little Background on Digital Images You don’t need fancy image manipulation techniques to make this steganography tool work. That said, you do need to know a little bit about how the machine represents a digital image. ...

June 25, 2023 · 7 min

Snake in the Terminal

Are you a text user interface enjoyer? Have you always wondered how difficult is it to write an ncurses UI? What better way to find out than to write a program of your own that explores ncurses’ API. Of course, you have to keep it interesting. Why not implement a scaled down version of a retro arcade game: snake. The Rules of Snake Step one of this project is to look up what the rules for a game of snake are. Specifically, what does the play “arena” look like, how do you win, and how do you lose? ...

June 17, 2023 · 14 min

Resumes in LaTeX

Writing a resume can be a time consuming task involving many rounds of proofreading, recollection, and wordsmithing. Alongside the content, the format of a resume carries a lot of weight. Many people start out writing their resume in Microsoft Word. As their resume evolves, they begin to fiddle with settings buried deep within Words’ menus. It can become tedious. You may have heard of LaTeX. LaTeX gives you fine-grained control that, at least for a programmer, may be easier to grok than clicking through a series of nested menus. This article takes a look at a LaTeX resume template in the style of Gayle McDowell’s “This Is What a GOOD Resume Should Look Like”. You’ll also see the tools and workflow that simplify resume development in LaTeX. ...

June 9, 2023 · 6 min

GPIO Driven Synchronization

Have you ever heard of the Kuramoto Model? The Kuramoto Model Wikipedia page has an impressive video showing out of phase metronomes synchronizing: Could two or more computers synchronize in a similar fashion? What would be the common “fabric” between the machines? In the clip with the metronomes, the base board is crucial in bringing the metronomes into phase. Perhaps you could use GPIO signals to achieve a similar link between two computers. ...

May 29, 2023 · 12 min

Beaglebone Black WiFi Setup

When developing on the Beaglebone Black (BBB), it’s handy to have the board on the network for when you want to SSH into it, install packages, etc. That said, you may not want to run an Ethernet cable from the BBB to a switch. Luckily, the BBB has support for a number of WiFi adapters. I purchased the EDIMAX EQ-7811UN adapter and set about trying to connect a BBB to my local network. This article walks through the steps required to get connected. These instructions also apply to the BBB wireless variants (that is, those BBBs with a wireless chip). ...

May 14, 2023 · 2 min

Linux USB Serial Device Name Binding

Have you worked with USB serial devices on Linux? One annoyance you may have come across is device name changes after each reboot. This problem gets solved by binding a custom /dev name to a USB device. This post shows you how. To be clear, this article walks through assigning USB serial devices persistent names. If you have a USB block device and would like to give it a persistent name, the ArchWiki has you covered. ...

May 6, 2023 · 2 min

Real-time Linux App Development

If you’re an embedded systems programmer, you have likely touched on the topic of real-time operating systems (RTOS). There are plenty of commercial RTOSes available on the market: VxWorks, Integrity, DeOS, Helix, the list goes on. As a hobbyist, you may not have thousands of dollars to spend paying for commercial licenses. Real-time Linux can fill the void by providing a path to a soft real-time system. This post takes a tour through the advice given in John Ogness’s 2020 presentation: “A Checklist for Writing Linux Real-Time Applications”. You’ll explore how to optimize a Linux system and application for real-time execution using John’s real-time Linux development checklist. ...

April 27, 2023 · 15 min