<M <Y
Y> M>

[Comments] (6) The Biennial Question: I need new computer stuff (specifically, hard drives and maybe a CPU). Where do I go, loyal readers?

Buzzword Namespace Collision: I went to the bank website and it said "LEONARD RICHARDSON - Personal Accounts" and I thought "Wait, why is Bank of America trying to sell me on Social Security privatization?"

[Comments] (4) Anacrusish #3: This is actually #2: I wrote it about six months ago but I just showed it to Brendan instead of posting it, and I forgot about it. I'm cleaning out Beautiful Soup email from my inbox and I stumbled upon it, so why not post it now? Because it's got the same problems it did earlier, that's why. Oh well.

Silas

God has bent the spectrum over His knee. A rainbow goes from red to between yellow and green, then back down to red. Grass, if there was any, would look sick and brown. Silas's arms have mainly lost their highlights, but his rubber gloves are as black as before.

Silas wipes at his face for suddenly appearing goggles. Is it his brain, his eyes? The room, the world?

"The blue wire!" shouts Detective Rogin from behind the vault's door. "Cut the blue wire!"

Silas looks down at the package and tries to remember. Clearly someone does not want him to succeed.

[Comments] (3) : I don't think I've ever enjoyed (or even seen) a TV show as formulaic as House. The least formulaic part of that show is at the very beginning, where the announcer warns you that there are going to be CGI simulations of what happens inside peoples' bodies. What will the announcer say? Will he advise "viewer discretion", or "parental discretion", or just plain "discretion"? It keeps me guessing every time! But then the episode starts.

[Comments] (1) : I got dragooned into seeing a movie today, but I got to pick the movie. I picked Melinda and Melinda, and... well, it was okay, but not great. Pros: Will Ferrell was funny, and the concept is good and very Socratic ("Oh, hi, Socrates, we were just discussing which is the worthier form of drama: comedy, or tragedy?"). Cons: It dragged a lot. Two miscellaneous fun things: the movie features Wallace Shawn in full Grand Nagus Zek mode, and there's a scene where a guy wears a plastic mullet like the one Brendan has.

It's a cliché to say that Woody Allen doesn't make funny movies anymore, but I'd rather perpetuate a cliché than a base falsehood. At least he's started having good ideas again.

[Comments] (1) More Movie Magic: Though I've never understood the "magic" part. Anyway, yesterday Sumana and I made up for watching Melinda and Melinda by re-watching the first halves of classic comedies Austin Powers and Some Like it Hot. I decided it would make Some Like it Hot a little more interesting to pretend that the character Dolores is actually Dolores Haze from Lolita, even though the timeline doesn't match at all. Also, William H. Macy was born to play Osgood Fielding III in the remake.

Sumana says I should write the screenplay for the heist picture in which Richard Feynman teams up with the Kool-Aid Man. "Okay, Kool-Aid Man. You get us through the wall, I'll get us into the safe."

: I think Beautiful Soup 2.0 is just about done. I'm not announcing it yet because I'm still writing the documentation, but you can download it as a beta from the main page.

[Comments] (1) : Here's a fun little DHTML game; not as elegant as Kirk Israel's games whose interface is the form submit button, but still nice. Yeah, "DHTML". We used to call it "Javascript", but that got a bad reputation, so we renamed it. Now, it sounds like a standard!

Belated Soup: Man, I hate it when I save as draft instead of publishing something. Anyway, here's what I wrote last night:

Well, I tried, but no Beautiful Soup 2.0 tonight. I'm almost done with the online docs but not quite, and I still have some things on the TODO list I want to put into 2.0 as long as I'm breaking backward compatibility. Tomorrow I get my reviewed copy of the web applications/services chapter back, (contrary to my fears the tech reviewer thinks I wrote a good chapter) so if I can't somehow squeeze it in tomorrow it's probably not going to happen for over a week.

[Comments] (14) Dismissed out of hand: I'm eating a Granny Smith apple. Whoever said they were good to eat raw? It's so tart. Brrrr,

[Comments] (4) Fried Tofu: I used to make stuff with tofu but not successfully. My attempts at stir-frying it were failures. Recently I had to create a vegan feast, so I fried tofu in peanut oil and brushed it with a peanut sauce, and it was tasty. What was missing from my previous tofu attempts was texture, and frying solves that problem.

[Comments] (3) : Hey, quick question. If I start up a server and bind it to localhost (instead of an IP address or an external hostname), then no one can access the server from outside localhost, right? This is backed up by my experience and stuff I've read, but I want to make triple sure so I don't tell people they're okay when they're actually exposing their systems to the outside.

[Comments] (5) Shaun of the Dead: Sumana rented it and we watched it tonight. It was really good, but in an amazing twist of fate the movie was ruined for me by false spoilers! Somehow while hearing about the movie (or, perhaps, seeing the name of the movie) I got the impression that halfway through, the main character got killed and came back as a zombie, but nonetheless they managed to pull it off as a romantic comedy. I thought this was so awesome that I kept wondering how they would manage it, and once it became clear that 1) it was not going to happen, and 2) the nature of zombiehood in this movie was such that it couldn't happen, it was a big disappointment. Still the best zombie movie I've ever seen.

[Comments] (5) Beautiful Soup 2.0: After much last-minute tweaking of Python and CSS, Beautiful Soup 2.0 is released! I really outdid myself this time. Still in one file, much better at parsing bad HTML, has pretty-printer, lots of idiomatic shortcuts for writing more concise code, lots of documentation. And, in contradiction of Leonard's Immutable Law of Open Source Software, it's not plugin-based. Go for it. No Python 1.5 support in this one, unfortunately.

SOAP Bigot Needed: Earlier I asked for some REST bigots to review the REST portion of my web chapter. I should also show the SOAP portions of the web services section to a SOAP bigot or two so I don't say wrong things. I'm pretty sure I got it right, but you can't be too careful when your writing's going into a book so heavy that an angry reader could use it as a weapon against you.

So if anyone who knows SOAP wants to look over about 10 pages real quick and flag any errors, please mail me or leave a comment. I'd like to send in my revised draft tonight so I can start working on revising the other chapter.

Piracy Oddities: When I think about modern piracy I think of the awful stuff, that makes you feel guilty about being interested in piracy: mafias and triads hijacking ships and "making the crew walk the plank" as Cryptonomicon put it. But the ICC CCS weekly piracy report only has a few penny-ante incidents a week, mostly pirates sneaking on board and stealing ship's stores.

If you read between the lines ("Coast near Aceh is particularly risky for hijackings") you see a glimpse of more dangerous incidents that don't get reported or don't show up on the weekly report they publish to gratify our weird voyeuristic tendencies. A while back I read a book called Dangerous Waters which painted a picture somewhere in between, of an East Asian pirate threat that was ever-present and chronic but not with many resources behind it, and easy to foil in most cases if you took safety precautions. Where does the truth lie?

I bring this up because there's a note on the piracy report page that I noticed when I went to fix its Automat feed by rewriting the scraper in Beautiful Soup 2.0:

After Tsunami there were no incidents of any kind in the Malacca Straits for two months. However, attacks have resumed since 28.02.2005. In the last four weeks there have been three serious attacks of Kidnapping the crew for ransom in Malacca straits. Heavily armed pirates have boarded ships and seized the master and one or two crew members and taken them ashore. Pirates have not stolen any property and sole aim has been to kidnap the crew.

Did the tsunami reboot the Indonesian piracy industry, giving them a chance to come up with more agressive and dangerous strategies? What's going on?

[Comments] (2) : The best thing about Arrested Development (apart from the total interconnectedness of everything in the fictional world, without which the jokes wouldn't be funny) is that the Ron Howard narrator is a real character in the show. Kevin even says the narrator is the protagonist. Anyway, last night's episode verified my suspicion that, like all the other characters, the narrator is a petty soul consumed with his own minor obsessions.

Near the beginning he took a potshot at the narrator of some other fictional show, and then kept sniping at that other narrator throughout the episode. I couldn't get enough of this, as narrator-on-narrator bickering is one of the purest forms of fourth-wall-breaking comedy gold in my book, second only to narrator-on-character bickering.

[Comments] (1) Easy Come, Easy Go: A couple days ago I got a letter from the Clark campaign. They are wrapping things up and they have an outstanding paycheck for me and is this the right address? Apparently between the week where nobody got paid and the actual end of the campaign, I must have put in a few hours of useful work, because I have $50.80 coming to me.

Then this morning I did my Arkansas taxes and it turns out I owe the state of Arkansas another $53. So that money's just going to go right back to Little Rock.

Night Of A Thousand Game Roundups: Cheap game roundup to celebrate that I sent off the revised copies of both my book chapters today. Yes, I am pretty much awesome. But enough about me. The stars of this particular show are the games, presented by ME! T-Rex!

The winner: Strategic Space Combat, aka SSC. No limerick as I am done with writing for today. Submit your own limericks in the comments, why don't you?

[Comments] (1) What they did to my manuscript: I've decided to stop thinking of the Python book as a book with a bunch of authors and start thinking of it as an anthology of essays on Python. Thinking about it this way makes those huge multi-author books make a lot more sense.

However the publisher sees them as big books, so the copy editor went through my chapters (essays) removing the "I" voice because the "I" for this book has multiple personality disorder. I use "I" a whole lot, because my nonfiction writing style is "Hello, allow me to tell you stuff". My "I'll show you x" became "You'll learn to x", and "I think you should do x" became "You should do x". The latter I'm a little uneasy with. It's just, like, my opinion, man.

Speaking of which, the copy editor also took out my Lebowski homage (changing "parlance" to "terminology"), but left "encroaching ennui" and all of my jokes intact. Not a bad trade.

[Comments] (4) Oranges and the Juice Thereof: Planet Organics had blood oranges on their list. I've loved blood oranges ever since I had blood orange juice from a Tetra-Pak Susanna brought back from Romania. I ordered two pounds of oranges for an exorbitant $4.00. As a tribute to the old Romanian aristocracy, I would bathe in the blood of oranges!

Well, it turns out two pounds of oranges is six oranges. Furthermore, that six oranges when squeezed yield about a glass of juice. So I spent $4.00 (of Sumana's money) on a glass of blood orange juice. I was enraged, but then we drank the juice and it was really good. Also, if you go out to a nice place for breakfast around here, a glass of non-blood orange juice costs $3.50. So $4.00 for fresh blood orange juice is doable as a one-time thing. I wonder if you can get those Tetra-Paks here, though.

: How do I keep getting sucked into these things? It must be my instatiable greed for latinum. I'm now in charge of revising a third chapter of the Python book. Soon I'll be an expert at everything!

Almost Immediate Update: Perhaps I spoke too soon; the original author is going to try to make time for the revisions.

The Downfall of Kris: I showed this cartoon to Kris and he vowed revenge. "Gil's goin' down," he says.

[Comments] (7) Cute Baby Wholphin Of Shame: Whale-dolphin hybrid has baby wholphin. This is not surprising as, you'll remember, there are no whales involved here, only dolphins under false names.

Just Don't Let It Happen Again: Ambiguous headline watch makes a return, with Mexico's Fox May Pardon Leftist Mayor for Election.

Beautiful Soup 2.0.2: People who complained about Beautiful Soup not being set up with distutils, it is now. I also made real unit tests out of my ad hoc tests, so you get the Good Programming Practices two-for-one deal. In conjunction with the unannounced version 2.0.1 there are also some fixes for bugs I found while getting the tests into place.

: Saw Eternal Sunshine of the Spotless Mind with Sumana and Sarah. (Remember, you heard about it here first; you also saw it long before I did). Everything I might have to say about the movie has probably already been said, so I thought I'd just recount a funny bit of dialogue from when we were perusing the DVD menu:

Sumana: Ooh, deleted scenes!
Leonard: They're all deleted scenes!

: Depressingly, I have yet to make a dent in the ultimate high score list.

[Comments] (13) Anticatnip: There are stray cats that wander the neighborhood, and they like to sleep on the patio and in the garden. Sumana dislikes these cats; they creep her out. Is there an anticatnip I could plant that would let me externalize the cost of stray cats by getting them to sleep on other peoples' patios?

The Secret To Writing Tutorials, I Guess: Writing a tutorial is like writing a test suite for someone's understanding of a topic. You start off with very basic assertions and gradually build on them until you can make assertions about the whole system. If you don't do it this way, you don't have full coverage of the topic.

[Comments] (3) Cue "doodly-oodly-oodly" Music: Okay, I have revised that guy's chapter and I am now done with the Python book altogether! Except I still have to send off a list of helpful URLs, and a little bio. I'm thinking of reusing my CodeCon bio ("Leonard Richardson lives in San Francisco and writes software calculated to drive you mad"). I would actually be "using" that bio, which I like quite a lot, since as far as I know the CodeCon people never used it anywhere. Anyway, what should I put in my bio? And what web pages are good supplementary resources for 1) network programming, 2) web applications, 3) web services? I have my own list but I'd like to know what you think.

Tomorrow flying to Utah for John's graduation. Taking the train back means lots of time for reading, and for writing fiction. Ah, sweet fiction, where you can make up random stuff and no one can say it's wrong.

[Comments] (3) Brrrr: Are you guys okay?

[Comments] (2) Self-Promotion: Sometimes we have people over for dinner and then Sumana wants me to play the gee-tar for entertainment. Recently we had Riana over and Riana was surprised that I play music. Clearly I am not that good at self-promotion if people I've known for years don't know I play music, even though there's a music link right there on my home page. I blame all the other stuff I have to do that has kept me from finishing my new album and achieving the musical superstardom I obviously deserve.

At the opposite end of the self-promotion spectrum, Riana also thought Jake Berendes is someone I'd made up. That's a common misconception, but a misconception nonetheless. Jake is doing installation art pieces on the other side of the country. How could I fake that? I can't even sew. I think I sewed a little stuffed-animal-size pillow once, but it split apart.

[Comments] (1) Onionskin: What is up with the really cheap, thin paper used in mass market paperbacks published in the 60s and 70s? I got a used 1972 copy of The Sot-Weed Factor and it's about as thick as any other paperback novel, but it turns out that's just because the pages are one micron thick. It's actually as long as (and more obscure than) frickin' Quicksilver.

Doodly-oodly-oodly: Hey, guess what. I messed up the copy of the doctored chapter I sent in, so I had to do the doctoring again from John's computer here in Utah. Fortunately I had the screenshots and the sample code to work from, so it only took five dang hours out of my vacation.

: Leaving on the train, eventually. We went up to Salt Lake today and it was pretty fun. I was unable to find anything at the cool SLC bookstore, which makes me think that I can't go shopping for books anymore without my Pocket Wisherman printout. Actually I did find some stuff, but I was too cheap to buy it. So probably I'm just being cheap.

[Comments] (6) : Back from Utah after a long train ride. There was a guy who did color commentary over the PA during our sojourn in the Sierra Nevada, and he talked about the Donner Party for five minutes without ever mentioning cannibalism, discussing every other aspect of the Donner Party in so much detail as to make me think that the cannibalism part was an urban legend (which it wasn't, and if it was you think he'd have mentioned that interesting fact). But it got me thinking along the same lines as many of my previous thoughts: why shouldn't I create and sell soy-based human flesh for ethical cannibals and the curious? I could call it either "Soyman" or Soy-lent Green".

[Comments] (1) Ye ask, What eat our merry Band/En Route to lovely MARYLAND?: Amtrak food: bad. Same logistics and preparation, but worse taste than airplane food. If you eat in the dining car it's got better presentation with tablecloths and real plates, but don't be fooled.

Fanboy Roundup #2: Tragically, NYCB fan favorite Bob the Tholian was killed in the most recent episode of Enterprise. Or was it merely his evil mirror-universe twin, Bob the Evil Tholian? You can tell he's the evil one because his name is spelled backwards. And the little crystalline goatee.

This season of Enterprise has been great for fansboy like me (apart for moment of sheer wince-inducing awfulness like week-before-last), but that's because it's been filling in gaps left by other Trek series. This comes at the expense of doing new interesting things that a franchise needs to do to get new viewers, and creating new gaps to be filled in by later editions of the franchise. I don't know if this navel-gazing was why Enterprise was cancelled, or whether, given the probable fact of its cancellation Manny Coto (my new Trek hero, BTW) decided to just do everything he ever wanted to see in Trek and damn the consequences.

Fanboy Roundup continues later this week with the Hitchhiker's movie.

[Comments] (2) BIDDLE NOWADAYS!: Someone's selling a laptop on eBay. Among the "REAL SCREEN SHOTS TAKEN FROM ACTUAL THE COMPUTER YOU WILL BE GETTING!!!!!!!" is the CNN screenshot from the Eater of Meaning (scroll down to "GO ONLINE TO THE INTERNET"). Plus things that aren't even screenshots, just the result of Google Image searches.

Ordinarily I 403 people trying to use Crummy images to spice up their eBay auctions, but I'll make an exception in this case. I guess if you bought this computer, the whole Internet would look eaten to you.

[Comments] (4) Graphs With Python: What's good for doing programmatic graphs with Python? I'm using PILGraph for a little project of mine. It's nice and simple but I'm having problems getting the labels to actually show up. I'll probably end up fixing it because I like the simplicity, but I'm wondering what else there is.

[Comments] (6) Ancient Chinese Secret, Huh?: I am interested in ancient history; I don't know why, but I like hearing about things that happened an incredibly long time ago. Let's say between 1000 BC and 1400 AD. About a year ago I reached the satiation point of my original interest in the Roman Republic and Empire (though I still plan to finish Gibbon, and to read primary sources). I've branched out both temporally and geographically, but I am having big problems finding good-quality books on ancient history. Part of this is probably due to a lack of written documentation about many parts of the world, or at least documentation that is not written by foreigners and full of crap about how peoples' feet are mounted on their foreheads. But some of it is just weird inexplicable gaps.

Lack-Of-Cliffhanger Cliffhanger: I read Dan Simmons' Hyperion and for the most part it was great. The universe is well-fleshed out and has fairly credible newslang and people act believably. It reminds me of the universe in the The Legend Lives! IF game, which I always liked and which I think has the most interesting universe I've seen in sci-fi IF, albeit one of the worst titles. (Obligatory disclaimer: Planetfall and Suspended and probably others are better games.) Geez, I haven't played any IF or felt guilty about abandoning my IF project for probably a year. Anyway.

The book is really good in general but parts of it are very boring (boringness is not correlated to "action" in the crude sense: some of the most boring scenes describe firefights and daring escapes). In particular there's a boring part about 40 pages from the end which goes on and on with fisticuffs and murder and repercussions and blah and blah. Maybe it's just boring because it's a framed story inside a much more exciting story that's coming to a head, and I've come to expect the last-minute revelation in these stories that someone is not who he seems. In my sci-fi epic, revelations that people are not who they seem will come at unpredictable times.

This framed story's eating up more and more pages and I realize that not only is this book the first part of a multi-part series, but it's not going to have a real conclusion or even a cliffhanger. Instead it will be as though it was originally a longer book that got split down the middle. Sure enough, that's exactly what happens. Just a chapter break with no next chapter after it, even though with about ten more pages there could have been a real heart-pounding "to be continued" cliffhanger. I never realized this before, but this is more frustrating than a real cliffhanger!

So, good book, but no resolution, even by the accepted standards of first books in series. I'd advise you to get the first and the second books at once, but maybe you won't like the first book and you'll blame me for forcing you to buy into the capitalist publishing machine when all I did was advise you to do this. Also, the copy I got in the used bookstore has much better cover art than the overly literal cover art you see for the book at Amazon. So get the, ah, 1991 edition if you want to feel threatened every time you close the book, instead of feeling like you're reading an Edward Scissorhands novelization.

RSS feed construction helper: This is kind of a neat tool I wrote but I'm not sure what to call it. It's a wrapper around the famous PyRSS2Gen library. It provides a simple pickle-based backend storage for state relating to an RSS feed that's screen-scraped from a web page. Some of the state it stores is redundant with the actual content of the RSS feed, but some of it is contextual information like "when was the first time a screen-scrape attempt found the item that has this guid"? (I am too tired to explain why this information is useful, but trust me, it quite often is.)

The tool provides convenience functions for fetching a new version of the web page, and does the good-citizen Etag and Last-Modified thing, so all you have to do is write a hook method that scrapes the webpage into a bunch of RSS items and adds them to the feed. As items go on the top of the feed, older ones automatically drop off the end.

In conjunction with Beautiful Soup) this makes it incredibly easy for me to screen-scrape a web page into an RSS feed and have it keep working over time. Up to this point I've been trying to run the various Syndication Automat feeds out of NewsBruiser notebooks. It's a clever idea but cleverness is just about all it's got going for it. It's clunky and awkward, and there are some cases I just can't handle, such as the Dover page where the items I want to RSSify don't have any dates on them. (That's why the contextual information mentioned earlier in this entry is useful, BTW)

I thought any alternative to using NewsBruiser would be a lot of backend work, but it's not. My module's about 150 lines of code: here it is in a temporary location until I come up with a real name for it: RSSHelper.py. Here's a sample script that uses it and Beautiful Soup and ASCII, Dammit (actually the "HTML, Dammit" subset) to make a Dover automat feed.

It originally took me an hour of work and eventual failure to get a NewsBruiser notebook-backed feed for the Dover site. It took about five minutes to write that script linked above. And the new script actually works, instead of putting the same books into the feed over and over again.

I've got the same feeling with this as I did when I stopped writing custom parsers for screen-scraping and started using Beautiful Soup. Is this as cool as I think it is? Do things like this already exist? What should I call it?

PS: Danny deserves a midwife credit since I came up with this and wrote it while working on my second hack for the Life Hacks book.

When Ideas Collide: I love it when a plan comes together. The perfect use for tiny images embedded in the body of a webpage is sparklines, Edward Tufte's trendy post-literate ideographs. Joe Gregorio has the Python implementation.

[Comments] (2) Subway: I was planning to write a series of articles on Subway, but a cursory run-through shows that such a series of articles would probably spend most of its time guiding people through small problems in Subway, and my time would be better spent organizing fixes for those problems instead of enshrining them in print. In other words it's not mature enough yet to be the subject of technical articles. So I may go back to my original idea of just writing individual articles on Cheetah and SQLObject, as I'd planned before I realized "hey, these things are all used in Subway". What do you think? Am I selling Subway short?

<M <Y
Y> M>

[Main]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.