Mac Mini!

Update (7/13/2005) – These seem really cool. Feel free to give me one.

I have a Mac Mini!

I’m in the process of transitioning from my old Windows XP machine to the Mac Mini. Things I’ve done so far:

Enable the root account.

Install Microsoft’s RDC Client.

Copy a whole bunch of files from my Windows XP machine to the Mini using FlashFXP, easily the nicest FTP software I’ve ever used. I connected these two machines off of the Internet so the cleartext FTP data didn’t risk yielding any of my oh-so-valuable secrets. 🙂

Switch my iTunes music library to the new computer. This was actually quite easy. I copied all the music files from my “iTunes Music” folder on my old computer to ~/Music/iTunes/iTunes Music”, and copied the “iTunes 4 Music Library.itl” file over the “iTunes Music Library” file in ~/Music/iTunes. I also copied the “iTunes Music Library.xml” file from/to the same folders, respecitvely. I tried to play a song I had purchased with iTunes, it poped up a dialog box to authorize my new computer, I entered my password, and I was rolling. To make things even better, my iPod just worked. I didn’t have to erase everything from it and reassosciate it with the new computer.

Advertisements

Bluetooth HID Devices

I’ve been playing with hidd and an Apple wireless keyboard (secC). I’m toying with the notion of making my cell phone behave like a HID device. Interestingly, I found Peter Klauser’s bthid project, which basically does the dirty work of connecting to a Bluetooth HID device and sending the keystrokes on to the kernel. It uses the uinput kernel module, while the more widely used BlueZ Linux Bluetooth suite uses a module called evdev, presumably meaning “event device.”

There really isn’t much to the bthid-0.10, which is encouraging, because I think the behavior of the HID device itself is even less complex. Well, all the circuitry inside a wireless keyboard is complex, but, assuming I have a mobile phone that has a Bluetooth stack already, the additional workload is minimal.

And what about going the other direction? Here is a really nice program I found that allows any HID-compliant Bluetooth keyboard to talk to a mobile phone. I’ve only tried the demo version, which is sufficiently limited to not actually be useful, but I am seriously considering purchasing the full version.

Update: I got to hacking on the out.c file from bthid-0.10:

This page helped me greatly.

My goal was to generate keyboard events from a program. The simplest way I’ve found to do this is through the uinput kernel module, since it just exposes a file interface at /dev/input/uinput. So apparently uinput doesn’t really want the raw scan codes from the keyboard. It wants the key codes as defined in /usr/src/linux/include/linux/input.h. This makes me happy, actually, because they’re all defined in one place and it’s fairly straightforward.

The out_event() function in out.c takes 3 parameters:

Prototype: out_event (int evt, int which, int amount);

evt is one of either EV_KEY, EV_REL, or EV_ABS (and perhaps others, but I don’t care about them right now), for keyboard, relative movement, and absolute movement. I only care about keyboard (for now anyways).

which takes a key code as defined in input.h, and amount is 1 for press, 0 for release.

Thus, this does an `ls`:


out_event(EV_KEY, KEY_L, 1);
out_event(EV_KEY, KEY_L, 0);
out_event(EV_KEY, KEY_S, 1);
out_event(EV_KEY, KEY_S, 0);
out_event(EV_KEY, KEY_ENTER, 1);
out_event(EV_KEY, KEY_ENTER, 0);

And this does an `lS`:


out_event(EV_KEY, KEY_L, 1);
out_event(EV_KEY, KEY_L, 0);
out_event(EV_KEY, KEY_LEFTSHIFT, 1);
out_event(EV_KEY, KEY_S, 1);
out_event(EV_KEY, KEY_S, 0);
out_event(EV_KEY, KEY_LEFTSHIFT, 0);
out_event(EV_KEY, KEY_ENTER, 1);
out_event(EV_KEY, KEY_ENTER, 0);

Error Correcting Codes in Java

I’m having one heck of a time trying to find some general-purpose error correcting code implementations in Java. I realize that these codes are usually written in C for efficiency reasons, but the amount of data I want to protect is small! If anyone has any pointers to free Java error correcting code (e.g., Hamming codes, Reed Solomon codes), please let me know!

Thanks!