Wishful Coding

Didn't you ever wish your
computer understood you?

Top 5 multi-protocol IM clients for Mac

Among the few applications I use constantly is my IM client. Just like my web browser, I constantly seek better and faster IM applications. With browsers there are a few big ones and everyone knows them, for IM on Mac however, you have to take a close look to find something that suits your needs. Since I've done a lot of this searching, I'm going to do a list of my favorites. If I missed your favorite, pleas leave a comment.

Top 5 multi-protocol IM clients for MacAdium

One of the most used IM clients on Mac. Adium is an application based on the same technologies that power the popular Pidgin client, but offers a native Cocoa interface and a wealth of plugins and customizations, listed at their extras pages. The 1.4 beta supports some additional cool features, but due to a lack of manpower is still not done. I recommend using the beta, as it is quite stable.

Top 5 multi-protocol IM clients for MaciChat

The chat client included with Mac OS X, it supports only the XMPP and AIM protocols, but I consider it one of the best if you don't need other protocols. It is possible to use other protocols via a XMPP transport, but this very is unreliable at times.

Top 5 multi-protocol IM clients for MacTrillian

Is a well known Windows client that has recently released an alpha version for Mac. It is not very feature rich yet, but it looks and works nice so far. One downside of Trillian is that it stores your credentials in a central account on their server, one of the upsides of Trillian is that it stores all your credentials in a central account, which is cool if you use Trillian on multiple computers/phones.

Top 5 multi-protocol IM clients for MacPidgin

This app is mainly aimed at Linux and Windows users, but with a little help of my previous post you can get it to work on Mac quite nicely. It uses the same technology as Adium, but due to a broader audience it might offer some features not currently present in Adium. Only use this if you know you need it, Adium has a nicer interface on Mac.

Top 5 multi-protocol IM clients for MacYahoo Messenger

Contrary to what you might think Yahoo also supports WLM, provides a good Mac look and a full set of features, unlike some other branded clients. It's not the ideal thing though for the real IM diehard.

Conclusion

I'd go with Adium if you're a regular user, or iChat if you don't need any of those networks. For the experimental people, Trillian and Pidgin might be good options. For the social network people it might be worth waiting for Raindrop or Digsby. For the WLM oriented minds, the official WLM client, Mercury and aMSN might be of interest.

display: inline-block; tricks

In most cases where you want to have a set of items on one row, you use floats to make things work. The truth is, floats are not meant to do this and they create all sorts of strange behavior, even in good browsers if you don't know what you're doing. This article tells an interesting story on how you could use inline-block in all major browsers. I want to add a few tricks to the mix I learned in the past few years. Use case 1: You want a horizontal menu with more items than fit on the screen, but with a flexible width. Floats are not up to the job; They would just wrap to the next line instead of creating a scrollbar. Use case 2: You want to center something vertically. You could use a mix of position and margin statements to achieve this, but not if you don't know the width and height of the object. Since the elements are in the text flow now, we can apply text-specific CSS! The first example is achieved by setting whitespace: no-wrap; and overflow: auto; which makes all the items stay on one line and create a scroll bar. The second example is achieved by adding ‌ before the item to make it behave like a real line of text, that has vertical-align: middle; applied to it.

Examples

Control the mouse with a joystick

When I made PyMouse I did so because I had the idea to make an iPhone mouse. Today I had another crazy idea for moving the mouse: with a joystick! It turns out it's quite easy to use the joystick via PyGame, so that is what I did this evening. I plugged in the joystick from my brother, copied some PyGame example, imported my own PyMouse module and here is the result. You might need to tweak it a little to make it work with your joystick or game controller.
import pygame
from pymouse import PyMouse
from time import sleep

# edit this to reflect your joystick axis and buttons
action = {'x':0, 'y':1, 'multiplier':3, 'left':0, 'right':1}

pygame.init()
j = pygame.joystick.Joystick(0) # first joystick
j.init()
m = PyMouse()
print 'Initialized Joystick : %s' % j.get_name()
state = [0, 0]
try:
    while True:
        pygame.event.pump()
        sleep(0.1)
        # check if any button state has changed and change mouse state accordingly
        if j.get_button(action['left']) and not state[0]:
            state[0] = 1
            print "left press"
            m.press(*m.position())
        elif not j.get_button(action['left']) and state[0]:
            state[0] = 0
            print "left release"
            m.release(*m.position())
        elif j.get_button(action['right']) and not state[1]:
            state[1] = 1
            print "right press"
            m.press(*m.position(), button=2)
        elif not j.get_button(action['right']) and state[1]:
            state[1] = 0
            print "right release"
            m.release(*m.position(), button=2)
        
        x, y = m.position()
        m.move(
            # get_axis returns a value between -1 and 1
            # fumble a bit here to reverse axis
            x + (j.get_axis(action['x']) * 50 * abs(j.get_axis(action['multiplier']) - 1)),
            y + (j.get_axis(action['y']) * 50 * abs(j.get_axis(action['multiplier']) - 1))
        )
except KeyboardInterrupt:
    j.quit()