Tag Archives: code

Introducing Digbuild

I’d like to intro­duce Digbuild, an open-source game engine inspired by the excel­lent game Minecraft (and Infiniminer before it — that’s right, Minecraft is itself a clone). I’ve been work­ing on it on and off in my spare time for a few months now, and today I decid­ed that it’s ready to show to the […]

Boot a Kernel over Serial with U‑Boot and Kermit

I’m doing a lit­tle bit of work that involves fre­quent­ly rebuild­ing the Linux ker­nel and installing it on a head­less ARM board. The par­tic­u­lar ARM board I’m work­ing with has some ven­dor sup­port for flash­ing ker­nels, but it’s slow and clunky, and I have to run it inside a Windows XP VM. The ARM board […]

Sloptimize

hide-first-let­ter slop·ti·mize | slop·ti·mized | slop·ti·miz·ing verb To make a pro­gram run faster by decreas­ing the accu­ra­cy of its out­put. Examples of slop­ti­mize We slop­ti­mized the cal­cu­la­tions to use 32-bit floats instead of 64-bit dou­bles, and got a 20% speedup.

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

It’s hap­pened to every­one. You kick off a soft­ware installer, answer a few ques­tions about how you’d like things set up, click next and you’re pre­sent­ed with a long progress bar. “No prob­lem,” you think to your­self, “this is a good excuse to grab a cup­pa joe.” You leave the com­put­er to its busi­ness and […]

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

It’s been a long time in the mak­ing, but I am proud to announce the first beta release of cppsh, the bash-like shell specif­i­cal­ly designed for those engi­neers who find them­selves most com­fort­able at the reins of a C++ com­pil­er. The best fea­tures from both bash and the C++ lan­guage come togeth­er in cppsh to […]

C++ Streams & Typedefs: Be Charful

The C++ type­def key­word is indis­pens­able in many sit­u­a­tions, espe­cial­ly for writ­ing portable low-lev­­el code. However, in some cir­cum­stances it can cause trou­ble, par­tic­u­lar­ly when it comes to func­tion over­load­ing. Consider the fol­low­ing C++ tem­plate class: tem­plate <type­name T> struct foo­bar {     foo­bar( con­st T foo ) : foo_( foo ) {} […]

The Terror of the Long Comment

A code com­ment can be a won­der­ful thing. It can offer a gem of con­text around a quirky bit of code that will make the read­er’s life eas­i­er for years to come: // Fields c and d are inten­tion­al­ly switched in ver­sion 3 of the // pro­to­col; see RFC 2324 S 12. fields.push_back( a ); fields.push_back( […]