Ken Kinder's personal website

Android, Google Maps, Navigation, and Open Source…

UPDATE: The details of this article are now moot, as the latest Google Maps application on the Android Market includes navigation on the G1.

OF COURSE when I saw that someone on the Interwebz managed to get the new Google Maps with navigation running on a G1, I almost wet myself with excitement. Normally this app only runs on the new Android 2.0 phones (namely, Droid from Verizon) and even rooted G1 are still only running Android 1.6. The instructions call for basically replacing the entire build properties on your phone with the Droid ones.

Read more »

How to fix NiftyCube IE 8 width problem

At work we use this tool called NiftyCube to round corners of elements (it even works with divs that have gradients in them). The problem, however, is that on Internet Explorer 8, 100% width divs are shrunk to the contents of the div.

Read more »

CherryPy v. Pylons

Over various pints of beer, emails, and late-night twitter tweets, I’ve alone and with others wondered about whether a smart, well-adjusted programmer would use Pylons or CherryPy for all his web programming needs (and whether such a programmer would take the time to convert from CherryPy to Pylons). Pylons is newish to me, but I’ve been using CherryPy (on and off) for years now. What troubles me about CherryPy is that despite all those years of experience, there are still parts of CherryPy I struggle with (and not just this horrible while-true-except-pass loop). Here are my partially collected thoughts. I’ll start with what bugs me enough about CherryPy for me to seek alternatives.

Read more »

Patch for meld to show multiple comparisons

I really like meld as a visual diff tool, but I wanted to have have it show multiple comparisons at once from the commandline. In the GUI, you can create multiple tabs for multiple comparisons, but there is (was) no way to do it directly from the command line. So, I wrote a patch that lets you use it like this:

meld spam.orig spam.mine - eggs.orig eggs.mine - pants.orig pants.mine

The usage is the same as it was before, but now you can specify multiple comparisons, separated by “-”. We’ll see if the patch is accepted; I posted it to the mailing list. In the meantime, you can download it here.

My first YouTube video…

MySQL (MySQLdb) sessions on CherryPy

No such module existed, so I wrote one. Using it is pretty simple:

Read more »

Making httplib log debug information

As opposed to having it print to stdout. Here’s how…

Read more »

Worst lock acquisition code ever.

Courtesy of CherryPy:

while True:
    try:
        lockfd = os.open(path, os.O_CREAT|os.O_WRONLY|os.O_EXCL)
    except OSError:
        time.sleep(0.1)
    else:
        os.close(lockfd)
        break
self.locked = True

Really people, really? We silently loop until an error goes away? Really?

The Wordy Shipmates

In the unplanned spirit of Thanksgiving, I recently finished Sarah Vowell’s The Wordy Shipmates. Written as a cross between a history book and a mémoire on the Massachusetts Bay, it’s so-named as a commentary on the Pilgrams’ verbose writing style. Vowell has a bookish snarkiness that makes the book worthwhile. Read it.

Decorating your methods

You can read about Python Decorators in the PEP like I had to, or you can just skip to the good stuff.

Python decorators are a way of modifying a function, of quickly wrapping it. They’re sort of like aspect-oriented programming, in that they let you define logic that cross-cuts methods all over your program. Here’s an example that takes a method that returns a list, and converts that list to a CSV file.

Read more »