|Ned Batchelder : Blog | Code | Text | Site|
» Home : Blog
This year we made two Halloween pumpkins, one designed by my six-year-old, and one designed by my twelve-year-old:
On the left: A UFO, which had already been nibbled by squirrels by the time I got a picture. On the right: A mettool, which is a character from Megaman who looks like this as a sprite:
Can a typeface save your life? Well, maybe not. But improved legibility on highways is a good thing, and ClearviewHwy is a new typeface designed with just that in mind. It's good looking, and could bring more mixed-case signs, which will give the roads a slightly friendlier feel. Maybe it will reduce road-rage, you never know!
¶ Limecat is not pleased.
¶ Rustboy: Tim Burton meets Pixar.
¶ Wired 12.10: SmartCar: check out the SmartCar/Hummer comparison.
One thing I've enjoyed about the SQLite mailing list is the quality of the email signatures.
There are plenty of political analogies this season, but I'd never heard of a post turtle before.
Many people incorrectly believe that Election Day in the U.S. is the first Tuesday in November. It isn't, it's the first Tuesday after the the first Monday. This year's election (November 2nd) is as early as it can be.
Why is that? The Federal Election Commission's FAQ's page has the answer:
Dave Leip runs the Atlas of Presidential Elections. This site is impressively detailed, with maps of every U.S. presidential election, broken down by state, and within states, by counties. Perusing the older elections, it is clear that ragged outcomes are more the norm than we've come to expect. And there are plenty of interesting factoids to dig up. For example, how many electoral votes did Ronald Reagan get in 1976? (No, that's not a typo).
Dave also maintains a blog on the site where he chases down electoral details (will Maine finally split its electoral votes?, how would past elections have turned out if we all had used Colorado's proposed electoral split method?). Fascinating stuff.
Tweakomatic is like the scripting version of TweakUI: it lets you fiddle with all sorts of Windows registry settings, but with templated scripts rather than a GUI. I haven't tried it, but I read the documentation, which is great:
The Braidy Tester lists his Hallmarks of a Great Developer. This is a good list to aspire to. There's not a whole lot of detail here, but the criteria are hard hard to argue with.
The one that really resonated with me is "Approaches debugging scientifically". I've always felt that developing follows the mathematical method (start with a few primitives, and build up from there), while debugging followed the scientific method (observe, hypothesize, experiment, and analyze).
This article in the New York Times hits the nail right on the head: For Families of Autistic, the Fight for Ordinary. In a nutshell, it's about families' efforts just to do ordinary things with their autistic kids. This story could be about my family: the well-rehearsed ceremonies, the haircut adventure, the mixed results with sports (stick with the solo events, skip the teams!), the cheat sheets posted around the house, and the meltdowns. Just this week, my son had a tantrum about getting on his school bus, because on that gray rainy day the street lights were still on, and they're supposed to be off before he gets on the bus.
I especially like the final words of the story:
My wife Susan wrote a personal piece a year ago with a very similar theme (and a focus on religious celebration as the Times piece starts with): The Rite Stuff.
I'm not a real baseball fan, but my cousin-in-law Benjamin Lloyd is. Here's his poem about the epic Red Sox victory:
MapReduce is a distributed computation tool at Google. It uses a constrained programming model (map and reduce, common functional programming techniques) to let users describe their computations in a way that make automated fault-tolerant distribution possible. It sounds like a great example of diamond cutting: finding the right compromise between what you want and what your users want, so that everyone wins.
I was working on a Python project, and reached a conundrum about interfaces. I know they are worthwhile in general, but in a dynamic language like Python their position is a bit fidgety. Read more about my Quest for Pythonic Interfaces.
We watched The Lost Prince the other night. It's about a Prince of England with epilepsy and apparently autism. He was hidden away for his short life to avoid embarrassing the Royal family. It's a good story, highlighting the screwed up ways families respond to their disabled members. We're not royalty, but I see glimmers of reactions I've experienced myself.
Wanting to read more about the story, I perused Wikipedia, and ended up at the bizarre Line of Succession to the British Throne, which calmly lists the 161 people in line for the throne. I can understand needing to know who the next handful of people are, or maybe a dozen, but after twenty, we're just talking snobbery and trivia. Of course, more fanatical pages can outdo the Wikipedia's conservative efforts: Persons eligible to succeed to the British Throne as of 1 Jan 2001 lists more than 4500 people in order of their claim to lead the British Empire. For all I know, one of them is my next-door neighbor.
Which brings me to The Bed-Sitting Room, a very strange movie I happened to catch on TV once when I was much younger (and they showed such fare in the wee hours of the morning). It's an absurdist comedy about a post-apocalypse England. The one thing that sticks in my mind about it was that they went to the trouble of figuring out who among the hundred or so survivors was next in line to the throne. The mild and unsuspecting housewife was duly coronated as best they could manage.
I honestly don't know how much of this is a joke, and how much is serious: Guantanamo is a tool that deletes all lines of code that are untested, as determined by code coverage tools. Two questions from the FAQ aptly demonstrate the philosphy:
This may take Deleting code too far...
Derek (no last name) is a lead developer at Microsoft on their XML libraries (first MSXML and now System.Xml). He's just started a blog, and he seems to know what he's talking about. His post Where XML Goes Astray correctly hits some of the dark corners of XML. He especially gets right the difference between documents and data, and understands that XML was fundamentally aimed at documents, which is what makes data difficult sometimes.
The problem with XML is the M. The X and the L are just fine. Remember, the M stands for Markup, which means adding meta-information (tags) in and around a body of text.
Every year around now, the Brookline Public Library has a book sale run by the Friends of the Public Library of Brookline. Every year, I go in to look around. Sometimes I buy something, sometimes I don't.
This time, they had four boxes full of a complete 1984 Encyclopædia Britannica, plus a three-volume Webster's dictionary, plus a dozen or so volumes of the Annals of America. The price: $50.
As a kid, we had a 1969 edition of the Britannica within easy reach. I often perused the encyclopedia the way people today surf the web: start at random, and follow references and threads until sated. I learned from my mother the habit of looking up more information on whatever topic is currently at hand (these days, the itch is more often gratified with IMDB, Google, and Wikipedia). I couldn't let a good Britannica molder in the Library's basement.
The $50 price was too good to pass up, especially after checking eBay and seeing similar items for three times the price. So I bought it and lugged it home. Now I just need to find the 49.5 inches of space to get the books out of the boxes and onto a shelf.
BTW: the Britannica site has this review of what sounds like a pretty good book: The Know It All: One Man's Humble Attempt to Become the Smartest Person in the World, written by a guy who read the whole encyclopedia!
Derek Sivers has written a short piece called Say NO by default about the need to keep things simple, and not pile on features just because you can. It's a good reminder, especially because as simple as the message is, it's really easy to forget.
One thing that caught my eye about the piece is that Derek is guy behind CD Baby, a hip online indepedent music store. I bought a CD from them recently (The Weepies if you must know), and was entertained by their refreshingly light-hearted e-commerce verbiage. The confirmation email I got included this:
Of course, the CD did not arrive in the finest gold-lined box that money can buy, but I was quite satisfied with the service and the CD, which arrived in the finest mailing envelope that money can buy.
Color synthAxis is one of those interactive color choosing tools you see every once in while on the web. But this one is cooler than most, providing a powerful range of tools to manipulate colors in different ways. I'd call it a color processor, the way Photoshop is an image processor.
You have a large palette full of swatches. Each one can be clicked to expose a set of tiny tools around it, which you use to combine, split, mix, and match with other swatches.
I'm not a color person (can't you tell from my design for this site?), but even I was mesmerized by the different shades I could create with this thing.
PHP/SWF Charts is a slick PHP package for dynamically generating charts as Flash files. The results are good looking and full-featured. I especially liked the idea that everything is defaultable. As the tutorial shows, this code:
will draw a bar chart with bogus defaulted data. Of course, the resulting chart is useless, but it makes it extremely easy to get off the ground with the package.
John Perry wrote an essay about how to use procrastination to become a super-productive person:
He wrote it nearly ten years ago. What does it mean that I'm only now getting around to reading it?
Most generated parsers don't let you select the target production at run time: they are always looking for the same syntax. But what if you want to call your parser in different ways, for example sometimes expecting a statement, and sometimes just an expression? Here's a trick I came up with to use any parser as a switchable-start parser.
In my plea over the weekend for help with HTML, I said I would write a glowing review for whoever helped me, and I am a man of my word.
"Maniac" of Software Maniacs provided swift, accurate, and persistent help. His (or her) site is in Russian, which I cannot read, but provides a few Windows utilities. Based on my experience with Maniac, I am sure they are high quality.
At the top of the page is this motto:
which Babelfish translates as:
I'll take it as, "Between black and white there are many shades". I'll refrain from drawing a political analogy.
SimpleSQL is another contender in the field of open source implementations of SQL relational databases. It's distributed under a GPL license. Interestingly, they seem to be writing in Java, then automatically converting the source to C++ so that they can support C++ clients!
Yesterday I was trying to write some C# code that uses the .NET XML classes to perform an XSLT transform. I was a bit hampered by not knowing C#, but not much. The tricky thing was working through all of the pertinent classes in the .NET framework.
I needed to transform an XML string (sDataXml) with an XSLT string (sXslt) and get the HTML string that results (sHtml). Further, I needed to pass a parameter to the transform. Here's what I ended up with:
In retrospect, the result is not as complicated as it seemed when I was in the middle of it. I understand the value of finely-diced APIs that provide many objects, each with a small job to do. The .NET framework has clearly taken this approach. Being able to pass an explicit URL resolver is a very powerful way to use XSLT in a larger system.
But sometimes you'd like some defaults to help you along. For example, the Evidence passed to xsl.Load: wouldn't that make a wonderful default? And when a XmlUrlResolver is required, a new one constructed with no arguments sounds like a good default.
I'll try not to get off on a CSS vs. tables rant here, tempting though it is. Just by coincidence, two different projects now need very similar HTML designs, and I don't know what my options are for accomplishing it. Ideas are most welcome.
I need a page split horizontally in two parts. The top part should expand and shrink to display however much content it needs to. The bottom part should fill the rest of the browser window, and get a vertical scroll bar to see all of the stuff in it. The effect should be like an email message window: the top half stays fixed in place to show the message headers, and the bottom half scrolls to read the body of the message.
I've tried divs, I've tried tables, I've tried iframes, and my head is spinning with all the combinations I've tried that didn't quite work. Please help! I'll write a glowing review about you and your work!
So I've been avidly watching the debates (three so far), and have found them fascinating. I think Kerry has been doing a good job going after the president and countering his negatives. But last night I was very frustrated with Kerry's rebuttal to the last question.
Laszlo Systems has shifted from selling closed-source software (their Laszlo Presentation Server), to selling services around open-source software (their newly-opened Laszlo Presentation Server). I always wondered how they would manage to compete with Macromedia's Flex platform, which occupied a very similar niche (rich web-based applications).
Now they're hoping to succeed with open-source mojo, and more power to them. I haven't used either Laszlo or Flex, but they seem very powerful and eye-opening in terms of the types of applications they can build. I hope it works for them.
Oliver Steele is an insider with more details. He's also a fellow Brookline resident, though I haven't (yet) met him.
I've never worked on a large open-source project, but I've wondered: do you write the code differently when you know it will be viewable by the world? Does working in a glass house change your code? As a coder, I like poking around in other source packs, and I'll be downloading Laszlo to see what the code looks like (though it's a lot: the .tar.gz file is 107M!)
In C++, if you want your code to talk about itself, you often use the predefined magic macros __FILE__ and __LINE__ to get the filename and line number of the current line:
This provides a convenient way to leave breadcrumbs that will direct you to the spot in the code later.
How to do it in Python? With help from the Python Cookbook, I created this. It uses scary functions from sys (_getframe has a leading underscore and is described as "for internal and specialized uses only"):
This goes one further than the C++ technique, by providing the function name as well as the file and line.
I use iTunes on Windows to play music at work, and I have a lot of songs (> 4000). Songs I really like I rate five-stars, and I use Party Shuffle with "play higher rated songs more often" turned on. But still, I hear a lot of one-star songs. And looking at the number of times each song has been played, it turns out there are over a thousand songs that have not been played at all, while many have been played over ten times, even though I haven't rated them highly.
So I made a smart playlist with live updating called "Least recently played", limited to 2500 songs selected by least recently played. Then I run Party Shuffle off of that playlist. Now it feels like I'm listening to a whole new library of music. I had also tried a list called "Not one star" which selected based on the rating not being one star. That was to permanently exclude songs that I had marked with one star. Next time I fiddle with the playlists, maybe I'll try combining them.
For lots more ideas of how to use smart playlists, take a look at SmartPlaylists.com. The people who post their ideas there have a whole lot more energy than me for making their music libraries dance.
Damien elaborates on his thinking behind the Couch business model:
Also notice that Damien now has a cute couch icon for his favicon.ico!
Two sites that do a good job showing statistics about the campaign: