@madpilot makes

See me speak at Web Directions South ‘08!

I got asked to talk at Web Directions South 08 a couple of months ago, but it was one of those “I won’t believe it until I see it in HTML” kind of moments. Well, John and Maxine just announced the speaker list for this year, and guess what – I’m on it!

I’ll be speaking about web service APIs, OpenID and OAuth in a presentation imaginately entitled “Web APIs, Oauth and OpenID: A developer’s guide”.

Online web applications are big business, with many people relying on the cloud for data storage and workflow. These days, an API is an essential part of any online system, but this presents authentication and authorisation issues for the humble web developer. Learn how to create Web APIs, how OpenID and Oauth works and what you need to do to implement them.

I am REALLY excited by this. The line up this year is huge and it is a great privilege to be speaking on the same bill with people like Derek Featherstone and Jeffery Veen as well as some of the fantastic local talent, including fellow sandgroper – Kay Smoljak.

This years conference adds another stream (total 3: Design, development and business), has 10 international speakers and some a good number of local up-and-comers,who get their first chance to speak at an international conference (Yours truly included).

Web directions is always heaps of fun – this will be my third one. Not only do you get to hear really smart people talk about really cool stuff, you then get the chance to hang out with said really cool people and chat with them.

So, if you are thinking of going, let me sweeten the deal a little. If you use the discount code: WDS08-ME when you sign up, you’ll get $50 off the price of your ticket! It should be three types of awesome, so hurry up and ticket yourself up.

When: 23-26 September 2008

Where: Sydney Convention and Exhibition Centre, Darling Harbour, Sydney

A stark realisation

There comes a moment in every career where you realise that there is a whole world outside of what you do. Sure, you don’t have to have three PhDs to figure out the world of macrame is significantly different to Ruby on Rails hacking, but when was the last time you thought about process in, say banking software development? Or had a look at what is going on in the world of Operating System code? To an outsider, these are related industries – they both involve sitting in front a grey box for hours on end banging gibberish on to keys with embossed letters that are out of order, but to us, they are worlds apart.

A couple of days ago, something reminded me that I, and I assume a great number of other web developers have forgotten our brethren that are more at home with linked-lists than unordered-lists, and as a result, we are significantly reducing our ability to find the right tool for the right job.

This revelation was borne from the recent Twitter downtime. As always happens, hundreds of well-meaning developers tried to offer up solutions to fix Twitters yo-yo like uptime graph – there was the usual Rails bashing, some bewilderment over MySQL replication, and a general consensus that is shouldn’t be this hard, but one article really stood out: Scaling a Microblogging Service. Go and have a read if you want to know why scaling Twitter is REALLY HARD (maybe impossible),

For those of you who don’t mind a spoiler, the crux is that Twitter is designed on a platform more suited to content management, when really it is a messaging system.

Now, you go to any web developer on the planet and ask them to build you a Twitter-clone, and I bet you each design would be pretty similar. You would have a table for users, a table to hold friend references, and a table for messages, which would all be linked via some sort of foreign key relationship. The reason being is that for 90% of what we work on on a day to day basis, this makes the most sense. Generally, you have few authors, many readers and those readers all get basically the same information.

Twitter is is completely different. Everyone is a producer and everyone is a consumer. Every second there are hundreds if not THOUSANDS of writes from people leaving their 140 characters worth of thoughts. To make matters worse, every user get a different view, so every page load would be absolutely thrashing the Twitter database servers.

Twitter is a MESSAGING SYSTEM – not a CMS. It closer to a mailing list then a blog. So why did the developers not make this observation straight away? Well, as web developers, this is foreign territory. If Nokia decided that they were going to build Twitter, I bet things would look very different. Twitter and SMS are pretty closely related, and for someone dealing with short messages all day, that may have been the natural path for them to take.

You might counter this argument by saying that we are web developers – of course we think in terms of web. We do what we know, just like everyone else. Correct. But maybe we should stop and think a little before we dive in and start coding up prototypes using our favourite RAD tools. Maybe we should try to look for metaphors in other areas before taking our hammer to unsuspecting screws, bolts and watermelons.

Maybe we should take some lessons from the User Interface guys? They use metaphors all the time when they design. Without somebody realising that people like putting paper into manila folders, we would still be kicking around text terminals. Lucky for us, our metaphors don’t need to be as abstract as that. We only need to look at outside our little bubbles to see what developers from other industries are doing and we may too see a obvious solution that we would have otherwise missed.

A multi-touch pad of my very own

I simply had to have one. As I previously posted, the ever so clever guy from http://ssandler.wordpress.com/MTmini/ posted instructions for making your own multi-touch (think Microsoft Surface or iPod Touch) pad. So what can any self-respecting geek do, other than to build one? Here is what I did.

Being the impatient kind of guy that I am, I didn’t want to have to buy anything to complete the build (I had to wait unit after work, and the shops were closed), so I did a little substitution with stuff you might find around your house. The ingredients:

  • 1 x An old red wine glass box (Although any decent sized box would do)
  • 1 x A4 picture frame
  • 1 x 6 year-old Dlink DCB-C300 Webcam
  • 30 cm of baking paper
  • 4cm of sticky tape
  • 1 blob of Bluetac
  • 1 x Software bundle from http://ssandler.wordpress.com/MTmini/

I had to modify the webcam slightly, as the current configuration was too long to fit in the box very well (You need as much gap between the pad and camera as possible which will give you maximum usage space), so I had to bend some pins to get it to lie flat. Next, I bluetac’d it to the bottom of the box. Next I took the cardboard backing off the picture frame, removed the glass and covered one side in the baking paper. I used the sticky tape to fasten it in, and replace the paper-clad glass back in the frame. Placing the frame on top of said box completes the build.

After installing the software and following the instructions (including the calibration instructions) it was done! Yep. That’s right. Done. 5 minutes work really (Not includingbending the pins and digging out the drivers for the webcam). See the photos and short (badly shot) video as proof of this wondrous feat. This is SERIOUSLY COOL.

The webcam sans it’s inners

The picture frame

And the proof that is works:

Multi-touch screen for under $50

This is why I love the intarwebs. I have found a project for this weekend. (Go to http://ssandler.wordpress.com/MTmini/ to get the skinny.)

Working with branches in Subversion

I know that Git is the flavour of the month in regards to version control at the moment, but I still use Subversion (SVN) for my day-to-day version control needs. And since it is still very popular, I think this quick tutorial still has it’s place. Today, I was asked by a client to show them how to branch a SVN repository so they could start making some major changes to their application with out running the risk of breaking the release version.

The scenario works something like this: You have finally launched your application and everything is purring along nicely. You decided to start working on the next iteration, which has some major changes that WILL break things initially. You start working away, and find yourself half way through the changes when you get a call from an irrate customer who can’t complete their transaction because of an obscure edge case bug that you missed. The dilemma that you have is that your source base is in a state of flux, and you can’t release it, because in it’s current state, it doesn’t work. Wouldn’t it be great if you could have maintenance version of your application that you could make the fix on? Enter branching.

Firstly, a bit of terminology. I’ve used the word “branch” a couple of times. The analogy is simple – you have a core line of code (The “trunk”) and you can have concurrent lines of code that “branch” from the trunk. One of those branches may well be our “stable” branch, meaning that the only changes that can occur are bug fixes – ie NO new features. As with any system, there is more than one way to fell a tree, but this is the system that I generally use.

So how do you do it? When I create a new SVN project, I like to add a trunk directory, and a branches directory. With in that branched directory, I add another directory called stable (let’s pretend my SVN server is at svn.myserver.com):

# Create a new project - tedious stuff like locking down access omitted for clarity

svnadmin create new_project

# Now head over to your working directory, and check out the initial version

svn co svn://svn.myserver.com/new_project

» Checked out revision 0.

cd new_project

mkdir branches

mkdir trunk

# Now to add the new directories to the repository

svn add branches trunk

» A         branches

» A         trunk

svn commit -m "Adding initial directories"

» Adding         branches

» Adding         trunk

»

» Committed revision 1.

Now we have our working copy setup and committed back to the server, you can start work on the trunk. Cut scene to the day before go live. You are pretty happy with how the trunk is looking, and you would like to branch the code into stable. For this we use the copy command

svn copy svn://svn.myserver.com/new_project/trunk svn://svn.myserver.com/new_project/branches/stable -m "Branching stable"

» Committed revision 10.

cd stable

svn update

» A    stable

» Updated to revision 11.

And we are done! Now you can continue on your merry way and change code in trunk with out affecting your stable release. Once you are happy with the next version and you’re ready to create your next stable branch from your new feature rich trunk, you can “merge” your changes from trunk into stable:

svn merge svn://svn.myserver.com/new_project/branches/stable svn://svn.myserver.com/new_project/trunk -m "Merging trunk changes into stable"

» A    new_file_that_is_in_trunk.txt

And of course it works the other way – say you found that obscure edge case bug in stable, and you have fixed it, you would want to merge the change back in to trunk, so you don’t introduce any “regression bugs” (Bugs that you fix, then inadvertently re-introduce by changing code). All you need to do is flip the order of the two URLS:

svn merge svn://svn.myserver.com/new_project/trunk svn://svn.myserver.com/new_project/branches/stable -m "Merging edge case fix from stable"

» M    fixed_file_from_stable.txt

There you go! Easy as pie – let’s just hope you don’t get to many conflicts that you need to manually resolve. It’s always a great idea to test you code again after a merge, just to be sure everything works as expected.

BarCamp Perth 2.0 – We came, we saw, we caught bird flu

Put 80-odd  geeks in a room and magic happens, which is what happened on Saturday at BarCamp 2.0, Perth. It was a fantastic turn out – we even got a couple of east coasters (Thanks @marclehmann and @liako) to enjoy the frivolities. Although, due to me running around like a blowfly with it’s head cut off, I still manged to get a couple of great presentations, which could lead to some seriously cool ideas which is all you can ask from a BarCamp.

But the biggest announcement for the day was WA’s very own Web conference – Edge of the Web.  After three awesome Web Awards over the last three years, it was a natural progression for us to push the envelope a little. Keep November 6 and 7 free – it’s going to be three types of awesome. We have international and national speakers, and we are fairly good at throwing parties over this side of the Nullabor. Oh, and we are running a poll, were you can put your 3c worth in picking our logo.

Having said that. I do have one gripe about our fair city. After the PTUB that followed BarCamp at the Royal, we moved on to @richardgiles‘ place for a cuppa tea and a scone. We realised we were out of Brandy, so we went out to find a friendly establishment to purchase a night-cap or two. It was 10pm in the evening AND EVERYTHING WAS CLOSED. I seriously caught a cab out to South Perth to go through a drive through. WTF. Anyway. Enough bitching – it was a top day and night and I’m not going to let our draconian liquor licensing laws spoil that.

Anyhoo, I’m off to nurse this cold that I and half of the Perth twitterati seem to have contracted.

Silicon Breach – who says Web 2.0 is a game…

BarCamp Perth is but two days away, and we have nearly 90 participants, it is going to be huge. There is also something a little special that is going to make it even bigger, courtesy of Giant Dice, everyone’s favourite local pervasive gaming studio.

Introducing Silicon Breach:

In Silicon Breach, three Web 2.0 startups compete for venture capital by circulating ideas. When an idea is shared within a company, it’s good. :) When an idea is stolen by another company, it’s bad. :(

On the morning of May 10, players will be secretly assigned to a company, and they will be given a secret idea. Every idea is two words, e.g. roundedcorners or morefunding.

Noone knows your idea but you. Noone knows which company you’re in but you. You must decide how to use this information.

It sounds like a really fun game,that incorporates mystic, social engineering and rounded corners. So if you are heading to BarCamp Perth, go and register to play.

Ask Myles-i the web guy…

As previously mentioned, Perth is having it’s second BarCamp, and in true unconference style, I’m not going to organise a talk – you are going to do it for me.

I’m running a Q&A, on all things web, so if you have a burning question about PHP, Rails, JavaScript, CSS, Apache, whatever – save then up for Saturday the 10th of May, and see if you can stump me :)

Bash history – a geek meme

I was browsing through some ruby blogs and came across this crazy memeshell command history distributions.

By running the following command in bash (zsh needs a -n 1000 after history apparently)

history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s \n",a[i],i}}'|sort -rn|head

and you’ll get the top ten most used shell commands. Mine are:

259 ENV=test  
45 cd  
36 vi  
36 ls  
34 svn  
18 script/spec  
12 rake  
9 fg  
8 cap  
7 script/generate

I’ve obviously been doing a lot of testing on a project I’m working on (Alas, it’s PHP). Most of the other calls are pretty rails centric though :)

I wouldn’t mind seeing what the rest of the Perth Ruby developer’s histories look like :)

BarCamp Perth II

That’s right folks is time for some unconference goodness in the West – pencil (nay, ink) in 10 May 2008 for the second Perth BarCamp!

Go an check out the wiki for all the details, sign up to the newsletter and buy a t-shirt.

Oh, and if you think you might be interested in sponsoring this year’s BarCamp, send an email to events@webindustry.asn.au 

Previous Next