fogbound.net




Sun, 5 Aug 2007

Viriconium

— SjG @ 10:00 pm

Viriconium by M. John Harrison, 2005, Bantam Books.

Consider a vast triangle. At one vertex stands one of the better authors of “great quest” science fiction or fantasy, perhaps J.R.R. Tolkien, or maybe Dan Simmons after a degree in Art History. At the next vertex, stands Mervyn Peake, with his cast of grotesques and desperate characters in their fantastic, crumbling, and endless decaying stronghold. The last vertex is simultaneously occupied by Angela Carter and Samuel R. Delaney, although they coexist in orthogonal dimensions, and are only vaguely aware of one another (via nebulous signs, strange dreams, and through the oddly resonant rituals that the villagers observe).

Somewhere near the center of this triangle lies Harrison’s sprawling poisoned wastelands, ruins, and evershifting city of Viriconium with its heros, artists, murderers and thieves.

The copy I read (thanks Peter!) comprises the three Viriconium novels The Pastel City, A Storm of Wings, and In Viriconium, and a collection of short stories. The collection has several distinct voices, and could conceivably have been written by different writers about a common thematic place. Characters show up in one story, and reappear in another — but are they the same person? Is it the cyclic nature of history we’re seeing? Are we in parallel universes? Places seem more constant than people (excluding perhaps Cellur the Birdmaker), although even places seem to shift location between stories.

Viriconium takes a few tropes of science fiction and fantasy, and weaves them in new and unexpected ways. Evidently, the ordering of the books and stories varies by edition, however in this copy, the tale starts in The Pastel City with what appears a fantasy setting which quickly reveals itself to be a distant post-apocalyptic science fiction world. From there, it evolves into a nearly opaque, disturbing, profound, and often absurd exploration of the nature of reality/realities in A Storm of Wings, and winds up with an equally absurd delving into courtly politics, artistic cliques, disease, and hooligan god-children in In Viriconium. In the short stories, many of these themes, places, and characters are revisited. Some are like fairy-tales, telling of people dealing with their destinies (e.g., “The Lamia & Lord Cromis”) others are tiny windows into a presumptively vast historical sweep (e.g., “Lords of Misrule”), while still others illustrate of village life and rituals in the shadow of a great city or ruminate on the significance of art.

Unfortunately, these few adjectives do the stories themselves no justice.

Harrison’s writing conveys a very strong sense of place, and is some of the more geological writing I’ve read. You can’t help but get a feel for the physical structure of the land, mutable as it is. The city of Viriconium too is imbued with a great presence, if not geography, and everything — city, land, society — is rich with barely imagined or imaginable history.

Harrison also has an exceptional vocabulary. I found myself consulting the dictionary on many pages, and discovering words like baize, catafalque, cinereous, costermonger, etiolate, gamboge, hispid, lazar, nacreous, osier, peneplain, phthisis, planish, saveloy, sempiternal, serac, and whin.

Filed in:

Sun, 15 Jul 2007

The Life and Opinions of Tristram Shandy, Gentleman

— SjG @ 8:53 pm

Laurence Sterne, 1759-1769. Read as a Gutenberg Project e-book, downloaded via manybooks.net.

I once had a co-worker (hi, Bob!), for whom completing an anecdote or telling a full story was an impossible task. Each new detail necessitated a digression, from which several tangents emerged, and so on, ad infinitum. We used to torment him by interrupting with nerdy / computer-science cries of “Pop the stack, Bob! Heap overflow!”

This is also the main thematic joke of Tristram Shandy, where, in telling us his life story, Tristram fills up three volumes getting up to his own birth, and then never really gets back to his own story with the exception of a mixed-up journey across France much later in his life. Life and Opinions is light on the life, and heavy on the opinions. We learn about his theories of many things, we overhear many conversations about religious, political, and military philosophy, and witness events reminiscent of Rabelais, but we’re too busy with these diversions to get much of his personal story.

Tristram has more to offer, though, than its (sometimes tiresome) tangents. Tristram’s amusing comments to the critics stand out, as do his grandiose opinions of his own literary prowess and techniques. However, overall, it’s the characters of Uncle Toby and his interactions with Tristram’s father Walter that make the work. Both men are peculiar, outrageous, and yet oddly believable, and their interactions can be surprisingly touching.

As with many of the older works I’ve read, Tristram suffers somewhat from what I call
Shakespeare/Bible Copycat Syndrome (in which a work so widely imitated and quoted that the original seems clichéd).

In what should give hope to those of us who are getting older and accomplishing less than we’d hoped, Sterne started writing this humorous, meandering tale when he was 45. Nine volumes and ten years later, he’d completed one of the great works of English humor. So there’s still hope for us.

Filed in:

Mon, 9 Jul 2007

Preventing “Overlapping” cron Processes

— SjG @ 9:43 am

I have a number of very time consuming processes that get run by cron on various machines. Some of these processes would cause problems if they “overlapped” — e.g., a new one gets started before the old one is done.

Now, there are a lot of ways to make sure you’re unique if you’re a process, but often I don’t want to modify the source of the process to add that (for many packages, I’d rather not patch and merge and recompile every time a new version comes out). So I write a simple shell script to run the process; cron calls my shell script, and prevents the overlap.

This uses the magic of “pgrep” — unfortunately, different versions of pgrep have different flags, so the code I originally wrote (which used the “-c” flag, which counts the matching processes) didn’t port to most systems. It’s easy enough to pipe the output through a “wc -l”.

I did have to move the pgrep exec out of my if statement, though, since the comparison was going against the return code, not the output. Doh!

#!/bin/bash

RUNNING_PROCS = `pgrep -f longRunningProcess | wc -l`
if [ "$RUNNING_PROCS" -gt "0" ]
then
        echo `date` longRunningProcess still running. I\'ll let it finish. 
else
        echo `date` Starting longRunningProcess.
        /path/to/longRunningProcess -flags 
fi
echo "----------------------------"

Filed in:

Wed, 27 Jun 2007

Unix: How to find files lacking certain strings

— SjG @ 4:10 pm

So, I’m working on a convoluted web site, and a problem comes up. It seems that some vitally important code was not included in some pages (for the sake of argument, let’s say it’s a copyright string). This particular site has an ungodly mix of files, including .htm, .html, and .jsp files. Some of the .jsp files are actual pages, and others are stubs to be included in other .jsp pages. The majority of the full .jsp pages include a “footer.jsp” that has the desired string, so they’re good. But I need to generate a list of the full pages, of whatever sort, that lack this string.

The inverse of this problem is easy, and is the kind of thing I use all the time:
find . -name \*.htm -o -name \*.html -o -name \*.jsp -exec grep -il "myString" {} \;

Initially, I thought using the -v flag to grep would work for me, but grep -vl returns all files it sees, because -v returns the lines that match the invert expression, not the files that match the invert expression. Then there’s the problem that I need to match “full” pages rather than included .jsp stubs.

So here’s how the Mighty Power of Unix came to my rescue:

find . -name \*.htm -o -name \*.html -o -name \*.jsp | xargs grep -il "</html>" | sort -u > full_pages.txt

provides me with a list of pages that are not mere inclusions, if you accept my assumption that an inclusion won’t match the closing HTML tag.

Then I generate a list of full pages that contain the magic string and or include the footer.jsp that would contain the magic string:
find . -name \*.htm -o -name \*.html -o -name \*.jsp | xargs grep -il "</html>" | xargs grep -le "uniqueCopyrightTag\|footer\.jsp" | sort -u > pages_no_string.txt

Then I compare the files to find out which full pages lack both the magic string and the include:
comm -3 pages_no_string.txt full_pages.txt

Wow. There it is!

I bet there’s an easier way. Post an example in the comments if you know of one!

NOTE: All commands are on a single line, regardless of whether they wrap in this particular display.


Sat, 16 Jun 2007

You Can’t Win

— SjG @ 6:16 pm

You Can’t Win, by Jack Black, 1926, reprinted by Nabat Press, 2000.

This is an interesting, conflicted, tripartite book. It’s an autobiography of a hobo and burglar, a jailbird, and a reform activist. The book starts as a good-natured telling of how Black left home, and became a hobo. We follow him as he gets caught up in the seamier side of life away from home, and how, ostensibly, through misunderstandings, he came to fall fully on the wrong side of the law. The arc continues through opium addiction, prison, abuse, and ends in reform and moral outrage.

The first part of the telling is a light, almost romantic adventure. The young man goes off, has adventures in the city, then starts to ride the rails. Sure, there’s danger, there’s police and railyard bulls to avoid, there’s even sudden death from shifting cargo, but the telling is almost with the exuberance of youth. Black encounters other hobos, who welcome him into the family, teach him the argot, and start showing him the ropes.

From here, the tale darkens. Black apprentices himself out to be a burglar, and the situations get more perilous. Friends get killed; Black gets into and out of prison. Still, the tale is rip-roaring adventure: now a member of the brotherhood of thieves, Black introduces us to a cast of wild characters. He describes to us the great hobo gatherings, with their camaraderie and drunken abandon. He details many hair-raising exploits of burglary and safe breaking.

The latter part of the book involves a lot more prison, betrayal, and drug addiction. It still has elaborate capers of theft and jailbreak, but now Black has suffered under the system. Authority is now beating him down, and he responds with wantonness and violence. In the end, there is kindness and reform.

The book is particularly intriguing in the shift of tone throughout the book. There is definite pride in the exploits, even if the words condemn his actions. The latter parts of the book are quite bitter, and the emotions are contradictory — Black blames the cruel neglect and abuse of society for making him into a monster, yet he also happily admits that he never had any interest in becoming part of society or behaving in a way that society would accept. This is what makes the book more than just a personal journey or a thriller; we experience the world from Black’s perspective, seeing hypocrisies in both the society with which he’s in conflict, and in his antisocial lifestyle.

Filed in: