|Ned Batchelder : Blog | Code | Text | Site|
» Home : Blog
I was talking with a fellow software engineer the other day about the process of designing software, and we got around to the diamond cutter analogy.
A diamond cutter (so I am told) takes a raw lump of diamond and has to cut it in just the right way to make a properly cut finished diamond. With large diamonds, the first cut is crucial, and can be an all-or-nothing proposition. Strike the diamond properly, and it is worth millions. Strike it wrong, and you have a pile of cheap industrial chips. There are stories of diamond cutters staring at rough diamonds for weeks trying to discern the right place and angle to strike.
Sometimes software design is like that. How should a pile of functionality be divided into modules and classes? What's the right separation of concerns? Which patterns will provide the best leverage over the forces of chaos? As with diamond cutting, the best answer may not be immediately obvious. Make the first cut incorrectly, and you could be struggling hard against a ragged grain for the whole rest of the project. Strike it right, and you could have a smooth, strong, easily-implemented interface.
When designing software, sometimes we have to mull a problem over, examine it from every angle. Simply starting out and figuring you'll hack your way through it may leave you with an unmanageable mess. Next time you're in this position, try letting it sit. The proper grain may become apparent to you over time. You may end up with a beautiful diamond instead.
We're using Adobe Premiere Pro to edit movies. I have not been able to figure out how to get smaller MPEGs from it. I use the Adobe Media Encoder to generate the MPEGs, and it has a bewildering array of options and sliders, but nothing I do changes the size of the output file. I export a two-minute movie at quality 5, and it looks fabulous but takes 97 Mb. I change the settings to quality 1, lowest bitrates, etc, and now I have a movie that looks like crap, and the file size is... 97Mb.
I'm importing the movie clips from a digital video camera, and they arrive as AVI clips. Is there something I need to do there to make the file smaller? Does anyone have an answer? This is one of those questions that seems impervious to web searches.
When FedEx bought Kinko's a few months ago, I wondered what they would do to bring the two corporate identities together into a unified image. Well, FedEx rebranded Kinko's, introducing a strong iconic logo:
Evenings are a little difficult: there's lots of different things going on. I'm tired after a day of work, but I want to find out what's been happening to everyone else. I'd like to relax, but I also want to play with the kids. I'd like to pursue personal projects, but there are house things to be taken care of too. There are blog entries to write (the blog in my head is much more interesting than this one), but there's also work from the office to get done.
With all of these different possibilities, it's easy to be pulled in a dozen directions at once. So when my youngest son appeared with a how-to art book, with a particular project picked out, it was very difficult to focus on it and agree to join in. My first reaction was, oh gosh, that looks really complicated.
The search for a laptop for my wife ended Saturday with a trip to the local Apple store. We left with a 12" iBook.
The price was good (especially with an educator's discount), the size is good, the style is good, and Sue originally used a Mac before the PC anyway. For the record, we are not going to casemod it, though it is cool that we could.
We're having some difficulty with the trackpad. Are there any secret tips out there for making it behave a little less flaky? We've tried the different settings, and it still seems prone to accidental movement while typing.
This is a copy protection scheme for arcade video games. I heard about it the summer I worked at General Computer. I don't know if it is true, but it sounds good.
One thing I didn't mention in my recent post about the Atari 2600 is that I once worked for a company that made games for the 2600. General Computer was started by some MIT guys who figured out how to hack a Missle Command game to give it more features. Then they did the same thing for Pac-Man, creating Ms. Pac-Man.
I worked for them in the summer of 1982, while I was in college. By that time Atari had realized they would do better hiring them than suing them. General Computer was making original arcade games like Food Fight, and porting existing arcade games to the home machines like the 2600. General Computer is still in business, though they long ago moved from video games to Macintosh peripherals, and thence to printers: GCC Printers Corporate History.
For a college kid who liked writing software and playing video games, it was a cool place to work. For one thing, there was a room full of arcade machines. The compilers of the day were not that fast, so when it was time to compile the latest code changes, you had time for a game or two.
When you don't have to pay to play the games, you can find things out other people can't. For example, one of the machines was Dig-Dug (GCC did the 2600 Dig-Dug port). As you moved up the levels of Dig-Dug, the monsters would move faster and faster. But when you got to level 128, the monsters would move extremely slowly. They had probably used a byte to represent the speed of the monsters, and added two for every level, and the speed wrapped around to zero!
My son swam in his first Special Olympics swim meet yesterday, and earned two medals. He got a gold for the freestyle 25, and a silver for the 4×50 relay. He was also the fastest in his backstroke 25 heat, but was disqualified: he walked the last 4 yards because he's afraid to hit his head at the end. Special Olympics is a wonderful organization, and not just for the reasons you'd think.
For some reason, the topic of APL came up yesterday at the office. APL is one wild-ass idiosyncratic language. It stands for A Programming Language, and was created in 1962 by Ken Iverson. One of its most unusual aspects is that it requires an entirely new character set, including not only Greek letters, but new symbols created by Iverson. To add to the typographic diversity, even more new symbols were created by backspacing and overstriking two symbols together!
Apartment is one of those slinky computer/art thingies that you can play with and try to understand, but maybe you're better off just going with the flow. As you type sentences, the words are organized semantically into rooms in an apartment. I can't explain it any better than that, but if you try it, you see your words fly around and become something new. Cool.
This is one of those discoveries that starts with a simple email, and blossoms into a grotto of discovery. Jonathan Feinberg dropped me a note, and it turns out he works at IBM Research in Cambridge, where it seems I have at least a passing acquaintance with a quarter of the staff. Apartment is a previous project of his.
I've long disliked the electoral college system for voting for president. Yes, even before the 2000 election. But we don't have to go as far as the ridiculous (and misnamed) Common Sense Electoral College Reform. We don't even have to change the constitution of any of the rules it contains.
As I mentioned in yesterday's post, while at BloggerCon II, I was interviewed by Julie Flaherty, a reporter from the New York Times. This morning, I am the lead paragraph in her story on page C4 in the business section: Many Started Web Logs for Fun, but Bloggers Need Money, Too. Whee! Set your stopwatch for 15 minutes of fame!
She also included a link to the page. Maybe now I'll make $3 a day...
An online irony: The whole point of the story is that I make a few dollars a day off of my goofy card-folding page. The reason I do is that I place Google ads there. Google chooses online business card printer ads, naturally. The New York Times also uses Google ads on their stories. Because of the prominence Julie gave my story in her piece, the Google ads on her page are: online business card printers!
Yesterday I attended BloggerCon II in Cambridge. It was an interesting gathering. I didn't know quite what to expect, which was good, because the organizers didn't either. It isn't really a conference in the traditional sense. There are no presenters or panel, just a hundred or two attendees in a room, with a topic and a moderator, and then the discussion begins.
Dan Bricklin was there taking pictures, as he always does. One of the photos on that page is of a New York Times reporter interviewing me, but I am out of the frame!
I met lots of people, and there were lots of people I knew of that I didn't talk to.
I'm disappointed that I wasn't at an impromptu and poorly announced session led by John Perry Barlow.
In the end, I was a little underwhelmed, and I'm not yet sure why. Is it because I'm not a blogging-is-journalism, we're-going-to-change-the-world, power-to-the-people kind of blogger, but just a geek looking for ways to connect to others of my ilk? Maybe it's because blogging is inherently a personal endeavor, so a blogging conference is bound to be just a cocktail party writ large? Maybe it's because I had a head cold!
Dagfinn Reiersøl shows us the dark side of software patterns: "Hello world" in 160 lines of impeccably patterned PHP code: Hello World in Patterns. I once worked with a guy who could write code like that (except his didn't do as much)!
I guess grammar is in the air these days. Here's a twenty-question grammar quiz: How grammatically sound are you? I found this quiz disappointing on a number of levels (and before we get into it, I scored Master on it).
My home computer and some co-workers' computers have been hit with some pernicious adware: obnoxious pop-ups in Internet Explorer, displaying ads from belgiandip.com. Spybot didn't help get rid of it. (I didn't try AdAware until after I'd already dealt with it manually.)
I searched Google for "belgiandip" and found this suggestion. It seemed to help. Here's how to do what I did:
I've always considered myself a good writer on the technical aspects of grammar, spelling and the like. But Writing Exercises for Engineers and Scientists presented me with a few head-scratching moments. They present grammar as a tightly structured endeavor (for example, "The adverb 'therefore' cannot join two independent clauses"), which struck me as overly strict. Some of the sentences they presented as correct also seemed poorly constructed to me.
I'm not sure what to make of the whole thing. Are they out-dated prescriptivist grammarians with no sense of style? Or am I a sloppy writer losing touch with the basic rules of sentence structure?
I had told my twelve-year-old about the Atari 2600, and how I had played it when I was his age (more or less). I impressed him with stories of how primitive it was. He likes to compare current video game systems based on their graphic power, so I thought he would turn up his nose at the laughably crude 2600 games.
He downloaded an emulator, and we played some games together, and now he's a fan. He likes them because they have simple titles, and you know what they are about. We also had fun playing the games, without worrying about epic backstories ("or any storyline at all" says son).
If you want to go back even further, there were "video games" before the 2600: pong-story.com has tons of information about the Pleistocene era of video games.
Two animal-related links I came across tonight:
¶ the electric sheep screen-saver, cool distributed rendering screen saver
¶ The Heavyweight Sea Snail, a monster contraption for getting electricity from tides.
I thought I has blogged this before, but I haven't, so here it is: Stella is Rob Webb's astoundingly comprehensive polyhedron exploration application. Starting with an exhaustive list of polyhedra (including some I'd never heard of), he provides a mind-boggling array of operations to perform: dual, stellate, facet, augment. All aspects of the operations can be adjusted, then nets printed out to make models. If you have the time and the inclination, Stella provides an endless set of rabbit holes to explore.
How else would a determinedly geeky guy survive a trip to Ikea? By pretending it's an adventure game, and writing a detailed walkthrough:
This is a small thing, but it bugs me. I use Quicken to balance my checkbook. It remembers payees so that if you type the first few characters, it fills in the rest. But if there are two payees, one a prefix of the other, it chooses the longer one rather than the shorter one.
For example, I have both "AT+T" and "AT+T Wireless" in my remembered list. When I type "AT", it fills in with "AT+T Wireless". Shouldn't it choose the first entry in the list, and don't dictionary rules say that "AT+T" should come first? Is there a good reason for this behavior, or is my annoyance justified?
From my father-in-law:
Sue just reminded me of this old classic: Problem Solving Flowchart. Note: there are other versions that say "did you mess with it", but they're just missing the point.
You probably think you've already heard all the Windows noises (chord, beep, ding, etc), and that there's nothing more to hear. You're wrong: listen to Windows Noise Becomes Music. Using the Windows sound recorder to play back the built-in noises in different ways, and combining them together, he's created quite a musical composition. (I'd point to the author's own site, which has other cool Flash gizmos, but it has exceeded its bandwidth for the month.)
I've been trying out Python IDEs, and I really like Boa Constructor. It's got a usable GUI builder, and it seems solid. When I first tried it out over a year ago, it was neither usable nor solid, so it's made a lot of progress.
On the con side, still though:
Here's my dream: that all of the Python IDE energy out there could be focused on one project. For example, SPE (by Stani Michiels) is another Python IDE (which includes wxGlade, a GUI builder), and it is also showing a lot of promise. If we could get Stani and Riaan working together on one IDE, imagine where we could end up. Then maybe we can pull in Detlev Offenbach (Eric3) and Josiah Carlson (PyPE), and the sky's the limit!
I've managed alright with the CSS for this site, but I'm still just a Salieri-like beginner ("Why give me the desire, but not the skill?!?"). There's one bug on this site that I have not been able to squash. If there is a kind-hearted CSS guru out there who can help, I would be very grateful, and would be glad to trade services for the answer.
A few months back, I wrote about wanting a warning from C++, and not being able to get one. It happened again.
There's just no telling how some people will react. My autistic son is upset tonight, because the daylight is lasting longer. He keeps saying, "it will get dark", and "after different, it will get dark" (because we said, "it's different").
It isn't that he prefers it dark, far from it. Usually the onset of winter brings a mood change in him for the worse as the days get shorter. But the sudden change due to the clock shift is hard for him. Change is always hard for him, even when it is a change he'll welcome in the long run. Before he can appreciate the difference, he has to accept the difference, and different is very hard for him. We were eating dinner while it was still light out: not right. "It will get dark, it will get dark.."
I've mentioned SysInternals here before, but I've just become addicted to another of their tools, Process Explorer. It's like the Task Manager on steroids. Have you ever looked at your process list and found some mysterious process running, but didn't know why it was there? Process Explorer shows you all the information from Task Manager, plus the parent process relationships, the path, description, and command line (!) of the executable.
For each process, you can get performance information or chart, the list of threads, a list of environment variables, the security permissions, and a list of all the DLLs loaded by the process. For each thread, you can see CPU usage, and you can examine the running stack. It just goes on and on.
In a nice touch, you can set it to replace your Task Manager, and its system tray icon shows the same CPU monitor, but it turns yellow or red as the CPU load gets too high. Highly highly recommended.
No one really knows just what Orkut will be good for. Here's an Orkut hack that adds to the list of things it can do that may or may not be useful: GoOrkut Density Map. It plots people from Orkut on geographic maps, showing where all the geeks are concentrated.