Tag Archives: code

Introducing Digbuild

I’d like to introduce Digbuild, an open-source game engine inspired by the excellent game Minecraft (and Infiniminer before it — that’s right, Minecraft is itself a clone). I’ve been working on it on and off in my spare time for a few months now, and today I decided that it’s ready to show to the […]

Boot a Kernel over Serial with U-Boot and Kermit

I’m doing a little bit of work that involves frequently rebuilding the Linux kernel and installing it on a headless ARM board. The particular ARM board I’m working with has some vendor support for flashing kernels, but it’s slow and clunky, and I have to run it inside a Windows XP VM. The ARM board […]

Sloptimize

hide-first-letter slop·ti·mize | slop·ti·mized | slop·ti·miz·ing verb \ˈsläp-tə-ˌmīz\ To make a program run faster by decreasing the accuracy of its output. Examples of sloptimize We changed the calculations to use 32-bit floats instead of 64-bit doubles, and got a 20% speedup.

Please Don’t Request User Input in the Middle of a Lengthy Task

It’s happened to everyone. You kick off a software installer, answer a few questions about how you’d like things set up, click next and you’re presented with a long progress bar. “No problem,” you think to yourself, “this is a good excuse to grab a cuppa joe.” You leave the computer to its business and […]

Introducing cppsh: A bash-Like Shell with C++ Syntax

It’s been a long time in the making, but I am proud to announce the first beta release of cppsh, the bash-like shell specifically designed for those engineers who find themselves most comfortable at the reins of a C++ compiler. The best features from both bash and the C++ language come together in cppsh to […]

C++ Streams & Typedefs: Be Charful

The C++ typedef keyword is indispensable in many situations, especially for writing portable low-level code. However, in some circumstances it can cause trouble, particularly when it comes to function overloading. Consider the following C++ template class: template <typename T> struct foobar {     foobar( const T foo ) : foo_( foo ) {}   […]

The Terror of the Long Comment

A code comment can be a wonderful thing. It can offer a gem of context around a quirky bit of code that will make the reader’s life easier for years to come: // Fields c and d are intentionally switched in version 3 of the // protocol; see RFC 2324 S 12. fields.push_back( a ); fields.push_back( […]