fogbound.net




Tue, 7 Aug 2007

What Makes Sammy Run?

— SjG @ 9:28 pm

Budd Schulberg, Vintage Books, 1990 (originally published 1941)

The story of obnoxious, hyper-competitive, and ambitious Sammy Glick(stein)’s rise from child of the tenements to the head of a major Hollywood studio is a familiar one. Glick embodies the entitled, egotism that we see everywhere, the ends-justify-the-means machinations, and the casual disregard for everyone unless they can be used for advancement.

The tale of Glick’s rise is interwoven the explosive growth of the studio system, along with the early development of the Screenwriter’s Guild. It’s a quick, engaging novel, filled with betrayals, triumphs, and backstabbery. The characters are familiar too, we’ve all dealt with Glicks and their victims, whether on campus or in a corporation.

The copy I read (thanks Karl!) contains not only the novel of What Makes Sammy Run?, but the two short stories from which the novel evolved, as well as an afterword written by Schulberg in 1989. The short stories are interesting views into how the novel was developed, but the afterword is even more revealing. Schulberg writes of the surprise of the book’s success, how it was simultaneously attacked as being Communist and being counter-revolutionary, and how it led him to a fist-fight with John Wayne on the beaches of Puerto Vallerta. He talks about his alienation from the Communist party, and offers a defense for his role as a friendly witness for the House Committee on Unamerican Activity.

Most poignantly, he writes of Sammy Glick’s evolution from a repugnant character to a role model in the forty some odd years since publication (or rather, how our American attitudes have shifted). He cites various late Reagan-era examples of how America has become a nation of entitled, self-important Glicks and Glickettes. He ends with the dire warning that the Sammy of the 21st century may end up making the Sammy of the 20th look like an eagle scout.

Filed in:

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.