stephendeken.net a blog of insignificant proportions

KeyCastr 0.8.0 Released

KeyCastr 0.8.0 has been released.  Source is available on GitHub.

Diary-X Composer

Back when Diary-X was still around, I was writing a Mac OS X application I called ‘Diary-X Composer.’  It was intended to be an offline version of Diary-X, allowing you to keep a journal on your local computer, and optionally sync it to the Diary-X servers.  I designed a glossy blue book icon for it, because I seem to always do the most useless parts of application development up front.

I never actually released a finished version — I posted one disk image, once, that was a very very early alpha version, basically just using the existing Diary-X code with a custom-built version of Perl.  I did, however, put my little blue book icon on it, because I thought it looked really cool, and I really seriously have a problem with doing the useless parts first.

Anyway, a few months back, Michelle and I consolidated our web hosting accounts to a neutral hosting provider (one that neither one of us had used before): HostGator.  The very first time I logged in to our account, my eye was drawn directly to their FAQ icon:

hostgator-faq

That’s my little book icon!  It’s been doubled for some reason, apparently because there’s a lot of frequently asked questions.  Every time I log in to the admin panel it makes me smile.

You’d think I’d know this stuff by now.

I’ve been using C and C++ for about ten years now, both personally and professionally.  And yet, I’ve never encountered a specific bit of syntax that I really should already know about: bit fields.  You can specify the specific number of bits required for integer members of C structs, allowing the compiler to take care of the bit masking and marshalling for you:

typedef struct foo {
    unsigned int flag_0 : 1, // one-bit variable (0..1)
    unsigned int small_enum : 4, // four-bit variable (0..15)
    unsigned int other_index : 3,  // three-bit variable (0..7)
} foo;

This struct will be packed into a single byte (actually probably a single int), which can potentially save quite a bit of space.  You could do the same thing manually by specifiying one “flags” field and doing the bit-twiddling on your own, but the bit fields make the meaning and the code a lot cleaner.

I’m embarrassed to admit that I didn’t know this even existed until yesterday, when I had to open up the NSWindow sources to look something up.

KeyCastr 0.8.0 Coming Soon

I’m very close to finishing KeyCastr version 0.8.0. This version is a complete rewrite from 0.7.x, with improvements across the board:

I’ve already promised a few people that it would be released two weekends ago, but I wanted to let everyone know that it’s really very close to being finished and will be released soonish.

Moving a Wordpress Installation

If you’ve moved a WordPress installation from one domain to another (or just between directories on the same domain), you might find that you can’t log in, and that lots of the CSS and images are missing.

The problem is that WordPress stores a partial URL in the wp_options table, and that partial URL is used to submit the login form, among other things.  So, you can do one of a few things:

  1. Reinstall WordPress at the new location,
  2. Move the installation back to the original location and make the changes via the GUI, or
  3. Hand-edit the database to make the required changes.

If you choose option #3, there are two rows in the wp_options table that need to be changed.  The option names are ‘home’ and ’siteurl’.  Changing those will at least allow you to log in, and any further changes can be made via the GUI.