Liking jQuery

jQuery I’m not trying to cop out of learning actual Javascript, honest. My copy of the DOM Scripting book is on its way and I’m sure I’ll learn a lot. And I like almost everything about Javascript (except the curly braces and semicolons). I still remember reading an article by Simon Willison several years ago which demonstrated techniques for standards-compliant and elegant use of Javascript. Like many who lived through The Great DHTML Frenzy circa 2000, I found this idea completely shocking at the time. Now it’s finally sinking in.

Two new Django-powered sites

One of the neat things about PyCon, even for those of us who aren’t attending, is that people save up goodies to announce and release during the conference. Django is certainly a hot topic at this year’s PyCon, and as of today at least two significant new Django-based sites have launched:

One is CheeseRater (great name!), from Jacob Kaplan-Moss, a quick-rating system for items in the Python community’s official package index, the Cheeseshop. In other words, if you think PyOMFG is the greatest module ever you can vote it up, and if you notice that PyFlockOfSeagulls hasn’t been updated since 1992 you can vote it down. The Cheeseshop is one of several pieces of python.org that I’ve thought could benefit from the application of some crowd wisdom; Jacob gets a prize for taking action. It will be interesting to see how this evolves.

Neat Python hack: infix operators

I came across this neat Python hack on reddit today, a technique for defining arbitrary infix operators. Not overriding + or >> et al., but creating keyword-style pseudo-operators that… well, the code is probably as clear as any description I could come up with:

class infix(object):
    """
    Clever hack (slightly modified) for defining infix operators. 
    Via http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/384122
    Intended for use as a decorator.
    
    >>> @infix
    ... def removing(str, chars):
    ...     for char in chars:
    ...         str = str.replace(char, '')
    ...     return str
    ...
    >>> print 'Hello, world!' |removing| 'eo'
    Hll, wrld!
    """
    def __init__(self, function):
        self.function = function
    def __ror__(self, other):
        return infix(lambda x: self.function(other, x))
    def __or__(self, other):
        return self.function(other)
    def __call__(self, value1, value2):
        return self.function(value1, value2)

Some people hate this kind of stuff. That’s why we call it a hack, to indicate that we don’t think it’s a great building block for your missile control software. Some of Those People still get their underoos in a bunch regardless. But you have to admit it’s damned clever.

iPhone, youPhone, weallPhone

Apple and Cisco have reached an agreement on the disputed “iPhone” trademark, and – surprise – Apple gets to keep using it. From the Cisco press release:

Under the agreement, both companies are free to use the “iPhone” trademark on their products throughout the world.

To further differentiate brands, the Apple iPhone will also be known as “the real iPhone”, with the Cisco model being referred to as “Oh, I thought you meant the other one.”

Dreaming In Code: The Interview

Dreaming in Code Over on the Well we’re having a discussion with Salon.com co-founder (and longtime Well member) Scott Rosenberg about his new book, Dreaming in Code. The book follows the Chandler project – conceived as a radical reinvention of the personal information manager – from its inception in 2002 through… well, through multiple stalls and restarts that lead not to a triumphal “Rocky of software” finish but to our embedded journalist moving on after deciding he just can’t wait any longer. Oddly, this a more satisfying ending; more honest, more interesting, and, for most programmers, more painfully familiar. It’s a postmortem on a project that hasn’t actually died.

An IRC-specific Django FAQ

When I’m doing Django development work I sometimes find my way to the #django channel on freenode.net to exchange advice. As has been the case on the Interweb since ancient days, certain Questions are Frequently Asked there, so I decided to try the experiment of making a FAQ specifically addressing those questions. Hopefully it won’t be too redundant of other material in the wiki – but if it is, I’m sure the group refactoring intelligence will take care of it.

Meta-roundup of Javascript libraries

I was working on a sharp little post about the bewildering array of available Javascript libraries and how I had almost become resigned to collecting lists-of-lists-of-libraries for future analysis. Then, while I was mulling this over, a neato Javascript library demo I was running crashed Safari, taking my post with it.

Lesson 1: I will remember to always use “Edit in TextMate” in the future.

Lesson 2: I won’t get too excited about cramming my pages full of Javascript.