Saturday, October 11, 2008

Neil Gaiman at the National Book Festival

Neil Gaiman at the National Book Festival

A couple of weeks ago we went to the National Book Festival (the best thing the Bush Administration ever started) to listen to Neil Gaiman and to stand in line for three hours, getting alternately soaked and sunburned, waiting for him to sign The Graveyard Book and Neverwhere. It was worth the wait, Gaiman was extremely nice to us.

My wife says this is a really good picture, so I thought I'd share it.

Monday, February 18, 2008

The Bookshelf

Happy Washington's Birthday, everyone.

Every once in a while (OK, once before) I like to give mini-reviews of the books sitting beside my bed. This time it's all science fiction:

  • Radio Freefall, by Matthew Jarpe: A first novel. It's got sex (a bit). Drugs (a bit more). Rock and Roll (lots). It's also somewhat cyberpunky, since everyone and everything is connected to the web. And, finally, it pays tribute to Heinlein, what with a moon colony that's revolting.

    Despite all that, the novel most reminds me of George R. R. Martin's The Armageddon Rag, what with a mysterious old rocker called Aqualung raising and obscure band to world-wide fame, with potential world-wide catastrophe looming.

    As a first novel it's not bad, though it does require the Evil Villain to be Phenomenally Stupid at just the right moment. Worth looking at, and looking for the next Jarpe novel.

  • Rainbows End by Vernor Vinge. You think of Vinge as a hard SF writer, but he does often does something that resembles cyberpunk. This one takes place around 2030, and it's pretty much believable that we'll be as connected as he says here. It's also pretty much believable that the geezers at that time (meaning us) will be pretty much out of it. Great plotting. A little confusing at the end, and I never did figure out who Rabbit was. But worthy of the Hugo it won.

  • Jonathan Strange & Mr. Norrell by Susanna Clarke. Another first novel, and another Hugo winner. Set in the Napoleonic era, it's the story of the magician Mr. Norrell and his partner/apprentice/rival Jonathan Strange. It's definitely not cyberpunk. To me it reads like Vanity Fair, but it's probably technically Georgian, it's just that I'm lot more familiar with the Victorian era. The paperback copy is over 1,000 pages long, and I'm only half finished, but it's worth looking at.

  • Cyril Kornbluth is probably best known for the short story The Marching Morons and his collaborations with Frederik Pohl. His Share of Glory has all of the short fiction written solely by Kornbluth, either under his own name or a pseudonym.

    I want to like this book. I really do. But the stories are dated, sexist, racist (see The Education of Tigress McCardle, which manages to be both), and just not fun. It would have been nice to see if Kornbluth could have grown in the 1960s, as Asimov, Pohl, Anderson and Heinlein at least tried to do (though they started from a far higher level), or if his output would have just slowly wound down into total hackdom. Unfortunately he died young, so we'll never find out. Recommended only if you really like 40s and 50s SF, and then you'll want to take it in small doses.

Thursday, January 31, 2008

doc2pdf

We all know that there are lots and lots of reasons to use the command line. But sometimes, believe it or not, there's a GUI program that does something that's not available as a command line utility.

Yet you want a command line utility, because you've got to do this thing 20-30 times, and sitting there clicking with the mouse is just boring.

So what'dya do? You hack the GUI program to do what you want it to do from the command line.

Let's back up a bit: Baen Books, the SF publishing house, has a long history of giving away its books. There's the online Baen Free Library, and every once in a while they'll put a CD full of old titles in the back of a book. You can copy this, give it to friends, use the copies for Frisbees at a warez convention, whatever, just so long as you don't sell them. The disks have several recent books, and, though I'll never claim that Baen's writers are in the class of Lois McMaster Bujold (well, she does have one book in the library) or Terry Pratchett, there's a satisfying bunch of science fiction and fantasy mind-candy that can be downloaded onto a computer and read on the plane or in one of those cheap hotel rooms that physicists crash in when we're at a meeting.

Baen puts the books out in all sorts of formats: HTML, DOC, RTF, Palm, Kindle, etc.

Everything except PDF.

Why, I don't know. PDF is compact, can be read on every computer of every kind, leaves the text exactly the way you want it. It just makes sense to distribute electronic books that include images in PDF format.* Yet Baen doesn't.

So last week I got hold of the disk in the back of Eric Flint and David Weber's% 1634-The Baltic War (the online version is only the first few chapters, alas). The disk has maybe 30 novels, some of which I actually want to read, some of which I'll read in a pinch, and all of them in the aforementioned everything-except-pdf formats.

The question before the house is how to convert all this mind-numbing SF into PDF files. The obvious way is to take the Word (.doc) or RTF version of the file, load it into OpenOffice.org, and hit the Export PDF button. A GUI solution, no doubt.

Given that it takes a few minutes to convert each novel, that's a really boring task. So let's look around for a command line solution. A look at the web shows that there aren't too many — make that there aren't any, in the sense that there is no open source, standalone, Linux command line program which takes a Word file and converts it into PDF.

There is, however, a way to do it. OpenOffice.org has a powerful Macro/scripting program included, and ways to call the scripts from the command line. All you need is the script.

Hey, don't look at me. I borrow, mostly, and point you to where I've done the borrowing. In this case, it's Convert MS/Word to PDF, posted by Graham Williams. He gives complete instructions for setting up the Macros and writing a short shell program to call them.

The only caveat is to heed Williams when he tells you that doc2pdf calls OpenOffice.org and then quits: it takes 5-10 minutes to convert one of Baen's novels to PDF, so if you want to do a batch job you need to put a long sleep time between calls of the shell command. Best to start the thing off at night and check it in the morning — just what you want a batch job to do, anyway.

So add one more command line tool into your kit, and good reading.

* It makes sense to distribute text without pictures as an ASCII file, but Baen doesn't do that, either. Well, I wasn't expecting the Moon, you know.

% I'm not a big fan of Weber's style of writing. Here's why. For some reason I keep going back to check the books out of the library, though. If I found myself paying for them I'd be really upset with me.

The RTF and DOC files are bitwise identical. This says something about someone. I'm not sure what, or who, though.

Monday, January 21, 2008

Ranking Science Fiction Characters

A colleague recently introduced me to Google Fight, which let's you stage bouts between your favorite web celebrities based on the number of hits Google gives them.

Well, sort of. For example, if you take the two predominate figures of the longest-running science fiction franchises on US television, Google Fight gives you:

James T Kirk: 296,000 results
Jack O'Neill:      24 results

which is obviously screwy. Going to Google its own self gives you:

James T Kirk: 389,000 results
Jack O'Neill: 573,000 results

which is in some ways even screwier: is the Star Trek franchise so dead that its leading hero gets beat out by MacGyver? (4,870,000 hits, though “Angus MacGyver” gets 29,400)

Anyway, this led me to the task of ranking leading science fiction characters by real Google hits, not Google fight hits. Below are my results, feel free to add to them. The rules are:

  1. The Google search string must include the common name of the character, along with a name that distinguishes the work in which the character appears. Thus we'll search for “James Kirk Star Trek“ to distinguish Tiberius from the actor of that name.
  2. There are no quotation marks in the search string.
  3. Yes, I did search Harry Potter Harry Potter
  4. The rank will be the number that appears after the string “Results 1-10 of” on Google, i.e., we'll use the first count Google gives us.
  5. If you don't recognize the characters here, don't whine about it, just Google them. The choice of characters says more about me than you anyway.
  6. Don't give me any grief about using “Benjamin Sisko” rather than “Ben Sisko” either.
  7. If you don't like my definition of Science Fiction, well, frak.
  8. No, I don't know why the Kirk searches above and below disagree so strongly. Ask Google.

And the results:

Character Work Hits Comments
Harry Potter Harry Potter 10,400,000 You expected different?
Luke Skywalker Star Wars 2,870,000 The Force is strong in this one.
Han Solo Star Wars 2,370,000 Not bad here, either.
Hermione Granger Harry Potter 2,150,000 Even Ron likes Harry better than you, Hermione
Albus Dumbledore Harry Potter 1,260,000 Wonder how many hits are from this fall?
James Kirk Star Trek 916,000 The Captain Supreme
Death Discworld 792,000 HOW INTERESTING
Gil Hamilton Known Space 769,000 A very long arm
Lazarus Long Future History 730,000 Still read Heinlein, I see
Teal'c Stargate 539,000 Kree!
Spock Star Trek 452,000 That I am behind a gold-tattooed alien is not logical.
Daniel Jackson Stargate 368,000 Needs to Ascend again
Lucas Garner Known Space 337,000 Old codgers do all right here
Neo Matrix 335,000 Young twerps, too.
Jean Luc Picard Star Trek 280,000 Was ahead of Teal'c until the latter stopped shaving is head.
Jack O'Neill Stargate 257,000 It's a lot worse with only one L.
Trinity Matrix 257,000 Apparently chicks in leather don't do as well as you'd think
Kathryn Janeway Star Trek 238,000 Well, better than this, thank God.
R2D2 Star Wars 209,000 The highest-rated robot
Samantha Carter Stargate 168,000 Should have done nude scenes when they were on Showtime
Adama Battlestar Galactica 149,000 About half-and-half.
Benjamin Sisko Star Trek 132,000 Deep in your heart, you know he was the best Captain
Miles Vokosigan Vokosigan 103,000 Short smart punks apparently don't score as well as tall dumb Colonels.
Rincewind Discworld 67,700 Wizzards are soon forgotten, especially if they don't get any new book deals.
Samuel Vimes Discworld 39,900 Cops, too.
The Luggage Discworld 37,100 But it does iron your shirts.
Granny Weatherwax Discworld 33,800 Apparently being Good and Right doesn't make you popular, either.
Corwin Amber 37,800 Obviously in the wrong shadow.
Hari Seldon Foundation 35,400 Don't worry, his name is all over this one Encyclopedia.
Fafhrd Lankhmar 15,000 I guess swords aren't all that popular these days.
John Falkenberg Falkenberg's Legion 10,100 Johnny Christian, we hardly knew ye.
Dominic Flandry Flandry 9,580 Maybe I'm showing my age.
John Grimes Rim Worlds 9,200 You think?
Gray Mouser Lankhmar 8,960 Undoubtedly.
Louis Wu Ringworld 6,130 Boosterspice, Louis baby, Boosterspice
Kimball Kinnison Lensmen 1,020 Mentor might not like this.
R. Daniel Olivaw Robot 1,010 Robots of Doom, indeed.
Nessus Ringworld 548 Two brainless heads are apparently not better than one.
Tela Brown Ringworld 73 Heading this list must be unlucky.

And, as I said before, add your contributions below.

Wednesday, July 04, 2007

A Treatise On the Number of Wizards

In preparation for the biggest first-edition press run in the history of the world, I'm rereading all of the first six Harry Potter books. While doing that, I came up with a question that's not answered adequately in the books: Just how many wizards are there?

While we can't get an exact answer, we do have enough information to allow a Fermi estimate of the answer. (Named after Enrico Fermi, a Fermi estimate attempts to get to within an order of magnitude of the correct answer to a problem based on a limited amount of information and reasonable estimates of the rest.)

The crucial fact we know is that Harry Potter's boys' dormitory room in Gryffindor has five beds. Assuming that the girls' dorm has the same number of beds, and each of the four houses has the same number of students, we see that Hogwarts admits forty students a year. We know of three schools of wizardry in the world, so that means that there are 120 wizards of a given age, all throughout the world. Hogwarts itself would have something less than 40×7 = 280 students, since many students leave before the end of the seventh year.

Of course, not every wizard is admitted to a school. We know of some wizard family members, such as Fitch, who have extremely limited powers. Presumably they aren't generally admitted into schools — though the admission of Neville Longbottom must mean that the schools are willing to scrape near the bottom of the barrel, at least for legacies. Then, too, an unknown number of Muggles are admitted to the school.

Let's assume, for the sake of argument, that the schools admit ten percent of all who could conceivably be called wizards. This is probably too low a figure, so our final number will be on the high side. Since the schools admit 120 students a year, there are approximately 1200 wizards of a given age, in the teen years, at least.

We then assume that a typical wizard lives for about 100 years — if they don't live longer than us, then they aren't really trying, after all. And we know that Dumbledore has been a teacher at Hogwarts for at least fifty years, so he's at least seventy, and showed no sign of slowing down until his untimely misfortune in the sixth book. One hundred years is about right, I'd say.

If we then take 100×1200, we get a really rough estimate of 120,000 wizards in the world. This is probably on the high side, given the Neville problem and the fact that many wizards will die before they get to 100.

One hundred thousand wizards in the world, give or take. This is a bit small, I'd think, for all the wizards that populate the books, including complete sets of professional Quidditch leagues. So let's see if we can increase the count.

Apparently, J. K. Rowling once said that Hogwarts has about 600 students. This means that Harry's class is a aberration, in that it's about half the sizes of an average class, but then Harry was born during the Voldemort years, when the birthrate was no doubt rather low. In this case, each school admits on average about 100 students per year, so our numbers go up by about a factor of 3, to, say, 350,000 wizards in the world.

That's still too low, probably because the books are Euro-centric: as far as I recall, every character is from Europe or the Near East. In particular, there aren't native Asian or North/South Americans in the books. So let's assume that the three schools mentioned draw from Europe (including European Russia) and Northern Africa — a population of roughly 500 million, one twelfth of the world's total. Presumably there are then are about 33 other schools in the world to teach the other wizards, or maybe the rest of the world is run by the White Council.

So we must multiply the 350,000 answer above by 12, which gives us a total of about 4 million wizards in the world, and that's probably an upper bound.

And that's not a bad answer. It's big enough to form a society (think of the Jews in pre-war Europe) that interacts with the rest of the world but keeps itself separate. And, as you'll note if you've been following my arithmetic, this is an order of magnitude calculation, meaning that there could be as few as 500,000 wizards in the world, and as many as 40 million. I'm pretty sure there aren't more than 40 million wizards in the world, or we'd see more of them.

Four million wizards, give or take, and they'll all be ahead of you in line on July 21.

Monday, January 01, 2007

Things You Never Learn About Your Home Town

Apparently, Holyrood had at least one interesting character living there when I was growing up.

Friday, April 23, 2004

Today's Reading

Hopefully this will be a regular item. Anyway, after finishing up Adrian Goldsworthy's The Punic Wars (the Romans win, Carthage delenda), I went to postmodern physics: Brian Greene's new book, The Fabric of the Cosmos: Space, Time, and the Texture of Relativity.

I read Greene's earlier The Elegant Universe. The parts that I already understood (basic quantum mechanics, general relativity) were very, very well written. The parts that I didn't know (string theory, M-branes, 9 or 10 +1 dimensions) weren't as clear. This may not be Greene's fault. It's hard to describe 10 dimensional systems, especially when 6 or so of them are wound up in complicated snake-biting-its-own-tail toruses (torii?). I was also a bit put off by the fact that Greene implicitly assumes that string theory is the absolutely, positively correct way to merge quantum mechanics and general relativity, even though we can't solve all of the equations yet, so we don't know what the results are going to be.

Coincidentally, this week I heard a talk by Sir Roger Penrose. They have different takes on the basic problem of todays physics: Greene wants to save Quantum Mechanics by modifying General Relativity. Sir Roger wants to save General Relativity by modifying Quantum Mechanics, specifically the Copenhagen Interpretation.

Greene's version, string theory + supersymmetry, has certain verifyable features that should be tested soon. If it fails the test, Sir Roger's version might be looking good.

Thursday, April 15, 2004

Confused? Don't Be, Read

The Confusion, Neal Stephenson's next entry in his Baroque Cycle. I wrote a little bit about the first entry, Quicksilver, in a previous post. Special thanks to the Anne Arundel County Public Library for getting this on order. (What? You think I buy all the things I read? I only have one house, and for some reason my wife thinks we're supposed to move around in it without tripping over books all the time.)

Saturday, March 13, 2004

Free Books Online

My we're busy today, aren't we. Two sites of interest:

For books out of copyright, see Project Gutenberg, which now has thousands of books online. These were typed or scanned in by volunteers. Bibles, Shakespear, Twain, it's all there. Now the files are available on CD and DVD. Useful for taking on trips with the laptop. The books are in plain ASCII format. If that bugs you, read them with your browser and change the font to something you like.

For certain books in print, there is the Baen Free Library. OK, it only has Baen books, and not the current ones, though you can also purchase current ebooks from Baen. The free books are promos, of course, hoping to draw you into one series or another. These books are HTML formatted. Series included are Telzey, Honor Harrington, Retief. Authors include Bujold (one short story), Flint, Weber, Niven and Pournelle (Fallen Angels), and more.

Thursday, December 25, 2003

If you're wondering

where the title Quicksilver comes from, apparently John Wilkins (1614-1672) a founder of The Royal Society of London, wrote a book on codes and cyphers called Mercury, or the Secret and Swift Messenger (1641). In Quicksilver this work is known as the Cryptonomicon.

Mercury ascending

I just finished Neal Stephenson's Quicksilver, which is a sort of prequel to Cryptonomicon and the first of the Baroque Cycle, which apparently follows the adventures of one (fictional) Daniel Waterhouse from the time of the English Restoration, through his activity in bringing about the Glorious Revolution through what looks to be his role in assigning the proper credit for the invention of calculus and universal gravitation to Isaac Newton. He might also have to give some testimony concerning the legitimacy of Prince Jamie the Pretender.

I didn't really get interested in this book until about page 600, which left me some 300 pages to go, but looking back on it, it is worth the read.

Stephenson has set up a ``Metaweb'' page which includes annotations, biographies, etc. It's at http://www.metaweb.com/wiki/wiki.phtml. Enjoy.