Monday, April 30, 2007

The real reason we love dogs. - By Jon Katz - Slate Magazine

The real reason we love dogs. - By Jon Katz - Slate Magazine: "It appears that dogs have evolved specialized skills for reading human social and communicative behavior"

…My belated response to a discussion of dog intelligence.

Segway | Concept Centaur

Segway | Concept Centaur

fun as hell looking concept vehicle. video is lots of fun if you can get it to play (i had to pull the url out of the source http://video.segway.com/video/conceptcentaur.wmv )

Friday, April 27, 2007

Cat House (EFBC/FCC) Home Page

Cat House (EFBC/FCC) Home Page

How cool is this, if you shop at Ralphs you can have them donate 4% of your purchases to The Exotic Feline Breeding Compound's Feline Conservation Center. Presuming you can find your card (I filed mine away when I realized you can just plug in your phone number), all you have to do is fill out Participants Enrollment Form.

We're not gonna make tomorrow's Twilight Tour, but we're making plans for the June 16th event if anybody wants to carpool (it's a little ways out of town).

Wednesday, April 18, 2007

Passing Arguments To Modern Event Listeners And Firing Onchange Events For Fields That The User Doesn't Change

I've been learning more about prototype.js, and have today solved two long outstanding JavaScript challenges. I'm sure many others have already solved these problems, but I hadn't yet, so here they are.

Up to this point I've not used modern event handling to any great degree. I've got a fair understanding of the right way to do it and the IE way to do it, the problems with the differences in bubbling, etc. But what I hadn't seen before is a way to pass an argument to a function attached in this manner, and without that I had dismissed the whole premise as pretty useless. But to the rescue come anonymous functions, allowing you to pass a reference to a complex function as a function.

I'm no good at explaining this stuff, here's an example using prototype's event handling (feel free to use your own, the arguments are pretty constant):

Event.observe(window, 'load', pageLoaded, false);

That calls the function pageLoaded() when the document renders. But what if you want to pass an argument, or call multiple functions. Here's how:

Event.observe(window, 'load', function() { pageLoaded(); console.log("it worked!"); }, false);

(That's assuming that you have Firebug installed, otherwise replace console.log with alert)

My second issue is how do you observe a change in the value of a field when the user does not change the field directly? When JavaScript changes the value of a field the field does not trigger its onchange event. A common example of this is when somebody updates a date field using a popup calendar widget. In the past I would have had the calendar widget manually fire the onchange event, but that's rather codependent don't you think? Better to let the field worry about the field. Here's the prototype.js code that does the trick:

new Form.Element.Observer($("endDate"), 1, repopulateDateRanges);

What that does is create a specialized form of a prototype "TimedObserver" to watch the field with id="endDate", testing it every 1 second to see if it has changed, and if it has to fire the function repopulateDateRanges(). If you think about it at all you can see how easily that could be written with a recursive window.setTimeout function, but isn't it nice to let the prototype developers worry about that?

Limited Edition Paul Chen Katsumushi Katana by Reliks.com

The sword I want has gotten so much buzz they gave it it's own website: katsumushi.com. Maybe I'd better get on the pre-order list.

IE getElementById Bug

If there are two elements in a page with the same name, say for example a hidden field and a meta tag, Internet Explorer won't let you get one of them by ID. Why? Because IE is stupid.

The solution: for form elements at least, you can fall back on old school antics such as document.FORMNAME.elements["fieldName"], but it would be advisable to wrap that in a function so that somebody on your team (or yourself a month later when you've forgotten the problem) doesn't come along and replace the old code with a $() call.

Code sample: TODO. (if a simple test case fails to reproduce the problem I'll delete this post, but I've encountered the issue twice now, so I think it will)

Monday, April 16, 2007

» Bill Buxton: Make many sketches, ideas are cheap » Jon Plummer

Bill Buxton: Make many sketches, ideas are cheap - Jon Plummer.

This is the shit I've been struggling with, asking questions about, for a couple years now. How to present a concept, a sketch, of a web application interface, without having the colors critiqued? How to get people to grapple with the concepts, not the superficial dressing? I've been working on my white-board interfaces, but haven't yet refined a technique for sketching Ajax style interfaces and presenting them to a remote audience. Maybe that's asking too much. Maybe the interface has to be local and paper. Wouldn't it be nice to be working with Mister Jon again?

Friday, April 13, 2007

Prototype.js, onComplete and anonymous functions

Prototype.js, onComplete and anonymous functions

Embarrassing post showing how far behind I've allowed myself to get in my JS knowledge…

I was looking for a way to call multiple functions after an Ajax.Request, and this does the trick. This should also solve the question I had about how to pass arguments to an event that you're attaching using current versions of addEvent(). Also, reading the comments I find out how little I really know about prototype, having missed the whole event observer feature. The prototype version of our clunky old addOnload("attachBehaviors();"); function call is Events.observe(window,’load’,attachBehaviors);, more flexible and presumably more robust, I'll have to research whether it has the purported memory leaking problems of the PPK contest winner.

Thursday, April 12, 2007

NOTCOT: Good vs. Evil Foosball

NOTCOT: Good vs. Evil Foosball

Mark was saying the other day that we should theme our table. Too bad this particular table isn't a good one, i.e., a tornado. While these guys may look more realistic, their feed just aren't designed to play the game well, to catch the ball and stuff.

HTML Tag: optgroup | HTML Dog

HTML Tag: <ltoptgroup>

Learn something new every day. Humbling when it's an HTML tag. Noticed it being used in Jira, assumed it was a neat little javascript widget, but inspected it with Firebug anyway and it turned out to be this tag. "Probably just supported by Firefox", I thought, but inspecting the source in IE using the Internet Explorer Developer Toolbar (Microsoft's half-assed knockoff of Firebug, no bloody console) I saw that the tag is supported by IE6&7. That leaves IE5.5 and mac browsers, and given that modern mac browsers are generally good, and nobody cares about IE5.5 anymore, I'd call that solid support.

Saturday, April 07, 2007

YouTube - Cheney is a Creep

YouTube - Cheney is a Creep. And there you have it, the reason that I don't wish George W. Cunthair were, ummm, removed.

Tuesday, April 03, 2007

Web Typography Sucks | Slides and notes from SxSW 2007

Web Typography Sucks | Slides and notes from SxSW 2007. One goal for my redesign (undetermined date) will be stronger more unified typography. My site's got a whole bunch of stuff all under one roof, it's time to make the information design simpler.

Monday, April 02, 2007

Human Computation - Google Video

In case anybody else watched this google tech talk on Human Computation, looks like Google has implemented his image labeling app: Google Image Labeler.