Uses of the 320 × 240 Resolution

This screen resolution is significant because its dimensions are half of the famous VGA resolution of 640 × 480, giving it one quarter the screen area. For this reason, it is sometimes called qVGA. Like VGA, it has an aspect ratio of 4:3. While there is a huge variety of screen sizes and resolutions in the wild, this resolution has been a popular choice for handheld electronic devices in the 2000s and for fantasy consoles....

Undo Systems

An undo stack and a redo stack This is the most common way to implement undo and redo. It’s used in almost everything that supports undo. Whenever you make a change, the previous state is saved to the undo stack. When you undo something, the most recent change is popped off of the undo stack and pushed onto the redo stack. Finally, if you undo some changes and then starts modifying the document, the redo stack is cleared....

NXEngine Variants

NXEngine (2010?-2014) Written from scratch by Caitlin Shaw (aka rogueeve) with the goal of porting the game to new platforms as accurately as possible. For more information about the origins of NXEngine, see this discussion by rogueeve. nxengine-libretro (2011-) A port of NXEngine to the libretro platform. It includes some fixes for bugs in the original NXEngine. NXEngine (EXL’s fork) (2013-) Forked from NXEngine in 2013. Primarily made to port the game to unusual low-end platforms like MotoMagx and Dingoo....

How to Make Vim Trigger Builds in a Terminal

In Vim, it’s easy to run builds with :make and :set makeprg, but just for fun I tried out making Vim trigger builds in a separate terminal. Though :make is really useful in general, there are some advantages of doing it this way instead: The output is separate from your Vim window. If there’s a lot of output, it won’t cover up you editing window, but you can still read it....

Plan 9

Plan 9, attempt 2. This time I’m running Plan 9 4th edition on my Raspberry Pi 3B using Richard Miller’s RPi port. This is what Devine Lu Linvega and Steve Lord did. Why plain 4th edition and not 9front? I’ve tried 9front before. Steve Lord summed up my feelings well: While [Richard Miller] saw 9Front as a fork, I’d consider significant novel innovation versus a filling the base userland with cruft as a key distinction between fork and distribution....

Annotated Bibliography of Regular Expression Engines

Cox, Russ (Jan 2007). “Regular Expression Matching Can Be Simple And Fast”. Retrieved 17 July 2020. Russ Cox demonstrates a case where a short regular expression can cause some regex engines to take an unreasonably long time to complete a search, while others can complete the search in microseconds. The article starts with the theory of regular expressions and how they can be expressed as deterministic and non-deterministic finite automata, then builds up the code of a simple regex engine step by step from there....

Make Variants

GNU Make An original implementation initially released in 19881. NetBSD Make pmake – Written in 1988 or earlier.2 Included in BSD.3 Inherited by 386BSD and then NetBSD. NetBSD has maintained it ever since. A few times, they imported changes from FreeBSD’s version. FreeBSD Make For many years they maintained their own derivative of pmake. In FreeBSD 10.0 (2014), they switched to bmake, a portable version of NetBSD make.4 OpenBSD Make OpenBSD maintains its own derivative of pmake....

Trying out Plan 9

This is mostly my thoughts on Plan 9 in general, but it’s based on my experience with 9front. I like the emphasis on empowering users to build solutions to their problems. “There isn’t a command to do that, but you can do it yourself very easily.” shell command line history roll your own: fn history {grep ‘^term%’ /mnt/wsys/text|sed -e ’s/^term%//’} 1 Emphasis on distributed computing is very cool. Heterogenous architectures...

C Libraries for Using D-Bus

libdbus The reference implementation. The API is low-level and designed to be used in bindings. The developers recommend that you use a higher-level library or binding instead. Distribution support: Everything. All Linux distros, all BSD ports distributions, Homebrew. Used by too many things to list. Here are some highlights: User applications: Firefox, Chromium, Steam System services: jack2, Pulseaudio, libvirt, BlueZ According to 1, it’s not that hard and is practical to use even though it’s low level....

Handling Interrupts in Go

This little Go program does not run the defer statement when you interrupt by pressing ctrl-C: package main import "fmt" func main() { defer fmt.Println("Shutting down...") for { } } > go run interrupt.go ^Csignal: interrupt > You have to actually trap the signal and handle it. Fortunately that’s super simple in Go: package main import "fmt" import "os" import "os/signal" var shutdown = make(chan struct{}) func main() { defer fmt....