Author Archive

Considering a Computer Science major? Read this first

What school should I choose? Look for a school that’s either big, or has a strong focus on providing a good CS education. Big schools offer more choice, so that you can skip or maneuver around poor teachers or take classes that might not be available in smaller schools. Undergrad-focused schools may have better quality […]

Batch organize photos by date

I wanted to get a pile of jpegs organized by the year, and then the day. For example, IMG00001.JPG would go in 2013/06-04 based on its EXIF creation date. The handy exiftool can do this, via its own virtual “Directory” tag. The “Directory” tag is not an actual EXIF tag, but exiftool will move the […]

Using bcrypt in CakePHP 2.3

CakePHP 2.3 adds native support for the bcrypt hashing algorithm, which is often recommended because of the amount of analysis that’s gone into it and its configurable cost function. Using it isn’t obvious, however. The 2.3 migration notes merely say, You can now use Blowfish in your $authenticate array to allow bcrypt passwords to be […]

Googling for bugs: hundreds of date-formatting mistakes

Here’s something really easy to screw up: [php] <?php echo date("Y-m-d H:m:s"); ?> [/php] Spot the mistake? The “m” format code can only mean one thing, which is “months”, not “minutes”. Yet, when you’re writing code in a hurry, it’s so easy to quickly write this code and assume it works. After all, it raises […]

We don’t remember your startup

Yeah, your startup. You know, the one that had the nifty HTML5 responsive launch page? The one that promised big things and nifty features? The one where we typed in our email address so we could be notified when it launched? You spent the last five months working your butt off to productionize and bugfix […]

Have you ever been computer illiterate?

If you’re like most hackers, you’ve spent so much time on the computer that the jargon and lingo have become natural. You instinctively know where the OK and Cancel buttons are, and get upset when they’re switched around for no apparent reason. You scan dialog boxes and make the right decision in a second, because […]

PHP’s wonderful pseudo-functions

There is a pseudo-function in PHP called empty, that tells you whether a variable is “empty” for someone’s definition of empty. The empty string, zero, null, and undefined variables are all considered to be empty. [php] <?php $x = null; echo empty($x); // prints "1" echo empty($nothere); // prints "1" [/php] Well, how did they […]

Fixing Minecraft on Ubuntu with OpenJDK

Minecraft! On Ubuntu! It actually runs great, once you actually get it to run, but there were two little things mere mortals can’t be reasonably expected to debug. Can’t connect to minecraft.net My Internet connection worked, minecraft.net was up, friends were able to connect just fine, but I couldn’t. Running it from the terminal via […]

Getting the Sparkfun EL Escudo to work

I’m really disappointed in Sparkfun. I recently purchased the EL Escudo shield for driving EL wire with a microcontroller, and woe be upon anybody who doesn’t do hours and hours of Internet research before plugging the thing in. There were 3 years of questions from poor customers with only a few answers, and the few […]

Ubuntu works great with the MSP430 Launchpad

I got my MSP430 TI Launchpad more than a year ago simply because of the price. It was (and still is) $4.30 (with free shipping!) for a development board, two MSP430 microcontrollers, external crystal, and USB cable. Unfortunately, Windows was the only supported OS at launch time with a couple proprietary bundled IDEs. It still […]