Development - Archived Articles
The Slow Decline of Internet Explorer and Slower Rise of Firefox
For the past 8 years or so, 5 Senses Coffee has been both a client of mine, and for the last 15 months, my employer. The public face of that work is the main website, which sells coffee, teas and other wonderful items. I’d like to think that the visitors to the website are a pretty good spread of the general population of the internet, not necessarily too technical/web based, and not too “Hey, what’s this internet thing all about?”
Every now and then a story will appear in my feed reader about the use of one browser being higher than another, and more often than not, that site has a skewed audience, which means that it’s users are more likely to have the latest and greatest than other, less browser obsessed users.
So, bearing in mind that this probably has no relationship to the wider world than any other site, here is the browser share of visitors to the 5 Senses Website over the past 21 months.

| Q1 2007 | Q2 2007 | Q3 2007 | Q4 2007 | Q1 2008 | Q2 2008 | Q3 2008 | |
|---|---|---|---|---|---|---|---|
| Internet Explorer | 77.16 | 67.15 | 64.63 | 64.76 | 65.26 | 60.81 | 59.72 |
| Firefox | 16.93 | 25.33 | 28.25 | 25.98 | 25.62 | 29.29 | 29.79 |
| Safari | 4.36 | 5.63 | 5.87 | 7.9 | 7.46 | 8.35 | 9.05 |
| Opera | 0.74 | 0.82 | 0.58 | 0.74 | 0.98 | 0.89 | 0.94 |
| Other | 0.81 | 1.07 | 0.67 | 0.61 | 0.67 | 0.66 | 0.50 |
And the breakdowns for the various versions of Internet Explorer, where “IE x” is all versions other than IE 6 and IE 7.

| Q1 2007 | Q2 2007 | Q3 2007 | Q4 2007 | Q1 2008 | Q2 2008 | Q3 2008 | |
|---|---|---|---|---|---|---|---|
| IE 6.x | 72.85 | 56.87 | 53.43 | 50.93 | 40.88 | 32.79 | 31.08 |
| IE 7.x | 26.4 | 42.5 | 46.2 | 48.83 | 58.93 | 67.02 | 68.82 |
| IE x | 0.75 | 0.62 | 0.37 | 0.24 | 0.18 | 0.18 | 0.10 |
and FireFox.

| Q1 2007 | Q2 2007 | Q3 2007 | Q4 2007 | Q1 2008 | Q2 2008 | Q3 2008 | |
|---|---|---|---|---|---|---|---|
| FF 1.x | 6.38 | 3.96 | 3.49 | 2.33 | 1.61 | 1.19 | 1.18 |
| FF 1.5.x | 34.37 | 4.95 | 4.95 | 3.04 | 2.49 | 1.21 | 0.79 |
| FF 2.x | 59.25 | 91.56 | 91.56 | 94.52 | 94.73 | 89.47 | 51.28 |
| FF 3.x | 0 | 0 | 0 | 0.11 | 1.17 | 8.13 | 46.75 |
What is evident from these numbers is that while IE is still the dominant browser, with almost 2/3rds of market share, Firefox has been slowly and steadily increasing. But not necessarily at the same rate that IE is losing share. Firefox seems to be losing a bit of ground to other browsers, namely Safari.
The interesting number is that Safari has doubled over the sample period. True, it’s still third by more than a few lengths, but it seems to be taking some of those gains from IE. I’m guessing this is mainly due to the increased market share of Apple in general, and not some massive use of Safari on MS Windows.
Other, possibly unrelated points that can be extracted is that FireFox users are more likely to upgrade their browser than IE users. This can be seen by the almost complete drop off in FF 1.5x users at the beginning of the timeframe, and the rapid rise of FF 3.x in the last 3 months, to the point that it almost equals FF 2.x. That said, there certainly appears to be some die-hard holdouts for FF 1.x, who are disappearing at a slower rate than those still using FF 1.5.x
So, not a scientific sample and/or analysis by any stretch, but still interesting. The surprising item here is the doubling in share of Safari (which, in the authors less than humble opinion is the best browser there is.) True, it didn’t have far to go to double that share, but it still had to be done.
The upshot of all of this is that, unfortunately, there is still a large portion of the internet population still using IE 6 (approximately 20% of all visitors it seems), so it still needs to be supported, or those people need to be encouraged to migrate upwards. How do we do that? Well, your guess is as good as mine.
Freezing Rails with Git
Now that the Ruby On Rails team has moved the codebase over to github, some of the standard rake tasks aren’t working the way that they used to. When it was on SVN, it was possible to type
rake rails:freeze:edge TAG=rel_2-0-1
and the appropriate version would be copied into your vendor/rails directory.
Now if you do that, rake downloads a zip of the edge release. Which is fine and all, but sometimes you don’t want to be on edge … like in any production site.
So, I found a screencast that goes through the process, but I thought I’d actually put the text into a post, mainly for my own reference more than anything else.
$ rails path_to_app $ cd path_to_app $ git init $ git submodule add git://github.com/rails/rails.git vendor/rails
At this point, git will effectively clone the repository, so that you can then choose one of the branches to “freeze” to. Type “git tag” to get a list of all the available tagged branches. Choose the one you want and type
$ git checkout v2.1.0
And that’s it. Slightly more involved than the old way, but still none too shabby.
Getting Rails, Git and Capistrano to work on a Joyent Accelerator
After several days of repeatedly smashing my head into both a metaphorical and an all too real brick wall, I seem to have managed to get git and capistrano working happily together on my Joyent Accelerator. I’m also using github for my git hosting, which threw up it’s own little challenge mid-way through the entire process.
Now, I should probably also say that I already had my site up and running using subversion, capistrano and my accelerator, so this article isn’t necessarily going to help with getting everything setup the first time. For that, you probably need to read this wiki entry.
Things You Will Need
- A github.org account
- A dedicated Joyent Accelerator (I have no idea how to do all of this on a shared accelerator. Sorry.)
- Also, I’m really only talking about RubyOnRails apps here … not too sure how applicable a lot of this is to other frameworks (it will probably help at least.)
Getting started
Assuming that you have your project in a git repository, and have a github account (and obviously an Accelerator) we can start.
Compiling git on your accelerator
Unfortunately, the first step in the process was, for me at least, a total nightmare. I’m not the biggest unix-head by any stretch, but I can do some basic tasks with a degree of proficiency. Unfortunately, I went into a dark place trying to get git compiled. One thing to note is that I’m talking about setting up the git client here, not a git server. Because capistrano executes scripts on your remote server, you need to have a copy of the client software setup for capistrano to call.
So what did I do? There are a couple of helpful threads on the Joyent Forums:
Hopefully those threads will put you onto the path of successfully compiling and installing git onto your Accelerator.
Setting up SSH keys with github and your accelerator
When you setup your account on github, you need to setup an SSH key for authentication. github has a really good tutorial on how to do this. I have a user defined on my accelerator that my website “runs” under, so what I did was to create a key for that user which gets stored into the ~/.ssh directory. I then added the contents of the id_rsa.pub key to my github account, which allows that user to access the repository.
Another tip: don’t forget your passphrase. It’s needed in the next step.
Configuring capistrano
Assuming that you have your capistrano deploy.rb file setup as outlined here there are a few changes that you will need to make to get things working with git.
I’m using Capistrano 2.2 at the moment. I don’t think it will work with earlier versions because of the relatively new git support.
Here’s my deploy.rb file:
require 'erb'
require 'config/accelerator/accelerator_tasks'
set :application, "website"
set :repository, "git@github.com:your_username/website.git"
default_run_options[:pty] = true
set :domain, 'XX.XX.XX.XX' #Your Accelerators public IP address
set :deploy_to, "/var/www/apps/#{application}"
set :user, 'website_account_username'
set :scm, :git
set :scm_username, "github_username"
set :scm_passphrase, "your passphrase here"
role :app, domain
role :web, domain
role :db, domain, :primary => true
set :server_name, "url.for.website"
set :server_alias, "*.url.for.website"
# Example dependancies
depend :remote, :command, :gem
depend :remote, :gem, :money, '>=1.7.1'
depend :remote, :gem, :mongrel, '>=1.0.1'
depend :remote, :gem, :image_science, '>=1.1.3'
depend :remote, :gem, :rake, '>=0.7'
depend :remote, :gem, :BlueCloth, '>=1.0.0'
depend :remote, :gem, :RubyInline, '>=3.6.3'
################################
# Some tasks for the old server
################################
task :after_deploy do
# tasks to run after deploy
end
################################
# End tasks for the old server
################################
deploy.task :restart do
accelerator.smf_restart
accelerator.restart_apache
end
deploy.task :start do
accelerator.smf_start
accelerator.restart_apache
end
deploy.task :stop do
accelerator.smf_stop
accelerator.restart_apache
end
after :deploy, 'deploy:cleanup'
It appears that the important line here is ’ default_run_options[:pty] = true ’. This means that capistrano can respond automatically for the request for the SSH Key passphrase that github replies with when you try to clone the repository.
If everything is working, you can type ‘cap deploy’ and it should all deploy nicely. If you get this error:
[err] Permission denied (publickey).
then there’s a problem with your SSH key and your settings on github. Make sure the key you copied into your github account is the public key for the SSH in your .ssh directory.
Hopefully, you’ll be up and running. If you have any tips, recommendations or corrections, leave a comment.
Connecting to Joyent Accelerator with CocoaMySQL
First things first: What’s an accelerator? And why would you care about connecting to it with CocoaMySQL?
Well, basically, an accelerator is kind of like a virtual server, offered by Joyent. Calling it a virtual server is a bit of a misnomer, because it conjures up images of a linux slice, but it’s a bit more than that. Running on OpenSolaris, it’s built from the ground up to offer scalable hosting. You get root access, and the ability to do pretty much whatever you want with it. Out of the box, they are setup to be rather special RubyOnRails/PHP/Python servers, with mySQL all setup and running like a champ.
OK. So where does CocoaMySQL come in? Your accelerator comes with PHPmyAdmin configured by default, but sometimes you want a little more than that you know? And with an app like CocoaMySQL you get a sweet GUI to do all your admin tasks, and nice editing facilities.
Because of the security built into your accelerator, you can’t connect to mySQL from anywhere but your server. Handy for preventing attacks, but slightly painful for server management. So, you need to open up an SSH tunnel, to securely connect to the server. But first of all you need to make some configuration changes on your accelerator.
sudo nano /etc/ssh/sshd_configchange the following parameters to ‘yes’
AllowTcpForwarding yes GatewayPorts yesThen you need to restart the ssh daemon, with the following command
sudo svcadm restart svc:/network/ssh:default
The next step is to setup an “SSH tunnel” between your machine and the accelerator, which is basically a direct connection between the two machines. All traffic that flows along this connection is encrypted, reducing the ability for someone to sit there and listen in on what you’re doing.
The command I use for setting up the tunnel is
ssh -2 -f -c blowfish -N -C username@accelerator.ip -L 3307/127.0.0.1/3306
This sets up a connection between port 3306 on the accelerator (specifically the mySQL port) and port 3307 on your local machine. To connect to your mysql server in CocoaMySQL you just connect to port 3307 on 127.0.0.1, which then just sends everything to your accelerator.
And a screenshot of the config screen for CocoaMySQL:

Now, obviously, that ssh command is going to be slightly painful to type in every time you want to connect to your accelerator. So, here’s a handy dandy script and configuration file that makes connecting to multiple servers a breeze. All you need to do is copy the setup in the config file and change the settings for each server. And of course, mirror those settings in CocoaMySQL.
Thanks to Ben Rockwood from Joyent for the tips on the config changes needed on the accelerator
Maps, Geocoding and Great Timing
On one of the sites I’ve been working on for quite a while (SchoolSeek) we’ve been wanting to add the ability for users to find out how far a school is from their current location. There are services that have been able to geocode addresses for a while, but they were either based in the US, or cost money. Not a lot of money, but free is always good.
A couple of years ago, Google Maps launched in the US and opened up a massive range of possibilities for programmers to develop cool “mashups”, which took information from one site, mashed it together with maps from google, and created a whole new website. They were all really cool, but unfortunately (at least for the non-US based of us) it was nothing more than something we could sit back and watch – which was kind of weird because the team of developers that built Google Maps was based in Sydney.
But finally the Australian version of google maps was released, and then recently integrated with Local Search, which means you can search on Pizza shotps near a particular address. Which is cool.
What is even cooler (if you’re a ruby developer), though, is the release of this: GeoKit. It integrates with all of the major geocoding/mapping services and provides a huge range of options and services. So now you can do stuff like this:
add_1=GeoKit::Geocoders::GoogleGeocoder.geocode("1 St Georges Terrace, Perth, Western Australia")
add_2=GeoKit::Geocoders::GoogleGeocoder.geocode("1 York St, Albany, Western Australia")
distance = add_1.distance_from(add_2, :units => :kms)
Which returns
389.248018478531
which is, of course, how far it is between the main streets of Perth and Albany in Western Australia.
Sawwweeeeeet.
Update
Well, that didn’t take long at all. A quick loop over the existing schools in the SchoolSeek database got the lat/long information for all the addresses. Then adding this line
acts_as_mappable default_units => :kms
to my Address model allows you to do this
@addresses = Address.find(:all, :origin => "18 Bland St, Ashfield, New South Wales", :conditions => "distance < 10")
which gives me all of the addresses within 10Kms of 18 Bland St, Ashfield. Nice.
So, basically GeoKit let me add distance searching to the site within about 45 minutes (allowing 25 minutes for me to read through the examples and such!)
Vista
On Thursday I managed to, um, locate, yeah that’s it, locate a copy of Windows Vista Beta 2, which has just been released out for people to have a look with. I had initially been relatively excited about Vista (when it was still known as Longhorn) because of some of the cool features that were being worked on: WinFS being the main thing, with some of the Avalon stuff and general improvements looking to be pretty good.
I format the C Drive (which I needed to do anyway because my XP install was almost a year old), fire up the setup program. It all runs relatively smoothly, a faster process than XP, and seemingly without any of the legacy DOS stuff that managed to hang around in some of the earlier versions.
Once I’m up and running I start to have a poke around, and I notice some of the differences from XP (the new Aero shell the most obvious): A whacked out Control Panel with all of the functionality spread out into what seems like 500 different, non-logically divided up places. I tried, without success, to change the location of my “Documents” Folder so it wasn’t on the C: drive; I struggled to find the way to set the properties on my network card; I managed to find where to change some of my display settings (to no avail, I had to download some new drivers from nVidia to make my GeForce FX 5950 Ultra perform with some responsiveness, let alone verve and moxy!).
It seems that MS have become so paranoid about security that they have decided to make it almost impossible to do anything on your computer without the annoying UAC dialog popping up. This window stops all other processes from running on the computer (which, for someone who uses Synergy to share a keyboard and mouse between their Mac and PC, is astonishingly annoying) until you give permission for the process to continue. And just about every function in the Control Panel requires this action before it will change any setting.
Now, I’m all for Windows to become more secure, but why couldn’t they have copied something from Apple on this one? In MacOSX there’s a little padlock on the control panel that lets you lock the settings down, and you can only change something if you click on this and enter your password. Simple and elegant, and it doesn’t take control of all of the operating programs on the computer while waiting for feedback.
After wasting a lot of time mucking around with all of this stuff, I thought I’d see what this baby could do. And the answer seems to be not much. I played (or at least tried to) and XVid movie, and it was awful: jumpy, jerky, interlaced. Now, I have a fairly powerful machine and it shouldn’t be doing stuff like that, beta or no.
I realise that it’s a beta and all, and that in the next 6 months until it’s released, there’s every chance that a lot of this stuff will change, but on first take I’m just convinced that my move to MacOSX was the right decision.
Oh, and I trashed the Vista install and put Windows 2000 back on the machine. Sigh.
Crash-o-rama
This humble weblog has been having some difficulties of late, particularly concerned with actually being available for the two of you to read. While this probably doesn’t cause much of a problem for humanity at large, it’s mostly annoying for me because I get a little email saying “Yo goober, your boring site is down.”
So, in the interests of trying to work out what the hell is going on, I’ve killed all of the content (except for the wonderful selection of photos and links down the side). If the site manages to stay operational for more than the 45 minutes it did last time I will reload the archives. If it doesn’t, well it will just fit in with the rest of my day (eg the catastrophic hard drive failure that just happened inside my PC).
And if it’s really screwed? Well, I’m switching to Textpattern
SVN Tips
Another post as a reference item for me.
Setting up a subversion project
Create the trunk, tags and branches subdirectories.Then some general housekeeping for Rails apps and subversion:svn import /path/to/project http://server.com/svn/path -m "Initial Upload" svn checkout http://server.com/svn/path/trunk project name
svn remove log/* svn commit -m "Removing Logs" svn update svn propset svn:ignore "*.log" log/ svn commit -m "Ignoring Logfiles"
Easy comma delimited files
From ~:caboose
# this is used directly on models only
# Usage: Customer.to_tab_delimited
def self.to_tab_delimited(path = nil, columns = nil, options = nil)
columns ||= self.column_names
File.open(File.expand_path(path || "./#{table_name}.txt", RAILS_ROOT), 'w') do |file|
file.puts(columns.join("\t"))
# Notice this is very close to what the Array#to_tab_delimited below does, except Array only calls itself, meaning
# it only exports it's own contents.
self.find(:all, options).each do |rec|
row = columns.inject([]) do |arr, col|
if rec[col].is_a?(String)
arr << rec[col].gsub(/[\t\n]/, ' ')
else
arr << rec[col]
end
end
file.puts(row.join("\t"))
end
end
end
end
Biblio
The other day there was a post by Seth Godin in which he talked about the opportunity for an online bibliography creator that allowed you to just enter the ISBN for a book, and it would automatically find all of the relevant information for you, incorporate it into a bibliography, which you could then share with whomever you wanted to. I was sort of looking for some project where I could incorporate Amazon Web Services and also start using Google AdSense. So this project basically slapped me in the head and said “Build Me”.
The upshot of all of that is that I did. Checkout Biblio – Online Bibliography Creator. It’s all very basic at the moment, but you can search for a book, build a bibliography and print it out in 5 different citation styles. There’s alot of things I need to add to it: Search by Book Name, Manual Citation Entry (for sources not listed on Amazon), other Citation types (articles, web pages, journals etc etc). Still, it’s a start.
I built it relatively quickly in RubyOnRails. I have spent most of the past few months pretty much back in the world of ASP.Net and C# for a couple of projects that I’m working on – GradDirect (I’m subcontracting for IBC) and on a new site for KVM Australia which is just about getting ready to launch (man, talking about WebCentral is a whole new post .. sigh). The upshot of it all was that I had slipped out of the RubyOnRails space, and I had forgotten just how damn cool it is. Good to know that she fits back on like a smooth glove.
Anyway, check out Biblio. Kick the tyres and leave a comment about what you thought of it.
Back it up
I recently signed up to Strongspace, the latest service from TextDrive, the wonderful people who host all of my RubyOnRails sites.
Strongspace is essentially an online storage service, with all sorts of added features. You can upload using SFTP, browse your files using your browser, and unlike other services, you can actually login to your account via ssh. This last part is particularly cool when combined with rsync.
rsync is a fantastic utility that performs incremental backups either on your own computer, over your network, or in the case of Strongspace, over the internet. Once you do your initial upload, you just run the script as often as you want, and it will only upload what has changed.
All in all, some very cool stuff, and when used in concert, it’s an amazingly powerful system that can ensure that you never lose anything ever again.
Now if only I can convince myself that I can afford the 30Gib plan, I can back up all of my photos as well!
Getting Underway with Ruby On Rails
This post originally appeared over on Spin Technologies, but I decided that it was probably more appropriate for this site. So here it is!
Almost a year ago, I started hearing about BaseCamp, a project management/organisational tool, that had been created by 37 Signals. As more information started appearing about the product and it’s development, people started talking about RubyOnRails, a new “framework” for web development. Details were relatively sketchy, documentation was around but not for the beginner and most importantly, Rails was only at 0.4 or something similar, so I had a quick peak, and then ducked for cover within the comfortable blanket I had made from ASP.Net and C#. (Oh, but I signed up for BaseCamp though!)
And then in December last year, a client that I had developed a site for, using my technology security blanket of course, came to me with an idea for a site (it eventually became World Time Capsule– a site where you can store information/documents/whatever and lock them up, for loved ones to view later). There wasn’t a lot of money for the project and so I began to think that this might be an opportune time to begin to look at RubyOnRails. I sat down and did a couple of the online tutorials that had appeared around the place (mainly blogging applications, todo lists – modelled on Tada from the ubiquitous 37 Signals!)
It quickly became clear that here was a technology that had been lovingly crafted, with amazing skill and forethought. David Heinemeier Hansson is the creator of the framework. He was initially a contractor for 37 Signals, doing work in PHP, and then when he started work on BaseCamp he decided to create a new method of developing websites. Once BaseCamp was up and running, he extracted RubyOnRails from it, did some polishing up and released it out onto the web.
It was quickly taken up by developers around the world who were getting tired of the large amounts of work that needed to be done in order to start a project, and were taken by the simplicity of the code. These developers started making suggestions and improvements, working hard to fix bugs and issues that arose, and basically working hard to create a fantastic environment. These efforts continue today, with David recently allowing Jamis Buck and Jeremy Kemper to commit changes to the official RonR source tree.
Bear in mind that all of this development is because the extra nice people at 37 Signals decided that the technology they built when creating BaseCamp would be made available to whomever wanted it, at no charge. Open Source at it’s best.
So how is Spin making use of this great platform/framework? Other than World Time Capsule, this site is built using RubyOnRails, as are several more that we’ve done recently: Global Health Source, 11 Recruitment, and Planning Your Get Away. We are currently redesigning our company Intranet using Rails, building a fully fledged eCommerce site for an up and coming clothing retailer and developing an intranet for Five Senses Coffee to help them manage their orders and interaction with their clients.
I think you could safely say that Spin is now firmly running on Rails. In an upcoming post, I’ll look at exactly how Ruby On Rails is used to build a site.
About this site
Infrequent and ill advised.
Articles in "Development"
- 11.09.08 The Slow Decline of Internet Explorer and Slower Rise of Firefox
- 12.06.08 Freezing Rails with Git
- 08.04.08 Getting Rails, Git and Capistrano to work on a Joyent Accelerator
- 15.11.07 Connecting to Joyent Accelerator with CocoaMySQL
- 10.02.07 Maps, Geocoding and Great Timing
- 05.06.06 Vista
- 04.06.06 Crash-o-rama
- 01.02.06 SVN Tips
- 18.01.06 Easy comma delimited files
- 12.01.06 Biblio
- 09.08.05 Back it up
- 26.06.05 Getting Underway with Ruby On Rails
Categories
Currently Listening To
- Right Here, Right Now - Fatboy Slim
- Walking After You - Foo Fighters
- Let's Play House - Parliament
- Cherub Rock - The Smashing Pumpkins
- How to Disappear Completely and Never Be Found (Early) - Radiohead
- Evidence - Thelonious Monk
- Let Forever Be - The Chemical Brothers
- Strawberry Fields Forever - The Beatles
- Thunder Road - Bruce Springsteen
- Sabotage - Beastie Boys