Pfizer Packs it In

January 22nd, 2007

I just found out via ArborUpdate that Pfizer is leaving Ann Arbor for good, leaving behind a 117 acre facility and taking 2700 well-paying jobs out of the local economy. As the discussion on AU points out, Pfizer was a huge taxpayer and contributor to local non-profits. This is a hefty blow to the city and the local economy around Ann Arbor, one of the brighter spots on the dismal southeast Michigan economy.

Update: They’re also leaving Brooklyn but Brooklyn will fail to notice….

Play it Safe!

January 10th, 2007

I made a Pando package of the “Play it Safe, Vol. 4″ mp3 posted on the WFMU blog. It’s a 43 minute long record published in 1972 design to play looped to sound like people were home. So so strange. If you want to get this via p2p goodness, get it here:

Pando Package

via: boingboing.

“We don’t care how they do it in New York.”

January 3rd, 2007

Ann Arbor Shopping Cart RaceA button owned by a friend of mine back in Ann Arbor provides the title for this post. Amanda called me out on her blog, announcing somewhat cryptically the upcoming Idiotarod. She says:

I have a friend who said once “oh, yeah, we do that in Ann Arbor, too” and I am here to tell you that nobody does this in Ann Arobor [sic]. Fire breathing dragons? Surgery on the run? Menacing giant squid? I don’t think so. This is Brooklyn, people. We turn everything up a notch.

27th of January in the year of aught seven

Yes. This is Brooklyn and they’ve turned it up to eleven. But does that make the Idiotarod better? Let us compare.

The Idiotarod (from what I gather on the C.O.B.R.A. web site) began in 2005, takes place in the dead of winter, is miles long, involves teams of five runners, has detailed rules posted on an official web site. It has a $5 entrance fee and features many creatively themed carts with outlandish props and dazzling special effects, live, in three dimensions. There are cash prizes.

The Ann Arbor Shopping Cart Race began in 1998, typically involves teams of two, has no “official” organizing body nor entrance fee. It is held in August, around midnight, is about 3/4 mile long, mostly downhill. It is part of the week long end-of-summer festival of Punk Week, which also features a city-wide capture the flag competition, cake walks and other spontaneously and independently organized events. It also features many creatively themed carts with outlandish props and dazzling special effects, live, in three dimensions. There is no cash prize but the winners often receive a cake, home-made.

What sounds like more fun? A short, high-velocity downhill romp on a warm summer evening with costumes, props and fireworks? Or a grueling run through New York City in the middle of a cold winter day that you must pay for the privilege of joining and may be “disqualified” from, with costumes, props and fireworks? I’ll take the former, but maybe that’s just the midwestern in me.

ViralVideos Widget: The Number Ones

December 20th, 2006

I have a huge backlog of half-done posts. I just can’t seem to get here frequently enough. Maybe I should cut out my Daily Show/Colbert Report habit for a month — see if that helps… Anyway.

Over at work, I’ve been tinkering with a little side project with Yaron amidst the gazillion other things I’ve been up to: a rewrite of ViralVideos.com. Yaron designed the site and the first rev was built by a “contractor” for cheap. The code was a tangled mess. It did work pretty well for being the morass of php generating php generating javascript generating javascript generating HTML that it was, but it was totally unmodular and non-reusable (and not indented and commented lightly, in Russian, at that). Anyway. I’ve improved upon that situation (though there is still work to be done. More on that later (with props to Smarty and jQuery).

One nice side effect is that in creating a more sane data model, we could quickly throw together other fun things, like the recently launched ViralVideos #1’s widget (see sidebar of this blog). The widget shows the current “#1″ video on eight top video sites by day/week/month/ever (approximately). It recently went live on the new “all things Internet video” blog recently launched by Om Malik, NewTeeVee. Holy crap!

For the geeks — I originally designed it as a simple javascript include which seemed to work ok, but when embedded in sites with anything but very simple xhtml/css caused unpredictable results. Embedding the whole thing in an iframe is proved much more reliable so this first revision is a simple javaccript-writes-ifram embed. The downside of using an iframe is the little “get this” drop-out box needs the have space to open into (it won’t just push crap out of its way like it would if it was embedded directly in the page) so the frame must be padded, but otherwise it works well. Ad networks frequently use this approach since their ads are usually designed to land in a fixed-sized space.

Next up? Probably a Flash widget for any even fancier interface and the ability to live inside a MySpace profile page…

Projecting in 3-D

December 6th, 2006

Video projectors are all the rage in ‘new media’ art these days. For example, this project featured over at we make money not art shows a piece where a projector distorts a projected image in order to cover a 3-D surface:


0bauderr2.jpg

This is kinda cool. It requires you to create a 3-D ‘map’ of the object configuration and calibrate the projector with the objects. What would really be cool is if the objects (including projectors) themselves could describe their dimensions, location and orientation to the system and the whole thing could auto-calibrate. If accurate enough, multiple projectors and objects in motion in a space would be possible. What would be even cooler is to attach particular images to particular objects. It seems like with gyros, accelerometers, RFIDs and some wireless communication protocol, you could pull this off. And it’d be really cool.

Kitchen Mystery: Baking Powder or Soda?

December 2nd, 2006

Baking Powder or Baking Soda?Lizz is firing up the oven for the first time in our new place to do some baking. Some time during the move the labels on many of our kitchen canisters went missing. We’d identified everything but weren’t sure which of the two identical, black canisters held baking soda and which held baking powder.

The consistency of each powder is quite similar, as is the taste. Remembering the science fair volcano trick, we tried adding vinegar. They both bubbled, so that didn’t help. I finally resorted to Google and found this Yahoo! Answers page which helped solve the mystery. The difference? “Baking soda is sodium bicarbonate” while “Baking powder is sodium bicarbonate, plus tartaric acid powder.” What does this mean? Baking soda requires an acid (e.g., vinegar) to bubble while baking powder requires merely water (to activate the included tartaric acid) to bubble. Testing a sample of each powder in water solved our mystery. Now I’m firing up my (ebay procured) label printer to prevent further label-detachment incidents…

Even More on Automatic Download Initiation

November 20th, 2006

I should probably be updating you all on the crazy long weekend I had. I saw many Michigan friends, drank a lot, started a company, cooked a new dish. But that must wait. Today I discovered yet another approach to automatically initiating a software download. This time, from Google Earth. This is how they do it:

<script language="JavaScript" type="text/javascript">

var detect = navigator.userAgent.toLowerCase();
var macurl = "http://dl.google.com/earth/GE4/GoogleEarthMac.dmg";
// Safari does not really support iframes.
if (detect.indexOf('firefox') >= 0) {
document.write('<iframe src=\"' + macurl + '\" width="0" height="0" style="display:none"></iframe>');
} else {
// We do not want to use this approach if we can help it, since it can create navigation/history problems
// on some platforms. Do it only if we think the iframe approach will fail.
window.location = macurl;
}
</script>
</body>

Strangely, in the comments, they say Safari doesn’t like iframes; which is odd, because Apple uses iframes for the iTunes download — unless either Google and/or Apple are doing browser detection before writing out the javascript; something else to investigate. In any case, this is a hybrid iframe/location approach. Their comments also suggest setting the location causes history problems so, while it is the simplest, it’s not ideal. Strange that this is so hard. If it wasn’t for the need to gather reliable stats, we could just link to the damn files!

Tracking Downloads

November 12th, 2006

Following up on my three windy posts about tracking download statistics and javascript, I’ve noticed two other, simpler approaches in common use. Apple uses an invisible iFrame for the iTunes download, like so:


<iframe width=0% height=0% scrolling="no" frameborder="0" src='http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iTunes7/
Win/061-2794.20061031.iTZW2/iTunesSetup.exe'></iframe>

No javascript required, apparently. I’ve also seen various other sites use a much simpler javascript approach of just calling “location.href=’http://example.com/download.exe’” with their onLoad handler. This apparently doesn’t require different behavior based on browser type. If I have time I’m going to play with these other options on a bunch of platforms and see which ones seem most reliable.

Autumn in New York / Autumn in Detroit

October 25th, 2006

Lizz and I moved to Brooklyn (alternate map). After scheduling complications with the paint store and the movers, we’re finally in the apartment. It’s going to take a couple weeks before we’re comfortably settled.

In the interim, this picture from detroitblog sums up the state of the city pretty well:


Autumn in Detroit

Javascript Voodoo: Tracking Downloads, Part 3

October 2nd, 2006

Pando Logo

This is the last of a three part series: [ Part 1 | Part 2 ]

So I left off in part 2 with two problems: image load/download delay times and recent Internet Explorer security.

The first problem turns out to be easy to solve. If you want to wait to trigger a javascript event until after the entire page (including images) has loaded, javascript provides the handy “onLoad” function. So rather than using a delay counter to guess at when the images would finish loading, I instead move the automatic form submit into a function and used “onload” to call that function after the entire page had loaded. I placed something like this at the top of the document:

function startdl() {
  document.dlform.submit();
}
window.onload = startdl;

And removed the “setTimeout” code from the javascript code in the body:

  window.setTimeout(’document.dlform.submit()’, 5000);

Now, the download kicks off as soon as the entire page (including images) loads. Much smoother.

The harder problem was figuring out what to do about Internet Explorer. I spent some time searching for a download site that got around this problem and eventually ended up on the WinZip site. After examining their code, I noticed they were handling differently browsers with a user agent string containing “SV1.” Google landed me on this blog post on the IEBlog explaining that SV1 was added to the user agent string of IE6 with XP Service Pack 2. It stands for “Security Version 1.” I assumed this was the version that began blocking file downloads via javascripted form submits.

Further examination of the WinZip code showed that, when a user clicked the download link from an “SV1″ browser, the page used a window.open function call to open an essentially invisible window with the path to the file URL. On Firefox this causes a small, blank, empty window to appear on the screen. IE, however, begins the file download dialog and the window artifact does not remain on the screen. I created a function to do this:

function dl() {
  if (window.navigator.userAgent.indexOf("SV1") != -1) {
    var dlfile = 'http://example.com/file.exe';
    window.open(dlfile,'securewin','toolbar=0,location=no,directories=0,status=0,scrollbars=no,resizable=0,width=1,height=1,top=0,left=0');
    window.focus();
  }
}

This code basically says “if the user agent string contains SV1, open a 1 x 1 pixel window with the contents of http://example.com/file.exe and then focus back to this window.”
I then added an onClick handler to the download link like so:

<a href="http://example.com/start-download/" onClick=”dl();”>download the file</a>

This worked great, except it still popped up the yellow warning box on the landing page. WinZip’s downloader did this, too, but it is pretty simple to work around the problem. I also discovered that some versions of IE7 don’t contain “SV1″ in the user agent string (wikipedia), but still blocked downloads.

To get around the IE7 problem, I added a check for “MS IE7.0″ in the user agent string in dl():

function dl() {
  if (window.navigator.userAgent.indexOf("SV1") != -1 || window.navigator.userAgent.indexOf(”MSIE 7.0″) != -1) {
    var dlfile = ‘http://example.com/file.exe’;     window.open(dlfile,’securewin’,'toolbar=0,location=no,directories=0,status=0,scrollbars=no,resizable=0,width=1,height=1,top=0,left=0′);
    window.focus();
  }
}

To get around the “yellow bar” problem, I modified the “startdl()” function to not kick off the download for IE6 or 7 browsers, since the download had already been requested by window.open:

function startdl() {
  if (window.navigator.userAgent.indexOf("SV1") != -1 ||     window.navigator.userAgent.indexOf("MSIE 7.0") != -1) {
    return;
  } else {
    document.dlform.submit();
  }
}

Now, altogether, when a user clicks “download,” the download dialog begins and a page is loaded. The page both presents novice users with helpful installation instruction and records the download click with our partner company’s software. Phew. Anybody got a better way?