Archive for June, 2007

MySQL Compression 6

There are a lot of instances where it’s extremely convenient to blobs of data in a MySQL database. It’s not necessarily the most efficient storage, but it definitely has convenience points.

Speaking of convenience, MySQL actually includes compression functions that you can use right in your queries, allowing you to store the data compressed, but sill have introspection abilities without any special interface. Unfortunately, however, those functions aren’t directly compatible with, say, the PHP gzip extension, so you’re stuck packing all of the compression load on your perhaps already overloaded database.

That is, until now. A few days ago I was facing this exact problem at work, and with a little goading from the DBAs (i.e., they said it was “impossible”), I determined that I’d fix it, regardless of what it took.

After a few skinny dips into both the MySQL and gzip-extension source code, I discovered that MySQL was prepending a long integer onto the beginning of the compressed string. Luckily, this is easy to replicate in PHP:

<?php
// compress compatible with MySQL UNCOMPRESS(...)
$compressed = pack('L', strlen($string)).gzcompress($string);

// uncompress compatible with MySQL COMPRESS(...)
$uncompressed = gzuncompress(substr($compressed, 4));
?>

Compression for all!

Certifiable 1

Back in May I had the opportunity to attend the php|tek ’07 conference that was put on by php|architect magazine. They included a complimentary Zend Certification Exam, which, of course, I took advantage of. I found out the other day (only about a month later!) that I’d passed. I guess I’m now official.

Before taking the test I was required to sign a bulletproof non-disclosure agreement and swear on a stack of Bibles that I wouldn’t divulge any of the contents, so I won’t say much. However, being a self-developed developer from the very beginning, I always knew that a piece of paper with a shiny seal wouldn’t change a single thing: I was either a good developer, or I wasn’t, certified or not. Taking the test only served to make me more aware of that.

So while I’m sure it’ll look pretty on my resume, I’m just not that excited.

Wii Boxing 0

Joshua (my nearly 2-year old son) just kicked the CRAP out of one of the introductory level opponents in Wii Sports Boxing. I wish I’d taken a video of it, but — unfortunately — my camera happens to be dead. I’m sure I’ll get another chance, though, since he just knocked down another guy. He’s such a boy.

Laptops and Vista 2

I found a pretty good deal on a laptop during CompUSA’s three day clearance (or some such), so I went and picked it up to replace Mindy’s aging Averatec (which has been a trusty old thing, but is, as I mentioned, getting some gray hairs). Unfortunately (or not, depending on how you look at it), it came with Vista Home Basic preinstalled.

Before buying it, I spent some time researching the downgrade clauses in the various Microsoft EULA for Windows Vista. According to everything I could find (and I’d post links if I wasn’t so lazy), the OEM EULAs do NOT include any sort of rights to previous versions of Windows, so if you were planning on that, don’t.

First impressions of Vista, however, seem to mirror what everyone’s told me: slow and annoying. The laptop came with 512MB of RAM, about half people said I’d want, so that’s part of it. But all of the confirmation popups have nothing to do with hardware.

All in all, though, after switching back to the “legacy” interface and removing the desktop background, I think it’ll be manageable. Although I am considering installing Ubuntu…

USB Rechargeable Batteries 0

I was introduced to these by a coworker, and while I haven’t tried them myself, he uses them on a daily basis to power his wireless mouse. They are batteries which are recharged using a USB port. Sure, they might not be up to USB specification-snuff (rules are meant to be broken, no?), but they’re cool nonetheless. And in my never-ending quest to carry a single power cord for all of my various gadgets, this is a huge leap forward.

RoundCube goes RC1 3

If you’re using the RoundCube webmail project and haven’t been following it’s progress very closely (so you’re like me), they released Release Candidate Number 1 last month. It claims to have fixed the annoying session timeout issues, and, while I haven’t tested that exactly over the past few days that I’ve had it installed, there seem to be improvements just about everywhere. In particular, downloading attachments no longer feels like pulling teeth.

Oh, and if you’re not using the RoundCube webmail project, maybe you should be.