| JezUK Ltd - The Coffee Grounds - January 2004 |
| << December 2003 | February 2004 >> |
My current bit of work, which I've been doing on and off for about the last year, had its press launch yesterday. Happily I wasn't invited. I never seem to be on the same wavelength as the marketing types. While I doubt the client produced any outright lies at this do, I'm sure I would have winced several times. The computer trade press journalists don't, on the whole, have my particular respect either. A large chunk of what they do seems to consist entirely of transcribing press releases and presenting the results as news. Being trapped in a room for several hours having to sit through a pile of guff with a bunch of duffers is something I'm glad I missed.
The software itself is my first piece of shrinkwrap and should, barring manufacturing mishaps, be cluttering up the shelves of PCWorld in about a month or so.
You could have a whole new series of articles :p [added 2nd Feb 2004]
"Geek names son Version 2.0" - cool?...erm i think not,
still its slightly preferable to being called Baby Nike
http://news.bbc.co.uk/1/hi/world/americas/3451207.stm
[added 3rd Feb 2004]
Committed some fixes in SAX2DOM. There was a couple of bugs which screwed up the reference count on DOM::Document if the DTD declared external or internal entities. Also fixed a bug which caused a crash if a default attribute was declared before the element to which it belonged.
Don't ask how I found this stuff didn't work ...
C-x b
etc
You should be able to live without keybindings. Where would you be without JDE, Tramp, xslide and all the rest? Modes. Now you really are stuffed without them [added 23rd Jan 2004]
Hang on, isn't this where we started ... [added 24th Jan 2004]
So busy. I'm into the extreme fiddly tedium stage of my current piece of work. Can you change the label on that window? Could change the colour of that bit. Can you just shoe-horn in this completely different layout for everything that we had a graphic designer do?
I'm also having to build installers for the first time, as it's destined to be shrink-wrapped and on the shelves of PC World by the end of February. That's similarly tedious - build the installer, run it, check everything is where it should be, uninstall, rebuild the installer, etc. VS.NET will build installers but they are really limited to put-these-files-there-and-that-registry-key-over-there. Our application has a list of pre-requisites as long as your arm (Agent, IE6, speech engines, .NET framework, etc, etc) and checking for all those using VS.NET tools proved pretty much impossible. So a big hurrah for NSIS. If you ever get saddled with building a Windows installer, this is the tool for you.
tar zcf package.tar.gz work/*
a few times. Doesn't that count? [added 20th Jan 2004]
There are a multitude of reason why I never have and never will vote Conservative. The characterisation of those that opposed Conservative foreign policy in the 80s as unpatriotic Stalinist dupes, for instance. Belief in Adam Smith's invisible hand to lead us all to some economic wonderland. What you could probably characterise as ideological issues.
I'm obviously becoming increasingly reactionary though, because right now this minute the thing that angers me most about current Tory policy is the idea that driving too fast or ignoring the odd traffic sign isn't really that bad.
This morning I stood with my two children and my dog at a pelican crossing and watched two cars and a lorry run the red light before I could cross. One of them even slowed down a bit first, before deciding that well, maybe he didn't have to stop after all. That's a bit of an extreme example, but I use the crossing 4 times a day and watch someone troll through on the red light about every second day. That's 1 in 8. The primary reason that people arn't routinely run over is because we've all learned to wait and see if the traffic really is going to stop.
Most evenings, as I dodge the traffic I can look down the high street to see a lots of people queued back over the crossroads. They will be waiting for somebody to whom the no right-turn doesn't apply to make his turn and get out the way. He'll be waiting for the oncoming traffic to clear before he can turn. But the oncoming traffic will be held up because of all the people backed over the crossing. Because knobhead wants to turn right. Eventually, of course, someone finally gives way, everything starts moving and traffic belts up the road. Towards the pedestrian crossing.
Perhaps because I grew up in a place where you could travel for miles without seeing a traffic light that when I see a red light now it means STOP. I don't see and read HAVE A LOOK AROUND FIRST AND CARRY ON IF NOONE SEEMS TO BE IN THE WAY or STOP IF YOU FANCY. It means STOP EVEN IF IT'S 3AM AND THERE'S NO ONE FOR MILES. Similarly, I read a no-right turn as DON'T TURN RIGHT HERE, not DON'T TURN RIGHT UNLESS YOU'RE IN A HURRY or I DON'T APPLY TO YOU.
I tried to come to some well considered little conclusion here, but I can't. People speeding and ignoring road signs puts me and my family at risk every day. I don't give a shit if some motorists feel resentful about speed cameras. They should be angry at their own stupidity. If the law were changed to allow mobs of angry pedestrians to pull them from their cars and give them a severe kicking, they still shouldn't feel resentful. Just don't drive like a prat. Everyone will be happier and safer.
Cameras should be hidden, so people don't just slow down where the camera is. If the complaint is they just raise revenue, cancel the fine but increase the number of points added to license.
Cycling to the office everyday lets me see close up the extreme risks some people will go to to get an extra 5 yards down the road, and get to the next traffic queue 30 seconds quicker. [added 9th Jan 2004]
And one senior motorsport journalist, in his weekly column in the biggest selling magazine of it's genre, wrote that "Instead of using all that technology to devise traction control software, those scientists should spend their time devising something to shut down speed cameras before I pass them."
So, don't be worried about *you* being reactionary... [added 9th Jan 2004]
I do feel that speed cameras are a poor substitute for what used to be. A speed camera can only measure speed. It cannot determine dangerous driving, varying local conditions or in rare cases a real need for a driver to break the speed limit. People do a much better job, simply because they have discretion. However the British police are never there where they are needed, seems to me. The excuse is that they have too much paperwork.
My best example of police discretion was, of course, the time an officer in Palacios, Texas decided that I was telling the truth when I confided that the speed signs on his stretch of road were too confusing! Well, as it happens it was July 4th and he was celebrating his independence from the likes of me, so perhaps his discretion was indulgence!
[added 15th Jan 2004]
As a bonus, police and emergency vehicles could be exempt from this limit enabling, for instance, a police car to easily apprehend a joyrider without killing pedestrians. With minor modifications, the system could be used to allow the police to switch off an engine of, say, a stolen or dangerously driven car. This way, you will get your stolen car back before it is torched!
As for running red lights, this is a case of dangerous driving and poor judgement and should be dealt with by an instant ban. Having said that, the whole traffic light system is flawed - sometimes not allowing drivers enough time to slow down on a fast road, or situated in poor positions in direct sunlight, or simply not working correctly.
Of course, all of this is just hot air as there is NO WAY the Government are going to give up their roadside cashpoints!
[added 10th Jul 2006]
This is a terrific little recipe. There are almost no ingredients, there's virtually no effort involved, and the result is a delicious, velvety soup
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. -Antoine de Saint-ExupéryGather up
While yummy as soon as its made, it's even more so if you let it sit over night. The flavours mingle up, rounding and filling, making the soup feel really quite luxurious in your mouth.
Recently, I've been toying with the idea of added XPath support to Arabica. Using a DOM for real work without using XPath almost never seems to happen, for me at least. The longer Arabica's DOM went without XPath, the less useful it seemed to be.
Last night, I had a very brief browse around various around various XPath engines (Saxon, Jaxen, Blue, XPath for ActionScript and one or two more), to see how they parsed out XPath expressions. Jaxen, for instance, uses a SAX-like approach to tokenise the expression. Saxon's parser is all written by hand. I saw one, possibly two, that were generated by Yacc or Bison like tools.
Parsing out the expression is the thing I'm most concerned about. If you can pick the right bits out, then actually doing the work is going to be easy :). Constructing a parser by hand is a big pain. You've got all kinds of state to manage, look ahead to worry about, and all kinds of other things. Plus, I want the whole thing to be (eventually) templated on string type like the rest of Arabica, which adds an extra wrinkle. Further, given a fancy hand craft parser, how do you validate it against the grammer in the rec without building a massive pile of test cases. And if you do make a mistake, how easy will it be to fix.
The XPath rec defines the expression grammer using EBNF, which isn't really a surprise. There are tools like lex and yacc will convert EBNF to code for you. I've never used them though, and didn't fancy starting to learn them last night. I have played with Spirit though. Spirit is a parser toolkit which lets you pretty much transcribe EBNF directly into your C++ source. It's barkingly clever while at the same time being really very simple. (It'd also make a good counter-example to the operator-overloading-is-a-really-bad-idea argument, but that's a whole seperate issue). I pulled the latest release (it's now part of Boost) and set off. The latest release really is a piece of cake to use, so I spent a happy couple of hours with the XPath rec on one side of the screen and vi on the other transcribing XPath EBNF into C++. Sounds silly to say, but I had a really fun time.
Are you going to support xpath 2.0? When do you think it will be available?
I look forward to hacking some cross platform C++ together with your code. [added 24th Jan 2004]
[added 26th Jan 2004]
[Add a comment]
Monday. I take Bean and Halster to walk Badger. Nat goes swimming.
Tuesday. I go swimming. Nat takes Bean and Halster to walk the dogboy. It rains.
Wednesday. I take Bean and Halster to walk dogsby. Nat goes swimming.
Thursday. I go swimming. Nat takes Bean and Halster to walk the Bidgebodge. It rains.
I came home and dried myself and sat down with my mags, and the guttering outside my house falls off (due to massive water overflow) as it's been threatening to do for me.
Somebody up there....well, you know the rest. [added 8th Jan 2004]
Been using Arabica for some real work recently, which isn't something that I've done for a while. The project I'm working on at the moment is a guided help & how-to system for a printer manufacturer. People install the application, and it tell them how to print business cards properly, or about different types of paper, or whatever. The help sequences come up a page at a time with Next/Previous buttons, a bit like a Windows wizard. They can also have multiple paths, so you could say, for instance if your running Word or PowerPoint and you'll be guided appropriately.
The help sequences are stored as XPDL instances. XPDL is an XML application for describing workflows, which is about as much as you really need to know. We're subverting it slightly for our purposes I suppose, but it works very well. It saved us the trouble of designing our own format, which is always harder than you think it will be. There are some reasonable-ish tools for defining the workflows too, which also saved us a lot of time.
Recently our client wanted to extend the help sequences to include screenshots. XPDL is arbitrarily extensible via its ExtendedAttribute elements, into which you can put whatever you like. The editor stashes its layout info in there, for instance. I decided to Base64 encode the images and pop them into an ExtendedAttribute, so that the images and the text they go with are all contained in the same package. Carole laboriously captured all the screenshots, and annotated the text to indicate which image went where. All we had to do now was get the data into the XPDL.
I wrote a small SAX filter to do the job. When we read a Description element, it checks the text it contains. If the text has a {{image:something.gif}} sequence, then everything kicks off. After the Description element comes an ExtendedAttributes element, into which it adds a new ExtendedAttribute element. It reads something.gif to a string, using oconvert_adaptor to Base64 encode the data. The encoded image data then becomes the ExtendedAttribute's content. Bingo - image data in the right place, without a lot of labrious manual labour. Sitting on top of that filter is SAX/filter/Writer, which properly formats the modified document and writes it out to disk.
Using a simple makefile, the workflow XPDL documents can now be rebuilt whenever the source XPDL is modified, or new images are added. Carole can write new help sequences or grab more screenshots (and there are a load of those left to do), check them into CVS and they'll get incorporated straight into the build.
Putting all this together took only an hour or two, and the source code runs to 260 lines including blanks and comments. Who said C++ was hard :) ?
So I was given a lovely new potato masher for Christmas.
And socks, obviously.
You?
A weird Al Yankowich CD (from my bro in the U.S)
2 books 1 v. helpful book on basic baby stuff and
one truly awful one on "balanced babies" by some american chap!
right, i'm off to surf emmas diary. (not emmas dairy
which gives an altogether different set of google results!) [added 3rd Jan 2004]
| << December 2003 | February 2004 >> |