# Canonicalizing {0,1}-matrices with Nauty

Previously on this blog:

# Wolves and Sheep, with tables

Previously on this blog: “Wolves and sheep” (2019-04-17). Since April, I’ve learned that this puzzle is exactly equivalent to “What is the smallest number $t$ of rows that a $n$-column matrix can have and remain $d$-separable?” As with the “Discrete Peaceful Encampments” puzzle (2019-10-18), the answers to this question can be tabulated as a triangular matrix:

# The Story of Mel

“The Story of Mel,” Ed Nather, May 1983. I’ve always liked this story since the first time I encountered it as an appendix to the Jargon File. In 1992 Ed Nather commented: “The original submission [to net.followup] was not in free verse, nor any approximation to it — it was straight prose style, in non-justified paragraphs. In bouncing around the net it apparently got modified into the ’free verse‘ form now popular. In other words, it got hacked on the net. That seems appropriate, somehow.” (The free-verse version was already circulating sometime before November 1984.)

# Comparative TMP #1: MPL, Mp11, Kvasir, Hana, Metal

I thought it’d be interesting to take some well-known template metaprogramming libraries and show how a simple (but non-trivial) program looks, in each respective style. So here’s my first entry in that vein. I’ve solved the same problem, in roughly the same way, in five different metaprogramming libraries:

# Holiday fun with template<class> and template<typename>

Let’s start simple.

# De Canibus Britannicis

This week I’ve been reading John Caius’s De Canibus Britannicis (1570), or rather, Abraham Fleming’s 1576 translation titled Of Englishe Dogges. The most immediately notable thing about the Project Gutenberg text is that it faithfully reproduces all the spelling quirks of the original’s Elizabethan English, including the indistinction of u and v (“reuenge”, “vpon”) and even the occasional use of scribal abbreviations to save space in the column (“thẽ” for “them”; “ye” for “the”). Besides these paleographic quirks, it also contains some fun facts about dogs.

# Implementation divergence with const int i; and mutable

While teaching the other day, I had just finished talking about one place in which C++ departs from its usual no-nannying philosophy: C++ prevents the programmer from writing

# Setup and teardown routines in non-flat class hierarchies

Here’s a C++ problem where I still don’t know what’s a good way to deal with it. (But I asked on Slack the other day and got some good-sounding advice from Kevin Zheng. See further down in this post.) Consider a class hierarchy something like this. We have an abstract base class Garment, a derived class Shirt, and a leaf class DressShirt that derives from Shirt. To don a DressShirt means to first do everything you’d do to don the Shirt part of the object, and then additionally apply the cufflinks.

# Sorrows and So You Want to Be a Wizard

I’m about two-thirds of the way through Marie Corelli’s 1895 novel The Sorrows of Satan, about which I’ll probably have more to say later. (Wikipedia tantalizingly claims that this blockbuster best-seller owed its popularity “partly due to an upheaval in the system British libraries used to purchase their books,” which I suppose has something to do with the demise of the three-volume novel; I still don’t really understand it.)

# Slack’s new WYSIWYG input box is really terrible

Slack has just recently rolled out a “WYSIWYG text input” widget to its Web browser interface. (Apparently, the phased rollout started at the beginning of November 2019, but it’s just now starting to hit the workspaces that I participate in.) The user experience of using this new input method is really, really, really bad.

# Throwback Saturday: Three variants on 2048

Right around this time five years ago, I was playing a ton of Gabriele Cirulli’s HTML5 game “2048” — a game so popular that it has had its own Wikipedia page since ten days after its release (or, fourteen days after the first commit in Cirulli’s GitHub repo). “2048” spawned a ton of variants; I got particularly hooked on Baiqiang’s “Advanced 2048,” which added “x2” and “x4” tiles.

My lovely wife (who was at that time my lovely girlfriend) also got hooked on “2048” and “Advanced 2048”… but we were both a little disappointed by how the “x2” and “x4” tiles made it easier to get high scores. One day she said something like, “You should make one that has square root tiles, too.” So I cloned Gabriele Cirulli’s repo, merged in Baiqiang’s “x2” and “x4” tiles (more or less), and then added square roots. The result was aesthetically pleasing to both of us. You can play “√2048” here. …

# How to build LLVM from source, monorepo version

This is an update of my previous post “How to build LLVM from source” (2018-04-16), which is now out-of-date. LLVM has moved to a “monorepo” design instead of a collection of smaller tool-specific repositories. So this new post has fewer steps!

# Hello World with C++2a modules

Here’s how to build a “Hello world” program using Clang’s implementation of C++2a Modules, as it currently stands as of November 2019. The compiler driver interface described here is practically guaranteed to change over the next couple of years, but this seems to be how it works right now in trunk.

# PSA: <random>’s distributions are stateful

Twice in the past week I’ve run into this issue (once on CodeReview and once on Slack), so I thought I’d make a blog post about it.

# CppCon 2019 talks are up

I’ve been watching a lot of CppCon talks on YouTube over the past couple of weeks. I heard they’re going online at the rate of about seven per day.

# An unexpected brush with “strong typedefs”

Today I failed to refactor a piece of code. Simplified:

# Why doesn’t C++ have networking support?

Recently, in a discussion of the Networking TS on one of WG21’s internal “reflector” mailing lists, Bjarne Stroustrup wrote: