Half person, half home automation, an under loved blog for all things Ruby, python and more in Adelaide
Thursday, March 31, 2005
Bleedingly Obvious User Tricks
I read other articles. These promise it doesn't have to be like this - computers that will feel cool and work with me rather than against me. Yes, I am thinking about getting a powerbook.
I want to turn this blog into a resource for fixing your usability problems - creative, robust methods to get around the bad ideas of the GUI model.
Contribute your hints today!
Wednesday, March 30, 2005
Bleedingly Obvious Usability Tip Of The Day
Here's why that annoys me to no end. The fold. The fold is the point at which you have to scroll to access. It's something that comes from newspapers, thus the term fold - people read the top of newspapers more than the bottom.
If you add new items to an existing list, they should never be displayed at the end of the list.
Infact, the main purpose of a list adding interface is to add things, so if your adding widget isn't at the top of the screen, I'm going to shoot you.
By appending things to the bottom of a list, if there is an error the following happens:
- A user has to scroll
- A user has to visually locate the artifact
- A user has to then find the editing widget
Why aren't things put at the top of a list, nearest the adding widget? Ideally:
- A user has to locate the artifact, which will be located directly below their focus.
- A user edits.
Lazyness. It's called array_reverse(). Use it!
Tuesday, March 29, 2005
New Usability Trick :: Click and Drag Links for Data Entry
I did something that I never knew I could in firefox. I clicked on a link, held down the mouse, and dropped it into form input.
Sure, I knew about doing that, I'd done it by mistake every now and then. However, up to this point it wasn't in my mind as a kick ass data entry method.
Example:
<p><a href="text">Link</a></p>
<form><p><input /></p></form>
Try it:
Link
Drop Here:
Oh, whoopie - it's got http://clockwerx.blogspot.com/text though! That's useless to us.
To be effective, we need to be a bit clever. The urn: prefix on a string will tell mozilla that we are talking about a Uniquely Named Resource. In my case that fits my use of it so completely it's dumbfounding - product data entry.
Example:
<p><a href="urn:isbn:0765304368">Down and Out In The Magic Kingdom</a></p>
<form><p><input /></p></form>
Try it:
Down and Out In The Magic Kingdom
Drop Here:
Now, my users will only ever have to type in one search and transfer the results with a flick of the wrist, across frames, windows and all other barriers. That's cool!
Of course, you cry, there's still the urn:isbn: prefix. Well, fear not. That's a functioning actual link, even if your browser doesn't support it - there's an IETF RFC on the use of urn:isbn: to identify books.
And if your problem is with the text itself rather than the un-semantic idea of it, you can either set all of your input fields to trim off "urn:isbn" onmouseout, or you can let your server side script deal with it.
Ok, ok, there's flaws if you don't deal with books, but surely urn:applicationname:product:barcodehere is a great URN!
Selecting Text
I ran into this problem while fooling about over the last few days, and it took me a while to find the right solution for firefox. It's
-moz-user-select, custom CSS that lets you either set it to normal or none. The cool thing, compared to all other hack solutions? Links are still draggable.What do you all think?
Friday, March 25, 2005
It's HERE!
Wednesday, March 23, 2005
The Semantic Web & Porn: The solution PICS never was.
It was a content labelling system for the web. It was mainly focused on accurately labelling content to provide you with choice before you were assaulted with pictures of people doing nasty things with food items.
Yes, we've all seen goatse.cx.
There were several approaches undertaken with PICS, from HTTP headers...
HTTP/1.0 200 OK
Date: Thu, 30 Jun 1995 17:51:47 GMT
Last-modified: Thursday, 29-Jun-95 17:51:47 GMT
Protocol: {PICS-1.1 {headers PICS-Label}}
PICS-Label:
(PICS-1.1 "http://www.gcf.org/v2.5" labels
on "1994.11.05T08:15-0500"
exp "1995.12.31T23:59-0000"
for "http://www.greatdocs.com/foo.html"
by "George Sanderson, Jr."
ratings (suds 0.5 density 0 color/hue 1))
Content-type: text/html
... to META tags ...
<META http-equiv="PICS-Label" content='
(PICS-1.1 "http://www.gcf.org/v2.5"
labels on "1994.11.05T08:15-0500"
until "1995.12.31T23:59-0000"
for "http://w3.org/PICS/Overview.html"
ratings (suds 0.5 density 0 color/hue 1))
'>
But it never really was too effective. That's because it was a bitch to label every page with something hard to read like that, and if you didn't know how to make your webserver do things niftily, you were screwed.
When MCF came about, and turned into RDF, PICS was the cool application for it.
Separate W3C working groups are developing a new label format, called RDF; the Resource Description Framework, based on XML. RDF labels will be able to express everything that PICS labels can express, but will also permit string and structured values, and some other nifty features. The latest information on this available at http://www.w3.org/RDF.
... but then, no one really cared for a good few years.
So why this post?
Because PICS is back and more RDFish than ever before!
It works like CSS does - one file to describe them all.
<link rel="meta" href="labels.rdf" type="application/rdf+xml" title="Content labels" />... and in labels.rdf, we find:
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:label="http://www.w3.org/2004/12/q/contentlabel#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:icra="http://www.icra.org/rdfs/vocabularyv03#">
<rdf:Description rdf:about="">
<dc:creator rdf:resource="http://www.icra.org" />
<label:authorityFor>http://www.icra.org/rdfs/vocabularyv03</label:authorityFor>
</rdf:Description>
<label:Ruleset rdf:ID="Ruleset">
<label:hostRestriction>icra.org</label:hostRestriction>
<label:hostRestriction>icra.org.uk</label:hostRestriction>
<label:hostRestriction>icra.tv</label:hostRestriction>
<label:hostRestriction>rsac.org</label:hostRestriction>
<label:hasDefaultLabel rdf:resource="#label_1"/>
</label:Ruleset>
<label:ContentLabel rdf:ID="label_1">
<rdfs:label>No nudity, no sex, no violence, no potentially offensive language, no user-generated content, no other potentially harmful activities</rdfs:label>
<icra:cz>1</icra:cz>
<icra:lz>1</icra:lz>
<icra:nz>1</icra:nz>
<icra:oz>1</icra:oz>
<icra:sz>1</icra:sz>
<icra:vz>1</icra:vz>
</label:ContentLabel>
</rdf:RDF>
So how do you get it working for you?
Well, you can either read W3C tech specs or you can use this handy dandy reference (mine has more mention of nudity, buttocks, and exposed genitals).
<label:ContentLabel rdf:ID="label_1">
<rdfs:label>Human readable description of rating goes here. WARNING: This contains geek pr0n.</rdfs:label>
<!-- Category nx: Nudity -->
<icra:nz>1</icra:nz> <!-- No Nudity -->
<!-- Category cx: User Generated Content -->
<icra:cz>1</icra:cz> <!-- No User-Generated Content -->
<!-- Category lx: Language -->
<icra:lz>1</icra:lz> <!-- No Language Content -->
<!-- Category ox: Potentially Harmful Activites -->
<icra:oz>1</icra:oz> <!-- No Potentially Harmful Activites Content -->
<!-- Category sx: Sexual Material -->
<icra:sz>1</icra:sz> <!-- No Sexual Material Content -->
<!-- Category vx: Violence -->
<icra:vz>1</icra:vz> <!-- No Violent Content -->
</label:ContentLabel>
Tuesday, March 22, 2005
Firefox in Australia
Readers of Slashdot, firefox lovers, it brings a smile to my face to read articles like this. Some of the choicer quotes.
Mr Robertson says Firefox's development community of more than 900 software engineers worldwide - many in Australia - was key when it came to selecting Firefox."Firefox has the best pedigree, with an active engineering community, wide community support and long history," he says. "It run(s) on most popular platforms. It has a consistent and stable interface, nice features like tabbed browsing and can be extended should we need to modify it or add to it."
and
Such is the case with the Roads and Traffic Authority of NSW, which serves 8000 users through a mixed fleet of Apple iMacs and Windows PCs at more than 250 sites. CIO Greg Carvouni says Mozilla web browser deployment saved the government department 20 per cent of its annual budget - about $2 million - through a reduction in software licences and staff reductions.
"Firefox is clearly where we should be," Mr Carvouni says. "We'll roll it out either in our next standard operating environment (a desktop update), or the one after. Firefox makes the (desktop) a bit more lightweight and customisable, and we're able to lock it down against user tampering."
For large organisations, Firefox supports enterprise management technologies such as a configuration system for managing user preferences, specification of rules for web access (WPAD), digital certificate security rules (OSCP), and automatic user login to servers (NTLM). These make centralised administration of large Firefox deployments possible.
Hurray, pro Australian open source advocacy.
Thursday, March 17, 2005
MCF / RDF
There's the original MCF tutorial I read the other day, which, now that I already understand the concepts in RDF, makes perfect sense. It's not RDF as we know it, but the fundamental ideas are there.
Have a gander!
Wednesday, March 16, 2005
The "Free" Trade Agreement
First off this week, I got an email from the democrats, asking about open source copyright licences. I (and probably everyone else on their open source advocacy list) pointed them to Creative Common's Australia specific No Derivatives, Attribution licences.
This was explained as something that had to be cleared up so that no official party statement could be modified, must be attributed, and is free to use for educational and general purpose use.
Secondly, I saw an article via Slashdot. It's about a bid by Sony to monopolize the industry with circumvention device laws - outlawing mod chips. It's argued that Sony is interfering with fair use and locking out competitors to their gaming platform, the Playstation.
What's next?
Tuesday, March 15, 2005
Some People Just Don't Get It
There's a bit of a fuss being kicked up about this. The original idea wasn't communicated well, so the unwashed masses are highly critical of it. What they are failing to appreciate is the dramatic decrease in traffic experienced by whomever is ranked number 10 in google's results.
Also, it's adding a factual article which is of some use to the world into what is otherwise a seedy domain.
Thirdly, it's centralising some of the efforts to fight spam - not very nice of the blogosphere, but better to have a community of people that can revert an article and despam it than making the individual do it.
Fourthly, who ever is getting less traffic gets less money so it's going make an impact on someone. Frankly, I hope they can't afford their next ivory backscratcher.
In other news, have you ever made a really really stupid coding mistake and not realized it till you'd blurted it out? Have a chuckle at my foolishness.
Monday, March 14, 2005
A Hack of a Different Kind
Thursday, March 10, 2005
Thinking Out Loud - The Pain of Developing Bad Ideas
What we need is a language neutral intermediate data format. XML you say. Too easy. But the differences between Javascript and PHP clash far too much that though a PHP object goes into XML, a different, far more crippled object comes out in Javascript.
Both PHP and Javascript are all about doing one thing at a time. But Firefox has problems that interfere with the UI if you try to do synchronus XmlHTTPRequest connections, so you have to step into the world of Asynchronus connections. This is where the problems get worse. Callback functions. JPSpan relies on anonymous functions in callback handler varibles. Thus, you can't go:
var mySale = new Sale(); alert(mySale.getTotal());. You have to rely on a function in two parts:
var handler = {
getTotal: function(result) {
alert(result);
}
}
function sell() {
var s = new Sale(handler);
s.getTotal();
//there is no way in this function to get the result,
//without resorting to global varibles.
}
That's incredibly more intricate than:
function sell() {
var s = new Sale(handler);
alert(s.getTotal());
}
Which is what we know and expect.
So, how do other AJAX applications manage broking objects where I'm failing?
Google's Gmail uses a UI engine which speaks javascript as the intermediate language. The server spits out javascript objects, there's no intermediate XML which makes us lose information in translation.
More 'traditional' web services (as this is all that we are really trying) do fine with RESTful interfaces and spitting XML at each other. There's a controlled and defined vocabulary, the server does their own thing, spits it out in hardcoded XML, and lets the client deal with the mess. This was the path I first started on, and I ditched it because when it got down to it, I was trying to pass strings about as my messages - messy, and I needed to pass more than one bit of information at a time.
PHP automagically understands GET and POST form submissions. XML via GET/POST as a restful service (ala musicbrainz) is an extra layer of abstraction ontop of that - but one we can deal with at the cost of losing our automagic varible parsing.
After writing this post, which was to entirely rethink the problem and forget that I'm screwing up quickly, I've realised that JPSpan isn't the way - the ideas are right, the implementation is too tangled. XUL, XMLHttpRequest, REST, XML. Well defined and controlled spec to start from. Evolves to meet real world implementations.
I recall initially I wanted RDF/XML over REST, but I abandoned this because RDF parsers in javascript where either closed to me (firefox security prevents me using the internal one) or not fully implemented (sorry Jim :/). How about RDF/XML over REST, parsed as XML by the client application, but more stable clients (like java ones!) could use RDF/XML to conduct transactions? I think I like that idea.
Next stop: Square One.
Wednesday, March 09, 2005
Feedtagger.com
Using XMLHttpRequest makes it a fluid and fun experience... I can't wait to see what Tahpot will do, perhaps we'll see some bookmarketlets?
The other question: the profit model, will we be seeing some Google Profitwords soon? :P Let Tahpot know what you think and get your feature implemented soon!
Wednesday, March 02, 2005
A Case for RDF & Open Source in South Australia
More and more we can witness the crippling effect this lack of interoperability has upon public services - website A has a page about a subject, but it's hidden and not easy to find. Website B has more about the subject, but you can't share information between the two, as A & B use two different methods to store their information.
Uh... Houston... we have a problem.
A sticky one at that. If you decree that program A must work with program B, who's right? Does program B take on the extra work of talking to program A, or vice versa? The answer, in real life, is that no one bothers, because it's too hard. Or, if they do, program C comes along and all of the effort is lost.
The answer, which the W3C advanced initially, was XML. XML is a way of representing information in trees - heirachies of connected properties with no inherent meaning. All around the world, people learnt about XML and rejoiced. This was the magic glue to fix everything. You were allowed to do anything you liked in XML, so long as it validated.
The problem was, people did. It's the same old problem, just less painful - as there is a solution, it's just tedious. XSLT is a method for translating one XML document into another - say an RSS news feed into a webpage. Program A still can't talk to Program B because they both talk slightly different local dialects in XML, and though syntax can be communicated, meaning can't.
Example:
Document A
<shop>
<close>1700</close>
</shop>
Document B
<door>
<close>true</close>
</door>
If you look at the
close tag, it's got either a time (int) value or a boolean value. If I publish my XML about doors and if they are closed or open, your tool might read it for shop opening and closing times - but not understand it, as it expects a time rather than a true/false value.What's a Developer to Do?
This is where RDF solves a lot of problems. RDF is a model, a graph: think of a whole lot of information trees (like XML documents), some sharing a common branch. Connect together more "branches" and you soon can no longer visualize it without it becoming a tangle of interwoven information.
How RDF does this is very simple. It uses a URI or other identifier to represent some kind of abstract thing. Example:
http://www.me.com/my/car/. It then goes on to describe the attributes of the URI, using the "rdf:about" attribute.
<Shop rdf:about="http://www.shop.com/">
<closes>1700</closes>
</Shop>
<Location rdf:about="http://www.shop.com/">
<address>#1 Bob Street.</address>
</Location>
What we see above is RDF expressed in XML, describing two seperate trees of information. One is a Shop, and one is a Location. The magic comes into play because an RDF parser knows that the Shop is the same as the Location, so it's both a Shop & a Location.
Graphed, we get this:

You can see how it's recognising the abstract thing at http://www.shop.com/ has 4 properties.
More Neat Tricks
If you wish to describe other things, you can do some nifty tricks too. There's the rdf:resource mechanism - the opposite of an rdf:about.
<Shop rdf:about="http://www.shop.com/">
<located rdf:resource="http://www.shop.com/address"/>
</Shop>
<Location rdf:about="http://www.shop.com/address">
<address>#1 Bob Street.</address>
</Location>
Now, we've said that the Shop object's located property is described by http://www.shop.com/address. The Location object now describes whatever's at http://www.shop.com/address. Thus, we're saying the Shop has a Location.
The power of RDF lies in that I can describe one thing on my website, and someone else describes another on theirs, so long as we use a common URL (like an ISBN URN, IMDB URL, email address (mailto:foo@foo.com), irc schema (irc://irc.network.com/) or anything else) we can link statements to each other.
It's a lot like how real people work - you ask someone for directions to a landmark, they tell you it's near Waymouth St. The next person you ask, you ask about Waymouth St instead of the landmark, and learn where Waymouth St is. The third person you ask can tell you the landmark is located just around the corner from Waymouth St. You then in your mind connect all of this together to find both Waymouth St and the landmark.
Onwards, enough with the RDF talk
AGLS is an RDF vocabulary designed for the Australian government. It's 19 descriptive elements which help form a foundation of well understood shared data. Agency A might not understand everything Agency B is saying, but they can catch the drift of it.
There's 5 terms that are base requirements.
Five metadata elements must be present for compliance with this standard. The mandatory elements are:
Creator
Title
Date
Subject OR Function
Identifier OR Availability
Covering the Who, What, When aspects of any service, document, or webpage which contains RDF.The what is the most important part. From the spec:
Recommended best practice is to identify the resource by means of a string or number conforming to a formal identification system. Example formal identification systems include the Uniform Resource Identifier (URI) (including the Uniform Resource Locator (URL)), the Digital Object Identifier (DOI) and the International Standard Book Number (ISBN).So if Agency A is talking about State Supply (Software Procurement) Amendment 2003, at http://www.parliment.gov.au/statesupplyamendment2003/, so long as Agency B knows that URL (enter google) there is much improved communication and information finding.
Agency A might be concerned entirely with the cost side of things, Agency B the security - but now, A & B have equal access to each other's information about the subject. A&B can compare versions of it, search for the last modified versions, specify data that one doesn't about the other, like coverage and so forth.
On Trust
Of course, in the wild, there's an issue of trust on things like this. Asking for directions, you trust that a person isn't lying to you and letting you get yourself lost. It's less of an issue for government, as they can simply say the dept of X trusts the dept of Y explicitly, but doesn't trust the dept of Z much - and their RDF database would reflect that.
Public keys and signed documents are a step in the right direction, as well as things like Trust in the Semantic Web - but mostly, it's not a huge concern.
Enter the Open Source
What has any of this got to do with Open Source? Vendor Lockin. Microsoft has largely withdrawn from standards like RDF - their products purport to support WinFS. It's the planned new filesystem which they can't get working for Longhorn - when Longhorn ships finally, it won't be with WinFS. WinFS is almost like RDF, just different enough so that Microsoft can keep it exclusively theirs.
You won't see other companies being able to implement web ready WinFS solutions on Linux, so you end up stuck with a costly operating system on every desktop - something you didn't need to upgrade in the first place.
Open Source, however, is developing fiercing the the sphere of RDF and the Semantic Web. Many of the major RDF vocabularies are under open or free licences that are designed to let developers use them. Likewise with the software - RDF Parsing libraries for almost every language exist, few don't have friendly licenses.
Furthermore: Firefox & Mozilla support RDF right out of the box. It powers the bookmarks, the extensions, and a whole lot more. This means that you could develop applications directly in the browser, reducing costs with everything and leveraging the power of open source. No more intranets, per se, but an intraweb of facts which aren't in static webpages.
Think, interdepartment calendars, documents, planning, maps, images and task management - all connected, all working more or less together.
AGLS is being adopted at a national level. The tools to do productive and innovative things with it are mainly open source. The great ideas will be open source - because you can't keep something the same and make it better (MS Word, for instance). Open source allows rapid innovation as ideas from one project move to the next and are made different. Open source allows you to do whatever the hell you like to your software without paying a cent.
Open source is empowering. RDF is even more empowering. The two together?
Open Data
Try and tell me that's not going to be doubly empowering.
State Supply (Procurement of Software) Amendment Act 2003
In '03 he pissed off Microsoft Lobbyists with the State Supply (Procurement of Software) Amendment Act 2003. I don't know if it acutally passed, but he's angry again (hurray!) about a related issue.
He's also a a database guru it would seem. Now I can finally say this is a South Australian political blog!
Tuesday, March 01, 2005
The problem with XMLHttpRequest()...
xmlhttprequest() just plain won't work like they should without an incredible tangle. There's no easy way that I can see, nor that Harry Fuecks can either, to implement threads which are spun off every time a remote request is made.A bunch of different approaches to this exist, but when it comes down to it, you're limited to a single request from start to finish.
You haven't noticed it, or cared, but with Gmail: You can only do one thing at a time. That's because it's all being run through a single transaction - as is everything on the web.
Actually, I stand corrected. If you load a webpage with images or stylesheets in it, your browser can successfully use queing and negotiation of http requests. Why can't we see some of this functionality exposed in javascript?
What we need is micro http transactions - but we don't have it. Not in javascript. What's a developer to do!
Also: Certain things are annoying!
Update: certain bugs have been resolved as of Firefox 2.0 which solve this problem.