12.23.07

Embedding iTunes album art into MP3s

Posted in Perl, Technology, Programming at 8:19 pm by rdavis

iTunes makes it really easy to download album art for an entire music library in one fell swoop (select-all, Advanced->Get Album Artwork). It’s a little trickier to embed the artwork into the MP3s themselves (for use with other players like WinAmp). I found a perl script at Teridon’s iTunes Scripts called itunes_insert_artwork that does a nice job.

While trying it out, I noticed that a lot of the jpegs from iTunes were ridiculously large. Some were over 800K, for a 600×600 image. Not quite sure why - resaving them even at 100% quality resulted in much smaller files. So, I tweaked the script to send the images through ImageMagick first. (At quality 85, those 800K images get down to 200K.)

Here’s the script. You’ll need to have ImageMagick and PerlMagick installed. If you plan on installing ImageMagick/PerlMagick for ActivePerl, note that, currently, you’ll need the older 5.8.x version to get it to work.

05.20.07

Google navigation hack, redux

Posted in Internet, Programming at 7:28 pm by rdavis

Google just updated their navigation bar. It’s definitely an upgrade - streamlined, looks nicer, and a bunch of new links. Of course it also broke my greasemonkey script which allowed customization. So, here’s an update that should be fully working. Enjoy…

Greasemonkey Script - Customize Google Navigation Links

Update: (07.22.07)
New script to handle Google’s latest changes. Note that Google’s latest update only got applied to the main web search - for the other pages, you can still use the previous version of the script.

Update: (10.30.07)
Another new script to handle some minor changes on Google. For iGoogle, you’ll need to run the older script in addition, available here.

11.25.06

KeyFix4000: Improve your MS Natural Keyboard 4000

Posted in Technology, C++, Programming at 4:58 pm by rdavis

I’m loving the MS Natural Keyboard 4000, but it does have some issues.

First, it is conspicuously missing a Windows key on the right side. Second, there is no way to remap the back and forward buttons to act as mouse buttons. After googling in futility for a solution, I decided to whip one up myself. (After all, this was nothing a little keyboard hooking couldn’t solve.)

The result? KeyFix4000.

The mouse button mapping is pretty straight-forward - it just translates a click on the back/forward button to a click on the left/right mouse button.

The Windows key issue was a little tricky - how do you fix a key that doesn’t exist? Well, the Apps key is pretty much where the Windows key should be, and I realized I could overload it. Now, when pressed by itself, it functions as the Apps key, and when pressed in combination with another key, it works as the Windows key. This dual usage works surprisingly well.

Download executable (zipped)
Download source code (zipped)

11.12.06

Sick bugs, part 1

Posted in C++, Programming at 7:05 pm by rdavis

I’d really rather not reminisce on the sick and twisted path that led me to this one, so I’ll just present it as is:

void bar() {}

namespace foo
{
    using ::bar;
}

using namespace foo;
// namespace {}

int main(int argc, char * argv[])
{
    bar();
    return 0;
}

In VC6, the preceding block of code produces

error C2668: ‘bar’ : ambiguous call to overloaded function

and the error goes away when you uncomment “namespace {}”.
Yikes.

08.27.06

Fixing Google

Posted in Internet, Programming at 1:13 pm by rdavis

A couple weeks ago, Google decided to yank the Groups link from its search pages and hide it under a new “more »” link. This pissed off a few people (including me), but given that this was a change to core search UI of Google, I’m surprised the reaction wasn’t stronger. Maybe the extra mouse click just isn’t a big deal for most people.

For the rest of us, however, this was begging for a fix. My searching revealed a Chickenfoot script here that looked promising. Unfortunately, I found that Chickenfoot isn’t quite ready for primetime. When I set the script to run on *.google.com/*, then went to mail.google.com, Chickenfoot caused Firefox to freeze and consume 99% CPU.

At that point I knew I knew it was time to break out good ol’ Greasemonkey. A couple hours of hacking, and the problem was solved. The script is easily customizable, and by default also restores the Froogle and Books links. Let me know if you have any suggestions or feedback.

Update: Google changed a few things that broke the script. I should have an update this weekend that fixes it and makes it more resistant to being broken by minor changes.

Update 2.0: Made a few tweaks and got everything working again. As per David’s request, the script also has two new functions. hideGoogleSearchLink moves a link off the main page and into the ‘more »’ popup. removeGoogleSearchLink gets rid of a link altogether. Enjoy…

08.26.06

The future of cell phones

Posted in Technology at 12:09 pm by rdavis

T-Mobile Begins UMA Trials
Wikipedia - Unlicensed Mobile Access

This is going to be huge.