Automatically fill forms with hCard mapper

Omnia Computing’s hCardMapper is yet another example (tip of an iceberg, really) of the power of microformats. Think how quickly your users will be able to fill out your registration forms if when they have a public hCard.

I’d like to see a greasemonkey script that uses this so I can auto fill other people’s forms using one of my selected hCards.

(Via John Allsopp’s microformatique.)

Remembering syntax patterns through context

Speaking of array functions in PHP, ExpressionEngine developer Derek Jones shares a trick for remembering which order to send your arguments in when using various php search functions.

All array-related functions use needle, haystack and all string-related functions use haystack, needle.

There are certain words in the english language which no matter how many times I spell or use them, I always have to pause and wonder if I got it right. The best way to conquer such elusive patterns is by placing them in context. Derek does a nice job of illustrating the context for these PHP search functions.

Brevity and Readability

So I’m cruising along in Ruby one day, when all at once I realize I’ve stopped writing. I’m stuck. I needed to compare two arrays, and trim one so that any records in it would be removed if they existed in the other one. In PHP, one way to do this would be to loop through one array and use something like in_array to check the items in the current loop against those in the other array. This approach always felt a little verbose to me, and I was hesitant to just hack up an equivalent in Ruby.

After a little digging in the manual and perusing a few conversations, I ended up with something that might look like this:

@people.delete_if { |person| @roster.include?(person) } #short and sweet!

I gotta admit – as much as I love brevity, that is almost too short. The nice thing about some of these common control structures, and for that matter functions that are named like in_array, is that if you are careful you can write code that is almost self-documenting.

foreach ($roster as $participant) {
 
	if ($found_participant = array_search($participant, $people)) {
 
	    unset($people[$found_participant])
 
	}
 
}

That is, if you asked a stranger to just read the words in the passage above out loud to themselves, chances are they will be able to figure it out. I’m not so sure that’s the case with that beautiful little line of Ruby. Maybe it’s just me and my relative inexperience.

Speaking of readability, Henrik Nyh has a nice little piece on making your function calls more readable in Ruby.

Tags vs. Categories

The distinction between tags and categories is an oft-requested point of clarification. The question has been asked at every blog workshop I’ve run, and yet for some reason I still find myself struggling to find the best way to explain it. Well no more. In the process of posting a killer new release of his blog publishing software, Daniel Jalkut lays it out for us:

One of the things that the blogging systems of the world haven’t been able to get their story straight about over the years is whether to support tags, categories, or both. What’s the difference? In a nutshell, think of categories as hierarchical categorization, and tags as more for indexing purposes. For example, the City of Lincoln and President Lincoln both deserve the tag ‘Lincoln,’ but one belongs in the category ‘Cities’ while the other belongs in ‘Presidents,’ while both belong in the category ‘America.’

Well put. By the way, if you have been waiting to take MarsEdit for a spin, now is a good time to check it out.

Seven Days is publishing their archives

Local alt-weekly Seven Days is in the process of re-publishing their archives:

We’re starting with 2001, and working our way back. We’ll also be filling in the holes in 2002-2007. If you want to check our progress, click on the Search/Index page of our site, scroll to the bottom, and click to the last page of results. Those are the oldest stories, and they’re getting older all the time.

It certainly won’t approach the scale or depth of the material recently released by the New York Times, but I like to think this is representative of the direction papers are moving in. After all, they could have put it behind a pay wall. This is also a significant move on the part of a publication that is such a big part of the community and local culture. I’m looking forward to seeing what comes out of the Seven Days “vault”.

Burlington PHP Users Group

Matthew WeierO'Phinney Last week saw quite a turnout at the Burlington PHP Users Group meeting. The event featured a talk by Matthew Weier O’Phinney, from the Zend Framework team at Zend Technologies. The discussion was lively and informative – there was a really good mix of people there, which made for great conversation. We even had some crossover from the rails group (ok, just me and one other person – but it was nice to see a familiar face there). Here are a few tidbits that I took away from the presentation and the various discussions.

Read More »

iPhone coming to Vermont

Looks like the iPhone may finally be available in the Green Mountain State after all. The news comes as part of a wireless network swap between AT&T and Verizon. The Rutland Herald has a look at the deal and some of it’s implications for Vermont.

(Via Paul Martin‘s Twitter.)

Simply mouth-watering

Congratulations to my culinary-inclined friends at Simple Measure. They just celebrated their first blog birthday. I’m not a vegetarian, but with these creations I could imagine making the switch without skipping a beat.

Visualizing consumption

A colleague sent me a link to this nifty flash based building monitor for UVM’s new student union. It’s nice to be able to visualize resource consumption on this kind of scale, and still have it tied to something you use every day. Hopefully there will eventually be more than a months worth of data available – it would be interesting to see seasonal usage in additional to daily reports. The firm that makes the software, Lucida Design Group, has produced similar projects for other institutions.

James Bennet on frameworks (again)

James Bennet is once more talking about web frameworks. Like his previous articles on the subject, he hits the nail on the head. Wherever you are in the web development spectrum – front-end, back-end, management, all of the above – it’s worth a look.