Categories
Usability Web

URL aesthetics

Look at the state of this… the URL itself I mean, not the page it points to:
http://www.tbs-sct.gc.ca/rma/eppi-ibdrp/hrs-ceh/6/RMA-CGR_e.asp

Can you imagine trying to dictate this to someone over the phone, or read it out on the radio? Reckon you can memorise it? If you saw it in your history list would you remember what the page was about?

URLs should be:

  • designed for people, not computers and not filesystems;
  • as short as possible (maintaining hierarchy only as necessary);
  • as meaningful as possible — using words, dates, standard reference numbers, or whatever will make sense to your users, not a bunch of abbreviations;
  • single case, not a mixture of lower and upper case;
  • persistent (cool URIs don’t change), and therefore designed with persistence in mind. A URL is more likely to persist if it is sensible and economical in the first place!

URLs should not:

  • include implementation details (.asp) and language preferences (_e), both of which can be handled transparently by content negotiation;
  • use unnecessary punctuation. Some punctuation is ok, but four dashes scattered throughout the URL is too many.

Ideally, it should also always be possible to remove the trailing part of a path to obtain an index document for that level. If that’s not the case (which it isn’t for this one), it’s a probable sign that you have more levels of hierarchy than you actually need.

Categories
Accessibility AJAX Rails Ruby Web

AJAX v Accessibility on Rails: Fallbacks

I’ve tentatively placed a toe aboard the AJAX bandwagon, thanks largely to Rails which makes it possible, even painless, to achieve AJAX functionality without having to learn Javascript.1

While AJAX, done properly, can be a big win for Usability for those whose browsers support it, I am also concerned with issues of Accessibility, and indeed keeping things usable for those with non-AJAX browsers.

Standards-Schmandards have come up with some useful hints about how to make AJAX pages more accessible to screenreaders, such as providing an option to pop up an alert box instead of, or as well as, simply updating the page. This is good advice, but it’s only half the story. These methods don’t help those without Javascript at all, or with non-AJAX-aware browsers.

In this article I will detail one method to help ensure accessibility for such people, without compromising on AJAX spiffiness, and most importantly without causing much extra work for us poor developers. The example is in Rails, but may be of interest to those using other frameworks.

Categories
Physics/Cosmology Science Technology Web

Quantum Imagination

Imagine a creature, about the size of a football, which has long green fur, and several purple tentacles with a glowing red eye at the end of each.

You have never seen such a creature; you are never likely to see such a creature. But I bet you were able to imagine such a creature, and perhaps your mind also filled in additional details than the ones I described. Perhaps you added a mouth, teeth, perhaps the creature moved, the wind ruffled its fur. Maybe it had feet. Maybe it made a sound. Maybe you found that a whole environment sprung into existence around it.

Now try to imagine a sphere, a snooker ball say, which is spinning in one direction, and also, simultaneously, spinning in the opposite direction.

Again you have never seen this, but this time, you could not imagine it.

The simple difference is that the creature, however unlikely you are to ever encounter it in your day-to-day life, is possible. It is entirely feasible that this very creature exists somewhere in the universe. The ball spinning in opposing directions is impossible, by the very definition of “spin”.

Now, something amazing comes out of this seemingly futile exercise. Your mind is capable of imagining only what is possible. If something is possible, you can imagine it, just by someone describing it to you, even if it bears little or no resemblance to anything you have seen before — provided it can be described in terms that you understand. But if it is impossible, you cannot, no matter how well it is described.

Why?

Categories
Perl

Parsing CSV files with embedded newlines in Perl

Need to parse CSV (comma-separated values) files which contain embedded newlines in the fields, as produced by many applications including MS Excel? The usual Perl modules Text::CSV, Text::CSV_XS and CSV.pm can’t do it. Fortunately there is one that can, called Text::xSV. Find it on CPAN. I’m posting about it here to raise awareness because Google searches threw up lots of people asking about this but the answer was not obvious.

Categories
Hardware Product Reviews

Review: Body Glove Scuba Cellsuit for K750i

A good mobile phone deserves a good case — ideally one that it never has to be removed from, so that it’s always protected from dirt and droppage. So I invested in a Body Glove “Scuba Cellsuit” for my K750i (got it on eBay). Here follows a review with some pictures.

For me the important things about a case are, in order:

  1. Doesn’t impede usage of the phone while in the case.
  2. Provides some protection if dropped.
  3. Doesn’t make the phone twice as big.
  4. Provides extra grip, making droppage less likely.

You’ll notice the absence of any requirement for it to look good. In fact, I’m quite happy for a case to look rubbish if it fulfills all the above criteria. Not least because it makes it look less worth stealing.

The Body Glove however manages to succeed at all the above and looks alright too. Not as good as the phone looks without it, obviously, but that’s fine by me.

Categories
Hardware Linux Technology

Sony Ericsson K750i and Linux

I just had a very strange experience. I hooked up my new Sony Ericsson K750i mobile phone via USB to my PC (running Linux 2.6.11 Debian unstable). And it just worked. I didn’t have to faff around with the USB driver as I’d had to for my Treo 600 a year ago. It just thought for a while, dumped several KB of its thoughts into syslog (I probably selected a debugging option when I built the kernel), and *ping* the memory stick in the phone appeared as /dev/sda. I just had to mount /dev/sda1 (vfat), and there it was.

Almost disappointing.

The phone is very nice, btw. Screen is good, mp3 playback is very good (even with the supplied earbuds — even through the speaker is not bad), camera is alright (for a phone). Organiser is rubbish: you can’t set up events without a time, or recurring events like birthdays, and the bold font used to identify dates with appointments in calendar view is barely different from the normal font. Sometimes I think I should just go back to a paper diary…