Software! Math! Data! The blog of R. Sean Bowman
The blog of R. Sean Bowman
January 12 2017

Here’s some code to find greatest common divisors in Knuth’s MMIX. It’s faster than published implementations I know of and does not use predicated instructions like conditional stores.

Read more...


November 26 2016

I use Emacs together with Evil mode, a combo I settled on after many years in part because of its extensibility. Not long after I started using Evil mode, I wanted Vim text objects representing C++ functions. This turned out to be a good exercise in learning about Evil mode. It also shows off the things Emacs can help you do with just a little study.

Read more...



November 22 2016

Recently I needed a way to check whether a callable C++ thing (like a lambda) could be applied to a given list of potential arguments. More precisely, I wanted to know, given a lambda f and list of arguments a1, a2, ..., an, whether the expression f(a1, a2, ..., an) would compile. I came up with a way to do it that I’m pleased with. Here’s an example of the interface:

Read more...


November 11 2016

In distributed systems a process often needs to wait for more than one of its peers before completing some action. For example, we may send a request to 5 of our peers and require that we hear back from 3 of them before considering the action completed. Even when the distribution of round trip times for a single request is pretty simple, it’s not entirely clear what the distribution of the aggregate request will be. (To me, at least; maybe if you’re smart or know statistics well it’s simpler.) In any case, we can use a histogram to get an idea of the shape of the density function.

Read more...


August 13 2016

D3 is a Javascript library for creating charts, animations, and other visualizations. It’s awesome. One of its key features is the easy creation of a DOM heirarchy mirroring some data you’ve carefully constructed for the job. Here’s a way to create a hierarchy of elements where the elements in each level aren’t necessarily homogeneous. I used this to make a table with a header column, but I’m sure it has lots of uses.

Read more...