Tuesday 22 December 2009

Updating Google Map Marker's z-index

Lately I've been working on a web application that uses Google's Maps API. It's been an interesting and engaging project.

One of the limitations of the current Maps API is that the z-index of a marker cannot be changed after it has been created. The client requested that the selected marker "popped to the front" as some markers obscured others in certain map areas depending on zoom and closeness of coordinates. This was a reasonable request and would enhance the UI, but was not so easy to implement.

Mike Williams gives a good introduction to this issue and details of how to set the z-index of the marker when it is created with addOverlay() in his Google Maps API Tutorial. Having read this, I attempted to re-create each marker when it was clicked and keep track of the top most z-index. I had some success but had unpredictable z-index results and it was definitely an inefficient way to produce the desired effect.

I decided to browse the DOM and see if I could find a better way to do this. I found a guide to Undocumented Google API features which seems to be mostly out of date, but contained the very important details of how to calculate a Marker's default z-index:

Use marker.setZIndex(Math.round(marker.getLatitude()*-100000)) to get a moved marker to overlap correctly.

Even though setZIndex() and getLatitude() are not valid methods in the current API, it's easy to understand the calculation.

In my application I was already using a unique icon for each marker so that they displayed sequential letters (A,B,C...) and had added an index property to the marker object. I was able to leverage this with a bit of jQuery magic to find each icon in the DOM and alter the CSS z-index value. Since the default z-index is something like -108619296, I created a function to toggle the z-index between normal and front positions by multiplying it by -1.

icon = $("#mapbox div div div img[src='/images/markers/"+marker.index+".png']");
zidx = icon.css('z-index');

Just to make sure that no other marker was still in the top position, I looped through my array of markers and reset the z-index with this function.

function reset_zorder(marker) {
$("#mapbox div div div img[src='/images/markers/"+marker.index+".png']").css('z-index',Math.round(marker.getPoint().lat()*-100000));

Obviously none of this is a copy+paste solution. but it should give anybody needing to manipulate Google Maps MAP Marker z-index a good example to work from.

Thursday 17 December 2009

"X-Moz: prefetch" and skewed page-hits

Earlier today I installed a WordPress plugin recommend for tracking the popularity of posts. The plugin is unsurprisingly named "Recently Popular". After installing the plugin I ran some quick tests and found that I was getting extra hits recorded. I spent a bit of time back-tracking to find the source and after systematically disabling all other plugins and page elements found that it was firing in wp_head() in the page header.

After some more digging, I noticed that the extra hit was for the chronologically next published post and that the problem occurred in both WordPress and WordPressMU. This wasn't making a lot of sense so I decided to try a different browser - more of a sanity test than anything. That's when I found it didn't occur in Chrome, or Opera - just Firefox 3.5.6 that I'd upgraded to a few hours earlier.

I fired up the Live HTTP Headers add-on and checked out the requests Firefox was making. It was definitely making both post requests. I took a closer look at the second request and noticed the extra header "X-Moz: prefetch".

A quick search for X-Moz: prefetch turns up Mozilla's Link prefetching FAQ which gives a good description of what is happening and why. WordPress creates a tag similar to the following when wp_head() is executed:

<link rel='next' title='The Next Post' href='http://your_domain/year/month/day/the_next_post/' />

I am unaware of anyway to disable the prefetch hints. You could edit your header.php and remove the wp_head() statement, but many plugins rely on the execution of this function so results could be unexpected and undesirable. The issue for me was not that the hint was published but that the prefetch hits were being counted as real post requests, as well as the actual request when I clicked through a second or two later. This would seriously skew the perceived popularity of posts.

My solution was to ensure that the Recently Popular plugin ignored post requests that passed the "X-Moz: prefetch" header. Depending on your server configuration, the method of checking the header exists may differ - apache_request_headers() (alias getallheaders()) is only supported when PHP is installed as an Apache module. Most servers should support checking for $_SERVER['HTTP_X_MOZ'].

I wonder how many other people will wonder why their page hit stats have mysteriously increased without any increase in ad impressions, etc.

I will contact the plugin author to suggest an update once I've published this post.

Friday 27 November 2009

How To: Android Scrollable Divs

Lately I've been working on a webapp for the Motorola Droid and a QNX CAR device. The application interface is a split screen with one half being a list of items of variable length. Neither of these browsers on these devices support iframes or scrollable divs, so the approach used in a traditional browser was not an option.

The application was using jQuery, so using the jQuery UI Draggable plugin was a natural choice. It was quick and easy to implement and worked well on the QNX device, but didn't work at all on the Android browser.

To get the prototype version of the application finished on time for the deadline, I resorted to adding up/down buttons to the interface that scrolled the div content by manipulating the margin-top via javascript. This satisfied the client, but as a solution it was less than optimal, and in my opinion it made the UI feel clunky.

At the time that I write this, there's not a lot of information about how to deal with this issue in the Android browser. It took me a while to discover that this issue is also a problem for the iPhone/iPod Touch browser and since Android's browser also uses WebKit, there is already a working solution called iScroll developed by Matteo Spinelli on Cubiq.org.

This code utilises WebKit's "touch" events, which are akin to click events, but are only fired by touch screens. You can find a great introduction to Javascript Touch Events on Michael's "Back To The Code" blog. If you're new to developing mobile webapps, you should probably also take a look at iPhone Webapps 101.

Hopefully posting these bits and pieces together here will help save somebody a lot of time searching on Google.

Friday 20 November 2009

Skype vs XAMPP

I like Skype. I use it everyday. Most of the people I need to communicate with are Skype users. Skype handles chat, voice and file transfers to individuals and groups, and one-to-one video-chat, and allows you to cheaply connect to real-world telephony and SMS too. I'd have to say I am a bit of a fan.

The only annoyance I have found is that when I reboot my PC (which is not that often), Skype starts up and grabs port 80 before my XAMPP install starts. This means that my local XAMPP Apache install fails to start. In the past I've been forced to quit Skype, start Apache and then restart Skype. No big deal, but a little annoying.

Yesterday I had a closer look at Skype's Advanced Settings and found this problem can be resolved by simply unchecking the "Use port 80 and 443 as alternatives for incoming connections" option and restarting Skype. Simple stuff, but I though it was worth posting.

Monday 9 November 2009

Parsing and visualising JSON

Over the last few days I've been working on a project that uses some fairly complex JSON objects. Because JSON (JavaScript Object Notation) is a lightweight data interchange format, it can be a great way to grab complex data structures via Ajax. It's been said that JSON is "the fat-free alternative to XML".

In theory JSON is easy to parse, but if your data structure starts to contain numerous nested objects and arrays, it can be come hard to keep track of and starts looking like a long jumble of punctuation.

I found Brenton Fletcher's JSON 2 HTML to be a quick and easy way to check your JSON syntax and visualize the data. You can either copy+paste a JSON string or sumbit a URL and the will page load the JSON string from the URL. It's definitely worth checking out if you're working with JSON.

Monday 26 October 2009

Converting Media Formats

There are so many media format in common use these days that it's difficult to keep up with them, not just with when and why to use each format, but also being able to read them or convert between them.

Lately I found the need to convert a couple of different file formats that Windows isn't natively strong with. If you've ever tried to track down a codec for a slightly different format, then you'll know how annoying and confusing it can be, especially when you want to export to another format.

There is one tool I have found to be very useful in this area, and it's a great piece of freeware. The name of the application is "SUPER © Simplified Universal Player Encoder & Renderer".

Here's a warning though - the website is not very aesthetic or user firendly, but it's worth the effort to get the free fully functioned application with codecs included. Just scroll to the bottom of the first two pages looking for the download link, and then the actual download link should be on the third page. If I post the download page link here it'll just redirect you to the first page anyway...

Just to prove that it's useful, here a vdeo I made with a an old .m4a file that I could finally convert to a more useful wav/mp3 and threw together twith some screen captures from Winamp's Milkdrop plugin. I wrote this track years ago (when I was in my "synth" phase), the original files are long gone...

Friday 9 October 2009

Hey, Where'd My Space Go?

Recently I was doing some routine stuff when I noticed the was a LOT less space on my main hard-drive than I expected. I was down to less than 500MB of space! I remember the days when I was smug about having a 30MB drive when the guy working on the next PC only had a 20MB drive. It's hard to believe in this age of relatively gigantic drives we can still fill them up without too much effort. I guess we can put it down to the ever increasing filesizes driven by higher pixel counts of digital cameras, the recent epidemic of software bloat, and the invention of peer-to-peer file sharing.

I needed to free up some space, so I dug out my favourite drive-space analysis tool. It's pretty lean and has a great interface, so I thought I would share it here.


This is Steffen Gerlach's freeware application for Windows called Scanner. Once the application has scanned your drive, you can drill down through each folder of the sunburst chart to easily identify what has been gobbling up your drive space. Admittedly the initial scanning can take a few minutes, but no more than it takes to grab a cup of coffee.

Sunday 4 October 2009

Installing Movable Type 4 on XAMPP

Yesterday, I finally got Movable Type 4 working on my development PC. I needed to install it for a project I am working on, and found it to be a lot more troublesome than expected. Movable Type is a weblog publishing system that was first released back in October 2001. It is written in Perl, and that's where the trouble started...

Downloading the latest version and setting up a virtual host for the test site was all as easy as I would usually expect. Then I pulled up the Quick Start Instructions to make sure I didn't make any assumptions. I carefully followed the process, making allowances for my install being on windows localhost, and met with failure after failure.

After much searching and reading, it became apparent that my old install of XAMPP required a Perl add-on patch. None of the download files I could find seemed to be the correct version, and since the current XAMPP installation package now includes Perl, I decided it was time to upgrade (see my previous post).

After the XAMPP upgrade, I started the Movable Type install again. More failures eventually pushed me to find a much more helpful installation guide from Brian Cantoni. Due to the multiple sites I have set up on my development PC, I used a different path in Step 3, and I chose to use SQLyog instead of phpMyAdmin for steps 4 - 6.

Step 7 is the crucial info missing from the Quick Start Instructions:
In the folder `c:\xampp\cgi-bin\mt4`, edit all the *.cgi files and change the first line to: `#!c:\xampp\perl\bin\perl.exe`

Unfortunately, Cantoni's guide doesn't mention how to handle the config file. Thankfully, you can find that information in Step 2 of this guide on etc. Another helpful hint in etc's guide is to use the MT system check script http://localhost/cgi-bin/mt/mt.cgi before trying to initialise your new install.

This is the point, I found that I still hadn't quite cracked it. I had some kind of Perl/mySQL install issue.
Your server does not have DBD::mysql installed, or DBD::mysql requires another module that is not installed. The DBD::mysql database driver is required to use MySQL Database. Please consult the installation instructions for help in installing DBD::mysql.

I resorted to installing ActiveState Perl to see how that compared. It wasn't the solution, but it did help me identify how to fix the DBD::mysql issue (I have subsequently uninstalled ActiveState). It seems that there was a dll file missing from C:\xampp\perl\site\lib\auto\DBD\mysql that XAMPP had already installed elsewhere on my machine. I copied the file C:\xampp\mysql\bin\libmysql.dll and pasted it into C:\xampp\perl\site\lib\auto\DBD\mysql and finally I had a working installation of Movable Type v4.31 on XAMPP v1.7.2.

Saturday 3 October 2009

PHP Parse Error: syntax error, unexpected $end

Yesterday I decided to upgrade my XAMPP install from (ye olde) v1.5.5 to (the current) v1.7.2. This was mainly precipitated by my inability to install Movable Type - apparently due to missing PERL libs. I like XAMPP. In my experience it's the easiest way to install the Apache/PHP/MySQL stack on a Win32 machine and I've been using it for years. So, since there was no simple upgrade path from v1.5.5 to v1.7.2, I set about backing up all of my development mySQL databases, and httpd.conf and extra\httpd-vhosts.conf files, etc...

I like to keep my root folder clean, so on the last install I'd opted for "c:\program files\xampp", but since I'd read that "program files" could cause major PERL problems, this time I installed in "c:\xampp". Installation went pretty smoothly, and I was able to drop in my old extra\httpd-vhosts.conf file with no problems. Then I re-imported the mySQL databases I needed and checked all my development sites were OK.

I did have an unexpected problem when I tested one of my sites - I was presented with the following error:
Parse error: syntax error, unexpected $end in {filename} on line {linenumber}

If you Google that error, you'll see a lot of pages stating that "it is caused by a missing curly bracket" or a bad class definition, which was definitely not the case for me. The cause in this instance was that this particular site's code was using Short Open Tags.

XAMPP's php.ini file states that Short Open Tags is a php.ini directive that:
"...determines whether or not PHP will recognize code between <? and ?> tags as PHP source which should be processed as such. It's been recommended for several years that you not use the short tag "short cut" and instead to use the full <?php and ?> tag combination. With the wide spread use of XML and use of these tags by other languages, the server can become easily confused and end up parsing the wrong code in the wrong context. But because this short cut has been a feature for such a long time, it's currently still supported for backwards compatibility, but we recommend you don't use them."

Due to the number of pages using these codes, I opted to update php.ini to allow Short Open Tags, but I fully endorse the above recommendation to use <?php in any new or updated code.

Finding the cause and implementing the solution was a simple matter, however I thought I should post a note about it here as the curly bracket comments could confuse some users, and hopefully this will help somebody. The default PHP setting for this directive is "On", (although XAMPP have disabled it in their install), so Short Open Tags will be supported unless your php.ini contains the following line - I'll let you decide if that's good or bad.
short_open_tag = Off

Monday 7 September 2009

How to use Playstation Controllers on PC

Last week I posted how useful I'd found the wired SingStar mic's USB adaptor to be outside of the SingStar game. Writing that post got me thinking about the old PS2* controllers and how useful these could be. Like many PS3 owners, I wasn't keen to shell out £35 on a second wireless controller and purchased a PS2/PS3 USB adaptor. This works pretty well on Little Big Planet or any other games not reliant on SIX-AXIS motion.

Because I had purchased this adaptor for the PS3, it had not occured to me before now to try plugging this USB adaptor into my PC. I tried this today and was pleased to see it automatically install as "HID-compliant game controller" on both XP and Vista. The next thing I did was fire up TrackMania Nations Forever on the hunch that it would be fun to play with a game controller. The controller was instantly recognised although all actions seemed to be assigned to the buttons on the left side of the controller. I prefer steering on the left and acceleration on the right, so I went into the Inputs configuration.

TMNF Inputs for game controller

This is the point where things started to get a little confusing. I had no idea which button was Button 0 or 1 or 4, etc. So after a little but of experimentation I put together this handy reference image.
PS2 button numbers

I even tried this with an old PS1 controller and it also performed well (apart from the controller's buttons being a little sticky). The only difficulty I found (apart from mapping the buttons) was finding games that support game controller input, TrackMania is the only game I have installed that does. It is nice to play it with a controller though.

* Connecting a PS3 controller is a completely different process which is nicely addressed by davies lim and HowToGeek, although you map still find the the button map above to be useful.

Friday 4 September 2009

Short rant about quotes

It seems to me that a high percentage of PHP programmers are making a simple mistake in their code that increases the execution time of their scripts. I certainly seem to be frequently fixing the problem in other people's code, whether I am maintaining a website, or using an open source class or plugin, etc.

To some, the following two statements might appear to be functionally identical, but in the second statement PHP has to parse the double-quoted content and check for any variables to evaluate before outputting it.


echo 'Hello World, so long and thanks for all the ghoti!';
echo "Hello World, so long and thanks for all the ghoti!";


If you're thinking, "So what? It's just one line..." then you are not thinking like a programmer. "Expect the unexpected" is one of the first rules of defensive programming. Imagine using this statement in a function or method that is executed many times in one script, or if it's called a few hundred times from within a loop, and maybe on a page which suddenly gets ten times the traffic you expected. All those extra CPU cycles quickly start to add up.

Now, think about all the times that static text is used inside your scripts outside of echo statements, because they will be parsed in exactly the same way. It's easy to imagine how this can start making a difference to the resources your site uses.

In a nutshell, if you're not evaluating anything in the string, use single quotes.

NB: ghoti = fish.

Wednesday 26 August 2009

mySQL row counter

Every now and then I come across a snippet of code which is incredibly useful at the time, but rarely used. The problem with these snippets is that I usually forget the particulars by the next time I need to use it.

Today I needed to use such a snippet and luckily for me, I knew exactly where I had last used it and was able to go straight to the source and grab it. This piece of SQL adds a row counter column to the result set. This is handy if you need to add a rank to records on a bulk insert, or create a new sequential key for on-the-fly table joins.

Here's a fairly simple example where the result set would return up to 50 rows:

SELECT (@rownum:=@rownum+1) rank, fieldname
FROM (SELECT @rownum:=0) ranks, tablename
WHERE something=TRUE ORDER BY fieldname ASC LIMIT 50

This concept can be taken one step further. In this example we update table_one's new_id field with table_two.id sequentially from the row with id value of 151.

UPDATE table_one INNER JOIN (Select @rownum:=@rownum+1 rank, id
FROM (SELECT @rownum:=150) ranks, table_two
WHERE something=TRUE) temp_table ON table_one.id = temp_table.rank
SET table_one.new_id = temp_table.id

Obviously this second example will only work where the id values are entirely sequential (no missing rows), but it worked well for the task I had to do and saved me from dumping the data into a temporary table just to be able to join for a one-to-one update.

I hope you'll find this as useful and interesting as I did :)

Friday 21 August 2009

WordPress Plugins

Earlier this month I decided to move pantsonhead.com from it's ancient codebase onto a current CMS platform. The goal was to make it easier to manage, and hopefully spur me into making more frequent posts, and to get some experience with another platform.

After a little deliberation and discussion with friends I decided to go with WordPress. With WordPress MU and BuddyPress looking to be quite big in the near future I thought this was a smart choice. I'd tried Joomla! before but didn't have a great experience. ExpressionEngine was also a possibility, I've used it before and liked it a lot and ExpressionEngine 2.0 being built on CodeIgniter sounds great.

In the end WordPress won out because it's open-source, because pantsonhead.com is 90% blog, and because the plugin development community seems very active. For me, writing Plugins is an attractive way to work on some bite-sized code projects for fun, and maybe even profit.

The conversion to WordPress was fairly painless although I did have to create a couple of plugins to provide the functionality I wanted. I decided to release some of these into wild and the response so far has been quite positive.

Activity Sparks
Activity Sparks is a highly customizable widget to display a sparkline style graph in your sidebar indicate post and/or comment activity. This WordPress plugin leverages Google’s Chart API, so does not require the PHP GDI library. Customization options include Title, size, colour, background transparency, activity granularity and period.

RandomText is a handy WordPress plugin that allows you to save, edit and delete categorized text, and inject random text by category into the sidebar (via widget) or pagebody (via template tags). Whether you want to display random trivia, quotes, helpful hints, featured articles, or snippets of html, you can do it all easily with RandomText.

RSS Blogroll
RSS Blogroll allows you to link to your favourite blogs via the latest items from their RSS feed. Article titles are much more attention grabbing and will deliver much higher quality traffic. We all hate clicking through to abandoned blogs – displaying article publication dates also lets readers know these are up to date and active sites. RSS Blogroll will create deeplinks to the target sites, which are much more useful for SEO than homepage links. Overall it’s a win-win situation with a better browsing experience for users and the linked sites getting more visitors who are actually interested in their content.

I'll be posting any future WordPress plugins on pantsonhead.com.

Sunday 16 August 2009

Newspaper Headline Image Generator

Last week I posted an article about creating an image using RSS + GDI. It featured a fairly simple example that was not always appropriate for the text contained. Yesterday I revisited the concept and produced the following image which feeds off the latest BBC News Headlines.

I've made some canny modifications to get the execution time down, but it still really needs short-term caching, and a link to the feed source. It's adequately working with most RSS/Atom feeds tested.

(Originally posted on pantsonhead.com)

Wednesday 12 August 2009

News Headline Image Generator

I'm feeling a little guilty about not posting anything here for a few weeks, so I thought I'd put this up here since it's fairly developer oriented (even though I posted it 11 months ago on my other site).

I started mucking about with generating graphics from PHP's GDI and RSS feeds and put this together for your viewing pleasure...

Now you can get the latest BBC News Headline with a smile, whatever the content (which is sometimes less than appropriate). I also put some related stuff here that you might also find to be a diversion. I’m not finished with this concept yet, so eventually we might see a more refined version.

Thursday 9 July 2009

Tracking Email Clicks in Analytics

Many of us are using Google Analytics to measure the usual web metrics, but most of use are only using a small portion of this tool's functionality.

It's common practice to send registered users an email to confirm account activity, to keep them up to date via a newsletter, or to try and encourage return activity. In many cases we are not really measuring how effective these mailings are or how they impact on our website traffic.

At first glance it looks like a tricky problem, mail client applications will generally not pass a referrer and browser mail will be recorded as one of the hundreds of mail domains in use. Link Tagging is the simple solution, although there are a few options depending on how deep you want to go.

Source and Medium

By appending utm_source and utm_medium parameters to your links you can easily track who many visits are directly attributable to your mailings and see them in the All Traffic Sources report.

Here's an example of how your links should look:

Setting the utm_source value will replace any referrer value as the Traffic Source so random browser domains will be consolidated under one value, along with any email clicks with no referrer which would usually be classed as "(direct)". This is the only required parameter of this type, any other utm_xxxx fields used in conjunction with utm_source are optional.

Using utm_medium=email is recommended, especially if you are using more than one utm_source value in different email types (e.g. Newsletter, AdminEmail, ReferAFriend) so that you can easily filter the results on the All Traffic Sources report.


Specifying a utm_campaign value can help group your links in a more meaningful way. This could be a sub group of your source categories (e.g. utm_campaign=200907 to identify this is the monthly Newsletter for July 2009) or you could use a campaign like utm_campaign=Winter-Sale across many sources (email, banner, CPC, etc). It all depends on what you want or need to measure. Whatever you choose, any utm_campaign values tracked will be displayed on the Traffic Sources->Campaigns report.

Content and Terms

These options are less common but still useful. Setting the utm_content parameter could help identify if text or html emails are getting more clicks. Alternatively you could track the comparative success of different creatives from the same campaign. utm_content values tracked will be displayed on the Traffic Sources->Ad Versions report.

I've included the utm_term here just for completeness. It's usually used to identify search terms or keywords purchased. utm_term values tracked will be displayed on the Traffic Sources->Keywords report.

Handy Hint

Even if you're already tracking your email clicks with another solution, it's probably worth adding these parameters (or at least some of them). As long as they are passed to the landing page it doesn't matter if you add them to the pre or post tracking URL. You may do some special tweaks so that your tracking solution passes utm_xxxx parameters on to the destination URL.

Wednesday 1 July 2009

Us Now film

Usually I avoid this kind of post, but I thought this documentary was worth sharing with everybody. "Us Now" is a film project about the power of mass collaboration, government and the internet. I found it to be both interesting and inspiring and recommend watching it.

Us Now from Banyak Films on Vimeo.

It's also available in seven parts on YouTube if you can't use Vimeo.

Monday 1 June 2009

Top Tips: Problem Solving

There will come a time when all your problem solving skills will hit a brick wall. These are some simple but effective tips to help kick start the process whether you are debugging, optimizing performance or whatever it is you're working on.

Scribble It
I'm a firm believer that nobody can hold everything in their head, this is why I recommend using a whiteboard or notepad to scribble out ideas, notes, lists and diagrams that can help your problem solving. Seeing everything laid out before you can also help give a clearer picture of a problem or reveal relationships you had not considered.

Discuss It
Vocally describing a problem to somebody else is a great way to spark ideas. The act of talking about it seems to allow your brain to follow new trains of thought and find new inspiration. It doesn't even matter if the other person fully understands what you're talking about. Inanimate objects don't really work for me, but if nobody else is available then even your cat or dog might help get you back on track.

Find Your Thinking Place
Everybody has a special thinking place where the ideas just seem to flow better. It doesn't really matter where it is, it only matters that you've identified it so that you can use it to your advantage. It could be walking to the local coffee shop, riding a bike, driving home, or walking the dog in the park. For me it's in the shower, I get all my best ideas there and actually write most of these posts in my head in the shower.

Sleep On It
Sometimes the best approach is to step away from a problem and leave it to background processing. If you've been thinking about something for a large part of the day, your subconcious will keep trying to make sense of it while you sleep. I couldn't count the number of times the answer has suddenly come to me at 3AM.

Friday 22 May 2009

How To: Use a PS3 with LCD monitor

This topic is a little step away from my usual content but the question has come up a couple of times lately and I thought I'd post a "How To" guide.

Many owners are content with using their TV for PlayStation 3 games and Blu-ray DVD. Some will be taking advantage of recent advances in HDTV and using an HDMI cable, while others are stuck with standard TV via an RCA AV cable or SCART (in Europe).

If you own a recently manufactured LCD monitor, then it's possible that you could take advantage of the PS3's HD capabilities without having to shell out for a new HDTV. Many LCD models feature a DVI input (digital) as well as SVGA (analog).

Converting HDMI -> DVI
The PlayStation3 has two different audio/video outputs. The HDMI (High-Definition Multimedia Interface) port will transmit uncompressed digital data for video and audio. We can covert this to a monitor friendly format by using a HDMI->DVI cable. This cable drops the audio data but allows the digital video data to plug into a standard monitor DVI input. I'm using one of these cheap HDMI->DVI cables into a LG FLATRON W2042T and I'm more than happy with the result. The monitor also accepts SVGA which I use for my PC and switch between the two using the monitor's "Source" button.

What about audio?
The HDMI->DVI conversion drops the audio data - since most monitors don't support audio, especially not digital audio, you're probably going to need something else to produce the sound. The PlayStation 3 simultaneously produces output on both HDMI and AV channels, so we can use the AV audio feed. In my set up I am plugging the Red and White RCA leads into a Logitech X-230 Multimedia Speaker System via an adaptor that came with the speakers (2x RCA female to stereo 3.5mm female). This is probably the best sounding system in the lower price bracket and features a handy headphone jack on the front of one speaker.

What about Xbox 360?
As I understand it, this technique will not work with the the XBox 360 as it only transmits data on either HDMI OR standard AV. Apparently you can plug your Xbox 360 into SVGA using this Xbox 360 VGA Component Audio Cable. I've not seen the output quality, but from what I've read it's quite acceptable, although some users experience ghosting on text.

Sunday 17 May 2009

RSS: Learn To Burn...

If you are regularly publishing any kind of content online, then you are probably also providing an RSS feed. (If you've been living in a cave for since 2005 and never heard of it, then you should read this introduction to RSS.)

RSS is a tricky thing to measure, requests are not tracked like normal webstats, and are commonly anonymous or via a proxy. The frequency of requests is dependant on the user's feed reader and could be daily, weekly, hourly or even every minute (or anything in between). This is why it's important to have a good grasp of how much bandwidth and processing resources your RSS feeds are using.

RSS Caching

The easiest way to offset the processing cost is to cache your feed. Depending on your site's publishing schedule and implementation, the caching period and method used will be different. The basic idea is to dump your feed into a file and serve that.

On each request check if the cache file exists and if it is younger than 15 minutes. If not then build the feed and dump it into the cache file, ready for the next request. Depending on the frequency of requests, this can reduce your feed building resource cost considerably.

Introducing FeedBurner

Feedburner has been providing RSS feed management tool since 2004. By October 2007, they reportedly hosted over a million feeds for 584,832 publishers. In June 2007, FeedBurner was acquired by Google Inc., and shortly after two of their popular PRO services (MyBrand and TotalStats) were made free to all users. By August, 2008, Google had completed migrating FeedBurner into its group of services.

FeedBurner works very well with the major blog publishing sites, but it's also worth investigating if your site is standalone.

The initial payoffs of using FeedBurner is that they can help you get a handle on the size of your subscription base, and will cache and serve your feed, thereby absorbing much of the processing and bandwidth costs.

There has been quite a bit of discussion about the accuracy of subscriber stats provided by the FeedBurner service. As stated earlier in this article, RSS stats are problematic due to the plethora of clients and the complications of anonymity and proxy services. Having said that, they service offered is a lot better than no stats and in my opinion the benefits outweigh the cost many times over.

Don't Lose Your Audience

One of the important tips about integrating FeedBurner is to make sure that your subscribers still subscribe to your site's feed URL and are redirected to your FeedBurner URL. This way, if you ever decide to drop the FeedBurner service, then you won't leave your subscribers stranded with a defunct FeedBurner URL. Google has been quite open about this issue, if you know where to look.

If you are redirecting traffic you need to make one small change to your FeedBurner options to make this work properly - but it's not that easy to find... Click on the Optimize tab for your feed, and then BrowserFriendly in the Services menu. At the bottom of the form, in the Content Options section, there is a link with the text "Use your redirected feed URL on your BrowserFriendly landing page". Click on that and then enter your site's feed URL.

This change should result in most subscribers using your site's URL, however, this still doesn't seem to work correctly with Firefox's Live Bookmarks. I haven't found a decent work around for this yet, or even much evidence that it is an issue, but for me it never works, so be aware. Even the "ClearFeed" landing page is somewhat confusing when Live Bookmarks are used, which is a concern considering Firefox's popularity.

FeedBurner Pros vs Cons

  • Free stats/caching service
  • Reliable infrastructure
  • Simple to use

  • Stats are tied to a single Google login
  • Subscription stats allegedly fluctuate
  • Some Firefox Live Bookmarks issues

Tuesday 5 May 2009

Common Sense SEO Tips

Search Engine Optimisation (SEO) is often thought of as a mystical dark art. Many folks are making a good living off giving advice on how to increase your ranking in the major search engines, some of them even know what they're talking about. In many cases the "tricks" involved are common sense and can be implemented without too much trouble. The clever part is recognising what is the best approach for each particular site.

Here are my best simple tips to get you found via Search Engines

Search Term Targeting
Think about what terms people would type into a search engine if they wanted to find your site. It's better to get 10 visitors who will be interested in your content than 100 visitors who will immediately leave and never return. Compile a list of terms you would expect your site to be well ranked for and target those terms. Make sure these terms appear in your page's body text. Keep the list in a spreadsheet and record your Search Engine ranking so you can measure improvement.

Good Content
Make sure you have a decent chunk of crawlable text. Webcrawlers don't index text if it's just in an image. Make sure the content includes the terms you want to be found for. If your product or service is regional then include those details on every page (the page footer does nicely), then you'll be more likely to be found when people search for "kitten jugglers London SW15".

Page Title
The content of the page's <title> tag is taken as a description of the page content. This is a key index for your pages. Make sure the title is clear but succinct. Limit it to 5-10 words, including your company name. Don't use the same title on multiple pages or they may be grouped as one page in search engine results.

Well Formed Links
Never ever use click here links. Link text is one of the best indexing opportunities you have, don't squander it. The text in links to your pages are treated in a similar way to page titles but links to your pages are aggregrated.

Meta Tags
Do use the keyword and description metatags. Keep it clear and simple. The keywords tag is said to be less used of late due to heavy abuse, but Yahoo claims to still support it. The description tag should provide a concise explanation of your page's content.

<meta name="description" content="An introduction to the nocturnal habits of hedgehogs of United Kingdom">
<meta name="keywords" content="hedgehog United Kingdom UK Erinaceinae nocturnal insectivore furze-pig">

If your website includes mulitple languages, translated content or is not in English you should consider also using the language tag.

If your site is brand new and hasn't been indexed yet, you can get the ball rolling by adding it to the Open Directory Project. Search engines are an incestuous bunch feeding off each other and this is a good entry point as it's used by AltaVista, A9, AOL, Ask, Clusty, Gigablast, Google, Lycos, MSN, and Yahoo.

Webmaster Tools
Google's Webmaster Tools can tell you if anything is going wrong on your site that could be affecting your search ranking. You can read about Webmaster Tools in an earlier post.

Monday 27 April 2009

Always get a Baseline first

As developers, we often spend time optimising, tweaking or redesigning to increase performance. It's fairly easy to measure performance increases when optimizing code or systems, but it's a lot harder to gauge the effectiveness of User Interface changes.

In many cases the UI choices we make are subjective at best. In some cases, our design decisions can actually make things worse, not better. There are some interesting anecdotes about this in this recent post.

In order to make sure we are making the right decisions, rather than just a bunch of assumptions, we need to measure the effectiveness of the current implementation in order to compare with the improved version.

Depending on what it is that you're changing, this could impact on conversions, page hits, or data collection rates. You'll need to decide the best way to measure the effectiveness of the changes, but without data to measure it, you'll never really know if you're doing it wrong.

It seems like a simple idea, but it applies for all optimisation and is often overlooked. A simple rule to follow is to remember to ask "How will we know if this works?" before you implement a change.

Monday 20 April 2009

Eliciting Site Referrals

One of the best ways to increase the reach of your website is through word of mouth. Personal recommendations from existing visitors carry a lot of weight. To make this easier and more frequent, it can be a good idea to give your users a nudge in the right direction with a "Share this with a friend" call to action.

The simplest way for visitors to share great content is to copy and paste a link to a friend (via email or chat). To help this process work well it's a good idea to have readable URLs to encourage clicking. For example http://yoursite.com/item/17326/The_Meaning_Of_Life looks a lot more interesting than http://yoursite.com/item=17326

Another approach to sharing content is the "Send this to a friend" model where the visitor enters a friends email address and the hosting site send the email on behalf. Many web-savvy visitors will avoid this rather than reveal the email address of a friend. In my opinion it's an out dated model that should only be used for "locked" content or simliar special circumstances.

A more powerful way to be recommended is by plugging into social networks or news networks where the link exposure is much greater than one-to-one. An easy way to implement this is via the AddThis.com bookmarking and sharing service buttons. It's a free service that allows a certain amount of customisation and also features analytics of what is being shared. There's a nice introduction video on the tour page.

Bonus Tip
Don't rely on the <title> tag to get the right title shared. To get the title to be picked up properly by Facebook, and a handful of other sites, you'll need to add a Meta Title tag:
<meta name="title" content="Dolphins rampage through Venice" />.

Wednesday 15 April 2009

Analytics Debunks Charlatan

Yesterday I overheard a friend's phonecall with a salesman for an internet listing service. She runs a modest business with her website as the only advertising and bringing in enough customers to keep her booked weeks in advance.

The listing service was claiming that they could increase traffic to her site because they specialised in listing companies in her specialised field. I suggested that she should think carefully before throwing her money their way, since her website is fairly well optimised for search engines.

As it turned out, the listing service had offered her a one month free trial (which had just expired) and had been allegedly sending traffic her way already. I decided to spend a few minutes helping her evaluate the trial.

The first step was to look at their website. Sadly their homepage failed to load as most of the content was blocked by ABP - not a good start. Next we found her listing on their site, mostly content pasted from her homepage, although her business name was spelt incorrectly (twice). By this stage I was feeling underwhelmed.

So we decided to check out the traffic they've been sending to her site. Google Analytics had been in place for some time so we could easily measure the impact. The first thing we did was check the Traffic Sources report. Indeed there were 27 visits in the last month, although they never peaked higher than 2 per day and the bounce rate seemed pretty high to me.

I suggested we check on where these visitors were coming from and see if we could find out a little more about them so we set up a Custom Segment where Source contains the listing site's domain. We could see that almost all of the traffic came from London, except for 3 visits from Australia, coincidentally where the business was based. Digging further into the New vs. Returning Visitors report showed that all but one of the London visitors was the same person returning every day or so to generate traffic.

In my opinion this kind of listing service is a waste of money if you have followed the most basic SEO principals. Needless to say, my friend will not be engaging their services.

Monday 13 April 2009

Repositize it!

If you write or maintain code for any number of projects on an ongoing basis, then you should be using a version control system. If don't already use one, then quite simply, you're needlessly working without a net. Shame on you!

The benefits of using a version controlled code repository include:
  • Keeping track of changes in source code/documentation
  • Maintaining historical versions of source code/documentation
  • Stopping developers from tripping over each other's changes
  • Assigning authorship to changes
  • Storing comments regarding each change
  • Branch and tag management
  • Rolling back to "clean code"

There are a number of version control systems available with the most common being Concurrent Versions System (CVS) and it's assumed successor Subversion (SVN). Subversion is my preferred system due to it's atomic commits (they either completely succeed or completely fail).

Golden rules to using a version control system
  • Always update from the server before you commit your changes
  • Always comment your changes (I like to use the "line 36: fixed text typo" format)
  • Use logins and passwords
  • Don't forget to back up your server regularly

Related links:
Tortoise Windows shell extensions
If you're working on Microsoft Windows you should check out TortoiseSVN and TortoiseCVS. These free clients integrate into Windows Explorer. TortoiseSVN won the SourceForge.net 2007 Community Choice Award for Best Tool or Utility for Developers.

Friday 10 April 2009

HiPPOs and A/B Tests

This 20 minute video from videolectures.net is good food for thought. It's got some great anecdotes about some big industry players and how hard it is to guess how users will react to UI changes. Well worth watching when you get a chance.

Practical Guide to Controlled Experiments on the Web:
Listen to Your Customers not to the HiPPO

Ron Kohavi

Wednesday 25 March 2009

How to disable Ad Blockers

Last week I posted an article about Ad Blocker Detection. Once you have an estimate of the potential advertising impressions lost, you can decide if you want to address it and how you wish to do that.

Some websites think of visitors employing ad blockers as content thieves. Some sites even go as far as forcing users to accept adverts to browse their pages. Personally I believe most sites don't have strong enough content to warrant this and they will only alienate users.

I believe the only way to get visitors to disable their Ad Blocker on your site is to ask them, nicely. All you can do is encourage them to support your site.

Have a look at these two banners. If you have an Ad Blocker currently enabled, then they will be identical. If not, then you will see an old Amazon banner I exhumed, and then a clear and polite message asking for support.

Ancient Amazon Advert

Both banner slots have the message set as the background image, but it is not visible for top slot as the Amazon banner is in the foreground.

To ensure the the background message is not displayed to users when no Ad Blocker is employed, the first frame of the image is transparent and is displayed for 5 seconds. Even the slowest advertisement should load within that timeframe.

If you are concerned that this message might be displayed to the user when no advertising inventory is available for this slot, then I would suggest you address the lack of ad availability before you try and reclaim more impressions. Beyond that, the prudent approach would be to set the background property for the banner slot with JavaScript only after you have detected the user is using ABP.

Monday 23 March 2009

Emotional Investment

A few years ago I was working for an internet startup. One of the developers there had a bit of a prickly temperament. He was fine if everything was going as he expected, if his efforts were noticed or rewarded, but when he had to fix other people's mistakes, or disagreed with decisions made by management team, he vented pure vitriol.

Some of the staff started to avoid dealing with him, the management team started wondering about his loyalty. His skills were never in doubt, but his attitude was causing problems. There are enough politics in a small startup without this kind of behaviour.

The problem was that he was taking it all too personally. He'd heavily invested emotionally into this business idea and wanted it to succeed, so when others made decisions he judged as incorrect, he took it as an affront to the extra effort and the time he'd poured in.

I know that's what the problem was, because a few years ago that guy was me. Luckily, I managed to snap out of that mindset before I got too bitter about things, or before got fired.

I am a perfectionist, and sometimes a bit of a control-freak because of that, coupled with my natural directness, you can imagine how I had reached that state of mind. The trouble is it's often hard to see it when you are there. The interesting thing for me is the number of times I've seen similar behaviour in others.

It's strange that over-commitment can result in such negative impacts. Emotionally based over-reacting can cause bad decisions.

In companies where the product is heavily dependant on the technical team (common in internet startups), it is easy to assume your opinion should carry more weight. But business decisions may often overrule - technical excellence alone won't stop a business from failing. The best you can hope for is that any advice you offer is considered. Those other departments exist because they are required to some degree. A successful company is a machine of many parts working together.

Being commited to what you're doing is important, but we need to remember that ultimately it is just a job. That can be hard to do when so many of us measure who we are by what we do. We're paid for the time we put in, that should be enough.

Friday 20 March 2009

FontSoup Screensaver

One weekend back in the middle of 2008, I spent a little bit of time rewriting the FontSoup Screensaver that I created back in 2001. It was long overdue for a revamp. The new incarnation is a lot more polished and now has two configurable display modes (Rainbow or Muted Tones).

This version displays your TrueType fonts in an elegant Win32 screensaver. You can download FontSoup 2.0 now for free.

Thursday 19 March 2009

Making A List

Low-tech solutions are often underrated by developers and their technically minded brethren. We tend to look down on things that aren't bleeding edge, or are designed for the technically inept. It's true that I have little respect for Frontpage, or Powerpoint or anybody who saves HTML from Word.

But low-tech is the wildcard that always trips us up. How many times have you spent hours debugging a hardware/software problem, only to finally find the cause was less technical than you imagined?

Oh, the stories I could tell: Cache files ate all the drive space.., The LAN cable fell out.., They rebooted the wrong server... Twice!, We've been Slashdotted...

One of the simplest and most effective tools that is often overlooked by developers is a daily To Do List - on paper, right next to your keyboard.

Electronic To-Do lists have their place. They really shine when you want to look back at what you did and when, and for logging chargeable time, and automated reminders, but for managing just today's tasks, I don't think you can beat a real lined page on your desk.

Here's my top reasons why I think you should adopt this practice:
  • Quick glance access avoids Alt-Tab disruptions
  • Less stuff to hold in your head - don't rely on your memory, write it down and then you can fully concentrate on what you're doing
  • Helps you set an appropriate work-pace for today's tasks
  • It doubles an idea scribble space
  • Doodling can help you concentrate
  • It's a great prop for declining new tasks, "Sorry, I can't fit that in today, I've got to get through all this..."
  • The tactile satisfaction of drawing a line through completed items

And here's some tips on making the most of your list:
  • Don't spend more than 20 minutes planning your day
  • Don't use too much detail
  • Create sub tasks for complex tasks
  • Prioritize tasks in groups
  • Note which tasks depend on others
  • Quickly reprioritize after completing each task
  • Start a new list each day. Transfer uncompleted tasks from the previous day

Wednesday 18 March 2009

Ad Blocker Detection

Late last week I mentioned Adblock Plus in my list of Essential Add-on Tools for Firefox. Here's the description again, just in case you missed it:

Adblock Plus allows you to browse without ads. It works very well and is incredibly popular because of that. Users love it, advertisers and websites dependant on ad revenue hate it. As long as flash banners keep soaking up CPU cycles, I'll keep using it.

Just about all websites rely on advertising revenue to some degree. The problem is, how do you measure the number of potential impressions you're losing to ABP?

A couple of weeks ago I cooked up a very simple solution that seems to perform quite well. In this example I'll track it with Google Analytics, but you could easily rework it to your own system.

ABP blocks items based on a list of exception rules. This detection script relies on a javascript file specifically named to be blocked by these rules. According to this script you have ABP enabled on this page (assuming you're viewing this on something that supports javascript).

Here's the code:

<script type="text/javascript">var hasABP='ABP';</script>
<script type="text/javascript" src="/js/advertising.adserver.bannerad.js"></script>
<script type="text/javascript">pageTracker._setVar(hasABP);</script>

The contents of the file /js/advertising.adserver.bannerad.js are:

var hasABP = '';

So after running this for a few hours, you should spot ABP users as 'ABP' in the Google Analytics User Defined section. In theory you could get some false positives, but the rate reported for me was so low that I think it's performing well.

Once you have some data collected, you can set up Custom Segment in Analytics' Advanced Segments and try and estimate the lost impressions based on page views.

Tuesday 17 March 2009

How to beat Jetlag

Every few months I make a 5,456 mile pilgrimage to Head Office. That's a twelve hour flight going against the clock and arriving four hours after I left, relatively speaking. That extra eight hours in the day can really screw up your body clock.

I've worked out a system to beat desynchronosis that works well for me, so I thought I'd share it here:
  • Direct Flight: Get a direct flight. Changing planes and layovers will just make transit time longer and jetlag harder to deal with.

  • Don't Sleep: Keep yourself awake on the plane. Cram in as many movies as you can, or if books are your thing, take a real page turner. Don't get drunk in the lounge or on the plane, it'll just make it worse.

  • Arrival Time: Arrive in the late afternoon or early evening and keep yourself awake until at least 9PM. This shouldn't be too difficult with the process of getting from airport to hotel, if you get the arrival time right.

  • Eat Before You Sleep: Once you have arrived and checked in to your hotel, eat a proper meal. This is crucial to success. Your body-clock will still think it's 4AM at this point, but if you eat a decent meal and then go to bed, the meal can trigger a reset in your circadian rhythm. You should sleep a good eight hours and be ready to face the world the next day.

Admittedly, westward jetlag is easier to deal with than eastward, and I am still learning to best way to combat that. Ultimately the same principals should still apply.

Monday 16 March 2009

User Segmentation in Google Analytics

You're probably using Google's free webstats product Analytics on at least one site. And to be honest, unless you're an anti-Google-domination zealot, there's little reason not to. It's easy to install and the tools are pretty good.

It's a shame there's no simple hourly traffic graph, and the Advanced Segments produce some fairly questionable results, but they are still in Beta and they do clearly state the "report is based on sampled data."

Aside from that, it's very easy to set it up, give the marketing guys "user" access and forget about it - which is what many of us do. This is where we fail. There is a lot of useful segmentation data Google Analytics collects that can give us technical insights.

Web-stats are so much more than unique visitors and page views. Analytics can give you a good grasp of your customers' browser version, operating system, screen resolution, java support, Flash version and even connection speed.

Geolocation stats can help you decide if your global reach warrants employing a Content Delivery Network.

You can even create your own segmentation using User Defined values. I like to use it to identify users as Anonymous, LoggedIn and Admins, but you can pretty much set any value you like using this statement after the usual tracking script:

<script type="text/javascript">pageTracker._setVar('SegmentX');</script>

As long as you don't go crazy inserting a unique id per user (remember this is a segmentation tool), you should be able to get some useful data back.

Friday 13 March 2009

LYCOS Email service withdrawn

Email bounce rates could be spiking all over Europe this month as LYCOS stopped it's email service on the 2009-02-15. Apparently this was communicated in the press and on their websites over the past few weeks, but I don't know anybody who heard about it.

In fact, the first I heard about it was today when a friend directed me to http://www.lycos.co.uk/ after spotting consistent bounces for that domain - "The server isn't even taking connections". The further information page doesn't really tell us much more.

Further investigation suggests this is a pan-european service withdrawl. I'm not much of a multilinguist but these pages all seem to be saying the same thing:

I couldn't find any information on http://www.lycos-europe.com/ either. Curiously this seems to have not affected LYCOS.com which is still offering email services.

You may have already heard of this and taken appropriate steps. If not, and you're using a mailing service with a strict bounce policy, I'd avoid sending to these domains until you've discussed it with your service provider.

Essential Add-on Tools for Firefox

Any good developer should have a few different browsers installed in order to check things are working properly in all of them. I currently have Firefox 2 and 3, Opera and IE6 installed and have IE7 on another box. I haven't gotten around to installing Chrome yet, but I guess I will have to sooner or later.

Firefox 3 is my browser of choice and here's why:
  • Tabbed browsing
  • Decent rendering engine
  • Live Bookmarks (Feeds)
  • Ctrl+U access to Page Source
  • Useful Add-ons

I don't like how much memory Firefox hogs, but it's much better than it used to be and maybe I should curb my tab usage. Sometimes the Shockwave Flash plugin flakes out and won't play until I disable/enable it or restart the browser, but that could also be related to tab usage too.

The following Add-ons are the reason Firefox is the first browser I'll turn to. They are incredibly valuable additions to your development toolbox. You've probably already got many of them installed.

Firebug allows you to "edit, debug, and monitor CSS, HTML, and JavaScript live in any web page." I couldn't count the number of times I've right-clicked to Inspect Element. It has a tiny footprint in your status bar when you're not using it. This is the best web debugging tool I've used.

Web Developer adds a toolbar and menu that allow you to manage cookies, CSS, Forms, Images, Outline elements along with a host of other tools. Highlights for me are the Cookie management, Outlining elements (to help debug layout issues) and the Error Console for debugging Javascript.

NoScript is a security add-on that allows you to protect yourself against XSS and Clickjacking attacks by only allowing active content to run from sites that you trust. It's this flexible script blocking approach that also makes it a useful debugging tool. You probably should have it installed to see how borked your sites are - it has a huge user base.

ScreenGrab lets you save webpages as images. You can grab the whole page or just the visible portion, or even copy it to the clipboard. No more copy+pasting sections together to screenshot a long page.

Adblock Plus allows you to browse without ads. It works very well and is incredibly popular because of that. Users love it, advertisers and websites dependant on ad revenue hate it. As long as flash banners keep soaking up CPU cycles, I'll keep using it.

YSlow for Firebug analyzes your web pages and tells you why they're slow (based on Yahoo's rules for high performance web sites). Some of the criteria is a bit subjective or inapproriate for smaller sites, but generally it offers some good tips.

SeoQuake SEO extension helps you "deal with search engine optimization(SEO) and internet promotion of web sites." It's possibly a little bloated for some users, but it does cover a lot of bases. It's worth checking out if you're doing any SEO work.

Thursday 12 March 2009

The "3 Times" Rule

I like breaking new ground. Making new things is exciting and engaging, sometimes it's challenging, but it's generally rewarding and fun.

What I don't like is doing the same thing more than once, particularly when it's because somebody couldn't be bothered articulating what they wanted properly. Usually taking a zero-assumption approach and asking a couple of carefully worded questions will avoid this.

But sometimes it's a long and involved task that just keeps landing on your desk. That's the reason I developed the "3 Times" rule (actually I might have stolen it from my brother-in-law).
  • The First time you have to do the task, it's an adhoc task.

  • The Second time you have to do the task, it's still adhoc, it's just an anomaly.

  • The Third time you have to do the task, it's likely you'll have to do it again, so build a tool, or automate all the parts that you can.

Let me clarify that I'm not talking about doing something three times because somebody made a mistake. I'm talking about running the same process on three different sets of data on three separate occasions.

This approach seems to work especially well with reports. Often it only takes a little more effort to throw the results into a webpage that the user can access on their own. The great thing about this approach is that the user feels empowered, and the task doesn't land on your desk again.

Wednesday 11 March 2009

What you don't know CAN hurt you

I'd be very surprised if you didn't know that Google offers a range of web products beyond their search engine. You've probably got a Gmail account, will have seen Google Adwords and may even already use Google's Calendar, Docs, RSS Reader, Analytics or Ad Manager. Even Blogger.com is part of the Google family now.

There is one application that nobody seems to talk about much. It's not as sexy as some of the other apps, but it can have great value for devs like us. I'm talking about Webmaster Tools.

Webmaster Tools can tell you about the things going wrong on your site that you never dreamed were happening. The functionality is organised into Diagnostics, Statistics, Links, Sitemaps and Tools.

  • Diagnostics will detail any errors and problems encountered by Google's web crawlers and mobile cell phone crawlers while accessing pages on your site. It also gives a Content Analysis that identifies potential problems with site metadata, such as title and meta description information.

  • Statistics include the Top search queries returning pages from your site and which of them were clicked, 'What Googlebot sees', Crawl Stats including the current PageRank for pages on your site, Index Stats and Subscriber Stats based on products such as iGoogle, Google Reader, or Orkut.

  • Links details the pages on your site that have external links, internal links, and which links on your site have been identified as candidates for appearing directly in Google search results.

  • Sitemaps allow you to submit and manage sitemaps.

  • Tools allow you to Generate and Analyze a robots.txt file, Remove URLs from Google's indexes, Enhance 404 pages, or install the Webmaster Tools gadget on iGoogle.

Together these tools make a cohesive suite that can highlight a whole slew of problems to tackle that you never knew you had. This might sound like a nightmare, but realistically you need to know which pages on your site have broken links, or HTTP errors, or missing title tags, or even 404s.

I've only discovered one gotcha to date, which is that Google Analytics data seems to be intertwined with the results. If you have been a bit clever with renamed pageviews, you could get some extra errors reported.

Webmaster Tools takes minutes to set up, and after a day or so will probably give you a raft of "measurable wins" to chase. Most of the problems highlighted are easy fixes, but depending on the traffic on your site can have a significant impact. At worst, even if you get no problems reported, it's worth the minimal set up time to get a clean bill of health from Google's crawlers.

Tuesday 10 March 2009

So, what is it that you do again?

Being a developer is a mixed bag. Generally we like to create, invent or fix things, but we often end up spending a lot of time maintaining, or optimising, or fire-fighting, or planning, or evaluating, or discussing. Although these things are all engaging tasks too, they are commonly not what drive us, and worse, they are pretty much un-measurable.

So what's the big problem with that? In a nutshell, most managerial types don't get what we do, and when it comes to performance review time it really makes it hard to shine when most of your work can't have a valid metric applied. This is easy to understand when you try to compare measuring a dev or sysadmin role to measuring a role with monthly sales target. "99% server up-time" doesn't cut it anymore.

Obviously meeting deadlines for project milestones are measurable and carry significant weight, but in reality many startups have a more fluid development path, and many of us are not working on projects where we can control or are responsible for milestones.

So what can we do about it? In short, not a lot. Try and set as many realistic measurable goals as you can, keep a log of anything adhoc you do that will look like a measurable win, so you'll be ready when review time comes along (or if you want to push for a pay rise).

Since the daily trials and task lists of most of us are out of our control, I thought I'd start this blog to suggest ideas over the coming weeks that can help you define your role in a tangible way, or maybe just have a "look what I did" moment. Hopefully they will also be "measurable wins", or at least interesting to read.