I just went through a ton of frustration with the file upload UI for Instructables. Here are some notes on working dynamically with forms, file inputs, and iframes:
- Of IE, Firefox, and Safari, Safari seems to be “strictest” about enforcing security around file inputs. Granted, allowing script access to the value of file inputs might present a security risk to user, but Safari goes too far: even copying an unmodified file input from one form to another invalidates it. My code was failing silently for a while before I figured this one out.
- Safari also requires that the file inputs be visible for their values to be sent. No
display:none for you.
- There are also crazy quirks in Safari around sending the request through an
iframe. Various combinations of iframe visibility and/or dimensions may screw the pooch.
- Safari is also picky about the iframe existing before you set it as the target of a form, when you’re creating both, dynamically. IE and Firefox are lazily content to pick up the reference at submission time.
- Need to set the encoding type for a form? Prototype will take care of you, but if you need to do it yourself, remember that IE uses the
encoding property instead of the usual enctype.
- Nested forms are a no-no. This goes without saying, but some browsers will let you get by with this one, so you have to be on the lookout.
[Update]: Here’s another:
- A recent IE security update causes “Access is denied” errors when submitting certain forms (it was on ours.) Some folks suggested that we use an onsubmit method on the form and have the user press a submit button rather than doing a pure form.submit() in script. However, clearing our browser settings did the trick. If this becomes a common bug amongst our users, we may have to implement the former fix.
No Comments »
The ferry commute from San Francisco to Alameda I take is pretty awesome, already. It’s way better than any commute I’ve ever had, with sun, friendly people, big surfaces to set up my workspace on, and plenty of room for bikes.
Even better, I recently noticed that there was an open wireless AP called “bartender” on the ferry. With a connection, my commute is fully productive. The presence of “bartender” was intermittent, though. Sometimes it was there, sometimes not. At first, I thought it was just a certain vessel (there are two that serve this route), but it would vary even on that one.
So, I asked around and it turns out that the “bartender” network is actually run by one of the ferry’s actual bartenders. His name is Juan, and he’s studying to be a web developer, so he’s always got a laptop out at the bar. He wanted his own connection during his shifts, so he got himself one of those PCMCIA cards for a network connection over mobile wireless (Sprint, in this case.) And, because he’s generous, he got a wireless router to share it with the ship. I gave him a tip, yesterday, when I found out what the deal was.
Thanks, Juan! This is yet another example of why the ferry commute rocks.

No Comments »
At the office, we enjoy wasting time poking around the naval base and its environs. Working next to a mothball fleet and its associated Superfund site inspires a lot of speculation about the history of the place.
Below is an image of our office (the control tower) circa 1963. Click on it for more images posted on the Instructables site.

No Comments »
From a good New Yorker Article I’m reading about Obama:
“If you’re a black male, you don’t have to try hard to impress people with your aggression,” [George] Haywood says. “There was a period when black politicians started to be successful, and it was understood that if you wanted to be mainstream you’d better have gray hair. Doug Wilder was an example. David Dinkins. Mayor Bradley in L.A. To be popular with the broader white electorate, you’d better look safe, you’d better not look angry. Now, I don’t think Barack made a conscious decision to come across this way, but it is a happy accident. Some people may have seen his speech at the Democratic Convention, or heard that he rocked the house, and they may be disappointed, but the mainstream is not ready for a fire-breathing black man.” (It seems likely that, consciously or not, Obama has learned from these examples, and knows that the election of a President Obama wouldn’t mean a revolution in race relations, any more than women prime ministers were a sign of flourishing feminism in South Asia. Bigotry has always made exceptions.)
I’m only getting started, but the piece is already giving me deep insight into the candidate. Found via Amy.
[Click through for more excerpts and personal reflections that struck me as I read on.]
Read the rest of this entry »
2 Comments »
I don’t use Safari, but I do need to test it. Looks like the Webkit project has developed an inspector that rivals Firebug, for Webkit-based browsers. It sure is purdy…

No Comments »
Below are two posters up on the wall at my office, both extremely dense visualizations produced by Stanford’s Global Climate & Energy Project. I wanted find PDFs of these, but Google didn’t turn them up. So, I took pictures with my phone and posted them here. Better than nothing, though the second diagram (the more interesting one, IMHO) is almost illegible.
Click on each thumbnail to see the full image.

2 Comments »