Alex Pooley's Blog

Hello there, my name is Alex Pooley and I'm a freelance web developer residing in Perth, Western Australia. My passion is in the development of web sites that solve everyday problems. Here's a gallery of some of my notable work. If you need a web site designer or developer, contact me with further details. Lastly, you can read more about me.

Flash Wins, Game Over.

July 12th, 2008

I came across this post in my daily readings. It describes hows Scott Petersen has created a toolchain that takes C code, converts to a byte code, and then runs via a virtual machine through Flash. Supposedly Scott has Quake, Ruby, Python, and other scripting languages running through Flash. The implications of this are huge. With the ubiquity of Flash, their virtual machine (Tamarin), and the ability to automatigically get C code running through Flash, we’ll finally have a decent platform on which to create rich Internet applications.

Personally I think this is a game changer and Adobe’s management should be commended for their foresight. This move will likely cement Flashes ubiquity, and please many web developers, myself included.

3.3 Million Pages & Google Video Ads

June 29th, 2008

Site Relaunch

In my last post I mentioned that Google had turned off the traffic flow to my site via their search engine. Well, I’ve done some tinkering and my 200,000 page site is now a massive 3.3 MILLION pages! Kapow!

The first incarnation of the site relied on Google navigating the site via Sitemaps. Each page on the site was a hanging node, and the only way to move between pages was to perform a search with a form post. I suspect that Google recently changed some policy regarding sitemaps, and so they stopped acknowledging pages in the sitemap. But I’m only guessing, I really have no idea. Either way, I’ve dramatically improved navigation around the site with standard links, and will keep an eye on the stats to see if my traffic grows.

Google Video Ads

Anyway, while plastering ads on my site I ended up stumbling across Google’s video with ads. Ooh la la, these things are nice! When setting up an ad, Google offer various sizes and colour themes. Smaller sizes provide video thumbnails that expand in to a player when clicked, and larger sized ads include a player with embedded thumbnails. Here’s a screen shot of a ’skinny’ ad I’ve placed on my site…


Skinny Google Video Ad

As you can see, the ad unit makes a nice addition to an otherwise dull page. Unfortunately, clicking on a thumbnail opens the player, which expands the ad unit size, which makes it harder to integrate with page layout. The next screenshot shows you what happens if you click on a thumbnail - note the horizontal page scroll!


Skinny Google Video Ad Expanded

On my site I have a search page. Due to the nature of a search page, there isn’t really much else to display other than search results. So what I’ve done is included a large ad unit on this page to soak up the remaining real estate.


Large Google Video Ad

Technical Junk

In case you’re interested, the new site runs on Ruby On Rails. The previous version of the site was simply a huge set of static web pages that were simply pre-processed and placed on shared hosting at Dreamhost. I originally pre-rendered the site because the complexity of the site is in cobbling all the data together, and I “just” wanted an easy way to render the data. I found the pre-processing approach was way too inflexible for updating the site, despite it’s clear deployment benefits.

In Summary…

I’m not sure if any of these updates will actually result in increased traffic flow. Surely with 3.3 million pages Google will simply have no choice but to send traffic my way. I’m going to sit on this for a bit to see what happens, then I may try my hand at a press release.

This site actually goes against guidelines 3 and 4 that I set out in my last post.

Perhaps I will prove myself wrong. We will see…

Two Coding Gotchas: Javascript & Ruby

May 24th, 2008

Nailed by two coding gotchas in two days. Argh!

Here’s the one in Javascript.

js> var a = (100).toFixed(2);
js> a
100.00
js> var b = (20).toFixed(2);
js> b
20.00
js> a > b
false

a is 100.00, and b is 20.00. 100.00 is greater than 20.00 right? Yes, except that they’re strings! toFixed returns strings, and any comparison is a string comparison and not a numeric comparison!

Now, here’s the Ruby one that got me. If you’re not a Ruby person then this one might be a little harder to pick.

irb(main):001:0> class Klass
irb(main):002:1>   def meth=(value)
irb(main):003:2>     return 'return this please'
irb(main):004:2>   end
irb(main):005:1> end
=> nil
irb(main):006:0>
irb(main):007:0* obj = Klass.new
=> #<Klass:0x83180>
irb(main):008:0> obj.meth = "Do not return this please"
=> "Do not return this please"

Well, I wanted to return “return this please” on the assignment, but instead Ruby ignored me and returned the value of the assignment instead. What if I want to indicate that the assignment failed? My only option is to throw an exception.

I can appreciate that Ruby wants to keep things consistent and always return the assignment value, but can Ruby appreciate my view of consistency and return when I say to return!

If you can tell me why Ruby behaves this way I would appreciate it if you could leave your mark in my comments section.


Save To Delicious