Definitive instant messenger comparison

June 25th, 2009

I wanted to make an Windows instant messenger comparison that was actually useful, so I’ve built a comprehensive comparison table of features in Pidgin, Trillian Astra Basic, Trillian Astra Pro, and Digsby. I tried to stick to features that came with one of the programs or was in an included plugin.

Now it’s hard to say which one is the best because no single client has all the features, so you eventually have to choose one that meets you needs adequately.

I tried to be fair in comparison, and I ran each client to get a list of features. If you see that I misrepresented a program, or I forgot to mention a notable feature, then feel free to leave a comment.

If you missed the link:
http://sk89q.therisenrealm.com/articles/imcomparison.html

Firefox add-on collections

June 15th, 2009

With the new collections feature on the Mozilla Add-ons site, I made two of my own:

Konami Code website easter egg

May 16th, 2009

The Konami Code is a cheat code that that has appeared in a lot of Konami games. The sequence is up, up, down, down, left, right, B, and A. Now, what’s to stop you from implementing this same cheat code on your own website?

The following snippet of code will do just that. It will call konamiCode.trigger() once the sequence is done, and again for every time after. You could, I suppose, use this for a Easter egg for your website. For example, you can see an easter egg I implemented at Keiichi Anime Forever… (press @@@disco).

jQuery is required to capture key presses, but you can easily change it to not require jQuery.

var konamiCode = {
    bufferIndex: 0,
    keyPattern: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
    init: function() {
        var t = this;
        $(document).bind('keyup', function(event) {
            t.trackKey(event.keyCode);
        });
    },
    trackKey: function(keyCode) {
        if (keyCode == 16) { // SHIFT
            return;
        }

        if (this.keyPattern[this.bufferIndex] == keyCode) {
            this.bufferIndex++;
            if (this.bufferIndex == this.keyPattern.length) {
                this.trigger();
                this.bufferIndex = 0;
            }
        } else {
            this.bufferIndex = 0;
        }
    },
    trigger: function() {
        alert("Konami Code triggered!");
    }
}

konamiCode.init();

Query languages for web service APIs

May 16th, 2009

I’ve built quite a few small mashups and website scrappers in the past decade, but I’ve never really delved deeply into any API. I only needed to do things like redisplay lists, show online status messages, and other simple tasks, so the API always met my needs. However, I recently was able to get some API updates (not that there is a real published API anywhere) for Fantastic Contraption, and I updated my FC Resource website to use them. However, I noticed that, if I wanted to re-intepret the data or aggregate data in an efficient manner, a change had to be made to the API. This started a very annoying back and forth process where the API would have to be changed, FC Resource would be updated, and then I would realize that more changes were needed (perhaps for new features).

I realized that if I could just flat out issue queries in SQL to the server, things would not only be easier, it would be all more efficient because only the minimal data would be sent. Of course, since that’s dangerous, I stuck with using more and more API calls, but that brought up the thought: wouldn’t it be nice if all web APIs could be queried with some query language? Constraints and indexes would have to be taken in consideration, but it would be such a godsend.

Maybe someone should make a library to parse these queries and generate index-aware SQL, making it easy for APIs to implement their own query language. Sounds like an idea!

PhysicsGravy: apply physics to any page

May 9th, 2009

PhysicsGravy is a JavaScript library to apply physics to any element on a page with the Box2D engine. I was playing with the JavaScript port of Box2D, and this is what came out. I know it’s nothing new, but you can use this to add any element to the physics simulation easily. It also supports static objects and circles.

It uses CSS transforms, so Firefox 3.5+, Chrome, or Safari 3.1+ is required. I originally tried using relative positioning, but that was quite painful and I wasn’t able to get it to work right. I’ll try again sometime later, so IE could possibly be supported.

You can see a demo (Firefox 3.5+, Chrome, or Safari 3.1+ required):
http://sk89q.therisenrealm.com/playground/physicsgravy/demo.html

See a video of it in action (different from the previous link):
http://www.youtube.com/watch?v=iyQEtC7NXnc

To use it:

if (!PhysicsGravy.isSupported()) {
    alert("Your browser is not supported!");
    return;
}

var pg = new PhysicsGravy();
pg.makeWalls();
pg.simulateAsBoxes($('.dynamic'), 1);
pg.simulateAsBoxes($('.static'), 0);
pg.simulateAsCircles($('.circle'), 1);
var sim = new PhysicsGravySimulator(pg);
sim.start();

Get its source code:
http://github.com/sk89q/physicsgravy/tree/master