The Arabian Nights

slaniel | Uncategorized | Tuesday, May 9th, 2006

I finished The Arabian Nights earlier tonight. Despite promises of 1,001 such nights, there were but 271 in the translation I read. I am talking with my lawyer about a possible class-action lawsuit on behalf of misled readers.

It is my ignorance in the face of books like this that reminds me how little of the canon I’ve read. I’ve only read a small bit of Shakespeare, and only read The Iliad in 2002 or so; I’ve still not gotten to The Odyssey, even though I’ve owned a beautiful hardcover edition of the Fagles translation since shortly after I visited Adam Rosi-Kessel at Princeton and sat in on Fagles’s translation class. So I’ve probably had the damn thing for 12 or 13 years; I should read it already.

Anyway, somehow I didn’t really know the story of The Arabian Nights until recently — at least not with enough clarity that someone could have pointed a gun at me and asked me what it was about, and I could have answered confidently. The premise is quite simple: a king (Shahrayar) discovers that his wife is cheating on him, develops a deep hatred of women, and decides to marry a new woman from his kingdom every night — then kill her in the morning. Eventually a brilliant woman from the kingdom (Scheherazade, or Shahrazad in this translation) decides that she can save the rest of the women by using her wits against the king. She’ll tell him a story so captivating that he will refuse to kill her until he hears the end of it. She proceeds to tell him stories, and every night he agrees to keep her alive for one more night. Eventually, goes the tradition, she bears him three children, he forgives women because of Shahrazad’s greatness, and they live happily ever after.

Pretty bloody cool premise, I’d say. In the hands of postmodern authors, this would be turned into a lecture on the craft of storytelling generally, and there may be good reason to do that. Indeed, throughout the first 100 pages or so of The Arabian Nights, I thought I was reading Calvino’s If on a winter’s night a traveler, which is not only a sequence of brilliant and agonizingly unfinished stories, but also a celebration of the act of reading. The stories in winter’s night fold in on themselves, blend together, peek out into the real world, and eventually reveal their hand to the reader in a particularly wonderful sendoff.

The Arabian Nights is rather less interesting. I can’t really fault it for lacking the structure of a postmodern novel (even though the stories do nest, and quite often they don’t unwind the stack). I just didn’t find it especially interesting once I got past the novelty of the premise and the structure. It’s a long sequence of identical stories about beautiful men, kings, and sometimes long sequences of misunderstandings and sorcery that eventually lead to someone getting a girl back. In schematic form, that’s the recipe for maybe 80% of Western literature, so I shouldn’t complain. It’s just that the actual contents of these stories don’t vary much. In every story there is a beautiful girl from whose beauty “even the deers learn”. There is a beautiful boy who’s “more graceful than a bough.” He also has a perfect little disc of ambergris on his face somewhere. There’s always a king and a vizier. There’s normally some kind of travel between Egypt, Baghdad, and Basra. And so on. It gets tiring. I’m much more excited about Conversations with Neil’s Brain, which is my next book and which I’ve already started.

To make any of the works in the canon interesting, I think I have no choice but to read commentaries on them. Maybe Harold Bloom is a good guy to consult on such things; he seems to have spent much time telling Americans what they should read, why they should read those works, and what relevance they have to people in their daily lives. Reading these works on their own, I miss everything about what made them great to the people who read them at the time. Really what I need is some way to put myself back in the shoes of the people who heard The Arabian Nights. If anyone can suggest good works in that direction, I’m all ears.

Anonymous voting with dollars

slaniel | Uncategorized | Tuesday, May 9th, 2006

Very interesting suggestion: rather than force political donations to be public, force them to be anonymous. That way political candidates wouldn’t know whom to bestow their favors on. Read the linked FT piece in there; it’s pretty interesting. It appears to be more fully developed in Voting With Dollars.

Higher-order Perl

slaniel | Uncategorized | Sunday, May 7th, 2006

 . . . looks really interesting. And it will be freely available in a Wiki at some point. Neat.

P.S. (17 May 2006): I now own this. It is extraordinarily good.

Phoenix

slaniel | Uncategorized | Sunday, May 7th, 2006

I saw Phoenix tonight at the 9:30 Club. They rule. The venue rules. And it’s within walking distance of my house, along with most everything else in northwest (though it’s maybe an hour to Georgetown).

The Phoenix guys really love being rockstars; that was the first thing I noticed about them. They played a high-volume, high-intensity set that hardly lost any momentum for a moment throughout the entire show, save a couple out-of-place (but still quite good) acoustic songs during the encore. I had never heard a note of their music before tonight, but I’m glad I got to see them for a measly $15.

Incidentally, companies and bands and even people have got to learn to name themselves in a googleable way. “Phoenix” is not Google-friendly. “Cat-Tonsil Avalanche” is. Likewise, if you have a common proper name, how can you expect anyone to Google-stalk you? You can’t. Pick a name that no one else has, like “Sassy McPlunderPants”. Then get yourself a website. That way we won’t have to go through the additional effort of stalking you through Friendster.

These are the rules of the digital millennium.

Why I miss Boston

slaniel | Uncategorized | Sunday, May 7th, 2006

I miss Boston because the city provided a police escort to get the only man who can catch Tim Wakefield’s knuckleballs, namely Doug Mirabelli, from Logan to a game last week on time. 25 minutes from Logan to first pitch. You have to love a city that would do that.

I miss you, Boston. I’ll be back soon.

Closures

slaniel | Uncategorized | Sunday, May 7th, 2006

Riffing off a proof-of-concept program to generate π, I started writing code this morning to do so in a way that doesn’t suck. More specifically, it generates better and better approximations to π, using one of the rapidly-converging series to approximate it. Some of these use factorials, which grow large rapidly and suck up lots of memory. So I started writing some dorky code that saves off progressively larger factorials to a table on disk, and extracts from or adds to the table one at a time to save memory.

But on the walk to Dupont this afternoon, I realized that this is a textbook case of why people use closures. I have almost no experience with them, but one can use them to construct potentially infinite lists — such as the list of factorials. The closure knows how to tell us what the next value in the sequence is, and it generates items one at a time. (In this way closures can be used to construct efficient iterators.) It keeps some state around, so that it doesn’t need to recompute all the smaller n!’s before it computes the next one.

I’m rather mystified by closures at this point, but I cribbed quite liberally from a Perl lazy-evaluation page and came up with something that seems to do just what I want. I’m sure there’s a more elegant way to do it, though perhaps not in Perl; I’m not sure. I do think it’s a little gross that one needs to know that evaluating $code returns a result and a pointer to a new $code in order to use it. This doesn’t seem very object-oriented. But I’m sure there’s a nice way around it; I’m just not comfortable with manipulating these things yet.

So that seems like it should help a lot in coding up some of these approximations. In concert with Perl’s BigInt library (and possibly BigFloat), I should be able to get arbitrarily precise approximations to π without using very much memory at all; I was generating very large factorials while using hardly any. I find this very cool.

P.S.: Hmm. Generating the sequence {n!}n=0 would help me if my series used n! in every iteration — for instance, if I were approximating e = 1/1! + 1/2! + 1/3! + ···. If I need anything like (2n)!, though, this won’t help. Hmm indeed.

P.P.S. (8 May 2006): The author of Higher-Order Perl uses memoization to do all my caching crappity-crap in a generic, clever, high-order way.

Last night and today

slaniel | Uncategorized | Sunday, May 7th, 2006

I’ve had a pretty great last 24 hours. Some friends and I went to Zaytinya for dinner last night — a very tasty, very trendy Lebanese/Greek tapas restaurant in the weirdly-zoned-but-somehow-up-and-coming area near Chinatown. Then we went to Thank You For Smoking, which is just a great movie. A few notes are in order about the movie.

It may be lefthanded praise, but Thank You For Smoking is a great movie because it avoids most of the seemingly inevitable clichés in American movies. When there’s a bad guy, he’s for one thing normally not a sympathetic character — or maybe he’s sympathetic in a way that you feel slightly naughty for supporting. He’s also quite often a straw man; there’s little reason why anyone would ever support him, and no one ever bothers to explain why he does what he does. (The intensely realistic bad guy in the original version of The Vanishing is a notable counterexample, but then it’s Dutch.) And there always has to be a moment at the end where he’s either defeated, or he decides to choose the Path of Righteousness — even if doing so is completely at odds with his character.

So what’s great about Thank You For Smoking, to put it concisely, is that the lead actor almost never breaks character. There are a few places where the script threatens to cave in to its main conceit, but mostly they stick to a satire of the real world. And it’s quite refreshing. The protagonist is a sophist — an exceedingly good one, who really makes you think about the structure of most arguments in modern life. (“It’s not an argument, it’s a negotiation” is one line that recurs throughout the film.)

And at 90 minutes, it says what it needs to say and leaves. This movie is definitely a keeper.

The only gripe I might make is that the character of the senator from Vermont is a bit of a straw man. Played by William H. Macy, he’s ineffectual like most Macy characters. He could be stronger while still allowing the protagonist to win all the arguments.

Anyway, so that’s Thank You For Smoking. Today’s adventure, after the habitual Murky Coffee run this morning, was a walk from Teaism in Dupont to Georgetown with a friend of my friend Britta’s. From Georgetown we tried to find the footbridge over the Potomac to Teddy Roosevelt Island, but ran into a dead end somewhere around the Key Bridge: the walk along the river just suddenly dead-ends at a parking lot. D.C. needs to make the shore of the Potomac as nice as the Charles River Esplanade is. We were hungry by then anyway, so we stopped in at Pizzeria Paradiso, then walked back to Dupont Circle so that she could take the train to Bethesda. All the while the weather was absolutely extraordinary — as beautiful as one could hope for.

Life is good.

The NLECs at Gitmo

slaniel | Uncategorized | Sunday, May 7th, 2006

David Luban has a great but — as is common these days — heartbreaking post about what’s happened to many of the Gitmo detainees. 30% of them have been cleared for release because they are “NLECs” — “No Longer Enemy Combatants.” The government realizes it made a mistake with them, and there’s no reason not to return them home. But many of them would be tortured if they were returned home, and as a matter of policy the U.S. government won’t extradite people if they may be tortured in the destination country. Those whose eyes have been open for the past couple years will note how odd this is: the U.S. government has had no problem capturing people “on the battlefield” in Afghanistan or Iraq and then sending them off to their dooms. (Note that I put “on the battlefield” in quotes. That’s because — as This American Life reports and as a Seton Hall Law School report confirms — at least 58% of the detainees have nothing to do with al Qaeda, and probably as many as 92% do not.)

So there’s a bizarre, horrifying, and deeply saddening inconsistency, a circle that the U.S. government has chosen to square in an obviously wretched way:

It appears the Administration’s view is that Article 3 applies only to cases in which a person is sent from the United States to another country, and that the treaty obligation does not apply to cases in which a detainee is transferred from one location outside the U.S. (e.g., Guantanamo) to another nation. This argument is made in an article written by John Yoo shortly after he left the Department of Justice (see 79 Notre Dame L. Rev. at 1229-1232), and is strongly suggested in Alberto Gonzales’s written answer to Question No. 11 of Senator Kennedy’s supplemental questions during the (now) Attorney General’s confirmation proceedings.

So we ostensibly have no problem returning people from Gitmo to be tortured, because Gitmo is outside the U.S. So we’re really only avoiding sending them back to avoid the bad P.R.

Read as many of the Balkin blog’s posts on this subject as you can. They’re immensely important reading, and very very sad.

“Muslim”

slaniel | Uncategorized | Saturday, May 6th, 2006

The Wikipedia entry on the word “Muslim” — which, not terribly surprisingly, is the first google result when searching for that word — is awfully fascinating. It’s a 2-minute read with a lot of interesting notes on the word.

Incompressible numbers

slaniel | Uncategorized | Friday, May 5th, 2006

In information theory, there’s a quantity called the Kolmogorov complexity of a number, which is the length of the smallest computer program necessary to generate that number. So for instance, π can be generated with this program:

#!/usr/bin/perl use strict; use warnings; print generatePi(); sub generatePi { my $pi = 0; for( my $i = 0; 1; $i++ ) { $pi += 4 * ( (-1)**($i) / (1 + 2$i) ); } return $pi; } 

That’s not the smallest possible program to generate it — I could get rid of the ‘use’ lines at the top, for instance — but it’s pretty short. And it’s certainly shorter than writing out all the digits of π itself. π, in this sense, is “compressible”: one can come up with a representation of π that is shorter than π itself.

It’s easy to see that some large number of functions of π will then also be compressible — e.g., π2 or 1/π or π2 + 1/π will have short computer-program representations. Even something very complicated like π + π2 + π3 + · · ·  has a short computer-program representation. Using the same function as above, we could do

my $sumofpis = powerSeriesOfPis(); sub powerSeriesOfPis { my $pi = generatePi(); my $sumofpis = 0; for(my $n = 0; 1; $n++) { $sumofpis += ($pi*$n); } return $sumofpis; } 

(Note that these programs take literally the rest of time to run. But they are short!)

Now, there presumably are incompressible numbers, in the sense that the shortest computer programs that can generate these numbers are as long as the numbers themselves. My question is: do we know anything about the set of all incompressible numbers? What is their measure within the space of reals? I.e., if we “chose a real number at random,” what is the probability that we would select an incompressible number?

P.S.: The Chaitin Incompleteness Theorem is fascinating. It’s something like a probabilistic version of the Gödel Incompleteness Theorem, assuming you can demonstrate that incompressible strings are very common. If you can demonstrate how common, then you can start getting bounds on what percentage of true statements are not provable within a given system. At least that’s my quick take on it.

Web dev versus just dev

slaniel | Uncategorized | Friday, May 5th, 2006

I was thinking about it last night on the way home from work: what makes web development any different from ordinary software development? If someone’s a really good web developer who, for instance, really knows all about data-model design, object-oriented development, GUI design, and building apps according to the MVC pattern, is there anything that he’ll miss that he would have gotten had he worked on an ordinary desktop app?

(I of course ignore things like low-level hardware coding. And when you’re developing web apps, my sense is that most of the languages used for the purpose don’t give you any fine-grained control over how memory is allocated or deallocated.)

Avoiding global variables in Perl

slaniel | Uncategorized | Tuesday, May 2nd, 2006

I’ve got a Perl script where there’s a data structure that really only gets used by one function. The function never changes the data structure — just uses it. The function gets called many times. Because the data structure will need to be used many times, I’ve pulled it outside of any function body; that way it won’t get created and destroyed every time we enter and exit the function.

But I have an aversion to global variables, and I want to put them closer to the place where they’re used — namely inside that function. If the compiler is smart, it will see that the function never changes the data structure, and will somehow tag the structure so that it stays alive between function invocations. That way we’d get the benefits of globals and none of the disadvantages.

So: does anyone know whether Perl’s compiler is that smart?

Finished The Wealth of Networks

Just a quick note about The Wealth of Networks. First, I should note that it is terribly edited. Given that Benkler thanked his editor for his Herculean work at the beginning of the book, I can only imagine the state it started in; as it is, it ended with glaring grammatical errors, including using “effect” when he meant “affect” and “wave” when he meant “waive”. (I’ll provide specific examples sometime tomorrow.) Editing, apparently, is a craft that is only noticed in its absence. I didn’t realize this until I read The Wealth of Networks. By the time I was done with the book, I was copyediting every page.

None of this mentions the stylistic errors, which are rife. Benkler uses the first-person singular pronoun once, or possibly twice, in the whole book; its use is jarring. The rest is passively voiced and all the words are sesquipedalian. Nothing’s wrong with inconsistency in style, when deployed artfully, but it feels more like an oversight here than a deliberate plan.

Those of you who’ve read the book will perhaps object to all this cavilling over style. Again, it’s only noticeable because it’s so bad; normally I would almost ignore the style and get to the meat of the argument. It was hard to do so here.

Benkler’s argument is quite systematic and nearly has the force of pure logic. His claim — propounded over a decade’s worth of papers and synthesized in this book — is that the new economics of the Internet fundamentally change deep parts of our culture. Cheap communication allows projects like Linux and the Wikipedia to emerge and more to the point work very well. Each of us can invest trivial amounts of our time and money, yet the end result is something much greater than any of us could have expected. Person A links to person B on his website, and lots of person A’s follow along with their own person B’s. Pretty soon there’s enough information — from our trivial little links alone — that Google can come through and aggregate that information into a profoundly useful information-retrieval tool. Millions of people click on star ratings on Amazon, and pretty soon we can all get highly accurate suggestions about books we might like. I copyedit the Wikipedia, and so do hundreds of thousands of others; before long, the Wikipedia competes with Britannica.

Benkler’s task is to take his understanding of what makes all this stuff tick, and think through the consequences. What does it mean for democracy when people can communicate cheaply? We’re starting to get a taste of the answer with blogs. The media available for political discourse before the Net came around — like television — were passive. Someone else produced a lot of content at great cost, and pushed it out to a lot of stupid devices that couldn’t really do anything interesting; televisions are “dumb terminals” for video. Now we can all be publishers for no cost, and the devices are smart enough that we can talk back and start conversations. Yes, we’re still getting much of our news from old-media stalwarts like the New York Times, but the medium allows us to blog about it, post comments to others’ blogs, and search around and see what others have said about it. All of this is possible because the publishing tools are getting easier, because communication is cheap, and because computers are increasingly available to everyone. We now have media that permit and encourage conversation; the old broadcast media never did.

In a world where communication is no longer passive, and where you don’t need a multimillion-dollar television studio to get your ideas out to the world, democracy changes radically. For one thing, the fringes suddenly have a voice that they didn’t have before. It’s obvious, just from thinking for a moment about how mass media work, that they serve inoffensive pabulum to the least common denominator. If you can choose to broadcast a show that might offend people or upset them (say, displaying images from Abu Ghraib), or else broadcast the latest news about Brad and Jen, you will choose the latter in a heartbeat. The point in mass media is not to publish the widest array of views, but to maximize revenue. Maximizing revenue means appealing to the broadest mass of people, which in turn means being as inoffensive as possible.

It’s not difficult to see that mass-market media incentives are quite different than the incentives that a democracy should strive for. Commercial interests are not our interests, orthodox capitalist training to the contrary. So what happens when media become non-commercial, like blogs? Suddenly you have millions of people who can get their ideas out to the world, and lots of things happen. For instance, it becomes clear to people that there’s more than just the Republican Party and the Democratic Party — or even Republicans, Democrats, Greens and Libertarians. The whole tone of the culture changes. Biting commentary gets airtime. We become active. We argue, like people in a democracy are supposed to.

All of this is not pie-in-the-sky idealism. As Benkler makes very clear, it’s kind of inevitable. The axiom is basically this: people will do more of what’s easy for them, and less of what’s difficult. With the cost of communications technology now negligible, lots of things become easy.

The objection that not everyone is a blogger is irrelevant. It may in fact be true that the majority of Americans are passive dullards. Even if it is, the fact remains that there is a new set of technologies that let many of us do things that we couldn’t have done before, and it would take willful blindness to believe that this leaves democracy unchanged.

Benkler builds out the argument in considerably more detail and considerably more verbosity. He wants you to understand what is likely to come out of all of this, what the challenges are, and where the promise may lead us. It’s a tremendous synthesis.

Alas, it will take people like Larry Lessig to make Americans understand this promise; Benkler has confined himself to academia. As I may have mentioned, I’ve heard a lot of trashing on Lessig recently — that he’s a shallow thinker who wasn’t even a good enough lawyer to win Eldred. I’ve heard Benkler’s book described as a landmark that people will be discussing in 20 years. Allow me to disagree. I think Code is a much more important work, both for the ground it cleared and for its rhetorical power. I think Lessig’s later book Free Culture could actually get people storming the gates of Disney, whereas Benkler will never.

More to the point, Benkler’s work seems like much more of a look back than a plan for forward motion. If you already use Linux and have internalized its lessons, you hardly need the theory that Benkler gives you. If you have really thought about the Wikipedia, then you can skip over that chunk of his book. A copy of Code and a thorough understanding of the GPL will probably give you 90% of what The Wealth of Networks does.

In twenty years, The Wealth of Networks will stand as a very nice description of the world as it stood in 2006. Code will mark the beginning of a movement. As someone who is ensconced in that movement, I believe that everyone should have a copy of The Wealth of Networks on his shelf and a copy of Code in his pocket.

« Previous Page