Thursday, November 29, 2007

New (to me) New Yorker Podcast

I happened on a podcast I am pretty excited about. It is put out by the New Yorker, apparently monthly. In each episode a current New Yorker fiction writer selects and reads a short story from another writer from an earlier era. The stories are mostly from the "golden era" of New Yorker short stories. John Cheever, Mavis Gallant, Jorge Luis Borges, and Donald Barthelme were read in recent editions. Then the writer and fiction editor Deborah Treisman talk for a bit about the story. Pretty simple, but its wonderful.

- J

Tuesday, November 27, 2007

Javascript

I have recently been spending a little time updating my knowledge of JavaScript. I have not been working on user interfaces in recent years. When I last looked at JavaScript the main advise was "don't". Obviously, that advise no longer pertains. Apart from XMLHttpRequest and AJAX, the two main things that I have found interesting are:
  • there is a much clearer understanding of the nature of the language and design principals and
  • there are now a variety of mature well supported libraries, including Dojo and jQuery. These are not just hokey widget collections, but appear to provide real programming infrastructure.
I am not very interested, at this point, in AJAX. The ability to talk to the server behind the user's back is nice for some discrete, mainly big pipe, applications. It is best where there is more data than you can effectively send at once or where the data is highly changeable. But, AJAX appears to create as many problems as it solves for most applications.

JavaScript turns out to have more in common with Lisp than Java, having closures. Lisp people are prone to making claims about object oriented programming having appeared in Lisp before some other languages, and in a sense they are right. You can implement inheritable, polymorphic, encapsulated things in Lisp using closures, but you need to think about them differently.

A number of writers have been exploring the idea of unobtrusive JavaScript. In this approach, page content is vanilla HTML and behavior is added in an onload script. This is, in a lot of ways, finally applying some ordinary engineering to the problem: separating concerns, regularizing binding, finding techniques to better leverage common logic, and so on. I like these ideas very much and they make JavaScript much more attractive for me. In many ways, it is contrary to a lot of the AJAX trends. Pushed to its logical extreme unobtrusive JavaScript would strip the body of a web page of everything but pure content and that content's natural structure. The AJAX implementations I have seen make the body of the page content free presentation elements.

Finally, when I last looked seriously at JavaScript there were only a few flakey command line EcmaScript interpreters. Now there are some solid looking ones, two from Mozilla! And a number of unit test libraries that I need to look at. It is not clear to what degree the unit test libraries support an emulated DOM. More later.

All of this is probably old hat to people who have been actually paying attention to the JavaScript world, but it comes as news to me. Worth a continuing look.

- J

Monday, November 26, 2007

Notes on "Garden of the Finzi-Continis"

This 1970 Vittorio de Sica romance is set in the Italian city Ferrera during the Second World War. The Finzi-Continis are wealthy jews who believe their wealth and high garden walls can protect them from the ravages of antisemitism. The hero is a middle class jew in love with the Finzi-Contini daughter. There is an air of melancholic nostalgia about the film. It almost suggests that the filmmaker is as reluctant to acknowledge the brutality of the era as the Finzi-Continis.

It is a complex story that does not have any easy resolutions and lingers in the mind.

- J

Liquidity Bubbles: Why they keep happening

Dear reader(s), does the following even make any sense? I wrote this a while ago, and did not post it then. I am not sure. When someone says "I am not an economist, but..." I get suspicious. I even get suspicious of myself.

- J
We have yet to see the end of what has become known as the Subprime Mortgage Scandal. There are apparently many more rocks to turn over. Already, though, the dollar amounts are huge. This is the latest in a series of Liquidity Bubbles: lots of cash with no place to go until someone figures out a way to rationalize very bad investments. The first liquidity bubble in modern times, I think was the Savings and loan scandal of the 80's. To a degree, the dot-com bubble was a liquidity bubble.

I am no economist, but it seems pretty plain to me. Starting in the Seventies we turned over to the Fed virtually all the management of economic cycles. At the same time we began a legislative trend that has had the effect of increasing opacity of economic transactions. "Deregulation" and "Free Trade" are opacity increasing activities. What is the economic value of moving manufacturing oversees? To make invisible exploitation of workers and trashing of the environment.

So when the economy slows down we pump more cheap money into it. This is intended to encourage innovation and new enterprise, and it does, but it also encourages fraud. Especially in a loosely regulated environment, old ideas, like pyramid schemes and ponzi schemes are easy to dress up as new, easier than real innovation. So we have bubbles, ordinary citizens are victimized and the government bails out the villains. And so it will go.
- J

Painting the Shed

I painted the garden shed over the weekend. I began at about nine and finished at almost four. No breaks. I meant to stop when I was hungry or tired but I did not get hungry or tired. In recent years my appetite has been on a reliable schedule, so I was surprised.

Some time ago I wrote about the psychological concept of flow, a state of mind where time seems to disappear and where the person experiences a sustained period of concentration.

This was not "flow", but it was something like it. The thing is: I don't particularly like painting. I don't mind it, but its not an activity I would choose for its own sake. I do not find it absorbing. It has a momentum, though. You can see progress and you can see the end point. And there is a cost to taking a break: you have to clean your brushes.

A few years ago we had to have a sewer line replaced. This took a week and the workers would work into the evening. Sometimes we would have to go out and tell them to stop for fear that they would disturb the neighborhood. When talking to the workers I would be surprised to learn that they had not stopped all day, not even for a meal. They would have worked through the night, too. This was dirty, backbreaking physical work, not the kind that the inventors of the concept of "flow" had in mind, but indeed they clearly had lost track of time.

I think gamblers feel the same thing, and this is not quite "flow" either. Pulling the arm of a slot machine they clearly sometimes feel, "just one more pull and I will stop."

-- J

Sunday, November 18, 2007

Notes on "Divorce Italian Style"

This 1961 film is a comedy of manners for an honor-based society. Marcello Mastroianni as a bored Sicilian baron wants to divorce his wife and marry his cousin, but, cannot, so he arranges for his wife to have an affair, upon which the rules of honor requires him to kill her. Thus, a black comedy. Mastroianni plays his character as utterly amoral, like the hero of The Stranger.

- J

Saturday, November 17, 2007

On being the Under Gardener


In our garden I am the under gardener. Kris found this term used in a now defunct gardening blog, Knit A Garden (thank you way back machine!) It gave us laugh in self recognition. It has always been my role. We never spoke about it. It just came out that way. I prepare beds. K plants them. I rake, hoe, and weed. K waters and harvests. K knows the names and habits of all the species and varieties that dwell in our 1/3rd acre. Anything requiring knowledge, expertise, and creativity is in her purview, anything that gets one's knees dirty is in mine. (This is not completely fair; K is not afraid of work in the garden, its just the brainwork is her exclusive domain.)

This is not at all a bad deal for me. On a weekend day I love having the sun on my back and dirt under my fingernails. After a week of manipulating symbols on a screen it is nice to be able to do real work and see concrete changes in a patch of ground. I enjoy that my part is simple, brutish, and repetitive.

This is a part of the polity of marriage or at least of our marriage. There has to be a way to make decisions. Everything cannot be done by common consent. Even when things are by common consent, in any given sphere one will have more interest or knowledge and tend to prevail. For us in the garden it is K.

We have visited gardens of friends or seen gardens on garden tours and have seen evidence of other political strategies at work. We have seen several yards where half the garden (usually the front) "belongs to" the wife and the other half the husband. Sometimes there is even a fence dividing them and a sign at the gate between. Sometimes the rule appears to be that the husband operates the machinery and the wife the hand tools. Sometimes the husband does the hardscape and the wife the plant life. Gardening couples that share equally in the decision making are pretty rare, at least in these parts.

- J

(Illustration is "Royal Gardener John Rose and King Charles II" by Hendrick Danckerts and is in the public domain. I found it on wiki commons.)

Tuesday, November 13, 2007

Notes on "Fellini's Roma"

What is memorable about this plotless and apparently structureless movie is the motion and the chaos: an overcrowded flat, a modern (well, 1972) street in a downpour, dinners on the street, both modern and old, whore houses and burlesque halls, hippie gatherings, and bikers riding through antiquities. Too much to take in all at once. It takes place mainly in 1940s Rome and the Rome of the early seventies. The imagery is stunning. Who needs plot? For my wife and I, though, who are planning a trip to Italy and are content with a pretty quiet life, it was all a little scary.

-- J

Addendum: And why is it that almost exclusively in Italian films there is inevitably a coming of age sequence in a whorehouse? Are (or were) whorehouses so much a part of the culture of Italy? Or, was it just part of the language of Italian film like American movies and chase scenes?

Monday, November 12, 2007

California: Land of the Environmental Suckers?

In politics, it is well known that California cares about environmental issues. National candidates who have not mentioned the environment in 49 other states come here and suddenly global warming is all they want to talk about. But, have we become such suckers that politicians feel that this is the only bone they need to throw to the electorate? Are we that gullible?

Dianne Feinstein seems to think so. Last week, literally in the dead of night, she gave her endorsement to our new Attorney General in spite of the fact he refused to disavow well known torture practices. Last week they announced her intention to support retroactive immunity for those who engaged in spying on ordinary Americans. According to polls, these are extremely unpopular positions in California. But, here she is this week, flying out to visit us to make angry speeches about the oil spill. Its called shoring up the base.

Schwarzenegger also seems to exploit the warm fuzzy place the environment has in the heart of Californians. His administration was teetering until he caught on and introduced a number of largely symbolic environmental initiatives. Now he is flying high.

Its alright that California is concerned about the environment but do we have to be such schmucks? A few small nods for the environment should not excuse trouncing with our civil liberties and our nation's good name.

- J

Sunday, November 11, 2007

A Simple Blog Backup Tool

I wanted to backup this blog. I looked briefly on the web. There don't appear to be a lot of good alternatives. The instructions on the Blogger site are complex and very manual. There do not appear to be a lot of open source alternatives.

So, I wrote a quick and dirty bourne shell script. Right now it is pretty rough, but it works. It relies upon a number of standard Unix tools; wget, xsltproc, and tidy. These may not be installed on an out of the box system, but can be downloaded as binaries for either windows (from cygwin) or a mac (from fink) so this script should work from any suitably configured computer. I am running my backups on a Mac. The script relies on the Blogger "Blog Archive" widget being present in the blogs template. This may be a problem for older Blogger blogs.

Below is the script. Copy it to a file, make the file executable, cd to the root of your backup directory and you should have a backup faster than you can say "screen scraping".

- J

#!/bin/sh
# Backs up a Blogger blog.
# Should work in any suitably equipped unix-like environment. Requires the
# following programs:
#
# 1. wget
# 2. tidy
# 3. xsltproc
# 4. xargs
PROGNAME=`basename $0`
DIRNAME=`dirname $0`

function usage() {
echo "usage: $PROGNAME [blogURL]"
exit 1
}

TMPFILE=/tmp/$PROGNAME-tmp-$$.html
XSLFILE=/tmp/$PROGNAME-xslt-$$.html
if [ "$1" = "" ] ; then usage; fi
URL=$1

# create xslfile from here-document
cat > $XSLFILE <<- "END-HERE" <?xml version='1.0'?> <xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="text" version="1.0" encoding="UTF-8" /> <xsl:template match="/" > <xsl:apply-templates select="//html:ul[@class='posts']/html:li/html:a"/> </xsl:template> <xsl:template match="html:a"> <xsl:value-of select="@href"/><xsl:text> </xsl:text> </xsl:template> </xsl:stylesheet> END-HERE # get the index file of the blog # clean it up with tidy in case it has bad xml syntax. Blogger uses xhtml. # write to a temporary file. wget -O - $URL | tidy 2>/dev/null > $TMPFILE

# read from temporary file.
# extract from a list of individual posts.
# get each post and all the files needed to render them locally.
xsltproc $XSLFILE $TMPFILE |
xargs wget -E -H -k -K -p

# remove the temporary files.
rm -f $TMPFILE
rm -f $XSLFILE

Friday, November 9, 2007

Feinstein Redux


Another letter to one who seems to have lately become George Bush's best friend on the Hill.

- J
Dear Senator Feinstein

I read in the paper this morning that you intend to support immunity for phone companies that are facilitating the government spying on ordinary Americans. I urge you to reconsider. In the article you are quoted as saying the phone companies should not be held liable for complying with requests from the government, that those in government should be held liable. But the effect of this immunity bill is that the facts surrounding the cases will be suppressed. This bill will permit the criminals in the Bush administration to get away scott free. There are so far unchallenged allegations that the Bush administration approached the phone companies long before September 11 about installing the equipment that is at issue. The argument that the parties were motivated by the need to respond to al Qaeda is therefore bogus.

Please reconsider your position Senator Feinstein.

(Image: from wiki commons. The Letter Writer by David Roberts)

Wednesday, November 7, 2007

Modern again...

A month later, our dishwasher is fixed. We are no longer heathens. No one here is sure how they will like the cold efficiency of the twenty first century.

- J

Tuesday, November 6, 2007

Dear Senator Feinstein ...

I sent the following mail to Senator Feinstein today. She was effectively the swing vote permitting the nomination of Mr Mukasey to go forward. I know such letters will have no impact on a Senator that doesn't have to think about her electorate for five more years, but it helped calm me down a little.

- J

Dear Senator Feinstein,

I know you will say that your vote on the Mukasey nomination does not mean you endorse the use of torture. I think you believe your vote was practical and pragmatic; making the best of a bad situation. If not Mukasey, Bush could send up somebody worse.

I think you are wrong. The citizens of California, the citizens of this country, and the citizens of the world are waiting for our government to stand up and begin to restore some of the ideals that we once stood for. Our president says we do not torture but has not disavowed memos that define torture so narrowly as to be meaningless. A number of your fellow Judiciary Committee members stood together to make a clear statement about torture, to draw a line. You would not stand with them. You stood with the president. You stood for torture.

- J

Of the Moon and My IPod

I read somewhere, I don't know where, about why a full moon appears so large on the horizon but shrinks as it climbs the sky. It is not from some refraction effect of the thicker atmosphere. It is simply because near the earth we have points of reference and the moon is large in comparison. High in the sky our only reference is the expanse of sky and the moon appears small. You can demonstrate this to yourself. When the moon is at the horizon, hold out your thumb next to it at arms length. Note how it compares to your thumbnail. Do the same thing when the moon is high. You will find they match.

I bring this up to talk about IPods. People say that IPods or other mp3 players will harm one's hearing. My personal experience tells me the opposite. Ear buds do not shut out or muffle the sound around you like earphones do. As I have walked around town listening to my IPod at a relatively constant volume a surprising number sounds drown out the sound from the IPod. Leaf blowers are loud of course, but they overwhelm my music at a hundred yards. Ordinary traffic noise is much louder than I would have thought and usually overwhelms my IPod.

An IPod is to the hemisphere of sound as a thumb at arms length is to the sky. It is a crude but good enough reference point. We don't ordinarily have reference points for sound. Nowadays, even if my tunes are at home I am much more aware of sources of loud volumes and will go out of my way to avoid them. My IPod may thus save what is left of my hearing.

- J

Monday, November 5, 2007

Notes on "Argonautika"



Someone needs to remind the good people at the Berkeley Repertory Theater that people go to see live theater to see live actors act. Spectacle can be had for under $10 a seat at the local multiplex.

This was a new play about the myth of Jason and the Argonauts adapted from older texts. They journey from Greece into areas of central Asia that are much in the news today.

Argonautika was yet another joint production with other regional theaters. Joint productions allow a company to invest more in the production. Mainly the investment appears to be in the sets and effects. The set, in this case was quite beautiful with simple clean lines. The effects were imaginative and fun to watch. But clearly, human actors acting was an afterthought. The people were props, thrown across the stage whenever the director conjured up a storm. Jason had the wooden delivery of Keanu Reaves or Kevin Costner. The Argonauts, a Greek myth super-group, are mostly barely distinguishable from one another. Perhaps this is intentional -- men are just playthings of the gods or some such, but is made for theater that felt a little Stalinesque.

Almost thirty years ago, K and I saw our first Berkeley Rep production in a storefront in the Elmwood district, an Edward Albee play, I think. The props were a couple of chairs, a table, and a lamp, not much more. I think the program offered them for sale after the show concluded. The actors were local. It was the actors that created the world that they and we inhabited for an evening.

- J

Saturday, November 3, 2007

Burn-out advice

I came across this article on dealing with job burn-out from a referral on Lifehacker. Its best advice was to make a list of things you like about your job and try to arrange to do more of that.

It got me thinking about workplace advice from literature:
  • King Lear, Shakespeare: It's not really a good idea to delegate your major responsibility to others and try to keep the perks. A worse yet idea to delegate to sycophants. It puts the world out of balance.
  • The Tempest, Shakespeare: Sometimes getting fired from your job can have its benefits. It can give you the opportunity to perfect your skills. Once that is done, you may find yourself running the place again. Also, do not neglect to cultivate friends in high and low places.
  • Old Man and the Sea, Hemingway: If you accomplish a big thing. Look out for sharks.
  • Bartleby the Scrivener, Melville: Even if you are burned out, it's possible to hang on for quite some time.
  • A Tuft of Flowers, Frost: Mainly it is people that give work meaning.
- J

Notes on "Mean Girls"

I am not sure exactly why we rented the Mean Girls DVD. It is another movie for another, younger demographic.

This is essentially a remake of the Michael Lehmann film, Heathers about the cruelty of the popular girl's clique at high school and what happens to a new girl who comes into their orbit. Heathers had some pretty biting and outrageous humor. This film is considerably toned down, but, frankly better written (Tina Fey of SNL), and funnier.

- J

James Fallows on Chinese Manufacturing

I heard a recent Fresh Air interview with James Fallows about his article in Atlantic Monthly on the Chinese manufacturing explosion. Most of the factories are small and family run. Most owners are from Taiwan. They compete mainly on being agile and cutting costs relentlessly. Most of the work is manual. They employ unskilled youth from the countryside who work for a few years for $100 a month. They then go home where they can live on $100 a year. They are family run because corruption is so endemic and the regulatory system so fragile that owners cannot trust anyone but family members. This keeps the companies from getting bigger.

Years ago Paul Hawken wrote a book, I think, The Next Economy, predicting an era in which small enterprises will drive the economy. Turns out he was right. Just got the country wrong.

- J