Wicked Wednesday – Evian Babies
November 18th, 2009 by pyrat
I really like when the baby grinds the rail on his roller skates. Its interesting to see how far the branding of water has come!
I really like when the baby grinds the rail on his roller skates. Its interesting to see how far the branding of water has come!
I am proud to announce the official launch of Simply Excited as a business. Initially offering a range of services from fresh project development to consulting, systems administration and training.
The aim for simply excited is to provide elegant solutions to the complex problems of the internet.
Simply Excited has already completed number of different projects which have been released to the wide world.
If you have an idea for a project or would like to employ my services in any shape or form please get in touch

Heroku recently went live with a git-based deployment cloud hosting solution for rails applications. (mouthful!)
I recently bought a new camera and had the need for a daily uploader to flickr. Heroku have a free plan which is exciting as it essentially means that you can now reliably host a simple rails application for free.
However, there are a few barriers to entry and things to be aware of.
You need to have a working knowledge of git the distributed version control system. This has an initial steep learning curve but once master is a power tool in your arsenal. The heroku documentation is a good place to start.
The filesystem is read-only, this means you have only one option when it comes to uploaded assets. They need to be stored elsewhere, ideally on a CDN. I used Amazon S3 which is not strictly a CDN but can be configured like so if you use Amazon Cloudfront
Spend some time reading the documentation so you know how to do things like:
Heroku do not provide email for free accounts so if your application needs to work with email you need to outsource your email.
The best place to outsource your email in my opinion is Google Apps for your domain. You can use the action_mailer_tls plugin to interact with google in a fairly reliable manner.
The big alternative in the free hosting arena is google app engine (GAE). It is possible to install ruby apps on there now, and I am keen to try it out.
There is an interesting performance comparison of Slicehost vs Heroku vs Google App Engine for a simple sinatra application.
Overall, I think that heroku is amazing for hosting those simple ‘toy’ rails apps that you dont want to spend money hosting. The pay plans are a little overpriced in my opinion as they still do not compete with the price of a VPS. I would like to see how heroku copes with high traffic sites and if the platform opens up with the paid plans, eg ability to run a postfix mail server.
However, it needs to be noted in terms of heroku costings, you do not need to concern your self with system administration tasks. Although you pay more for hosting you may save a lot in man hours.
I have done some basic benchmarks using httperf a great tool provided by Hewlett Packard.
Currently we have Heroku free plan versus slicehost 256mb slice running one thin instance behind nginx and mysql server on the same machine. (A cheap setup.)
I hoped to deploy the application to google app engine but it seems like getting rails applications running on this platform is currently a bit of an effort. You also need to almost design your application for the restrictions imposed by the platform. I dont like platform restrictions; while they are likely there to help large applications scale, it serves to cripple the small lightweight app.
For example, there is a 1000 file limit for GAE apps which you can easily reach with a rails app.
It is also not possible to use ActiveRecord as the database provided (BigTable) is a key/value store.
However, running something like sinatra with Datamapper as an ORM is a valid choice for a GAE deployment.
A great blog post on setting up a sinatra app with GAE.
Heroku – 58.5 requests per second stddev=3.6
Slicehost – 47.9 requests per second stddev=2.1

Surprisingly Heroku is faster than the equivalent setup on a small VPS. However, on testing earlier in the day I only managed a maximum of 25 req/s average. This means that you may be subject to competition for resources which are beyond your control.. a little like being on a shared server.
This snowboarding film coming out next year looks really interesting. Apart from filming, there was no use of helicopters and the riders are hiking their own lines. Alaska is calling!

I am going to improve my knowledge / learn afresh the following 5 languages in the next few months.
Javascript is used more and more nowadays, with powerful frameworks such as jquery and prototype and improved browser support. Internet users expect a rich internet experience nowadays and often this is made possible by a sprinkling of javascript. Whilst I have a fairly strong javascript knowledge, I would not consider myself to be accomplished. I will try and write a useful jquery plugin to further my knowledge.
Curl is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, kerberos…), file transfer resume, proxy tunneling and a busload of other useful tricks. Command-line network tools interest me (wget is ace) so I want to learn curl as I don’t currently use it at all.
c is a low level compiled programming language. I used it for graphics programming at university but haven’t touched it since. I want to refesh my memory, maybe I will try writing a some c code which interfaces with a ruby script or something along these lines.
erlang is a general-purpose concurrent programming language and runtime system. The sequential subset of Erlang is a functional language, with strict evaluation, single assignment, and dynamic typing. For concurrency it follows the Actor model. It was designed by Ericsson to support distributed, fault-tolerant, soft-real-time, non-stop applications. The first version was developed by Joe Armstrong in 1986. It supports hot swapping so code can be changed without stopping a system. Erlang was originally a proprietary language within Ericsson, but was released as open source in 1998. (wikipedia)
Concurrency is deemed to become more important in the future, due to the current trend in processor design. Hence, I am interested to both write some concurrent code but also bend my mind around functional programming once and for all.
c# is deemed the java killer for the “I have a good job with a big company crew.”. I know an increasing number of developers that work in the .net platform. Rather than be ignorant and shout about how good the ruby platform is, I need to sample the delights of .net and specifically c# for myself. I will not however, call Scott Hanselman god.
Will keep you all updated on how I fare in these language related adventures.
Things to take when touring hut to hut in Norway.
Silk liner
Silk pillowcase
Down jacket
Waterproof jacket
Waterproof trousers
Light fleece
Thermal tops x2
Torch
Spare batteries for torch
Thermal bottoms
Leisure sock x1
Hiking socks
Blister prevention and treatment
First aid
Camera
Indoor shoes (slippers)
Boots
Compass
Map
Toiletries
Book
Key
Hat
Gloves
Buff

Documentation on ActiveResource is fairly thin on the ground.
If you are using ActiveResource in the real world it is likely that you will want to use different webservices depending on what environment you are in. (Staging, Development, CI, Production etc.)
Heres how to do it. This assumes the REST api has been put under the api namespace and has been setup with HTTP Authentication.
config/initializers/config.rb
raw_config = File.read(RAILS_ROOT + "/config/config.yml") GLOBAL = YAML.load(raw_config) APP_CONFIG = GLOBAL[Rails.env]
config/config.yml
development:
webservice: http://username:password@localhost:3001/api/
test:
webservice: http://username:password@localhost:3001/api/
staging:
webservice: https://username:password@staging.com/api/
production:
webservice: https://username:password@production.com/api/app/models/incometype.rb_
class IncomeType < ActiveResource::Base self.site = APP_CONFIG['webservice'] end
Here is a great railscast on the subject.
Djamolidine Abdujaparov is one of my childhood heroes. Here we have him crashing in the 1991 Tour De France.