So I’m still writing lecture notes. This time, I need to include kind of larger pieces of C or C++ code, and environments do not really help me a lot. Some are better than others, but you still have to escape and fancify text yourself. This is laborious and error-prone, and is an obvious target for automation. A script of some sort. The task isn’t overly complicated: highlight keywords, and escape symbols like { } _ and & that make
unhappy. This looks like a job for
sed.
LaTeXify C/C++ code snippets
26/01/2016Interpolation Search
19/01/2016We all know about binary search. It’s been with us such a long time. Knuth thinks it’s first appearance in print is in the Moore School Lectures, in 1946. The technique search for an item in a list by halving, iteratively, the searched portion. Its complexity is for a list of
values, making it a very efficient algorithm for searching.
One may even be tempted to think that it’s in fact optimal, that we can’t do significantly better. Is that so?
Search all your Bibtex files
12/01/2016When I write papers or other things, I tend to create separate bib files, so that I don’t end with a giant unsearchable and unmaintainable blob. Moreover, topics tend to be transient, and the bibliography may or mayn’t be interesting in a few year’s time, so, if unused, it can safely sleep in a directory with the paper it’s attached to.
But once in a while, I need one of those old references, and since they’re scatted just about everywhere… it may take a while to find them back. Unless you have a script. Scripts are nice.
A Bit About Bit-Fields
05/01/2016Let’s make a detour through low-level programming this week. Let’s talk about bit-fields and some of their quirks.