Reminder: Don’t Hard Code It

Today’s reminder comes from the “magic number” department, where we remind you to never hard-code a magic number in your software. For example, the value for ETIMEDOUT on Linux can vary depending on your C library. glibc, for example, defines it as 110, but uClibc defines it as 145. This tends to matter when you […]

Parkzone Habu Walk Through

My new Parkzone Habu ducted fan jet arrived in the mail this week. I put it together and provide this walkthrough for the benefit of those who have not yet purchased their Habu (hint: just do it). Stay tuned for the flight report in a couple weeks. Parkzone Habu Walk Through from djsmith on Vimeo. […]

Fancy QSlider Stylesheet

Seriously. I don’t know how I ever created a Qt user interface without using stylesheets. This was, by far, the best idea Trolltech ever had. For today’s show-and-tell, I give you a nifty-looking QSlider with some nice gradient style applied to it: The handle has a nice hover effect, the bar has a moving gradient […]

Qt Layout Squashing

I’ve encountered this problem a handful of times over the past few years using Qt’s layouts. Qt generally does a great job making sure that your Windows cannot be resized too small such that your content would be truncated. However, it seems that introducing a QStackedWidget causes a problem. These two screenshots illustrate the issue: […]

Talking to Qt Threads

I wrote about multi-threading in Qt a while back, and how to use QThread to wrap a blocking function call “lock free”. Today we’ll talk about how to pass data into your thread. This approach can be used, for example, to tell your QThread to stop. There are two ways to use QThread, with and […]

First Person Video on a Shoestring

Today my friend Cliff showed me his first-person video R/C airplane: This thing has every feature imaginable, which means it packs a lot of wires: Here’s a video tour of all its features, which include the following: Auto fly-home if control is lost (uses GPS) Heads up video display of altitude, heading, and pitch RF […]

Functional is not Procedural

I’ve recently seen some confusion about the terms functional and procedural in the software development community. Let me spend a moment trying to clear things up for (both of) my readers. First of all, just because a programming language has functions, that does not mean it is functional. In fact, its confusing name has nothing […]