Main | November 2004 »

October 2004 Archives

October 29, 2004

MySql & XML Output

Pulled this from DECAFBAD... Nice tasty article all about -X command line switch in mysql. Wonderful I thought. XML based power in the worlds most popular and free relational database. I heard the sounds of dreams coming true.. well maybe ;) There had to be a catch however.

However, just when I thought everything was peachy I started playing with this feature with less than spectacular results. Some intensive googling yielded the answer.
It seems that using the -X command line option for exporting the data in XML format produces invalid XML. It assumes XML escaped data in the DB!.. On what grounds??? Mysql only encloses the query results in XML element tags, but doesn't do encoding of the contents inside the tags.


In XML, if you want to use one of the characters <, >, &, etc. inside an element tag is not valid. If you want to use one of those characters, you have to use the respective entity instead. Mysql doesn't seem to do that, so when selecting tagged data or markup like "<foo>red & green</foo>" with the -X command line option will always lead to invalid XML.
An uncool workaround would be to perform some string replacements for every selected column when using the -X option:


  • replace all & by &amp;

  • replace all < by &lt;

  • replace all > by &gt;

  • replace all " by &quot;

  • replace all ' by &#39;


Other stuff, like language specific characters (umlauts etc.) has to be encoded as well or has to be handled by defining or applying a different character set when post processing the XML output.

So the command produces invalid XML as invalid chars haven't been escaped... Now this is a shame as writing some code to escape it in the db server coulda been done quite easily. A combination of escapes and using different charsets (perhaps as a command line option) along the lines of mysql --xml --xmlcharset=mycharset would be sweet. We'll see what happens in the next release

October 30, 2004

Mini-me

Many of you will be familiar with the concept of two separate genus of man existing side by side in prehistoric times. I'm talking about Neanderthal and Homo-sapien. Recent studies have shown our homo-sapien ancestors may have contributed to the extinction of the neanderthals. It seems 3 factors were at play


  1. Neanderthals were unable to deal adequately with cold stress at a time of climactic change, 25-30,000 years ago

  2. Neanderthals needed to increase their energy intake and hence food consumption to keep warm. Homo-sapiens were more anatomically suited to keeping warm, making better use of increasingly scarce food resources

  3. Homo sapiens devised high-tech ways to keeping themselves warm including furs, boots etc.


However, in a remarkable paleoanthropological discovery, researchers have unearthed the remains of a dwarf human species that survived on the Indonesian island of Flores until just 13,000 years ago. This significantly extends the known range of physical variation in the homo-sapien genus and reveals that we shared the planet with other humans much more recently than previously believed.
This bantam human genus, dubbed Homo-floresiensis, stood around a metre tall and had a head slightly bigger than a grapefruit. Despite it's compact cranium it developed sophisticated tools such as micro-blades, perforators and barbs. As the article points out islands have produced giants aswell as dwarves as evidenced by the giant komodo dragon lizard. Anyway, I keep wondering what we'll learn about the evolution of man, the full extent of our genus and the factors that both shaped us and caused homo-sapien to prevail. It's also an interesting assertion of the effect of genetic and environmental isolation on genetic development. More on this at a later date...

Why the US should adopt Approval Voting

Excellent article from kuro5h1n here. This illustrates the fundamental flaws in the US electoral system i.e. essentially forcing the voter to choose between 2 deliberately polarised viewpoints (democrat or republican) when they may share neither. Approval voting is different in that it allows the electorate to vote for all the candidates or choices that they endorse. Indeed, this electoral system is favoured by the United Nations. The article is well worth reading, pointing out that the US electorate doesn't necessarily imply its citizens as their right to vote isn't protected by the constition. Yes that wasn't a misprint! Americans have a constitutional right to bear arms (a right that many of them exercise to the hilt of their fully automatic assault rifles) but not to vote. This right is reserved for the members of the electoral college system who, theoretically at least, may arbitrarily distribute the votes as they see fit. And even if you do vote, the chances of it being accurately counted are much lower than could reasonably be expected. The US has a long tradition of voting fraud, even in Florida!

The art of the mix-tape

It's good to broaden your musical tastes and one great way to do it is to get others to suggest the songs that have soundtracked their lives. Kinda like making a mix tape for your friends.. We're in high fidelity terrority here!

Rob: "The making of a great compilation tape like breaking up, is hard to do and takes ages longer than it might seem. You gotta kick it off with a killer to grab attention. Then you gotta take it up a notch but you don't want to blow your wad. So then you gotta cool it off a notch. There are a lot of rules. Anyway...I've started to make a tape. In my head, for Laura. Full of stuff she'd like. Full of stuff that'd make her happy. For the first time, I can see how that's done."
(from the movie High Fidelity staring John Cusack)

Recently I was forced to come up with a list of songs to be distributed to friends and colleagues over the next few weeks. Here's what I picked. Not going to comment on them, it's just like a musical snapshot of my life at the moment and whatever truths are here lie in the ear of the interpreter.


  • Are You Going With Me - Pat Metheny Group

  • Pink Moon - Nick Drake

  • Free Falling - Tom Petty

  • Samba Pa Ti - Santana

  • Belfast (Original Version) - Orbital

  • Into The Mystic - Van Morrison

  • Natural Beauty - Neil Young

  • She Is So Beautiful - The Waterboys

  • Wild Flowers - Ryan Adams

  • Get Down Make Love - Nine Inch Nails

  • Step Outside in The Morning Light - David Kitt

  • Lay It All On Me - The Black Crowes

  • Electrolite - REM

  • Zero - Smashing Pumpkins

  • Gorecki - Lamb

  • Whipping Boy - We don't need nobody else

  • One/Take 5 - Rodrigo Y Gabriela

  • Pyramid Song - Radiohead

  • Nobody's Fault But My Own - Beck

  • Go Down Easy - John Martyn

  • The Man in the Station - John Martyn

  • When the Stars Go Blue - Ryan Adams

  • No More Tears - Ozzy & Zakk Wylde

  • Redemption Song - Bob Marley


Pretty eclectic mix there but with some real gems aswell. I think that's one of the unacknowledged benefits of the current wave of file-sharing apps. Broadening the musical palettes of a generation. To quote Rob again
"What are you guys doing? Stealing for other people?"

Web Services standardisation (or trying to pass a herd of overkeen elephants through the eye of a needle)

In a previous life as a research manager in an Irish research group called TSSG I wrote a piece about semantic web for a technology column in a local paper. It's the usual non-critical high-level look at a technology but the excitement at the promise of semantic web is very real.


However I'm less than convinced about the current web services standardisation effort. In comments to another blog I was scathingly critical of the original WS technology (SOAP & XML-RPC) and the malaise of WS standards and specs. I've also been keenly following the wise words of Steve Vinoski, Chief Engineer of IONA technologies, another company I used to work for. Before I digress onto another topic entirely I'm going to reiterate some of my original comments about WS standardisation, mirroring steve's feelings about the lessons that can be learned from CORBA regarding tool & vendor support. So without wanting to offend too many of the great people involved in the process, here are my considered thoughts:

  • "Web Services" is a brand name for a range of disparate and relatively unfocused technologies.

  • The technology was hugely overhyped without accepted standards to back it up

  • XML messages were touted as human-readable. If you know that many humans who read large XML schemas in their spare time you need to get yourself and your friends "to a nunnery". OK, maybe not but you get the point ;-)

  • It often seems that around 20 years of distributed systems thinking was ignored in their creation. Hence SOAP was misnamed "Simple". "Incomplete" would have been more appropriate.

  • With usefulness comes complexity. With complexity comes unwieldiness and with unwieldiness comes confusion. The secret is normally appropriate abstraction but it's early days yet

  • The standardisation effort is frustrating and feels uncoordinated. All too often standards are hurriedly created to plug holes in other standards. Often if feels like the wheel is being reinvented, as if nobody in the effort knows that RPC has been done before. I hear Vinoski's cries for an overarching Architecture spec so have both a map and a flashlight

  • Almost none of this matters as the major industry players are now behind it in a bid to recapture the goldrush of the late 90s with a 'must-have'technology. For this reasons alone the tool support will hide much of the complexity and encourage utilisation. This is already happening. Thank you Microsoft, IBM, HP, BEA, IONA, SUN etc.

  • The most loosely coupled thing about WS/SOA is often the standardisation process. There could be trouble ahead



However there's hope for us all in the form of REST. It may correct several issues with webservices (including the loengthy standardisation process). WS piping is so incredibly powerful that it can't be overlooked. Also, REST provides some neat answers to security issues, automation, semantic web & may just bring about world peace given an appropriate level of vendor support


Arguably the URI is the reason the web took off in the 1st place. There were better transport and application layer protocols, more elegant markup grammars but the idea of the URI is compelling. Arguably with REST, semantic web & canonical URI's we may just be getting somewhere. I believe that these technologies will determine the success or failure of the web service initiative and everything else is pretty much window dressing.

Rodrigo Y Gabriela

Rodrigo Y Gabriela are two young 20-something (I think, no time to check at the moment!) guitarists that form a two-piece specialising in classical/jazz/rock fusion. With blistering solo runs, intriguing harmonies, innovative use of harmonics and a wonderful percussive style on heavier numbers they prove that classical guitar really can rock. I recommend going to their website and downloading some of the sample tracks here. I met these two in small theatre in my home town of Waterford, Ireland and I think they're both pretty damn fantastic. Check it out.

About October 2004

This page contains all entries posted to Ordo Ab Chao in October 2004. They are listed from oldest to newest.

November 2004 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33