RSSAmplifier

Blog

Julian Squires

cipht.netRSS feed ↗20 posts

Latest posts

Bug story: getaddrinfo(3) and PBR

A while ago I was working on wireless access points (APs) based on OpenWrt . One day I discovered that remote logging wasn't working, and the debugging that followed had some surprises. On OpenWrt, there's a process called logread responsible for shipping the logs to another device via the syslog protocol . These APs don't persist their logs between boots, so sending logs to a system that can…

the perils of pause(2)

I recently had a bug in a simple program that has a form I've seen a lot in the last few years: loops and signal handling without masking. The worst thing about these kinds of bugs is that they don't rear their heads immediately – they fall into the class of "huh, it's blocked in a syscall and I'm sure it should have woken up" bugs. Let's look at the problem and then how to lint it. 1. A…

worried by wordexp(3)

The function wordexp(3) is a POSIX C standard library function which performs "word expansion like a POSIX shell". wordexp(3) combines the safety of elaborate string parsing in C with the efficiency and robustness of invoking the shell on arbitrary user input. Why does it even exist? And why shouldn't you use it? 1. usage Probably the most legit use is by init -style programs executing a command…

Some talks

Over the course of 2016 and 2017, I gave a few talks in public. I wanted to link to all of them, in part because it forces me to release the slides and code associated with them, but also to say a little about the value of public speaking and putting oneself out there. Like many people, I have a hard time putting myself in front of people and exposing myself to criticism. (I've also spent a lot of…

Fixie tries

tl;dr: Here's a trie you probably don't want to use, but you might find interesting: an x86-64-specific popcount-array radix trie for fixed-length keys. The code (in Rust) is on GitHub . In which I discuss a slightly-hackish minor trie variant, the fixie trie . There are already so many kinds of tries 1 : PATRICIA , Judy array , hash array mapped trie (HAMT) , crit-bit , qp-trie , poptrie , TRASH…

Building shells with a grain of salt

The shell is at the heart of Unix. It's the glue that makes all the little Unix tools work together so well. Understanding it sheds light on many of Unix's important ideas, and writing our own is the best path to that understanding. Earlier this year, at a place I worked, I decided to run a series of workshops on writing a Unix shell. A lot of questions had come up that I think writing a shell…

Return to the Source

If a system is to serve the creative spirit, it must be entirely comprehensible to a single individual. — Dan Ingalls I saw Ellen Ullman speak last night, about her new book , 1 and the topic turned to culpability for Y2K, systems that people never expected would run for decades, and systems that no one understands any more. When a Peterborough nuclear facility reached out to retrocomputing…

Are Jump Tables Always Fastest?

tl;dr: I make a petty point about premature optimization; don't go out and rewrite your switch statements as binary searches by hand; maybe do rewrite your jump tables as switch statements, though. A couple of years ago I got into an argument in a job interview. In this case, the question was how I would implement dispatch for a protocol handler efficiently, and my answer was that I would write…

When is an Erlang iolist an iovec?

While trying to improve the performance of JSON encoding in an Erlang application last year, I came to wonder about the different representations one can use when writing data to disk or sending it over a socket, and how they map to the OS's underlying facilities. In Erlang, there is a convention of deferring the creation of large binaries, whereby functions accept a list called an iolist,…

#1GAM February 2015: ZooKicker

One who makes no mistakes never makes anything. It's Nuit blanche à Montréal , three in the morning, but I'm not out in the city, surrounded by revellers; I'm at home, hunched over an aging Thinkpad, asking myself, "Is this a game? Can I release this?". I tweak another detail, and blaze through the game's three stolen levels again, prolonging the inevitable. It's #1GAM time again. How did I end up…

#1GAM January 2015: Balloon Spite

Want the game? Here's the ROM . Press B to flap. Hit L or R in the select screen to choose an alternate palette. START skips most screens. In December, I found out about One Game a Month (abbreviated #1GAM), which is a kind of personal challenge to finish and release one game every month for a year. (I am no stranger to ridiculous personal challenges .) I read Christer Kaitila's blog post about…

Papers We Love Montreal Followup: Procedural Modeling of Buildings

(I organize a meetup group which is the Montreal chapter of Papers We Love ; we meet monthly to discuss a paper or papers someone loves, to help bridge the gap between industry and academia for working programmers. This is a followup to the last meetup, where I talked about the paper Procedural Modeling of Buildings .) 1. On questions There were some very good questions during my talk, but I think…

ILC2014 summary

When I heard that the International Lisp Conference (ILC) was happening in Montreal this year, I got very excited. Actually, I started making ambitious plans for a paper to submit and a talk to give, against which the rest of my life conspired, but I certainly registered as soon as registration opened. I've always wanted to go to ILC (and ECLM and so on), but having it happen in the city in which…

Headless Testing of OpenGL Software

I've been resuscitating an old game I wrote in C; at the same time, I've been involved in a major refactoring effort for a client, which resulted in me rereading Michael Feathers' excellent book, Working Effectively with Legacy Code . Inspired by Feathers, I decided I would like to try to get 95%+ code coverage before I made any major changes to it. I'm planning to write more about testing and…

The boustrophedonic madness of space-filling curves: ICFPC 2012 postmortem

The programming contest associated with the ICFP conference is, in my mind, the most prestigious programming competition currently running. The lack of restrictions compared to many competitions is an indication of its difficulty: anyone can enter, on teams or alone; almost any language is permissible; and the task changes several times during the competition. Many years I have promised myself…

A static blog compiler in emacs

Back in the mid-to-late '90s, I had a hideous homepage on geocities or something similar; in dark blue text on a black background, serving no purpose, as was the style of the time (but at least it was Lynx friendly!). Anyway, at the time, it seemed logical to me that one should statically compile such sites, using templates to insert uniform headers and footers. So, I implemented my own with m4…

Shred for Satan initial release

Here's a little GTK-based metronome I wrote for Kyla to practice the Molt material. It was created because the material contains a lot of meter and tempo changes, which are hard to practice with a conventional metronome. So this one reads key, meter, and tempo changes from a MIDI file. Since we prepare all our scores with Lilypond , we have MIDI files that include all the requisite information. It…

A kernel driver for legacy Wacom serial tablets

Update (14/08/20): It looks like this driver will be included in Linux kernel 3.17, thanks to the labors of Hans de Goede. It should no longer be necessary to use the version linked here. Update (12/03/27): There is a new version of this driver available, which includes a patched version of inputattach , here . This includes support for PenPartner tablets. For Intuos tablets, look here . Having…

Molt live, July 21st

My eccentric death metal band, Molt , will be playing Barfly on July 21st. Further details to come soon — keep an eye on the feed at molt.ca or the event page on last.fm .

Anaphora 0.9.4 released

Just shy of the fifth anniversary of the last release, anaphora 0.9.4 has been released. This release is mostly some accumulated minor bug fixes, though it also adds ALET and SLET . Anaphora is an anaphoric macro package for Common Lisp, allowing code like this: ( define-binary-type array ( type count ) ( :reader ( in ) ( aprog1 ( make-array count :element-type type ) ( loop for i below count do (…