| JezUK Ltd - The Coffee Grounds - April 2005 |
| << March 2005 | May 2005 >> |
YouGov and Mercer Delta Consultancy are currently running a survey amongst UK business leaders and would be very interested in your views.
How do you think the outcome of the General Election will affect you in your professional capacity? How do you feel about your professional relationships with your key audiences and how do you think these will change over the next five years?
Your views, along with those of other UK business leaders, will be used by Mercer Delta to inform an article published in the national press. We will also send you a full report of the results from this survey once they have been published.
If you would like to take part in the poll, please click ...
YouGov think I am a business leader. No wonder their poll results are so out of line with all the others.
Back in the mists, when I first started programming it quickly became apparent that the bulk of the tools I used everyday were invented or written about by Brian Kernighan. I was doing my job on the back of the work of many, many people, but Brian's contribution to my take-home pay seemed the most significant. I developed the idea of Brian Kernighan's Fiver. If I ever met Brian Kernighan, I'd give him five pounds as a symbol of the living he'd given me.
As time went by Brian's everyday significance declined, and his place in my little pantheon of thanks was taken by Bjarne Stroustrup. I decided that should I ever meet him, I'd give him a fiver too.
Last Thursday, that opportunity finally arose. There I was in the bar. There he was. I had a fiver in my wallet. A normal fiver, not a special one I'd been keeping or anything like that. Just an everyday five pound note.
Bjarne was talking to Jim Coplien, among others, and frankly Cope rather frightens me so I was loathe to interrupt. After 20 minutes or so, he got up to leave. He was going to walk right past me. Fate was lifting her skirts and taunting me. I *had* to do it.
"Dr Stroupstrup? ..." Quickly, I explained about the fiver and offered it to him. He declined. "I'm going to have dinner with my wife," he continued, "perhaps we could use this to buy a drink later on."
A drink with Bjarne Stroustrup? Blimey. But, hang on. We're in the bar of the Randolph Hotel in Oxford, seemingly one of the most expensive bars on the planet. A fiver here doesn't go far. Then it hit me - a fiver wasn't enough. He was trying to tap me for a tenner!
The disappointing end of the story is that I didn't get to buy that drink, because our bar trajectories didn't cross again. I used the fiver to pay for car parking. Bjarne no doubt thinks I'm a nutter.
A stingy nutter at that.
[added 24th Apr 2005]
For boolean, number and string types, the XPath recommedation has a simple and straightforward idea of what consititutes equality -
The = comparison will be true if and only if the objects are equal; the != comparison will be true if and only if the objects are not equal. Numbers are compared for equality according to IEEE 754 [IEEE 754]. Two booleans are equal if either both are true or both are false. Two strings are equal if and only if they consist of the same sequence of UCS characters.
For node-sets, things are a little different.
If both objects to be compared are node-sets, then the comparison will be true if and only if there is a node in the first node-set and a node in the second node-set such that the result of performing the comparison on the string-values of the two nodes is true.Two node-sets are equal, then, if any node in one set has the same string-value as any other node in the second set. The nodes in question don't have to be the same node (ie having the same position in the same instance), just have the same value. The node-sets themselves could contain different numbers of nodes, and so on.
Comparisons of node-sets and string or number values are defined similarly
If one object to be compared is a node-set and the other is a number, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the number to be compared and on the result of converting the string-value of that node to a number using the number function is true. If one object to be compared is a node-set and the other is a string, then the comparison will be true if and only if there is a node in the node-set such that the result of performing the comparison on the string-value of the node and the other string is true.If any single node in the set matches the comparision value, then the node-set and the value are equal.
Only the comparision of a node-set and a boolean value is what you might inituitively expect
If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.
Despite these unusual looking definitions of equality, when you actually use them in an XPath, the "right" thing seems to happen. Consider
/root/child[@attr = 'theoneIwant']Here
@attr selects a node-set, which will be empty, or contain a single attribute named attr. If this attribute the value theoneIwant then the predicate is true.
Node consider
/root/child[grandchild = 'theoneIwant']We read this as selecting those
child which have a grandchild node contain the text theoneIwant. It's a straightforward XPath, and nothing unusual. The child nodes might have multiple grandchild nodes. Without the above definition for node-set and string equality, we couldn't construct the appropriate XPath so concisely. I haven't thought about this in great depth, but if equality were not defined as it is, it might not be possible at all withouth defining some other mechanism (like a function say). As it is, the odd sounded definition leads to "natural looking" XPaths.
The reason I've been thinking about this is, as you might have guessed, because I've been working on node-set equality this morning.
Next Monday and Tuesday I'm onsite with a client in London. I'll be travelling down on Monday morning, and returning on Tuesday evening. I can decide when to leave, but I'm not sure when I'll be finished on Tuesday. I am trying to buy a train ticket accordingly, and can make absolutely no sense of which ticket buys travel on which train. I have a choice of 23 different tickets, ranging for a £9.50 single, to £178 return.
I think the ticket I want is a Standard Open return. Right now, I'm looking at this, which offers a choice of two Standard Open returns, at widly different prices, apparently available for different trains. Both have identical terms and conditions, including Valid every day. No time restrictions.
Don't understand. Don't understand. Don't understand. Don't understand. Don't understand. Don't understand. Don't understand. Don't understand. Don't understand. Don't understand.
In the end, finished up buying two singles. [added 11th Apr 2005]

| << March 2005 | May 2005 >> |