Ruby on Rails 1.0

Yesterday, Ruby on Rails 1.0 was released. It came along with a nice website redesign, too. And some teasers:

Rails 1.1 is already pretty far along in development and will see some of the biggest upgrades of any Rails release. Hopefully some time in February.

BusinessWeek somewhat confused about Java

BusinessWeek Online has an article today called “Java? It’s So Nineties” which purports to track the fall of Java from enterprise grace.

I’ve posted my own brief notes on that theme and I don’t disagree with the general thrust of the article, but it is distractingly, embarrassingly overflowing with technical bloopers. A sampling:

Java – once the hippest of hip software…

Java certainly had its moments of irrational popularity during the applet mania of the ’90s. But try to imagine somebody saying, “Hey, this Java is really hip!” (I don’t know, though, maybe the Cobol guys did say that.)

Python question: a better urlparse?

Is there a more sophisticated equivalent of urlparse.urlparse() somewhere that knows enough to break out username and password components? Ideally it would return a dict, with keys like ‘scheme’ and ‘host’ and ‘user’, instead of a tuple. Something like PHP’s parse_url().


Paul Jimenez commented on Mon Dec 12 13:09:22 2005:

I wrote http://mail.python.org/pipermail/python-dev/2005-November/058301.html about urlparse being broken not too long ago, though I have yet to present my replacement. What kind of API do you think a better urlparse() should have? Keep in mind a good solution should deal with not only http://user:password@host:port/path?query#fragment, but also tel:1-234-567-8910 and news:newsgroup and news:msgid@newsgroup. I suspect the problem with a dict instead of a tuple is standardization of keys. Or maybe that’s fine. I’d be interested in your opinion.

A minimal wiki in Django

A minimal wiki in Django

TheWiki I built a proto-wiki in Django as an exercise for learning how to make a custom template filter. It’s absurdly easy, it turns out. Per the docs I added a templatetags module; here’s all the code in it – wikitags.py:

from django.core import template
register = template.Library()

@register.filter
def wikify(value):
    "Makes WikiWords"
    import re
    wikifier = re.compile(r'\b(([A-Z]+[a-z]+){2,})\b')
    return wikifier.sub(r'<a href="/\1/">\1</a>', value)

Then, in my page template:

{% load wikitags %}
<h1>{{ page.title }}</h1>
<div class="body">
    {{ page.content|wikify }}
</div>
...

I wrote about 60 lines of Python code in total. There are much smaller wiki engines, of course, but given the flexibility and expandability offered by Django I think that’s pretty good.

Wozniak pro-open-source comments

The Stanford Inquirer has an interesting interview with Apple co-founder Steve Wozniak. The whole thing is worth reading, but what caught my attention was this little digression on open source software:

I just favor the whole concept of open source as being a way that companies can be not entrapped by proprietary software. And one thing we do find is that anytime you’re using something that’s proprietary, you do wind up being pretty trapped, as much as they can trap you.

Windows Live Local

Another Update, 2005-12-15: MS has fixed the incompatibility with Gecko-based browsers as of today.
Update: A connection at Microsoft has said that this should at least work on Firefox, and that he’s passed along my report. Hopefully fixes will be forthcoming.

Windows Live Local has potential, but it’s a total strikeout on the Mac.

(Perhaps the “Windows” part of the name should have been a clue. But if it’s really not supposed to work on the Mac, why not do some browser sniffing and send a helpful message – like “Go away”?)

Evolving a new keyboard

This is amateur science at its best. Peter Klausler, an aficionado of the Dvorak keyboard layout, decided to see if there were better permutations of keys yet unrealized:

…I constructed a complicated function that measures the amount of “work” needed to touch-type a given text with a given layout.

Very good. But where does the primordial soup of keyboard layouts come from?

…4096 keyboard layouts compete with each other. The layouts in the initial pool are entirely random. In each generation, they all race to “type” a word list, and their per-word times are multiplied by the word frequencies in the input sample. After the race, the fastest half are kept. The pool is then repopulated by generating a single mutation for each survivor.