Category Archives: Uncategorized

Hunting the wily #if

Since a reader (djmott) found some use for Stupid gcc trick #2: finding all included files, recursively …  here’s another quick trick for finding which set of nested #ifdef/#elif/… controls the inclusion/exclusion of some piece of your source file. This … Continue reading

Posted in Uncategorized | Leave a comment

Why is Quicksort that quick?

Quicksort has a reputation for speed. In school, you learn that it is O(n log n) … the optimum for all single-threaded, comparison-based sorts. In fact, when combined with median-of-three pivot selection, tiny-partition insertion-sort, and special equal-keys handling (qv Top … Continue reading

Posted in algorithm, sort, Uncategorized | Leave a comment

GMAKE cheap trick #3

What’s the shortest way to define a GMAKE var that is exactly one space? SPACE = $~ #

Posted in make, Uncategorized | Leave a comment

Quick update on ACISM

Thanks to Nicholas Sinnott-Armstrong, who suggested that the fast and compact Aho-Corasick interleaved state machine, on github could use an upgrade from 32-bit to 64-bit, to handle (say) over 40M strings — a bit beyond 32-bit ACISM’s 16MB limit. He … Continue reading

Posted in Uncategorized | 3 Comments

21st Century Programming Languages

When I was a co-op student, I programmed in a language that had lambdas, currying, user-defined operators (including assignment), dynamic compilation, and a wealth of other features. It was neat, efficient and readable. That languages was POP-2. It was written … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

“Unusual uses of SSE2” posted to github

In this month’s frenzy of putting source code out there in a usable form, I’ve posted source to github for the SSE2 implementations of string search, BNDM search, sorting [16] doubles, and bit-matrix transpose; plus some convenience tools for SSE2. … Continue reading

Posted in bit, bit matrix transpose, bit shift, ffs, SSE2, string search, Uncategorized | 2 Comments

A tiny asynchronous DNS client posted to github

There’s a world out there beyond the “bind” daemon … and this DNS client library can access it and show you how it works. This is my reference model for writing a tiny independent library plugin to another event-loop mainline, … Continue reading

Posted in Uncategorized | Tagged | Leave a comment