Welcome to Geoffrey Swift's βlog. Please subscribe to the Atom feed.


Website pet peeves part 2

What country am I in today?

Lots of websites have forms that let select your country. Unfortunately these websites generally have a large number of different countries to choose from. I find this means a regular chore of guessing which country to look for, the right one could be any of the following: Britain, England, Great Britain, United Kingdom or UK. The only option I haven't come across is the actual name of the country where I reside, the United Kingdom of Great Britain and Northern Ireland.

So to anyone writing a web pages with forms allowing a choice of countries. It would be nice to see a default country value determined using a country IP database. That would make things a bit easier.

"Back to" … the future

A lot of sites have links with text such as "Back to homepage", or "Return to to search results". But you may have accessed the page via a link on an external site or even a bookmark. So the wording of such links presumes that a visitor to the site came via the web page that's linked "back" to. My suggestion is to leave out the word "back", as it is fairly redundant and potentially inappropriate.

Comparing techniques

There are lots of interesting tips and ideas relating to programming techniques and related principals bandied about. The people who advocate them have all sorts of different backgrounds, and undeniably it can be very useful to draw on the experience of others.

Some techniques are devised to solve problems that are common to all programmers alike, but the significance of an underlying problem addressed will vary for each project. While something may be critically important for you, it could well be of insignificant concern to somebody working on a different project.

Each programmer faces difference challenges, and has difference experience - so the solutions they come up with are quite personal to the individual. For example a programmer may advocate a technique that merely addresses a problem specific to certain programming languages, or is specific to the size/complexity of their application or even their development team.

Techniques in computer programming have evolved significantly over time, and opinions are constantly changing. This is no surprise, considering the rapid pace of change in what software is used for and how it is used.

Because of this, I feel it is important to have an awareness of various different techniques. In each new scenario it's then possible to decide what is the most appropriate technique, treating each case on its merits.

Programming is a complex task and difficult to make generalisations about. There are many tips floating around that contradict one another, and have no explanation of what the basis for them is. It is more difficult to evaluate a technique, without some explanation of what its purpose is.

Website pet peeves
From my referer logs I've noticed people looking up problems with XHTML, JavaScript and CSS. Hopefully some web designer will read my pet peeves below, and mend their ways!

Bad support for font resizing

I use a relatively high resolution 1600*1200, and so most websites look small to me. When I increase the font size in my browser (Firefox) to compensate, the layout of most sites become a complete mess. Typically words are crammed into columns that just look too narrow, or text becomes illegible because it no longer fits inside its containing box. This problem typically occurs because dimensions have been stipulated using pixels in the CSS code, but this will go wrong for other fixed unit of measurement. So when you're coding up your layout using the "box model", try using only em, ex or percentages instead of pixels and the layout should resize in proportion with the text.

Login forms setting focus away from password

Many websites have login pages, which set the focus to the user name field when the page finishes loading. This might sound like a great idea, but not while I'm in the middle of typing in my password! I don't really want half my password in the password box, and the other half plainly visible in the user name field. This is another quite common problem. A simple fix might be to only set focus on the user name field, when it is empty.

Click to enter site

There still seems to be no shortage of sites, with a main page that just says "click to enter site." The fact that such a page actually is the website, seems to be lost on the web designer. Unless there's a good reason for having such an entrance page (like a disclaimer) just let people surf straight in to meaningful content without any such inconvenience.

Radio tuner revamp

My homepage has a link to tune into my internet radio presets. This play list file is generated automatically by the web server, which checks whether each of my favourite stations is currently available.

I've updated some of the dead links for some Drum & Bass stations that have moved, and included some new Dubstep stations also. There's now also only one entry in the play list per station, to make channel hopping easier. This also makes the list load up quicker as it does fewer checks.

Give it a try, just click on the link to the file radio.m3u, it should open up in Media Player or iTunes etc. let me know what you think!

Windows Services in Delphi

The Win32 API methods for the Service Control Manager are powerful but rather unwieldy. Download the Delphi unit service.pas which contains wrapper functions for QueryServiceStatus(), StartService() and ControlService().

See the interface section for the unit below, hopefully it's all self explanatory.

unit service; // Some useful wrapper functions for NT Services. // Geoffrey Swift (c) 2006 interface uses Windows; function GetServiceStatus(const ServiceName: String): DWORD; function StartService(const ServiceName: String; const Wait: Boolean): DWORD; function StopService(const ServiceName: String; const Wait: Boolean): DWORD;
Sudoku enhancements

The Sudoku page has been improved today. When entering a number, some simple checks are made for an error. If the number entered is OK, it automatically moves to the next cell ready for another number to be typed. I updated the server application also, and the solution can be interactively solved. The server now solves easy parts of the puzzle as you key it in. This is implemented using AJAX programming techniques.

I would also like to set up a daily puzzle. The Pascal source code for the server side solution engine might get posted, if I find time to tidy it up. Please leave comments if you have any ideas!