Archive for October, 2007

Using Prototype with Adobe AIR

Monday, October 29th, 2007

Long story short: I found out the hard way that Adobe has nerfed the AIR runtime so that any JavaScript functionality that relies on the eval() function doesn’t work*. Sweet.

I’ve been wanting to play with AIR more, but every time I get into this system I find myself banging my head on the wall. I wanted to start a personal project with AIR - just something to remember and search some notes for now. I had a nice little JavaScript MVC framework going on. I was dispatching events related to commands… those events were being dispatched to the correct controllers… the controllers were… not rendering any view code. Crap.

The problem lies in the way AIR nerfs eval() functionality in Prototype. Something as simple as $(’id’).update(data) doesn’t work because String.update (along with most AJAX functions) automatically eval() script segments in the strings they work with.

* Okay, so you can get it to work, but you have to split out your main HTML interface into an iframe and create a bridge between the two sandboxed areas (the AIR-enabled root HTML file, and the AIR-nerfed, Prototype-enabled iframe. Yuck.

If anyone has any ideas how to get around this, that’d be nice. I suppose I can see why Adobe would be careful about allowing developers to eval() anything they like, but the proposed solution is really nasty and doesn’t solve anything anyway.

Prism

Friday, October 26th, 2007

The buzz on the web today is all about Mozilla’s new experiment, dubbed Prism. At first, I was thinking, ”
Hey - this is just like Adobe AIR, minus the flash, but it’s probably open source.” I think competition for AIR is healthy, and while Adobe is usually a benevolent monopoly, it’d be nice to be able fall back on some open source web-to-desktop software. Why did I think this? The Prism site compares itself to Silverlight and AIR:

Unlike Adobe AIR and Microsoft Silverlight, we’re not building a proprietary platform to replace the web. We think the web is a powerful and open platform for this sort of innovation, so our goal is to identify and facilitate the development of enhancements that bring the advantages of desktop apps to the web platform.

Then I read the rest of the article.

Essentially, Prism looks like an extra nice way to bookmark sites you use on the web. It’s like Firefox minus Chrome. “LabRats,” the author of the announcement responds to the critique of an AIR fan in a way that confirms my disappointment:

…we don’t do anything to close the web platform. We simply provide you with a dedicated window to an application running on that platform. It’s the same as if you had opened a new window in Firefox and loaded the application there, but without the browser chrome to get in your way.

Leave it up to Web 2.0 to hype up something product that actually offers less than it’s predecessor.

ALA 2007 Web Design Survey (in SQL)

Tuesday, October 23rd, 2007

Eric Meyer’s blog made a request for an online application that spits out custom reports based on their brilliantly put together survey. We’ve been mulling over it a lot in our office, so if you haven’t had a chance to check it out, please do so.

I started looking at the data (they offer it in CSV and Excel), and it’s currently in a state that is difficult for processing via database. I created a script that imported the data into SQL format, but I normalized the data a bit:

  • Any multi-valued fields have been broken out to their own tables
  • Any range has been broken out into a min and max

I normalized things so queries would make more sense, and I broke some of the responses into ranges to allow for some finer querying (e.g. “How many web professionals between the ages of 25 and 35 make between 55- and 65K?”).

This comes with no warranty, but it looks good to me. If anyone happens to notice anything out of place or incorrect, I’d be glad to know about it so I can fix it up and re-post the data.

ala2007survey.tar.gz

The benevolent among you might consider giving me a line of credit in whatever application you create. :)

Enjoy and happy coding!

Firebug, Where am I?

Friday, October 19th, 2007

It’s stuff like this that makes me feel verified in my lack of interest in using jQuery heavily.

There’s a guy who wrote a logging function so you can figure out whereYou(are).whenYoureCoding().inThe(middleOf).a(jQuery).trainWreck().

I can see the power of chaining things together, but my guess is you’ve probably gone too far if you’re needing to log things to the console mid-swing. There’s probably little to no chance you’re going to be able to read it a week from now, too.

 
random side bar image...