@madpilot makes

Freelancer Friday – come and hang out with us!

Anyone who has ever freelanced knows that being your own boss is great, but it can also be lonely. Being able to work in your pyjamas is convenient but not being able to bounce ideas off other people can be frustrating. As many of you know, I work in at the Silicon beach house which is a shared office space and we have a board room table and some couches that are less than utilised, which kinda made me think – we should have a freelancer day! And so you, kind people of the intarwebs, I present Freelancer Friday.

The idea is simple – bring your laptop and bring your work. We all sit around doing said work, but we can bounce ideas off each other, try different things out or just generally find was to distract each other :)

It is really similar (if not exactly the same) as the Work At Jelly initiative, so if you have heard of that, you will know what we are talking about.

So we will be running the first Freelancer Friday in two weeks on 26 October 2007 at the beach house – Level 2 Kings St, Perth. There will be someone there by 9, so any time after that is cool.

Grant and I are feverishly plugging away at building a web site around the idea, and it should be up soon, but we don’t have to wait for that. If you are interested, please email me on myles@madpilot.com.au

Edit: Oops, nearly forgot – if you aren’t in Perth and think the idea of a Freelancer Friday is cool, start your own one up! Invites some freelancing mates over to your house and get to work. It’s really easy to do. They don’t even have to web type people ;)

Be a good netizen: Use the correct HTTP response code

Remember the good ol’ days back before dymanic websites where pages had .html extensions and when you tried to access a page that didn’t exist you got an ugly, yet reassuring 404 Not found page? The significance of this page is actually pretty important – not only does it tell the user that the page is not found but it returns a special HTTP status that tells web spiders the same thing. As web developers, sometimes we forget that humans aren’t the only ones accessing our pages, and as a result don’t use the correct HTTP response codes to denote what is going on.

What the hell is a HTTP response code?

When your web browser makes a request to a web server, the web server will return a status code as well as the web page, which tells your browser what has happened. This response is usually made up of two parts: a number (which is for any spiders or bots that might be accessing the web site) and a string (which is for humans) and back when everything was static the web server took care of everything.

Unfortunately for web developers, in this environment of database driven web sites, we often don’t have the luxury of letting the server take care of everything, so this article aims to show you that it isn’t that difficult to do HTTP responses correctly. As I will show later, this can adversely affect your ranking in your favourite search engine.

Let’s try it out

Firstly, lets see what happens when you actually make a request – you can see what is going on using another old school application: Telnet.

Open up command line or Terminal.app or terminal depending on you flavour and type the following:

telnet madpilot.com.au 80

You will get a prompt and type the following (Windows users might not see anything as the telnet client won’t echo what you type):

HEAD / HTTP/1.1
Host: madpilot.com.au

…and hit enter twice – you should see something like:

HTTP/1.1 200 OK
Server: Mongrel 1.0.1
Status: 200 OK
Cache-Control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 4123

The first line of the response is the important bit – it tells the web browser that the response conforms to HTTP version 1.1 and more importantly the response code is 200 and the response type is OK! The 200 type is the most common response you will come across, it means that the page was found and served up correctly. Generally your web server WILL take care of this one for you. Let’s look at how you can change that status code.

I’ll use PHP as an example, because it is still the most common dynamic language – but you can do this in any language, leave a comment if you would like an example of how to do it in another dialect. It is all very simple – BEFORE you output any HTML, call the header() function as such:

header("HTTP/1.1 404 Page Not Found");

As you have probably guessed, this will tell the browser that the page it requested was not found. Why would you want to do that? Obviously if the script is being run, it has been found? Well, yes – that is true, however, when the HTTP specification was written, CMSs and dynamic product catalogues weren’t even thought about – so we need to think a little bit differently.

Let’s look at an example: Your customer has requested to see the details for product #10 by browsing to

http://www.yourcomany.com/products/view/10

Product #10 exists, so we serve up the details, but what if the customer decides to see what product #20 is? If product 20 doesn’t exist, then what should we do? One option is to print out “Product not found” which is fine for the user, but what happens if your favourite search engine tries to hit product #20? If you maintain the default action the search engine will receive a 200 OK status which makes it think that the product exists and it will index it! This just pollutes the search engines’ index and hurts your ranking, which is bad. So what we can do is serve up the 404 header from above and this let’s both the user AND the search engine know that what they have requested doesn’t exist.

So what other response codes can we use? There is a complete list here, but I’ll run through a couple of the common ones:

301 Moved Permanently: This response code means the resource that has been requested USED to live here but has now moved somewhere else and will never return. Returning this status code is extremely important if you are changing the structure of your website, as you can tell the browser where it needs to go to get the resource. More importantly, it also tells your search engine to update it’s index with the new URL. You need to supply the new URL as part of the request, so it looks something like this:

header("HTTP:1/1 301 http://www.yoursite.com/new-url");

302 Found: The 302 is actually generally used incorrectly. The most common use is to redirect a user to another page TEMPORARILY which is actually what the 303 code is for. unfortunately, not all browsers support 303 and actually expect a 302 in this case. So who are we to argue? If you are a PHP developer, you have probably used

header("Location http://www.yoursite.com/somewhere");

before – this is exactly what this does.

403 Forbidden: If you wanted to really play HTTP right, you would return this code every time someone tried to access a private URL when they weren’t logged in. It means the server knows what you are trying to do, but isn’t going to let you do it.

404 Page not found: This has been covered – basically if the resource the agent wants doesn’t exist, you serve this up.

410 Gone: This page you are looking for used to exist, but it doesn’t anymore. In fact there isn’t even a new URL, so if you are a search engine, just forget about it. Whether search engines listen to this, I’m not sure, but it can’t hurt.

500 Server Error: Something went wrong with the server. I would throw this up if there is an error that is stopping the page from loading, such as a missing database or a broken web service or similar.

Don’t forget that you can also server up content to the browser (in fact, if you don’t humans will just get a blank page), so it is recommended that you serve up a nice friendly message to your visitors explaining what happened.

So there you go – now there is no excuse for serving up errors to your users and forgetting about our automated friends. So when you are writing your next kick-arse web app, spare a thought for the visitors that aren’t so good at parsing human talk.

Web Directions over for another year

What a crazy week we have all had, a week of much drinking, socialising and occasionally learning stuff. Highlights from the second day were Andy Clarke, talking about layout techniques that can be stolen from comic books. Andy has such a effortless presentation technique and always presents beautiful slides and this year was no exception. Coming from a developer background, well presented design talks really interest me, as it is something I know little about, although there was quite a bit of overlap with some traditional user interface theories, which is what I did my honours thesis on.

Lisa Herrod‘s presentation on usability and accessibility was awesome – she tabled her idea for splitting up the official accessibility checklist between all members of the design team, emphasising the the point that it isn’t just the front-end developers responsibility. Quite often there is the situation where the copywriter, for example, will drop the content on the front-end guy, thinking there job has been done, which isn’t the case.

Finally, Mark Pesce who is an amazing speaker presented the awe-inspiring final keynote about mob rules. Basically, he noted that the internet finds a way to route around not only technical issues, but social issues such as censorship. He made mention of companies that were quietly chipping away at the traditional network infrastructure giants not with large amounts of money, but having many individuals helping out. Everyone was mesmerised.

Although, from a technical point of view many of the presentations were aimed at the beginner to intermediate level, there was much to be learnt from listening to what the presenters weren’t saying. Picking up little tidbits about what happens behind the scenes is what has inspired me. That and all of the adhoc discussion that goes on over beers.

And beers we had. Sydney has much cheaper beer prices than Perth and coupled with free beer almost every night, the pub was a very popular destination. Wednesday night was Port80 Sydney, and myself (under the guise of 88 Miles) and Adrian sponsored the bar tab. What we didn’t know was the Quarrymans’ hotel has Wednesday night trivia in which Port80 entered two teams, one of which can second. Nice work.

Thursday night drinks were provided by Adobe at the conference venue, and the Friday night closing party was lubricated by Microsoft. Andrew Krespanis managed to drink a Windows XP Home license. Myself, Grant and Joe (from Hive Media in Melbourne) stayed up at all hours on friday discussing all things web from Flash vs AJAX to running a web business. It is amazing discussing things with people that really know what they are doing.

Saturday, I headed over to the Nerf Palace to hang with a number of the Ruby on Rails Oceania clan as well as some of of the Sitepoint boys for some impromptu hacking. I decided to see what all the fuss was about by working on an iPhone/iPod Touch version of 88 Miles. Thanks must go to Tim, Cam and Mike for letting us take over their house. After this we quickly scurried over to WebJam!

Once again, I thought I would get up to the plate and present. Nick Cowie was the other local to to the three minute thing. There were some amazing talks –  Dmitry Baranovskiy presented his microformat validator, which is going to revolutionise the way we use microformats, trust me. Myles Burne showed the power of YAML and HAML and some guys from Digital Eskimo spruiked their site lobbying for the government to improve the NSW liquor licensing (Sounds like something we should do in WA). Unsuprisingly, Dmitry won – more suprisingly, my AJAX-based front end to the Ruby on Rails debugger came second, which means I can get $150 worth of Sitepoint schwag and I get to go back to Web Directions for free! (Again!) I’m publish and release the code soon – just got some clean ups to do.

So as you can see – a pretty crazy couple of days. Now to let my liver recover!

See you facebook. Thanks for the spam

Goodbye facbookI have given facebook a chance – longer than most web apps. Hell, so many of my peers use it, surely I just haven’t had that gotcha moment that will make me become addicted it. Nope. Sorry. I still don’t see the point – oh, other than allowing people to spam their friends with pointless “applications”.

So it is today that I bid you adieu. It’s been a gas.

RIP.

Edit: Fix typos – thanks to all that pointed them out :P

Facebook suicide pact

Ok, for all those who are sick to the teeth of getting spammed by your friends by “applications” on Facebook, I propose a mass Facebook Hari-kari tomorrow.

When: 28/09/2007 at 5pm Australian Eastern Standard Time (+10GMT).

The steps are simple.

  1. Login to your soon to be defunked Facebook account
  2. Click “accounts”
  3. Click “de-activate account”
  4. Revel in the fact that you are making the web a better place to be.

Pass this on to friends.

Sleepless in Sydney – Web Directions begins…

Here we are again at Web Directions and the drinking, erm, learning has begun.  Last night, we had Port80 Sydney at the Quarryman Hotel which was conveniently across the road from our hotel. The usual Perth suspects where there (as was expected, most of them are staying at the same hotel across the road) but we also had a number Port80 noobs who can along, probably for the free beer. Unknown to us, the Quarryman has a quiz night on a Wednesday night, so we entered two Port80 teams, one of which can second!

Once again, Grant and I were up to our usual shenanigans, and we decided to ignore the advice of the others and headed to a late night pub until 3am, so I’m feeling a tad seedy now. BUT that dd mean I managed to get some sleep last night. Unfortunately, the friendly barkeep failed to mention that they had redirected M4 motorway to flow right next to my room. At about 5:30 it seems that every truck in NSW drives along Harris St, which has a metal plate in the room which plays an ever so sweet drumming noise as said heavy vehicles drove over them. Nice.

Anyway, we have now managed the get to the conference proper and we are just over half-way through the first day. We started off with Rashami Sinha from Slideshare speaking about the perils of popularity. It was very oriented around the different types of social networking. It is scary how many Facebook users there were in the room. I’ll rant about Facebook shortly.

I next went to Andy Clarke awesome talk where he looked at how web designers can steal techniques from comic books. Andy is an awesome speaker which I was silly enough to miss last year – but I’m glad I made it this time around. His slides were beautiful and he presented so smoothly. Enough gushing.

I wanted to see Cameron Adams, but the room was so full (there were people sitting in the hall) so I went and hung out with Rose and Adrian.

Now I’m sitting in John Allsopp‘s talk about the future of the web – looks like we agree – the mobile web is going to be the next big thing. I’m seriously thinking about going out to buy an iPod touch when they get released tomorrow so I can get developing on some serious mobile web sites.

Right, getting motivated – will probably start cutting some code soon :)

Gentlepersons, start your engines

I have just arrived at the Kirk on Harris in Sydney which has become the Perth head quarters for those who are attending Web Directions South 2007. Whilst Gary, Drew and Nick are at workshops today and whilst I wait for the rest of the Perthians to show, I’m going to go hang out with Tim and try to get a sneek preview of the version 2.0 of the Web Directions social networking tool – connections.

More to come…

Web 2.0 Application Develpment – A presentation

On October 12 and 13, the WA Department of Industry and Resources and a number of prominent ICT professional organsiations will be holding a conference: ICT WA 2007. You can all the details of the conference at their website: http://www.ictwa.org.au. There will be a wide range of topics covered from Broadband to gaming, so go and check it out. On top of the usual presentations that are usually associated with such conferences, there will be a number of three-hour workshops – one of which will be presented by myself, Bronwen Clune and Richard Giles.

Our topic is “Web 2.0 Application Development – Hints and tips”. All three of us run Perth-based Web 2.0 startups, and know the trials and tribulations that are associated with trying to run the next generation of online applications and social networking sites. The workshop will be fairly informal and, just like any Web 2.0 project will probably take a completely different direction to what we are planning, but currently on the cards is (in no particular order):

  • Web 2.0 in business – how can you fit Web 2.0 into existing business infrastructure, both internally and externally
  • Web 2.0 development – looking at the nuts and bolts of a Web 2.0 project
  • Marketing in the 2.0 space

If you have an interest in starting a Web 2.0 project, or you want to try to convince your boss of the benefits of online collaborative tools, then come along!

Port80 Sydney

It is just under two weeks until Australia’s biggest web conference, Web Directions is on in Sydney and as happened last year a whole bunch of Perthites will be making the trip across the nullabor. As a result, the AWIA committee has decided it is time to try another Port80 Sydney, so if you are interested in seeing what the whole Port80 thing is about it would be a great time to come and drink some beer, chat with with other web geeks and generally have a bit of fun. It’s really informal, and you can just turn up – you don’t even need to RSVP!

Where: Quarryman Hotel

216 Harris St (Cnr Pyrmont Bridge)

Pyrmont NSW 2009

When: 6pm 26 September, 2007

See you all there!

Rails were rumbled. Voting starts tomorrow

There is something obtusely magnificent about locking away geeks for long periods of time, giving them a laptop and a kick-arse framework and leaving them up to their own devices – which is what Jordan Brock, Matt Didcoe and myself did last weekend for Rails Rumble ’07.

The idea is simple – You have 48 hours to create an entire website in the ever so beautiful Ruby on Rails framework. Because the competition was run out of the US and because we have real jobs/school to go to, we only ended up with 36 hours, but we didn’t let that deter us. The result? Sandwich – a recipe sharing site. During that time, we managed to product a site with friending, tagging, bookmarking and recipe parsing which is no mean feat – I dare anyone to do it in another language in that time frame.

Part of the competition is the community judging, so help a brother out and head over to our voting page and throw us a few votes – you can make a difference in the lives of three hapless codies. Go on. I’ll wait… While you are there, go check out some of the other great entries, but don’t vote for them, because you are voting for u, remember? :)

It was a really fun weekend – it was great to kick out some great code with great peeps over a stupidly short time frame. We must do it again sometime.

Previous Next