|Ned Batchelder : Blog | Code | Text | Site|
» Home : Blog
A Spot of Bother has nothing to do with autism, it is a family story involving an impending wedding, infidelity, fear of death, and a few other things. It has humor but is not a comedy. It deals with serious situations, but is not melodramatic.
The thing Haddon does amazingly well is to get inside his characters' heads. In Curious Incident, he deftly imagined an autistic's inner monologue. In A Spot of Bother, he rotates among his characters, taking each of their viewpoints in turn. He does this to such a degree that there is absolutely no exposition in the book. So although the book is written in the third person, the viewpoint is actually multiple first-persons, to an extreme degree. Nothing is presented except as that character would express them.
This is a bit disorienting at first, but you quickly figure out who everyone is and their interrelationships. Presenting the story this way allows Haddon to present everything from pure points of view. I realized as I read the book that a traditional third person style gives you some distance from the characters. You are standing apart from them, even if only a little bit. In Haddon's style, you are the character.
Asymptote looks like a really full-featured technical drawing programming language. It makes a wide variety of drawings. They seem very proud of the LaTeX typesetting, but when I look at those drawings and see Knuth's Computer Modern fonts, it screams out for some real typography. Those fonts now seem as much a marker of time and place in technology as the plotter-based Hershey fonts did.
Hashiwokakero (or Hashi for short) is a Japanese puzzle. I discovered it in the back of a magazine at my haircutter, of all places. Like sudoku, it's an abstract puzzle requiring reasoning about a number of constraints at once.
The numbered circles are islands, your task is to fill in the bridges connecting them. There can be zero, one or two bridges between each pair of islands, orthogonally. Bridges cannot cross, and the number on the island indicates the number of bridges to the island. Lastly, all the islands must be connected:
Indigo Puzzles has the nicest online implementation: not only can you interactively solve the puzzle, but you can ask for advice, and it will patiently explain a possible next deduction, and why. They have lots of puzzles if you join the site (free).
A few tools I happened upon today, mostly because friends sent me links:
¶ CSS Text Wrapper: a cool GUI for making irregular text wrapping in browsers.
¶ Design: an elegant and beautiful suite of browser tools for working with design geometry.
¶ Read it Later: a Firefox extension for saving links to read later.
¶ Launchy: the Windows key-based launcher, now at version 2.0!
My first corporate job was with Digital Equipment Corporation. I worked in the printer group, on PostScript technologies. It was common then to simulate the Digital logo by scaling Helvetica and superimposing it in white onto colored rectangles.
But I knew that was inaccurate, and it gave a bad hacked-up impression. So I took it upon myself to create a genuine Digital logo in PostScript. My association with the logo was strong enough that I still get requests every few months for the logo. I am now an HP employee, so I have contact with even more ex-DECcies interested in the logo (HP bought Compaq which bought Digital, you see).
When the latest request came in, I decided to make a serious attempt at resurrecting the logo.
Hopefully, these will satisfy the needs for Digital logo fans. If you need anything more, let me know!
Kate Rhodes wrote a post about simplistic vs. useful sorting: Alphabetical != ASCIIbetical (cute name). In it, she points to Dave Koelle's Alphanum algorithm, which says to split the string to be sorted into numeric and non-numeric chunks, then sort so that the numeric chunks are treated as numbers. This makes "z2" sort after "z100", for example.
I looked at the code Dave provided (in Java, C++, or Perl), and all of it is much longer than I expected: the C++ is 40 or so lines. A comment in there says it's easier in a pattern language like Perl, but the Perl is still 20 iterative lines.
A few helpful Python features make this more compact: re.split provides just the function we want for chunking the string, sort takes a key function for computing sort keys from data, the key to sort on can itself be a list, and comparing two lists compares lexicographically among the elements of the list.
Each of these features in and of itself may have only occasional use, but here they conspire to help me write code nearly as expressive as the English description in my first paragraph. And there are enough of those features that they often help make expressive code like that.
It's still 11 months until the presidential election, and we haven't had a primary or caucus yet, but I'm willing to make a prediction: the Republican nominee will win.
I have two reasons. First, all the likely Democrat nominees are senators, and the likely Republican nominees are either governors or mayors. Historically, executive branch candidates do much better than those from the legislative branch. To quote Wikipedia's U.S. Presidential Elections page:
Maybe this is because of the compromise nature of the legislative process, and the hay that can be made of it. Remember "He voted for the war before he voted against the war"? Maybe it's that personalities that succeed in Congress are not well-suited to executive branch work. I don't know.
The second reason is that both parties have moved to the left. Clinton and Obama are both more liberal than Kerry was, and neither Romney or Giuliani is as conservative as Bush was. That means that the Republicans are moving toward the center at the same time that the Democrats are moving away from it. I've heard more than one liberal Massachusetts friend say that Giuliani wouldn't be bad, for example.
I hope I am wrong, but from this (admittedly early) vantage point, it doesn't look good for Democrats.
If I had a need for quick charts as images in web pages, Google Chart API looks pretty useful. I have a feeling I would have more charts on my pages if I took something like this as a given. I'll have to keep my eyes peeled for opportunities I would have overlooked.
They don't handle negative numbers, but that may be a misunderstanding about whether the data are values or relative positions.
I was trying to diagnose a problem with a PDF file we generated yesterday, and suspected that the images were corrupted. To see, I wrote this quick script to extract JPGs from PDF files. It is quick and dirty, with the absolute minimum understanding of PDF files, which can be quite opaque.
# Extract jpg's from pdf's. Quick and dirty.
This script works for my PDF files. Maybe it doesn't work for all, I don't know. PDF files are complex beasts. Your mileage may vary.
What I'd really like is a tool for exploring inside PDF files, so that I could see exactly what's going on in there. pyPdf is a start, but only scratches the surface of the kind of stuff I'd like to see...