Posts tagged: PROGRAMMING

Software for determining image similarity?

This is a lazyweb request – I’m looking for something but I don’t even know if it exists. I have about 200 photos (headshots) and I’d like to make an animation that runs through them in order of, for lack of a better term, visual similarity. I’m not talking about morphing or just fading between the images in arbitrary order. Is there software out there that, given a reference image and a set of images to select from, can choose the most similar image? Open source would be best, as there’s no budget for this, and command-line-only is fine, but I am on a Mac.

Johnny can too code

David Brin, in a piece at Salon.com entitled “Why Johnny Can’t Code”, complains:

almost none of the millions of personal computers in America offers a line-programming language simple enough for kids to pick up fast

Maybe Apple’s marketshare is so small that they equal “almost none,” but all OS X Macs come with Python and Ruby among other options. But wait, Brin seems to have heard of some of these newfangled scripting languages:

A MAC address regex

Today I worked on a form and script used for registering users on a restricted-access wireless network. Here’s a nice compact regex for checking that MAC addresses have been entered in the correct format. (If you’re using this in a double-quoted PHP string, escape the “$” with a backslash.)

/^([0-9A-F]{2}:){5}[0-9A-F]{2}$/i

Bjoern commented on Mon Jun 4 09:09:14 2007:

Hi,

great regex! exactly what I was looking for.

It only does not match lower case also the windows output of ipconfig/all (using a dash as delimiter) is not covered

Rails security hole hullabaloo

Oops So, a serious security hole in Rails was announced this week. There’s a lot of bashing going on about “security through obscurity.” I’ve always understood STO as sustained secrecy about known (or possible) vulnerabilities, which seems different from the Rails team’s provisional waiting period between the initial announcement and the full disclosure. (And the patches themselves told the story, for those familiar with the source.)

Not that there weren’t legitimate problems with their patch release process. They definitely made mistakes they can learn from.

TextMate update

A new “bleeding edge” version of TextMate appeared this evening, featuring extensive improvements to the bundle infrastructure. (If you’re not sure what this means, read my earlier post on how bundles are the heart of TextMate’s stupendousness.) Allan Oddgaard has put a lot of thought into the balance between distributed bundles and user customizations, and has developed some really elegant solutions that allow you to benefit from improvements in the bundles (some of which move at a rapid clip thanks to motivated community developers) while retaining your specific customizations.

Enforcing Style

Browsing some programming blogs this evening I came across Ken Arnold’s provocative “Style is Substance” post from October 2004. In it, he argues that coding style variants should be eliminated by including style in the language definition:

…the only way to get from where we are to a place where we stop worrying about style is to enforce it as part of the language.

This isn’t that shocking to Python programmers (perhaps that’s why he mentions Python twice in his list of “mature” languages?). Python enforces whitespace style. To me this is one of the great joys of working with Python – my code from two years ago, or somebody else’s code in an open-source project I’m looking at, uses exactly the same indentation “conventions” that I do – because they’re not conventions, they’re requirements.

Dabble DB

I can’t remember the last time a software demo made me involuntarily say “holy crap” so many times. In a good way, I mean.

Dabble DB, in case you haven’t heard of it, is a browser-based database exploration/development tool. The interface alone is inspiringly clear, elegant, and rich. And then there’s what it actually does with the data. We’ve all done these things, but we’ve had to do them in much slower, more laborious ways.