Archive for October, 2008

Charging your iPhone on the go

Posted on October 29th, 2008 in iPhone | 1 Comment »

The Kensington Mini Battery Pack for iPod and iPhone

So I’m planning a 2 week trip to Korea, and I know during the course of my trip I’ll probably be watching lots of video on my iphone, potentially siphoning off internet for my MacBook, and reading my Google Reader when I can. All of that would lead to the quick demise of my iPhone’s battery life – with no AC outlet in sight. To remedy this I’ve been planning to get an external battery pack – something like the Kensington’s Mini Battery Pack ($50) [inset left].

The other day, however, I was at the local Duane Reade (popular NYC pharmacy chain) and came across this in the $10 discount bin [inset right].

Energizer Energi To Go Portable Power for iPod

It’s called the Energizer Energi To Go ($10?) and what is basically does is recharge your iPod via two double-A batteries. Although the packaging only advertises charging iPods, I took the chance and bought it considering all the connectors are the same. Sure enough it works great! I’ve only tested it out twice but I dig it. Here’s the pros and cons:

Energizer Energi Pros

  • It’s cheap. Judging from the condition of the packaging this things been around for awhile, and I’m pretty sure I’m not the only guy that’s never heard of it. I mean, Energizer, making an iPod accessory? It even comes with a free pair of batteries.
  • It’s easy to charge. You can get a small box of double-A’s anywhere and in most countries I assume. I could go camping for days and still be able to make calls and get online.
  • It’s small. Easy to slip in a jacket pocket if you know you’ll be needing it. It folds compactly when you’re not using it and also serves as a stand when you are. Here’s an unoptimized WMV movie (6MB) from their site showing the folding action. Additionally the device has a coin-operated screw area so that you can expand the dock to fit larger or smaller devices.

Energizer Energi Cons

  • It’s a little wasteful. And probably worse for the environment. A set of batteries can charge an iPhone about 1.2 times before being emptied.
  • Long charge time. Takes a good couple of hours to charge.
  • Dock can be a little fickle. I’m not sure whether it only happens when the batteries or low but sometimes my iPhone beeps / vibrates constantly as if it’s constantly getting unplugged and replugged.

Overall, I definitely think the pros outweigh the cons, especially for my case where I’m not going to be using it much. I’ve got an iPhone dock ready at home and work so the only time I need it would be when I’m away from both places for longer than a day. The charging time isn’t so bad either since I can charge and use it at the same time (I only wish it could somehow dock horizontally for MovieTime™.)

This marks the end of my review, so if you have ten dollars burning a whole in your pocket go to your local Duane Reade store and try to pick one up!


Posted on October 27th, 2008 in JavaScript | 11 Comments »

I noticed that JavaScript has a String.fromCharCode for decoding a sequence of numbers to Unicode values but no String.toCharCode for doing the reverse. So here’s my rendition:

String.prototype.toCharCode = function(){
    var r = '', string = this.split('');
    for (var i in string){
        r += String.charCodeAt(string[i]) + ',';
    return r.substr(0,r.length - 1);
// returns "98,111,98"

Update: version from my good friend Takashi and link to his blog on why it’s more efficient:

String.prototype.toCharCode = function(){
    var str = this.split(''), len = str.length, work = new Array(len);
    for (var i = 0; i < len; ++i){
        work[i] = String.charCodeAt(str[i]);
    return work.join(',');
// returns "98,111,98"