Archive for February 2008

Apple Mail filters suck

Thursday, February 28th, 2008

While I would normally use gnus/gmane for mailing lists, cygwin-apps‘s gmane gateway is read-only, so sending a message necessitates an ezmlm subscription. Unlike mailman, ezmlm doesn’t allow you to be subscribed in a “don’t send me mail” state.

So I end up with 38 emails of noise in my inbox overnight, which would be fine, except that interspersed with these are personal emails which I overlook.

One of the nifty features of M2 was its automatic mailboxes for mailing lists. IIRC thunderbird had similar “virtual folders”, and Apple Mail has a “Smart Mailbox” feature that is essentially stored filters. The only problem is, the Apple smartness is limited to a few predefined fields, and the “Mailing-List” and “List-Id” headers aren’t among them. However, you *can* add custom headers for “Rules”, but this requires a genuine folder (e.g. an IMAP folder), and by that point it’s a better policy to add the rule server-side.

So, here’s the maildrop ~/.mailfilter rule:

if (/^List-Id:.*/)
{
        exception {
                to $DEFAULT/.Lists/
        }
}

Cocoa devs fail Data Structures & Algorithms?

Saturday, February 9th, 2008

I can’t find a linked-list class in Cocoa. Yes, I do want to do middle-insertions, and I’d have a fine time amortising my sequential access to constant time. Fine; it’s not like they’re hard to implement.

The scary thing is that when searching, I blindly fell into the pool of ignorance displayed in this circa-2004 Cocoa-dev thread. To be fair, the OP was more concerned about iterator functionality than a list implementation, but most of the responses seemed oblivious to:

  • The iterator design pattern
  • The time-complexity advantages of a linked-list implementation over arrays and deques (NSArray) and hashes and trees (NSDictionary and NSSet)

(more…)

ruby-mp3info utf-8 support

Wednesday, February 6th, 2008

While apparently there are plans to improve ruby’s support for unicode, the 1.8 stdlib doesn’t make working with encodings transparent. The historically poor support has had its toll on ruby libraries, as I discovered while updating scroball.rb to do the right thing with utf-8.

It led to this patch. On the whole though, it’s of limited use. You don’t see the Id3v2 class from the Mp3Info class, so you don’t get an opportunity to set the encoding up. Even if you did, the implicit assumption that the user deals solely in iso-8559-1 isn’t comforting. Fortunately the characterspace isn’t always truncated into iso-8559-1: strings which fail the iconv transcoding get left alone.

The situation with ruby-mp3info is symptomatic of several legacies: id3v2 and its ad hoc unicode extensions, and second-class support of unicode strings in ruby before 1.9.

reStructuredText for WordPress

Monday, February 4th, 2008

I’ve previously mentioned how Matthew Scott’s reStructuredText for WordPress is a good hack for making wordpress usable. However, revision 5 from the rest-wordpress bazaar repository was broken in a few ways.

The most annoying way was that the options I’d configured up the top of the file weren’t having the desired effect. I wasted the better part of an hour in debugging until I recalled how horrid PHP scoping was. It was a simple fix.

(more…)