July 10, 2008

Running the Numbers


Big numbers are really hard to visualize.

Charles and Ray Eames showed us how quickly they scale beyond human scope with their powers of 10 video

Now Chris Jordan uses art pieces made up of thousands of photographs to scale some large statistics down into a more human understandable form. Take a look at Running the Numbers on his website.


chris jordan.jpg
Depicts 1.14 million brown paper supermarket bags, the number used in the US every hour.

Posted by Barry at 12:22 AM | Comments (0) | TrackBack (0)

June 25, 2008

Lilly's Birthday Weekend

Lilly's 13th birthday celebration was a long, drawn out, affair. The night before her Birthday (Friday) she returned from a 2 day school hiking trip so we had a relatively quiet evening with just Maike spending the night. We ate Pizza and watched France vs Holland. The two girls were so exhausted they fell asleep before the end of the game! On Saturday we went to Dan and Sam's wonderful house near Blaye for a double celebration at as it was their wedding anniversary too. We all spent the night there and the following day we went to Lake Carcans and did some windsurfing with the Nutzels...


Guess what Lilly got for her Birthday?


The view from Dan and Sam's Lawn:


Cake on the lawn:


Dinner scene:

Some really good wine was drunk:


See the album for lots more photos...

Posted by Barry at 8:19 PM

June 12, 2008

Getting Rails and Prototype to talk XML

Another Ajax programming with Prototype tip. This one is aimed at Rails developers.

I wanted to use Ajax.Request to communicate with my Rails application via XML. Turns out this was fairly straightforward apart from one major gotcha!

Receiving XML with prototype is easy but not very well documented. You simply set up your Ajax.Request as per the documentation then as long as your application returns a response of application/xml the XML body can be found in the responseXML property of the Ajax.Response object passed to your request callbacks.

For me this looked something like:



The other side, sending XML to the Rails app, is where I started to run into problems.

I wanted to Post the XML to the Rails app and have rails parse it with it's built in XML paramter parser. If you read the Ajax.Options documentation it would seem you just set the contentType to application/xml, set the method to post and put the XML in the postBody, right? Wrong! I couldn't get it to work. My rails app kept seeing the post args as form-encoded. It wasn't until I looked at the request headers in firebug that I realized what was happing. Prototype was appending the encoding string to the content-type header - "application/xml; charset=utf8". This is correct but Rails (1.8 anyway) doesn't recognize this as XML.

To fix it I found if I set the encoding option to be blank Prototype leaves the encoding string out. If you don't do this is defaults to "utf8". I'm sure you can also use content-type synonyms in rails but this seemed a way simpler fix.

My code:



BTW. Don't forget another caveat with posting XML to rails is your XML document must have only one root.

Anyway, you can see this in action on Bossa Live. I use it for loading music in the flash player and updating user profiles while they are playing music with the player.

Posted by Barry at 11:30 AM | Comments (1)

Sign In

Elsewhere

Barry tweeted, "Listening to '100 Days, 100 Nights' by 'Sharon Jones and the Dap-Kings'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry tweeted, "Listening to 'Suzuki' by 'Tosca'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry tweeted, "Listening to 'Anywhere On This Road' by 'Lhasa De Sela'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry saved the link MySQL Performance Blog
Barry tweeted, "Listening to 'Agua' by 'Si*Se'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry tweeted, "Listening to 'Mangia Amore' by 'Marsmobil'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry tweeted, "Listening to 'Inside And Out' by 'Feist'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry tweeted, "Listening to 'A Cause Des Garçons' by 'Yelle'. Follow what I'm listening to on http://bossalive.com/user/barry"
Barry saved the link The Website Is Down
Search


Archives
July 2008
June 2008
May 2008
August 2007
June 2007
April 2007
March 2007
February 2007
December 2006
May 2005
June 2004
May 2004
February 2004
January 2004
2003 archive
Recent Entries
Links
Comb Jellyfish
Photo Friday
My weekly most played artists
Syndicate this site (XML)
Creative Commons License
This weblog is licensed under a Creative Commons License.
Powered by
Movable Type 4.12