| March 20, 2012 11:18 am

I saw this quote on Fountly and quite liked it:

"Life is pretty simple: You do some stuff. Most fails. Some works. You do more of what works. If it works big, others quickly copy it. Then you do something else. The trick is the doing something else."

It’s attributed to Leonardo Da Vinci.*

________________________________

* I’m highly skeptical of this attribution and want to see a reference. Even better would be to see the quote in context. Most of Leonardo’s words of wisdom come via his notebooks, and that’s not usually how he wrote things in his notebooks. For the open source writing book, I’ve spent a fair amount of time with the notebook translations, and this just doesn’t sound like Leo. Mostly because Leo didn’t seem to be that concerned with others copying him. He enjoyed being emulated. With all that said, I still like the quote. (Even though it is an error to map modern sensibilities onto our ancient role models.)

 | March 19, 2012 9:36 pm

XML Parsing with Python, Part 4In Part 2 of this tutorial, we looked at how libxml (through the use of the lxml Python bindings) can be used to parse XML documents. We covered how to load XML files from disk, parse them, look for specific tags and attributes, and generate custom datatypes from the results.

These are the operations that lxml is used most often for and are probably what most developers will need it for. It only scratches the surface of what it is capable of, however.

In Part 2, we talked about three common XML operations: parsing, validation, and transformation. Of these three, parsing is the most important. We touched upon validation and transformation, but didn’t look at how they work.

In this video, we’ll take a look at the last two operation. We’ll cover validation using DocType definitions and XML Schema and transformation, using XSLT style sheets.

Note: The example files used in the video can be downloaded from here.

Show me more… »

 | 1:59 pm

Parsing XML with Python, Part 2As we talked about in Part 1 of this series, XML is one of the most versatile structural languages, which has led it to be used in nearly everything every sort of application imaginable. It serves as the basis of file formats, a way to store financial records, and for communication between web servers. For this reason, programmers and designers should be familiar with not only how to write it, but also how to parse, validate, and transform it.

One of the most powerful tools for working with XML is libxml, an open source parser. Given its versatility, libxml is used in many open source projects, and even commercial products. It can be found at the base of the Gnome desktop and in banking software.

In this video, Part 2 of a series on working with XML from Python, we’ll look at how you can use libxml from Python through the lxml bindings. We’ll show how to load and parse an XML document, iterate through the elements and attributes, test for specific tags, and translate the document structure into a custom object.

Note: The example files used in the video can be downloaded from here.

Show me more… »

 | March 16, 2012 3:01 pm

Parsing XML with Python (Part 1, Installation)XML is one of the most versatile structural languages around. It is used extensively for file formats, storing miscellaneous data, and communicating between different programs. You can find it on the web, on the desktop, and places you might not expect, such as in interactive books.

Given its importance, most programming languages come with a parser that can be used to analyze and decode XML. Examples include MSXML, which is used in Microsoft’s .NET framework and libxml, a popular open source library.

In this series of videos, I’ll show you how to get up and running with libxml, through the lxml Python bindings. We’ll look at how to install the programs (Python, the Python package manager, setuptools, and lxml itself), read and parse an XML document from a file, inspect tags and attributes, validate XML structure, and perform XML transforms.

This first video will focus on the installation of Python, setuptools, and lxml.

Show me more… »

 | March 8, 2012 12:15 am

For many writers, the act of writing (or placing one word after another) is synonymous with the tool that they use to do it. There’s a reason why writers feel so strongly about their moleskin notebooks, fountain pens, and computer software. I’m no different than any other writer. I have my preferred tools, and I love them dearly. They help to focus on my ideas and craft prose that I can be proud of.

When writing on a computer, the tool of choice for many writers (dare I say most?) is Microsoft Word. It’s everywhere and everyone has used it. It comes preinstalled on most computers and is a de-facto standard for exchanging written material with others.

Unfortunately, Word is not part of my preferred toolset. I prefer to write using LyX and an add-on I’ve written for it called LyX-Outline. But while I love my writing program, it makes it difficult to collaborate with other writers who use Word, as LyX doesn’t have a straightforward way to directly import Word files.

This isn’t a new problem and I’ve written about it before. I’ve even proposed a solutions. But while that solution was a good fit for me, it isn’t something that I would recommend to others.

For starters, it required a great deal of software to be installed. You needed a program to convert Microsoft Word documents to Open Office documents. You then had to use a second utility to convert it to HTML or LaTeX. After that, you used to a third utility to clean it up and import the LaTeX code into LyX. Three distinct steps, with a lot of places where things could go wrong.

Over the past few months, I’ve found that I need a better way, a tool that can directly import a Word document and cleanly translate its content. So, I decided to create one.

MSDoc2LyX

Show me more… »

 | February 13, 2012 3:39 am

One of my grandfather’s favorite pastimes was to fish. He loved to deep sea fish, he would travel for the salmon run (one of the things he most loved to talk about were the many trips to Alaska to fish for King Salmon), fly fishing (he spent hours tying his own flies), and lake fishing. He has albums filled with pictures of dead fish, moments spent on the lake, and the good times that came from his love of nature.

Along with his love fishing came a natural, and only slightly less passionate, love of boating. He loved to motor boat, sail, and paddle.

As long as I can remember, he’s always owned a boat (and occasionally more than one). The one I remember most was a top of the line waterski cruiser. It was beautiful, with red and white racing stripes and an overpowered, oversized, outboard motor. It was also always referred to as his “fishing boat,” which seemed a bit like calling a Rolls-Royce the “casual” car.

That was hardly the first boat that he had ever owned, though, or even his second. His first boat was something of a legend. It was called the Amazon Queen, her name inspired by a famous movie of the time.The Boat Crew

The salesmen of Standard Supply Company hard at work on the Amazon Queen. Taken in the chicken coop at my great-grandfather’s home. At far right is my grandpa, Charles Stillman. At his left is great-grandpa, Gary Wayne Stillman.

The Amazon Queen began life in the chicken coop/shed of my great grandfather as a hobby project. He went to my great-grandfather with the idea that it would be fun to build a boat, and Great-grandpa agreed. Apparently, others agreed that it was a great project idea as well.

Working on the boat became something of a company past-time, at least for the sales people. Every night after work, an entire crew would head to Great-grandpa’s house and spend all night shaping boards. After several years of work, the Amazon Queen was finally finished.

The Queen was fifteen or sixteen feet from bow to stern, with wood panel sides and an outboard motor. She could comfortably sit four people and could uncomfortably sit about a dozen.

Before her maiden voyage, though, the crew faced something of a dilemma. When it came time to get the boat out of the coop, they discovered that she was too big for the front doors. It was impossible to get her out!

Faced with such a challenge, they did what any self-respecting boat lover would: they tore down the chicken coop, taking great care not to damage the boat.

The Amazon Queen on her maiden voyage

The crew from Standard Supply company, enjoying the Amazon Queen’s maiden voyage.

The maiden voyage of the Amazon Queen took place at Pineview Reservoir (located near Ogden, Utah) a couple of months after her official unveiling. Because so many of the staff at Standard Supply Company had helped in her construction, she became the star attraction at the company picnic. The photo above was a snapshot from the picnic and shows her crowded with sales people, accounts receivable clerks, and stockroom workers. (My grandpa is the one sitting on the bow.)

The Amazon Queen had a long and happy life. She toured the width and breadth of the Western United States, visiting the lakes and reservoirs of Montana, Idaho, Utah, Wyoming, Colorado, Nevada, Washington, and Colorado. The only requirement was that the fishing be good, or that the water skiing be acceptable.

Like any well loved thing, the Queen was also well used. She taught daughters to water ski, children how to survive on the back of an inflatable tube, and was manhandled by friends. Occasionally, she was even a bit abused, including one infamous trip to Bear Lake where Grandpa’s best friend, Charlie McDonnell, ran her  into the beach at full speed. (Of course the children in the boat immediately ran up the beach looking for my grandpa, yelling, “Charlie beached the boat! Charlie beached the boat!”)

No boat, no matter how lovingly built, is meant to survive that kind of abuse, and the Queen eventually gave out under the strain. In her case, it was during a family trip to the lake. Friends of my grandpa were out for a late afternoon run on the water, when the bindings at the front of the boat, began to come undone. Then, as she bounced over the wake of another motorboat, the entire boat came apart from bow to stern into two separate pieces. This sent the pleasure goers sitting on her prow flying into the water and those who survived the wreck swimming for shore. Luckily, no one was hurt.

Bitten by the boat bug, though, my grandfather wasn’t to be put off long. It wasn’t a year later that the whole family was back on the water in another hand-built wooden boat.

Grandpa Stillman's Mahogany Boat

 | February 8, 2012 7:47 pm

Note: This morning, I came across a wonderful surprise. Retronaut published a series of eight illustrations of what London might look like if it were to sink below the level of the Thames and become flooded: a second Venice. While the images are lovely, though, the source article from which they come is even more so. It was printed in 1899 by Harmsworth’s Magazine, a monthly picture magazine. I’ve reproduced it below.

“Geologists say that the land upon which London is built has subsided 68 feet during the last 500 years. This doubtless is traceable to substratiform deposits, lunar attraction, or causes equally occult; but whatever it is, the figures 68 disarm suspicion. Assuming that the subsidence is still going on, one can imagine the metropolis some day sinking below Thames level and becoming a second Venice.”

– Daily Paper.

BUT didn’t you know?” asked my travelling companion.

“No!” I answered. “You see, I left England away back in ’99, and I have been virtually cut off from civilisation ever since. In Siberia the reading of newspapers is not encouraged, and letters, even if you have friends at home to write them, have a way of going astray unrivalled in any other country. Until I landed in Hull this morning, I had not had occasion to use the English language for years. So it is little wonder that what you say is surprising news to me.”

” Quite so,” continued the affable gentleman with whom I shared the first-class carriage, ” though we have grown so used to it by this time that we almost forget London ever existed in any other form. Let me see, it must have been in 1910 — the year of the floods — that the last subsidence occurred. It would have come about naturally in time, geologists said, but the climax was certainly precipitated by the Government’s action in allowing London to be undermined to such an extent when the new coal fields were discovered under the city in 1900. We had been steadily raising the embankments of the Thames, but the floods swept these away, and one morning we awoke to find our streets converted into waterways. All manner of remedies were tried, including a Royal Commission, which, by the way, decided only last week that nothing could be done, thus endorsing the public opinion of fifteen years ago. Of course the lower stories of all houses had to be abandoned, save as diving baths, but it was a simple matter to add others. Naturally the old street traffic almost vanished, cabs, ‘buses, and carts giving place to gondolas and steamboats. To begin with, we had to import gondoliers from Venice, to instruct our late cabdrivers in their new craft, at the same time adopting many other features peculiar to the Bride of the Adriatic. These, as you can imagine, have had considerable influence on our customs, our architecture, and even our language. English is still largely spoken, however.

Palazzo Degli Horse Guards

Hullo ! we’ve arrived. ‘Stazione di Pancras’ I think that gendarme called — formerly known as St. Pancras, if I remember rightly.

“Come! hand your bags to the servitori, and let me introduce you to the new London, the Bride di Middlesex, as we proudly term our city. You will stop at the Hotel Cecil, on the Canale, I presume. We shall find gondolas at the other side of this piazza.”

Somewhat bewildered, I alighted from the train and followed my friend, having heard him instruct a cut-throat looking ruffian regarding my luggage in a jargon I could not understand. He led the way across a large paved space on to a kind of quay. What he had described was true.

At our feet stretched a shimmering sheet of water, its surface, in our immediate vicinity, black with countless gondolas, the men standing up in them clamouring loudly for custom. My companion beckoned, and a score glided up as though we had pulled as many strings. Entering one, we took our seats in the cool shade of the awning. “Lago di Hyde, Canale del Regente, Lago di Piccadilly, Croce di Charing, and Grand Canal,” called my friend, and away we sped.

I was dumb with amazement. The dull roar of traffic that I had always associated with London streets had vanished as though it had never been. Save for the rhythmical splash of the oars and the low musical voices of the gondoliers as they passed each other or approached a turning all was silent as the grave.

Cathedral and Piazza Di St. Paul's

Here a prosperous city man, I knew the type — he carried his little basket of fish as of yore — was being whisked off to his suburban home in a fussy little steam affair; there a vision of olive-skinned loveliness, peeping coyly out from behind a fan, flitted past us all too fleetly; now the canals were so broad that even loitering Carter Paterson barges could not impede our passage; now they were so narrow that two gondolas could hardly pass abreast. The houses, flower-decked and sun-kissed, had nothing in common with the houses of my day, though many of them I knew must be the same. The ladies, sipping tea on balconies or tuning mandolins at open windows, seemed more daintily clad than any I had even seen before. Presently we passed beneath an arch that struck me as being familiar, and entered upon a vast expanse of water dotted with islets. Hundreds of other gondolas preceded and followed us. I looked at my guide inquiringly.

“This,” said he, “is the Lago di Hyde, Hyde Park that was in the dull old days, now the only place of its kind in the world. On the largest of the leafy islands that you see, bands play every afternoon and evening, and hither flocks all London — society in its private gondolas, and the people in personally-paddled parties at ten centesimi per head. Over there, that double line of posts marks what was once, I recollect, styled the Row. Tradition dies hard, and here fashionable men and maidens still take exercise in the early morning, now on water bicycles and water skates.”

Lago Di Piccadilly

On we went, threading our way between the islets and through many a quiet side canal, emerging at length into what was introduced to me as the Canale del Regente, but which I recognised as the Regent Street of old, and now undoubtedly rendered one of the most picturesque thoroughfares in the world. This in turn led to the Lago di Piccadilly (once Piccadilly Circus), from which we glided down the Rio di Haymarket, past the Teatro di Her Majesty, into surroundings that strangely recalled Trafalgar Square.

There were the lions, as of yore, save that they seemed to have developed wings, while on the north side was the old National Gallery, though my friend insisted on referring to it as the “Accademia delle belle Arti.” Nelson’s Column, I was glad to see, had been left alone. Leaving the Lago di Trafalgar we presently reached a much broader waterway than I had yet seen. Sheer out of it on one side rose the Houses of Parliament.

“The Canalazzo, or Grand Canal,” explained my companion, “formerly the Thames, Here are held all the water sports and races. This year America is sending over a gondola to compete for the London Cup against Conte Lipton.”

The next landmark recognisable to me was Somerset House, now styled, I learned, the Palazzo or Palace of the Doges; and then I saw the splendid Palazzo of the London County Council, from here being issued all regulations regarding the hours for bathing and the muzzling of the larger kinds of fish.

I had noticed that all the gondolas we had seen were painted black, only the ‘buses and other public vehicles boasted vivid colouring. In Old Venice, I recollected, during the fifteenth century a decree was issued ordering all floating things into mourning, the object being to favour espionage and political intrigue. In a black gondola on a black night the spies of the Government might travel anywhere without fear of detection. Only to ambassadors was given the privilege of decorating their gondolas in colours, and this in order that their movements might be the more easily followed. Some such edict had gone forth in London I concluded.

“The Council of Doges certainly did try something of the sort,” returned my guide in answer to my query, “though not with any great success. In the case of the gondola it wasn’t necessary. The Englishman who can afford to paddle alone is naturally of a sombre disposition, and would no more ride in a gaudy gondola than he would have patronised a yellow cab in the olden times. And as far as the ‘buses were concerned, the Doges’ decrees were as abortive as their attempts to restrict the language of the gondoliers, which, under stress of circumstances, remains a bright crimson as of yore.”

Anyone who has ever lingered in the vicinity of a canal must have realised what a marvellous influence such waterways have upon the rhetoric of skippers. Across the Rio at this moment was wafted to us the sound of voices–those of rival gondoliers holding sweet converse.

“Ten cents all the way to the Banco,” crooned one. “‘Igher up, there! ‘Ave ye bought the whole canal, Marco Giovanni ? Not so much splashing, Corpo Paolo, or I’ll smash yer bulkheads.”

“Garn,” replied the gondolier of a dazzling turn-out in green and gold — obviously a pirate –” I paddled a ‘bus before you eat yer first hokey. Git ‘ome to bed.”

Venice-London07

With this pleasantry ringing in our ear we passed under what was pointed out to me as the Bridge of Sighs, but which looked suspiciously like the old Tower Bridge. Now we turned, and ere long we were in another spot familiar to me.

“Here,” said my friend, “you see the Palazzo di Royal Exchange, the Banco, and the Palazzo di Mansion House.”

“The Lord Mayor’s Show,” said I, “must be wonderful in these days.”

“Ah, yes; but you should say ‘carnival,’ and the head of the city is now known as the ‘Syndic’ — not Lord Mayor. It was suggested in some quarters that ‘syndicate’ would be more in keeping with the trend of the times.”

It was growing dusk now, but the most wonderful sight was yet to come. St. Paul’s, rising gaunt and spectral from its aqueous bed, the moon glinting on the lapping waters, the grateful silence, the quaint shadows that followed us down what was once Ludgate Hill, these things painted a memory-picture that will never fade.

One thing was puzzling me as we glided through the Rialto in what was formerly the Strand.

“Has cricket died out in London?” I asked.

“By no means,” was the reply; “on the other hand, we have improved it vastly, thanks to the introduction of water skates and floating wickets, and certainly rendered it far more exciting. I think we shall beat the Australians at the Lago di Lord’s to-morrow. It was very sad; their best bowler slipped on an oil patch and was drowned while playing at the Lago di Oval last week.”

I was not sorry when, shortly after, the gondola stopped at the Hotel di Cecil, and I stood on terra firma again. As I alighted the gondolier broke forth into song.

“Gondolieri drinka beera,” he chanted.

“What means he?” I asked.

“In the picturesque language of his class,” explained my fellow voyager,” he indicates that he will be glad to drink your health.”

” I will throw the lazzarone a lira,” said I, beginning to catch the atmosphere of the place.

*      *      *      *      *

“I think he’ll do,” someone said.

I sat up and gasped, “Is it out?”

I was in a dentist’s chair, recovering from gas — an overdose, I think. Even a normal amount induces strange dreams. My hands clutched a newspaper, and as I glanced at it my eye again caught the paragraph, ” Geologists say that the land upon which London,” etc.

Our photographs are by Messrs. R. Thiele and Co.

Collage of images showing how London might appear if it flooded like Venice.

How Her Majesty’s Theatre Wold Look – If London Were Like Venice

If London Were Like Venice, Hyde Park Corner Would be Much Improved

The Banco and Palazzo Di Royal Exchange, If London Were Like Venice

Palazzo Degli Horse Guards

Cathedral and Piazza Di St. Paul’s

Lago Di Piccadilly – Late Picadilly Circus

Stazione Di Pancras – the Late St. Pancras Station

Canale Del Regente – One Time Known as Regent Street

– Via Retronaut via Forgotten Futures

 | February 7, 2012 3:47 pm

For his entire life, Grandpa was a collector. He collected coins (gold and silver dollars, pesos, pounds of the British Empire, historical coins of interest, and even a couple of Reichsmark from the Veimar Republic of Germany), guns, stamps, jokes (usually of questionable appropriateness), and baubles of interest. When I was quite small, I remember sitting with him as he would show me some of the items in his collection and talk about where they had come from.

Apparently, the drive to collect things is something that he’s always had. When he was a child, Grandpa was always filling his pockets with things, usually until there was room for nothing else.

These were mostly the harmless sorts of items that all boys bring home – bottle-caps, interesting stones, pretty feathers, bits of colored (and probably broken) glass, and bugs. But though most were harmless, there was one exception: Grandpa also liked to collect matches.

Like any mother, this tendency greatly concerned Great-grandma (especially as the parent of a prankster-prone boy). She was thoroughly convinced that grandpa, either deliberately or by accident, would burn the house down.

(Apparently, there may have been some rationale to these fears. Several times in my life, I’ve hard reference to an “incident with the chicken coup.” No one seems to know the specifics, but the consensus is that it was damaged, and that it was my grandpa’s fault.)

Great-grandma tried, gently, to persuade Grandpa that collecting matches was a Bad Thing. This, however, was less than successful. So, Great-Grandma decided to take bold action. One night, while Grandpa was sleeping, she took all of his clothes and sewed up the pockets.

Unfortunately, this was unsuccessful as well. He still managed to find ways to bring things (including matches) home.

 | February 6, 2012 6:25 pm

Note: One of the good things (yes, there are good things) about a funeral, is the opportunity to see friends and family, to remember your loved ones, and to hear the untold stories from their lives. As part of the preparation to speak at the funeral, I’ve been talking to friends and family about what they best remember about my grandfather. This story comes via both of his sisters.

Grandpa Stillman and brother, Richard (circa 1932)

From the moment he was born, Grandpa was a trickster. Few moments passed where he wasn’t planning a prank, pulling one off, or fleeing the consequences. (Usually to the dismay of his mother, Florence. Years later, she confided to one of grandpa’s sisters, “The children were easy to raise, except Bob.”)

On one occasion, when 10 or 11, Grandpa had done something so odious (no one seems to remember what), that it had to be punished. For that reason, his mother set about to catch him (usually more trouble than it was worth).

Grandpa had other ideas.

At first, he tried running away, but Great-grandma could run just as far and fast. With that not working, he decided to try another strategy: hiding. Great-grandpa and grandma had a big, bulky bed that was just high enough to sweep under, but not quite so large as to allow an adult to crawl underneath.

This is where Grandpa headed to wait out the storm, with Great-grandma heading right after him. Grandpa, however, made it to the bed (and safety) first and great-grandma couldn’t follow.

Being a smart lady (grandpa got it from somewhere, after all), she decided to try a different tack. Nicely, she tried to coax him out from under the bed. They could talk about what had happened and then everyone could be happy.

Grandpa wasn’t having any of that.

Upon the failure of persuasion and long-suffering kindness, Great-grandma decided to try and grab him. She reached under the bed to snag his feet.

Grandpa wasn’t having any of that, either.

Each time she would get close, grandpa would roll to the other side of the bed, just outside of her reach.

This left only one recourse: brute force. Great-grandma went to the kitchen where she kept the broom and proceeded to clear him from the bed much as you would coax an angry and vicious cat: vigorously.

Again, though, no luck.

Unable to deal with her son, Great-grandma settled for another target: scolding the two young sisters, who had watched and giggled through the entire exchange from the doorway.

I’m not really sure that anyone knows what got grandpa out from under the bed. My personal bet, though, is that it involved ice cream. You could pursue Grandpa to do just about anything with ice cream.

 | 5:18 pm

This past week, my grandfather passed away, and I’ve been asked to write a speech for his funeral. It is the strangest thing, this being asked to distill eighty-seven years into twenty minutes. What do you include? What do you say? Do you tell the story about grandpa as reluctant mouse-hunter (it ends badly)? Or the one where his hip went out at the lake and his friends decided to take him to the emergency room, boat and all? Do you talk about the distressed husband, at the bedside of his dying wife, realizing that there might have been a lost opportunity to express just how much he loved her?

Human lives are complicated things. When well lived, they encompasses moments of beauty, love, friendship, and happiness in addition to tragedy, lost opportunity, and regret. (And my grandfather’s life was well-live.) What’s more, we human beings are embodiments of paradox: a man may be both a great philanthropist and a brutal monopolist, who built his fortune upon the shattered careers of others. Or he may be a vicious murderer and anarchist who “loved sunflowers, eating yogurt with honey; who took his children to the beach, and let them sleep under the stars.” How do you capture all of it: the good, the bad, the ugly, the contemplative, the tragic, and the hilarious?

The only answer I have been able to find to that question was given by Neil Gaiman, while being interviewed by a reporter about someone still very much alive:

I spent half an hour yesterday talking to a reporter who was working on the obituary of someone who is currently very much alive, even in good health, and it was … well … very odd. I’d always known that obituaries aren’t just knocked up (or perhaps tossed off. Look, neither phrase sounds particularly wholesome) on the spur of the moment by some dusty, but hard working, obituarist whenever someone kicks the bucket, but they are written ahead of time, often rewritten many times over the years. The Daily Telegraphs are the best, I don’t why this is, but it’s true. Here is my favourite Telegraph obituary ever, because it contains:

Despite a brisk code of discipline, Singleton took a laissez faire approach out of the classroom. Every November 5, the smallest boy in the school was sent down a tunnel to light the very core of the bonfire. None, so far as anyone can recall, was ever lost.

Good obituaries (and by extension, eulogies), it appears, is much like any other sort of writing: a careful product of thought, time, review, and attention.

That is, perhaps, why they are such an art-form. Unlike other types of communication, they have to be composed in moments of pandemonium, distress, and chaos; at a time when it’s essential to find precisely the right words under conditions which make it all but impossible.

Manifestly unfair, if you want my opinion.