Highlights Of FOWA 2007

Monday, 26 February 2007

Last week I had the pleasure of attending Carson Systems‘ annual Future of Web Applications conference in London. This two day conference and day of workshops has expanded significantly since the single day conference held last February (which I wasn’t able to attend). The Carson Systems crew did their usual superb job of organising the event and of attracting a good mixture of industry heavyweights and up-and-comings as speakers. Digg founder Kevin Rose was arguably the star draw, but there were also representatives from Google, Amazon, Microsoft, Yahoo! and Adobe, to name a few household names.

The conference was made even more enjoyable for me because my good friend John Conners joined me in casting a somewhat cynical and perhaps slightly jaded eye over some of the things that we were being asked to buy into during some of the presentations. The thing about John is that he actually worked at a startup for a number of years and was involved with the Web the first time around when it was still 1.0, so he knows what he’s talking about. At various points we felt like dragons in the Dragons’ Den, exclaiming ideas as ridiculous in the style of Duncan Bannatyne. It was a real blast sharing the FOWA experience with John and comparing notes and swapping stories.

Lots of people got upset because a technical hitch meant that there wasn’t any free wi-fi in the venue, but Ryan Carson explained the reasons why and apologised for this several times. It didn’t bother me, as I was there to pay attention to what was being said up on the stage rather than writing e-mails or the multitude of other distractions that the laptop-wielding majority seemed to find to occupy themselves with. The only time it was annoying was when some of the speakers were giving live demonstrations using the Internet and appealed to the audience to lay off the Internet connection for a bit to help the demo go smoothly. Unfortunately some people were so engrossed with their laptops that they obviously didn’t hear the request, with the result that the demo was spoiled for everyone. Never mind. I’m sure next year’s event will have the most amazing connectivity of any conference, ever!

Rather than dwell on the negative, I thought I’d run down what my highlights of FOWA 2007 were. These weren’t necessarily the best presentations or the things to look out for, they’re simply what I found the most interesting.

Day One

  • Simon Wardley from Fotango gave a particularly inspired and entertaining ten minute presentation covering ducks, The Spice Girls, Tony Blair, the commoditisation of services and Zimki, which is an interesting server-side JavaScript platform. Worth keeping an eye on.
  • Matthew Ogle and Anil-Bawa-Cavia talked about Last.fm which I must admit I hadn’t heard of prior to the conference. It turns out it’s only the world’s largest social music platform! They presented information on the building of their platform and the growing pains of moving from four people working in a flat to thirty people working in a proper office. What I found particularly interesting and what became something of a theme for this year, was the idea of getting users to spy on themselves—so-called myware—in order to generate attention data which software can use to do something interesting. Last.fm use it to serve their users a streaming radio station that’s completely customised to that user’s taste, amongst other things. It’s intriguing.
  • Werner Vogels from Amazon plugged their S3 and EC2 computing services in an effective manner, in many ways following up on Simon Wardley’s point about the commoditisation of services. The point being that you don’t have to worry about (for example) building a storage infrastructure for your web application anymore—just pay to use S3 and let an Amazon-class company take care of all that hard stuff. There was a great moment when someone asked Werner where the data is physically located if you use S3. He answered that it’s replicated across several locations and that Amazon can afford to lose two entire data centres and not be affected! If losing one data centre might be considered careless then I don’t know what losing two is…

Day Two

  • Adobe’s Make Anders made a great pitch for Adobe’s various Flash-based technologies and gave an impressive demo illustrating significant speed improvements in the forthcoming Flash player.
  • Simon Willison explained what OpenID is and why you should be using it. Simon’s presentation was very fast-paced. I don’t know whether it’s because he was nervous or whether he’s like that anyway. I suspect the latter. Anyway, it was a thought-provoking talk and as a result of it I’m considering adding OpenID support to AssetsGraphed.
  • PHP creator Rasmus Lerdorf gave a very interesting and technical presentation covering some of the security problems that plague the Internet and also how to go about profiling a web application in order to improve its performance. He covered some really useful things and I know that John enjoyed this one in particular.
  • Richard Moross and Stefan Magdalinski gave a good presentation all about their online printing business, MOO. I felt that Richard was a little stilted as he paused whilst he turned the page in his notes, but overall they carried it off. What really came across was how they have executed perfectly on their great idea of printing high quality business cards featuring images from online services such as Flickr. Like Apple they understand that their customers’ satisfaction is a gestalt of the entire product experience. In other words, it’s not just the product that’s important—it’s the packaging, it’s the little touches that delight, it’s the fact that they use recyclable paper from sustainable sources and that they package their products by hand to improve the quality, whilst paying a decent wage to the people who do the packing. All of which makes you feel good about buying from them. I’ve just sent off for a pack of complimentary MOO MiniCards and plan on placing a paid order soon.

Day Three

  • The third day was an optional day of workshops. John and I attended Khoi Vinh’s morning session on designing using a grid-based layout. Although I’d read about this technique on Khoi’s blog, it was still great to hear it from the man himself. I particularly enjoyed the run through of grid-based designs throughout the years and also Khoi’s ground-up reworking of a couple of pages from a certain well-known site that begins with a “Y”. The results of which looked fantastic. I’m planning on redesigning the AssetsGraphed home page using a strict grid layout at some point, so watch out for that.
  • Finally we came to the last session of FOWA 2007. We opted to hear Stefan Magdalinski talk in a lot more depth about all things MOO, which he was certainly able to do in an entertaining and informative manner. Stefan is full of amusing war stories from the various ventures he’s been involved with. We learned how it’s apparently impossible to buy thousands of pounds worth of servers at list price from Dell and also how Adobe’s PDF specification possibly doesn’t support right-to-left languages such as Arabic. I can’t actually think of anything that I might have wanted to know about MOO’s technical architecture and journey from development to successful launch that wasn’t covered. It was a great talk about a great company from a great guy.

I’m really looking forward to seeing what FOWA 2008 will have in store!

Thought For The Day

Friday, 26 January 2007

Enterprise Java leads us to a point where choice becomes a bad thing.

Installing Mint On A Rails Machine

Friday, 12 January 2007

I recently added Shaun Inman’s superb Mint statistics package to my AssetGraphed Rails Machine installation. As the installation wasn’t particularly straightforward, I thought I’d write this little guide for others who may be struggling. I should point out that the real credit for the information here goes to Bradley Taylor from Rails Machine who was extremely helpful and persistent.

First of all, I should point out that these instructions cover installing Mint under your /public directory i.e. yoursite.tld/mint/ rather than the subdomain installation method (mint.yoursite.tld). Also note that → indicates that the line has a break in it in the instructions, but in reality it should all be on one line. With that out of the way, here’s what you need to do:

  1. Install PHP on your Rails Machine using these instructions. You should have no problems with them if you follow them exactly.
  2. Log in to your Rails Machine as your deploy user then become root by using su - root and entering your root password.
  3. Edit /etc/httpd/conf/httpd.conf and search for DirectoryIndex index.html. Add index.php to the end if it’s not present as shown below and save the file:

    DirectoryIndex index.html index.php
  4. Edit /etc/httpd/conf/apps/yourapp.conf and add the following immediately after the RewriteEngine On line:

    RewriteRule ^/mint/$ /mint/index.php [QSA]
  5. Now find the three lines shown below:

    # Redirect all non-static requests to cluster
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$→
    balancer://yourapp_cluster%{REQUEST_URI} [P,QSA,L]
    —And add the following line immediately before them:

    # Don't redirect requests to /mint
    RewriteCond %{REQUEST_URI} !^/mint/(.*)$

  6. The full rewrite rules should look like this:

    RewriteEngine On
    RewriteRule ^/mint/?$ /mint/index.php [QSA]
    # Prevent access to .svn directories
    RewriteRule ^(.*/)?\.svn/ - [F,L]
    ErrorDocument 403 "Access Forbidden"

    # Check for maintenance file and redirect all requests
    RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /system/maintenance.html [L]

    # Rewrite index to check for static
    RewriteRule ^/$ /index.html [QSA]

    # Rewrite to check for Rails cached page
    RewriteRule ^([^.]+)$ $1.html [QSA]

    # Don't redirect requests to /mint
    RewriteCond %{REQUEST_URI} !^/mint/(.*)$

    # Redirect all non-static requests to cluster
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$→
    balancer://yourapp_cluster%{REQUEST_URI} [P,QSA,L]

  7. Save the file. It’s probably read-only. If you edited it using vi then you can save it even though it’s read-only by using :wq!
  8. Finally, restart Apache by using /sbin/service httpd reload and log out completely from your Rails Machine.

You can now install Mint itself by adding it to your working copy directory under /public and adding it to your Subversion repository using svn add ./public/mint. Once you’ve deployed to your Rails Machine you’ll be able to complete the Mint installation by visiting http://yoursite.tld/mint/ and following the instructions.

P.S. I have spent the past several hours wrestling with WordPress trying to get the markup in this post to validate, but I have conceded defeat!

24 iPhone Impressions

Wednesday, 10 January 2007

I’m no mobile phone expert. My current phone is a Sony Ericsson Z200 which is a few years old and doesn’t have a camera, FM radio or MP3 player. I bought it because you can make calls with it and because it’s very small and quite robust. I don’t even use it enough to justify having a contract—it’s Pay-As-You-Go all the way with me. So I’m hardly qualified to comment on Apple’s glorious new iPhone, but I’m going to anyway.

  1. The iPhone name seems to have caught everyone by surprise, not least because it’s currently owned by Cisco.
  2. You’re not going to be able to use an iPhone with a Pay-As-You-Go contract like I have. If you’re not using the device’s Internet features then you’re not getting value from it.
  3. The screen lock slider is classic Apple design: eminently practical yet a bit flashy.
  4. The user interface is almost entirely software, which means that it’s really easy for Apple to change and enhance.
  5. I remember reading about Apple’s patent on the pinch gesture used in the touch screen interface a few years ago. It’s great that it’s finally seen the light of day.
  6. The Visual Voicemail feature is really neat. Serial access (i.e. having to scroll through stuff to get to what you want) is so unsatisfying, whether it be voicemail or videotape.
  7. I remember watching Star Trek: The Next Generation and seeing crew members walking around with little black tablets with a software interface in their hands. Now we can have them too!
  8. People say that $599 is a lot of money for a phone. It is a lot of money, but think of it as a new top-end video iPod—albeit currently without the top-end storage capacity—along with a mobile Internet device that you can also make phone calls with.
  9. It’s hard to see how the next iPod can continue with the same form factor now the iPhone has been revealed. People are going to want that flippable screen on their iPod. Software scroll wheel anyone?
  10. Can you run OS X’s Terminal.app on it? If you can’t, then someone will find a way.
  11. Can you have a message engraved on the back like you can with an iPod?
  12. Will the casing be more scratch-resistant than the iPod’s?
  13. Hopefully Apple have invented a new type of plastic for the screen that really will be fingerprint resistant and easy to clean. Yeah right. We haven’t even got suction cups that don’t come off the surface they’re supposed to be attached to yet.
  14. Expect an open-source project/competition to be announced in June with a prize going to the first person to get Linux running on an iPhone.
  15. Expect Amit Singh to write an article about how to make phone calls by typing commands directly into the iPhone’s fireware interface. The commands will be surprisingly intuitive like:
    fs0:\> call 1-800-my-apple
  16. The on-screen keyboard looks quite cramped and might be hard to use without any tactile feedback.
  17. The iPhone looks too big to fit in a trouser pocket, which is a major problem for me as that’s where I like to keep my phone in the summer when I don’t wear a coat.
  18. Expect a galaxy of third-party cases/pouchs/screen protectors, all of which make you look like a dork.
  19. There’s no mention of what CPU the iPhone uses.
  20. I don’t know anything about mobile phone networks, but from reading people’s reactions to the device, lots of Americans really don’t like Cingular.
  21. Expect a plethora of music videos filled with gangsta rappers flashing their iPhones into the camera. Bling!
  22. Is the battery replaceable?
  23. Every phone I’ve ever used is full of undocumented features that are hidden away in dark crevices of the UI. For example, on my current phone, there’s one called Minute Minder and I have no idea what it is. The iPhone won’t be like that. No dark crevices.
  24. How long before the first mugging where the victim was attacked for their iPhone? How long before the first murder?

The Anticipation Mounts…

Tuesday, 9 January 2007

I just checked the Apple Store and noticed that it’s down for updating. They always do this just before a Steve Jobs keynote when he announces lots of new goodies for Apple fanboys like me to spend our hard-earned cash on. I’m excited, particularly if the long-rumoured Apple phone is going to be announced. It’s about time there was a properly designed mobile phone.

A picture of the Apple Store update message

UPDATE: Looks like I’m not going to be disappointed!—

A picture of the new Apple iPhone

AssetsGraphed At The Rails Way

Tuesday, 9 January 2007

You may recall that a while ago I mentioned The Rails Way, which is a site where Rails core team members Jamis Buck and Michael Koziarski review code submissions and illustrate Rails best practices. Well, the big news is that they’ve started reviewing my code! I submitted a subset of the code from the AssetsGraphed application and the first article about it was posted yesterday. Incidentally, in case you’re wondering what I didn’t submit, it’s the code for the Reports feature and for the hidden administration interface that I use to manage users and currencies within the system etc.

The first part of the series is about removing a lot of duplicated code around the incomings and outgoings that each asset has. I always knew that having so much identical code was totally evil, but I wasn’t quite sure how to go about removing it. As is often the way with these things, it does seem kind of obvious now! I have to admit that it’s quite nerve-wracking having my early fumblings with Ruby and Rails subjected to public scrutiny, but it’s also a great way to learn, which is why I’m doing it. I intend to implement all of the improvements featured, although some of them may be more challenging to do than meets the eye because I have the added problem of having to preserve the existing data. I don’t know how many articles are going to be in the series, but there’s certainly lots of areas that I know could be done better.

I’ve also just launched the AssetsGraphed Forums where you can post any feature requests or bug reports or just generally hang out. I’m using Josh Goebel’s and Rick Olson’s Beast forum software. Go take a look!

AssetsGraphed On Rails Machine

Wednesday, 3 January 2007

I’ve just finished moving AssetsGraphed over to Rails Machine. The application was originally hosted by TextDrive, on the same server as this site. I don’t have any complaints about TextDrive but it was clear that I needed something more substantial for AssetsGraphed. I have lifetime hosting with TextDrive which is fine for websites but problematic for Ruby on Rails applications, as you’re limited to 48 MB resident memory and 80 MB virtual memory. If your application exceeds those limits—which are pretty generous for a shared hosting environment—then your Ruby process gets terminated without warning and it’s goodnight to your app. This was proving to be a problem for AssetsGraphed, which is fairly memory intensive due to the image processing required for the graphs.

I did consider TextDrive’s other plans, in particular their Accelerator Hosting plans whereby you get a proportion of a Solaris box and root access. It sounded great but a bit too DIY for me. I don’t mind the odd bit of system administration but I’d rather be writing code with my developer’s hat on. Enter Rails Machine. I’d read good things about them and watched the demo movie on their site. The thing that appealed to me was that they make it really very easy to set everything up and deploy your application, leaving you free to spend your brain power on development. You use their Rails Machine RubyGem and custom Capistrano recipe and it all just works, as if by magic.

I went for a three VPS set up, as shown below. One virtual server is given over entirely to the AssetsGraphed Rails application, a second one will host the forthcoming AssetsGraphed forum and blog and the third is the MySQL database server that all the applications use. It’s a nice, tidy set up:

A diagram showing the configuration of my three Rails Machine virtual private servers

One of the things that I didn’t appreciate from the Rails Machine site is that the don’t provide any DNS services, so you have to bring your own. I signed up for the cheapest account from DNS Made Easy and all I had to do was go into my GoDaddy domain control panel and enter the names of the nameservers that DNS Made Easy provided me with. Then, in the DNS Made Easy control panel I set up the records for the assetsgraphed.com domain so that they pointed to the IP addresses of my Rails Machine virtual servers.

Because I went for a multiple VPS arrangement, I did have a few configuration problems where my set up deviated from the instructions on the Rails Machine site, which assumes a single VPS per app. For example, something that caught me out was that when I initially set up the Rails Machine for AssetsGraphed, the assetsgraphed.com domain was still pointing to TextDrive, so I set the domain variable in the Capistrano recipe (deploy.rb) to the non-friendly server address assigned to me by Rails Machine. When I did switch the domain over and accessed the application, all I saw was a Welcome to Rails Machine! holding page. That was fixed by setting the domain variable to assetsgraphed.com and then running:

cap setup_web
cap reload_web

—To configure Apache correctly. I should stress that I got excellent help with this and the other issues that I had by dropping in to the Rails Machine Campfire chat and talking directly to Bradley Taylor, who has always been friendly and quick to help, no matter what else he was occupied with at the time!

If you come to Rails Machine from other hosting providers like I did, then you may find it a bit bare-bones at first. As well as no DNS service, there’s no Web-based control panel. It’s all driven through Capistrano and the command line. However, don’t let that put you off because once you wrap your brain around it then it all works extremely well. What you do get for your money is a high performance Rails hosting solution, with the emphasis being on solution. All the hard work of setting up a Subversion repository, importing your code into it and deploying and running your application has been done for you. Highly recommended.

Introducing AssetsGraphed

Tuesday, 12 December 2006

I’ve just put my first Ruby on Rails application online. It’s called AssetsGraphed. It’s a free asset tracking application that also graphs your data. I created it as a vehicle for learning Rails and also because I needed a better handle on where my money goes!

AssetsGraphed lets you create assets and give them a starting balance. An asset can be anything financial that you want to track over time. For example, that dream holiday that you’re saving up for, a bank account, a retirement fund or even your pocket money. You enter incomings or outgoings against each asset and each incoming or outgoing is assigned a category, which might be something like Deposit for an incoming or Electricity Bill for an outgoing. You have complete control over your own categories. Oh, you can select which currency you want to do all this in too. There are eight to choose from, although it’s easy for me to add more. I made it default to the U.S. Dollar because that’s the nearest we have to a global currency. Don’t be offended if it’s not your currency, just select your own on the Settings screen.

An extract from the screenshots on the AssetsGraphed home page

The main AssetsGraphed screen gives an overview of all your assets and you can click them to drill down into the detail. Sparkline graphs plot the trends in the incomings, outgoings and overall balance for the asset. You can view or share asset activity by subscribing to its Atom feed. Yesterday I added a Reports page that for now just contains one report. It’s a pretty useful one though as it gives a breakdown of income or expenditure by category, either for all your assets or individual ones. So you can see the movement of your money very easily.

It’s important to understand that because AssetsGraphed is a learning exercise, it’s not a bulletproof web application. That means that it might crash, although I’ve been eating my own dog food on AssetsGraphed for just over a month now and it seems pretty solid. If it does crash on you then I’ll automatically get an e-mail about it and will investigate. You might find it a bit slow too. That’s because it’s actually running on the same shared server as this blog. I’m currently weighing up various options for moving it to a much more powerful hosting environment. I might even add SSL support too.

AssetsGraphed is just the first step on my journey to learn Ruby and Rails. There are lots of bits under the covers that I know could be done in better ways. I shall keep improving it as I learn more. There’s a really great community around Rails. I’d like to thank the Rails Weenie folks for patiently answering my questions and also Khoi Vinh for inspiring me with his Boxes and Arrows colour palette and letting me re-use it on AssetsGraphed.

Now that you’ve learned about AssetsGraphed and you’ve read the disclaimers, why not give it a try and let me know what you think?

Rails Tip #10: Listing Model Associations

Friday, 8 December 2006

You can use the built-in Rails console script to ask any model class for its associations:

Model.reflections.keys

—For example, let’s say we have a simple iTunes-like application in which a user can have one music library that contains many tracks:

class User < ActiveRecord::Base
has_one :music_library
.
.
end

class MusicLibrary < ActiveRecord::Base
belongs_to :user
has_many :tracks
.
.
end

class Track < ActiveRecord::Base
belongs_to :music_library
.
.
end

Now, firing up the Rails console and listing the associations produces the following output:

./script/console
>> User.reflections.keys
=> [:music_library]
>> MusicLibrary.reflections.keys
=> [:user, :tracks]
>> Track.reflections.keys
=> [:music_library]

Rails Tip #9: Don’t Load What You Don’t Need

Wednesday, 29 November 2006

If you’ve frozen a version of Rails into the vendor/rails directory then you can configure your application so that it doesn’t load frameworks that you aren’t using. All you have to do is uncomment the line below in your config/environment.rb file:

config.frameworks -= [:action_web_service]

—This example is instructing Rails not to load the Action Web Service framework, which is going to shave approximately a third off your application’s memory usage.