Wednesday, September 24, 2008

Reading the iPhone

The iPhone has a wonderfully clear, hi-rez screen, and seems a perfectly usable platform for ebooks -- not as good as the Kindle, but better than the Palm V on which I once read "Don Quixote."

Sadly, Plucker hasn't been ported to the iPhone yet, putting it somewhere behind the 1999 Palm V in functionality.

There are a plethora of eBook readers available for download from the App Store. Most of them cost money; Stanza is one of the exceptions. It's got some decent books available for download, and the library interface is only moderately wonky, but... but. The book reader is TERRIBLE. Rendering takes minutes--not downloading, but rendering--and tilting the screen triggers a complete re-render, meaning that any accidental tilt interrupts your reading for 2-3min. Completely unusable.

The best book reader I've found is the iPhone's built-in PDF viewer, accessed via Air Sharing, an app that was free a week ago but now costs $6.99. Air Sharing allows you to connect to a network share on your iPhone via WebDAV, which initially sounds only mildly interesting, until you realize that files within that share can be opened for viewing on the iPhone.

PDFs rendered this way open fast, rotate even faster, and the viewer state--ie, which page you're on--is saved between Air Share sessions. It would be perfect were it not for the sometimes screen-unfriendly nature of PDFs.

Text and HTML files can also be viewed, and the Text viewer retains state, but render times are prohibitive.

Wednesday, September 17, 2008

Sync'ing Google Calendar w/ the iPhone

Do we have a word for the relationship milestone marked by my sync'ing my girlfriend's Google Calendar with my iPhone?

It's pretty easy to do, at least on a Mac.

Tuesday, September 9, 2008

A loathsome and indefensible lie

From Livejournal, by way of Pharyngula:

The theory of childhood, also known as child origin, is a damnable, loathsome and indefensible lie. How can any thinking person suppose all humans used to be babies once? ...
The development of children has been well-researched in our six-month study following a sample of one thousand children and adults of various ages. We have conclusively proven that while there are minor changes in features like height and body fat ... incontravertibly still every creature in the study that started out as a child had only slightly more adult features at the end of the observation period than at its beginning.

Monday, September 8, 2008

Two patched protein subtypes and a conserved domain of group I proteins that regulates turnover.

I'd almost forgotten about this:

Two patched protein subtypes and a conserved domain of group I proteins that regulates turnover.

Kawamura S, Hervold K, Ramirez-Weber FA, Kornberg TB.

Biochemistry & Biophysics, University of California, San Francisco, CA 94158.

Patched (Ptc) is a twelve-cross membrane protein that binds the secreted Hedgehog protein. Its regulation of the Hedgehog signaling pathway is critical to normal development and to a number of human diseases. This report analyzes features of sequence similarity and divergence in the Ptc protein family and identifies two subtypes distinguished by novel conserved domains. We used these results to propose a rational basis for classification. We show that one of the conserved sequence regions in the C-terminal domain of Ptc 1 is responsible, at least in part, for rapid turnover. This sequence is absent from the stable Ptc 2 protein.

Wednesday, September 3, 2008

Levenshtein distance

A Levenshtein distance, or "edit distance," is a measure of the similarity of two given strings as embodied in the number of changes--insertions, deletions, or substitutions--required to transform one string into the other.

This is an incredibly useful tool for grouping and ordering strings, and in particular, non-language strings -- we already have a convention for ordering words in English, but if you're staring at 200 protein sequences, alphabetic order doesn't do anything for you.

There's a fast C implementation of the Levenshtein algorithm and though it doesn't seem to have a proper project homepage, it can be found in the Pootle & Translate Toolkit.

I needed to add a wildcard parameter to the Levenshtein algorithm so that the distance between, eg, ABC and AXC is 0, given that 'X' is the specified wildcard character. (Normally, the Levenshtein distance between "ABC" and "AXC" is 1, of course: it takes one substitution to turn one string into the other.)

So I did.

Before I attempted to modify this C version, though, I put together a simple, unoptimized Python version, and the difference in performance was shocking. On my test data set, the C code took 0.3s to run, and the Python version took ... over 3 minutes. It was over 1000x slower.

After adding the couple of if statements and loops necessary for the wildcard code, the C code slowed to 1.2s.