Monday, June 18, 2007

That Contest I Didn't Win (But Could Have)

After an interminable wait, the OMGWTF contest results are in. It looks like I'll have to get my MacBook by buying one, because I sure didn't win the one in this contest. Though I did make it into the top twelve, and I got a great write up. That's something, for sure, and having people like Raymond Chen and Joel Spolsky actually read your code is an honor. I just wish I knew what they thought of it, because I didn't even get mentioned in the final decision. I like to think this quote, taken out of context, was prompted by my entry: “Joel said about “clever” solutions in general, “nobody told these people that pure OO design isn’t always the best way to write a given piece of code.”

It looks like the judge's choice for the contest winner was the most "believable" entry; it contains code that is strange, but strange in a way that you might actually see in a real project. Perhaps I overshot the mark then. My entry was pervertedly clever, but was a little too strange to be believable. I didn't expect to get the "crowd favorite" award either; that clearly belonged to the OMGOCR calculator. But last I checked, my entry was doing 1 percent worse on the polls than the votes for "None of the above!"

Despite the fact that Alex gave my entry a great write-up, there was quite a bit of material I wrote to him that he had to leave out of his article due to space limitations, and I've obtained his permission to post that material here. (Alex Papadimoulis is editor of www.worsethanfailure.com, the site which held the contest.) I've been too busy to blog for several weeks, but with the contest getting over, I figured I'd better make it snappy with this post before it became old news. Here is the full text of the conversation I had with Alex about my contest entry:

• Where did you grow up and where do you live now? Anything fun/interesting about these locations? Do you have any kids, family, etc?

I grew up in poverty. My father was a working class man at a time when the type of jobs he had grown up doing were leaving the US to go to third world countries. When I was young we moved all across the country, sometimes as much as four times a year, as my father searched for work. I've lived in or been to twenty-five of the fifty states; by the time I was in sixth grade I'd gone to more schools than grades. I've seen much but held on to little - we could never afford to ship anything with us when we moved, only what could fit into the trunk of a car. So when people ask me, where did I grow up, I... don't know what to say. I guess I grew up on the road.

When I was twelve, my parents moved for the last time. My father got a settlement on his social security disability and bought a tiny house in a very small town in rural western Oklahoma. After a lifetime of wanderlust, he is content to never move again. I emphasize with him; I too am sick to death of moving. But my journey is just beginning.

I could not stay in that small town. If you live in western Oklahoma, you will be a farmer, or a rancher, or work in the oil fields. There was no place for me there. When I was seventeen I joined the Marines for no other reason than to get away from the life I felt trapped in. I did not believe I would ever go to college. Growing up in a family with no money, I was raised to believe that it just wasn't in the cards for me.

I became a Small Computer Systems Specialist in the Marine Corps. I went to school in California and was stationed in Washington, D.C. (I loved D.C!) Working alongside civilians, I came to realize that the only difference between their opportunities and mine was the degree. I liked my job, working with computers, but I did not take well to military life. I also really wanted to be a programmer, but my duties only included network administration. If I went back to school, I could do what I really wanted to do, and be a civilian.

I could have gotten a tuition scholarship on academic merit without having to join the military, but that would not provide money to live on. After I got my honorable discharge, the G.I. Bill money enabled me go to college. I chose a small college (Southwestern Oklahoma State University) because it was close to where my family lives. Since then I've been blessed by many great opportunities. I got an internship writing business software, a summer fellowship doing undergraduate research in machine learning and robotics, and most recently I became the first student from a regional university to get a NASA internship. I also met the love of my life, Melissa, in college. We will be married next year, after I graduate. For the moment I'm living in Norman, Oklahoma, finishing the second summer of my undergraduate research program at the OU.

• When and why did you get into the field of computer programming? What college/university did you attend (if any)?

In elementary school, I got my first exposure to computers playing Commander Keen on my uncle's computer. I wanted to write my own games, but without a computer of my own I satiated my desire to program by performing thought experiments, trying to figure out from first principles alone the algorithm Commander Keen used to draw tiles and sprites.

It wasn't until I was twelve that I got my own computer. Someone gave me an Epson QX-10, which was an old 8-bit Z80 machine with 256K of RAM. It was older than DOS; instead, it ran CP/M. To put this in perspective, I was running CP/M on a Z80 while my schoolmates were running Windows 95 on 586 Pentiums. My cousin asked me if my computer was a dinosaur; I told her that it wasn't even that evolved, "more like a trilobyte computer!" I loved it though.

(This topic parallels something I recently wrote in my blog: http://dennisferron.blogspot.com/2007/05/phosphor-green.html )

Most people get their start in programming by learning BASIC. I've never met anyone else who learned to program in dBASE II. Unlike most 8 bit computers, my Epson did not come with BASIC. It did come with a scattering of business software disks, including the dBASE programmable database software, and a slim, friendly introduction to programming in dBASE script. We're talking a book less than 100 pages and a language that only let you have 80 integer variables - that's all I got. But it rocked my world. As I read about if-statements and loops and variable assignments, I did not so much learn the material as experience divine revelation. I wanted to shout it from the rooftops. I would read about an algorithm and shout, "Aha! Of course! THAT'S how it's done!" Everyone thought I was nuts.

There was literally not a single soul in my small school who was interested in programming, besides me. I learned to rely on myself to overcome problems and answer questions, because there just wasn't anyone else around to ask. You learn to be resourceful that way; a child can shirk responsibilty for hard problems onto the shoulders of an authority figure, but when it came to computers I was the highest authority I had. So if I ran into something I didn't understand how to fix, I went at it like a dog with a bone until I figured it out myself.

dBASE was ultimately too limiting a programming environment to write games on. Just as I was nearing the end of what I could do with dBASE, my uncle built me a 486 machine with Win95 to replace my Epson CP/M machine. On the Windows 95 CD, tucked away in an obscure folder, I found my next great love: QBASIC. If I could not get my friends interested in programming itself, I could get them interested in the games that can be written in QBASIC. It was shortly after discovering QBASIC on my own machine that the realization hit me that not only were the Gorillas and Nibbles games on the school computers written in QBASIC, they came in source code form. I spent countless hours at school hacking those two games which came on the school computers, and my friends actually enjoyed watching me program. I learned the uncommon skill of entertaining an audience while programming, which is something that has helped me immensely whenever I have given code reviews in my professional life today. I also learned to program while explain what I was doing to someone watching over my shoulder, and still to this day I write code as though I have someone watching, trying to understand what I am doing.

Since then I've had a passion for learning every computer language I can. I'm now studying for a bachelor's in Computer Science at Southwestern Oklahoma State University. At the risk of upsetting my professors, I have to say I haven't really learned anything in class that I hadn't already picked up before I came here. But what I have had is the wonderful opportunity to do internships and participate in research activities, and it was through my university that I was enabled to do this. And furthermore I stress the words in class because while I get nothing out of lectures, I have had classes which featured projects we had to do, and I certainly learned things after class while doing those projects.

• What is your job title and where do you work? How long have you been there?

I've never liked the generic term "student" for encompassing all of the things I do. This summer I'm a undergraduate researcher in machine learning and robotics at the University of Oklahoma. I'm also a .NET software developer for a great software company called CDF Associates, which I will be rejoining when I go back to my usual college in Weatherford this Fall. I'm in my second year with the research program and have been working off and on for CDFA since my sophmore year.

• How long have you been a reader of WTF? Have a favorite article/story? Submit any?


I've never submitted an article, but I've been a long time reader of the site. I seriously thought about submitting this story: a coworker of mine designed a new user interface for submitting data in a grid (a problem which has obviously never been solved before). The grid featured different colors for validated rows depending upon whether they were new, old, canceled, or "uncanceled". (The system had appointments you could cancel or undo cancellation on.) If you hit "OK," the form saves the data. If you hit "Cancel" he wanted it to ask, "Are you sure?" Apparently it was tongue-twister Friday that week because he came up with a slightly different way of phrasing the question. Here's the message box the application brings up if you hit cancel: "The rows which were uncancelled that are now cancelled are highlighted in white. The rows which were cancelled that are now uncancelled are now highlighted in gray. Are you sure you want to cancel the uncancelled rows and/or uncancel the cancelled rows?"

He couldn't understand what I found wrong with that. I told him to say it three times fast.

• What drew you to the OMGWTF contest?

I suppose you're looking for an answer that involves the recognition of my peers, the thrill of the competition, and infinite glory (or at least infinite ego). Nope. I did it for the Mac Book. Ever since I started this undergraduate research program, I've had an acute case of Mac envy, but can't afford one for the foreseeable future. Among computer science researchers, all the cool kids have Macs. In the lab we have mostly Linux machines, some Apple, and a few Windows computers - but we put those in last kind in a corner and do not speak of them. Sometimes we make the sign of the cross and throw garlic at them, just in case. Anyhow I noticed that with me on my Windows XP laptop (I'm such a hypocrite), and some of my friends on Linux and some on Mac OS, when it came to basic day-to-day use, the people using Mac OS would actually get everything done twice as fast as the rest of us. It gets points in the usability department, to be sure. But the most important factor is that carrying a Mac around will increase my "street cred" here in the AI lab.

• How did you come up with the idea?

I drew on a number of different sources. I've been thinking lately about the difference between static and dynamic typing, since I learned Ruby after being a C++/C# aficionado. The difference is in static typing variables have types and that determines the type of value it can hold, but in dynamic typing the importance of each is reversed - only values have types, so a variable just has the type of whatever it's holding. I have finally come to the conclusion that static typing is a false savings - it appears to be helpful but ultimately causes more work than it saves. To illustrate the ridiculousness of static typing, I imagined a fictional language in which not only is the integer a type, but every value of an integer is a different type from every other value. "Two" is a different type than "Three", and you cannot store a value of type "Three" into a value of type "Two". If you, good heavens, need to store both "2" and "3" into a variable, you must create a new class and multiply inherit from both "Two" and "Three".

When I saw the calculator contest, I realized it would be fun to try to simulate this situation in C++. Of course the trouble is that under normal circumstances the "petrified values" language I described wouldn't actually be useful. However, for some time I have been aware of the concept of template metaprograms in C++. See, it turns out that C++ templates are so complex that they are actually Turing complete! They can be used as a pure functional, recursive language that "runs" at compile time. Since templates act on types, it should be possible to write C++ templates which perform recursive programmatic functions on types. Instead of passing the value 2 to a normal function, I pass the type Two to a C++ template.

Which brings me to my next point. Although I didn't actually have to use any true template metaprograms in my code (my templates are similar to metaprograms, but not really), when I found out that template metaprograms were possible in C++, it brought a startling and abrupt end to my love affair with C++. You see, the cardinal rule of good software design is to implement the same feature only once. Once I learned of the existence of template metaprograms, I understood that C++ implements two Turing-complete languages. One language runs at run time (normal C++), and it is classified as an imperative language. The other language, templates, runs at compile time but is a pure functional language. Though they are locked in a perverse embrace, the two languages could not be more different from one another. It begs the question, why would you have one language that runs one time only (templates that run at compile time), and another language whose code runs every time? That was how I came to understand that templates are just a poor work-around for the real underlying problem: you only need templates because the static typing is too limiting. A language which uses dynamic types does not need templates because you can do operations on types at run time with the same language you use for other problems.

I could go on but I'll suffice it to say that I designed the calculator to be an example of what I think it wrong with inheritance and static typing, and I also wanted to push the boundaries of what is possible with the C++ language. For instance, in the project I actually invented a new kind of method dispatch which selects base functions by namespace with the aid of templates.

• How long did it take for you to develop?

I didn't find out about the contest until there was only a week to go, and by then I had already made plans to go away over the weekend. So I had to finish it in about four days. That's nothing. I was once assigned to a project which had been worked on by two other programmers for months. It was a calendar and scheduling service. When I inherited the project the other two programmers were reassigned and the boss told me I had two weeks to finish the project for them and ship it. I looked over the code and the forms but there was one thing I just couldn't understand.

Me: "Um, it's supposed to be a scheduler, right?"
Boss: "Sure!"
Me: "Well, I don't see any calendar in here, or any code that has to do with calendars or appointments..."
Boss: "Oh, I had them do administrative and maintenance forms until you got here. You know, all the icky support stuff. Don't worry! I have faith in you!"

Two weeks to go and the application had not one line of code that actually dealt with what the app was supposed to do! Egads. In two weeks - I had it done. Didn't sleep for days and my girlfriend thought I disappeared from the Earth, but I shipped it, baby!

(This is the same place I worked where I picked up the moniker Steely Eyed Code Slinger, which I used as the name of my blog. I talk more about what that means in this entry: http://dennisferron.blogspot.com/2007/03/new-blog.html)

• Were you inspired by any WTFs that you encountered in your professional programming?

I think I was inspired by as many of my own WTF's as other people's. I used to work with someone who came in to be the software architect for our team. He and I had several differences of opinion. Joel Spolsky talks about architecture astronauts; I'm here to tell you that the opposite can be a bad thing too! Yes, we had an architect that didn't believe in abstraction. Kind of like hiring a cowboy that doesn't ride horses. He criticized my code because I would solve a "2+2" problem by making an inheritance hierarchy seven levels deep in a modular class framework with dynamic loading and package management. Yet he went too far the opposite way - in his code every class lay at the same level, and he never reused anything. (Or... maybe he did! Is cut and paste reuse?) If we had 200 tables in a database, I would make one class that could handle every table. He would make a new class for each of the 200 tables. The key is that they differred only in types; the logic was the same. Although we had many arguments, I think that ultimately I benefitted from knowing him, perhaps more than he did from me. I do not know if he ever adopted any of my viewpoints, but I took his criticism of my methods seriously. He may not have seen things the same way as I did but he did have four times the years of experience as I have, and as I too gained more experience I came to see that proper use of abstraction is a balancing act. If you go too far in optimizing for abstraction, you may pay for it in the loss of simplicity or time.

That does not, however, mean that you can't do badly in every possible facet. My use of classes was narrow and deep (deep inheritance, but few classes at each level). His use of classes was broad and shallow (short inheritance, many classes at a level). The architecture of my calculator takes the worst of both our methods - it uses many more different classes than it should and inherits as deeply as possible. Instead of 1 x Height or Width x 1, a structure that is both deep and broad results a Height x Width rectangle! According to the garbage collector inside the calculator program, instantiating an object of type NinetyNine results in the instantiation of about 2700 other objects.

• What challenges did you face in creating your solution?

Once I started down the path I set out for myself with the initial ideas, it was very difficult to rein in the project and keep it under control so that I could finish on time. At first I put in ideas as soon as I came up with them, but when I reached the halfway point I knew that I needed to turn around and swim back for shore (to wrap up the architecture I started), and sometimes I was afraid I'd gone too far and wouldn't be able to pull it off. I started out with a number of ideas that, based on what I know about the C++ type system and templates, I was pretty sure would work, but there is always the possibility of a devil in the details that keeps things from coming together. There were a couple of sticking points where I was out in uncharted territory. For instance, I decided to implement the calculator state machine using multiple inheritance, with each base class of the calculator corresponding to a different state. The function names would be the same; different implementations of the same name would just come from multiple bases. I thought that by casting the "this" pointer to a different base class, I could choose which one would be called. Like virtual functions in reverse. I cannot remember now why that didn't work - something to do with having a pointer an object under the disguise of one base class not necessarily meaning that the compiler knows how to cast that to another pointer to a different base of the same object. Information gets lost in the translation that you can't get back. So I had this brilliant state machine implementation - only problem was, it didn't actually work, due to a small detail. I was able to solve it, though. Instead of casting the "this" pointer to a new type, I pass the buck to a call-back proxy, which is a template class. This way I can store the type of the base class in the form of the specific type of callback object I create. The callback object then calls a template function on my calculator with the original T type argument it was instantiated with. And inside my template function, I have code that reads T::some_func() where "T" is a class. So if you have a state callback object which was instantiated with type "Cleared", you will get Cleared::some_func() ("T" is replaced by "Cleared", literally) but if it is state "Enter1stNumber" then T will be literally replaced with Enter1stNumber to make Enter1stNumber::some_func(). Thus it selects which base class to call some_func() for. That's an example of the kind of thing I had to solve to pull this off.

• Would you replace calc.exe on Windows with your calculator?

Absolutely. During the testing of my program, I compared my program's results to the results calc.exe produces. In the process I found an obscure bug which calc.exe has but which my program does NOT! Yes, the Windows calculator is buggier than a WTF entry. You heard it from me first.

P.S. Let me know if you'd like a WTF sticker.

Yes I would like one, thanks.

Thursday, May 24, 2007

Phosphor Green

My first computer was an Epson QX-10 (see it here too). I was 12 when I got it, back in 1995, and it was already ancient then. It wasn't a PC compatible, and did not even run DOS. Instead, it ran something that predated DOS, an older operating system called CP/M. With its simple CP/M software and elegantly straightforward 8 bit Z-80 hardware, in a cute chassis, it meant to me what old Apple computers must have meant to their owners. The QX-10 was the last, best 8-bit home computer.

I spent many months in the cool glow of its green monochrome screen, learning to program. Gosh I loved that computer. At first I used my electronics skills to keep it running, but when it finally deteriorated past the point of my ability to repair it, I am ashamed to say I cannibalized it for parts. Like Shel Silverstein's story of The Giving Tree, where a boy cuts from his favorite childhood tree until all that's left of it is a sad stump, I chopped pieces from the computer to build other projects, until there was nothing left. When I was 12 it seemed impossible that anyone could understand the entire workings of such a complicated device; now at 23, with much greater electronics experience, I look back and realize that I could keep such a simple computer in repair forever, if only I had left it intact. The only thing I still have from it is a 3 inch long piece of black plastic and silicon - the Z-80 CPU that was at the heart of the system.

Nostalgic Apple II owners and Commodore 64 enthusiasts can now download emulators of their old systems, but no one ever made an Epson QX-10 emulator. I suppose it just wasn't a common enough system.

However, while perusing a computer museum site, Dave's Old Computers, I found he has CP/M emulators (scroll to the very bottom of the page). I always thought that a CP/M program would be for CP/M on a QX-10, or CP/M on a Kaypro, etc. In other words, since CP/M runs on many different computers, I assumed that the programs would need to be both written for CP/M and be for that particular type of computer. But it seems that any CP/M computer can run a program for any other CP/M computer, at least as long as both computers use the Z-80 processor. So even though it might not be emulating the QX-10 per se, it seems to run the programs anyhow.

With emulators in hand, I went looking for CP/M software. I found the CP/M Commercial Software Archive, which even has a version of dBASE II, the environment I first learned to program on. I was disappointed that I couldn't find Valdocs in their downloads section. Although it was written years before Microsoft Office was ever thought of, I could do anything with Valdocs that you can do today with Word and Excel, and I often got compliments on how nice my homework assignments looked when I did them with Valdocs. I kept many of my old disks, but in agreement with Murphy's law, it happened that the disks I still have are mostly blank or worthless, while important ones, such as my own copies of the Valdocs disks, are all missing.

There's still a surprising amount of CP/M software around. The Unofficial CP/M Web Site even includes source code downloads. By far the most eyebrow-raising download of all is option to download the entire source code for the CP/M operating system itself! There is also a "mostly finished" version 3 of CP/M which was being written for the Motorola 68000 processor. The nice thing about this version is that the source code is in C, so it could be compiled for something other than the 68000 as well; one of these days I would like to try taking that C code and porting it to another computer. That would be fun.

Communications

I have a story that makes people's cell phones ring.

It isn't even a very important story. Just one of those stories that begins, "so, something interesting happened to me today on the way to your house..."

Except that I can't get any farther than that line without my listener's cell phone interrupting the conversation. I am in mid-sentence; her cell phone rings, and I wait patiently for her to finish talking to the random caller. "Sorry, what were you saying?" So I begin again; but I don't get any farther than I did the first time, when her phone rings again. It's the original caller, who thought of something she forgot to say before she hung up. I wait again, but it's no use. The second call does not even finish before a third call comes in.

This has become so commonplace that it wasn't until the second time I tried to tell the same short story, to a different friend, at another house, when I once again could not tell the story because of phone interruptions, that it even occurred to me to be upset over this treatment! If everyone does it, is it still rude?

My fiancee is infamous among our friends for never answering her cell phone. But I never get mad at her when I can't get through. "I'm not a slave to my phone," she says. Damn straight.

I'd still rather people tried to reach me by phone than email. Oh, how I hate email. I check my email twice a week; inevitably I find my inbox stuffed with frantic messages because one professor or another has some urgent business and has to reach me right away, and they've gotten themselves all in a tizzy because they can't understand why I haven't replied to their emails in two days. I want to say to them, "Hello? It's called the telephone? Ever heard of it?"

I met an old-timer at NASA who shares my astonishment that people put so much stock in email. He illustrates his point with a hypothetical question:

"Suppose I told you that you've won $10,000. All you have to do to claim your prize is get in touch with me by the end of the day. What would you do?"

"I'd call you."

"You wouldn't email me?"

"No."

He then poses the same scenario over again, but lowers the amount in question each time. Most people draw the line at $50. When $50 is at stake, an email will suffice. But for larger amounts, people want that assurance that they got through. The difference between a phone call and an email is that if you physically talk to someone on the phone, you know they got your message. "So why," he asks, "Do people conduct important business deals, over a medium they don't trust further than $50? It's insanity."

You expect this sort of thing from the older generation; but I am a young person, and I agree with him!

Monday, May 14, 2007

Programming Contest

I've had Mac-envy ever since I started my undergraduate research program last summer. That's where I learned that Macbooks are what the real computer geeks are all carrying now; all the cool kids have one.

They are, unfortunately, out of my meager price range; so when one of my favorite websites announced a programming contest, the offerred grand prize really made me take notice: A shiny new Mac Book Pro!

I looked at the contest rules and thought, "I can do that!" Given that the site is very popular, I'm sure that I'll be competing against a large number of other contestants. But the contest is in C++, and I'm at the top of my game right now, having just wrapped up a very challenging C++ program for NASA last month. My brain is still in "C++ mode," so I dived in with both feet (well, both hands really; it's hard to type with your feet). I've been coding like a madman all week, pulling out all the stops, exploiting every C++ trick I know up to the hilt. I finished the submission just a few minutes ago, and had to blow on my hands because my fingers were smoking. We're talking serious hacking here, three cups of espresso and a bottle of aspirin and go! go! go! Yeah baby.

So... I submitted it. All there is to do now is wait and see if they like it. I hope so; I don't need any validation as a programmer but I really, really want that MacBook. Wish me luck!

Saturday, May 12, 2007

How I Decide What Level to Write at

When writing about complicated subjects, it's difficult to maintain a balance between giving enough depth to make the topic interesting, and glossing over some details to make the article easy to read. Some advice on the subject boils down to targeting your writing to the lowest common denominator - dumbing it down, if you will, but in a good way. Yet I don't think this is the right approach for a blog with a technical focus. I'm not writing this blog for everyone; I'm writing it because I think reasonably intelligent people will enjoy reading it.

So what I actually do is that when I write a sentence or paragraph, I ask myself whether it would make sense to an overwise intelligent reader at 2:00 in the morning, who is tired and not thinking clearly, but who likes to stay up sometimes and read blogs. I figure if that person can at least make sense of it, then the cognitive effort required to read the words is low enough for anyone else to cruise smoothly over the page. It is not hard for me to put myself in that person's shoes, since I only write blog entries at 2:00 in the morning, when I am tired and not thinking clearly.

Tuesday, May 8, 2007

Offline Blogging

I'm writing this blog entry offline.

When I first moved in, my professor warned me that he didn't think the signal from his wireless router reached the far bedroom in which I'm staying. “That's ok,” I said, “I'm getting 2 bars; not great but it's a usable signal.”

After I'd been using the network for a few days, I happened to mention to him that I'm getting horribly slow speeds on his “linksys” wireless network. “I don't have a Linksys router,” he said. “What?” I asked. “I don't have a Linksys router. I have a D-Link router.” “But... then how... who...” “You must be getting a neighbor's signal.” “Ah. I see.”

Since my connection to a neighbor's internet was both unreliable and slow, I would much rather be on my professor's cable modem connection. I was pretty sure the lack of a signal from his router was a configuration issue rather than a signal limitation, so I went to go check the configuration. At this time it was well after midnight, and not wanting to disturb my professor's sleep, I resolved to hack into the router rather than wake him up and ask him for the password.

In the pitch-black living room, I used the light of my laptop screen to illuminate the mess of cables around his router and cable modem. I'd have to have a copper hard-link until I got the wireless working. I found a spare ethernet port on the router and plugged myself in. Turn on DHCP... then run ipconfig, good: it gave me an ip address. Now that I had a link, I needed to access the router's configuration page. Nine times out of ten, the ip address of a router is 192.168.1.1. I opened up my Firefox web browser and typed in that address. It popped up and asked me for a username and password. So far so good – I wasn't in yet, but at least I knew there is a router at that address.

I never get discouraged when I see a dialog for a password and I don't know it, because I've learned a few very simple facts: 1. most users never change the default passwords, 2. default passwords are remarkably easy to guess. Besides, I had a gut feeling the login would be “admin/admin.”

That brought up the router configuration page. Now, to check the “wireless” section. I clicked on it, but instead of any configuration options, I was treated to this helpful message: ~!@ #$%^ &*()_

The software that is loaded on home network appliances has never been particularly well-written, but lately it has been getting even worse. In this case, the router's configuration software is so badly broken, that it returns a page containing random binary garbage, instead of the wireless configuration page.

Upgrading the firmware on the router to fix this problem would be more work and more intrusive than my original intentions, so I prepared to give up for the night. Then I noticed that the color scheme of the configuration page was purple and grey, rather than the blue and grey D-Link would use. Guess which router company favors puple over blue? Yep, Linksys. I missed the Linksys logo when I first logged in because their broken software just loads an empty image box where their logo goes. But a quick check of the ip addresses on my interfaces showed my error: I should have been on 192.168.0.x if I wanted to connect over my copper ethernet. What I used, 192.168.1.x, was my wireless interface. Darn it, I broke into the wrong router. Sorry neighbor dude! How embarassing – like walking into the Women's bathroom by mistake.

With the correct IP address in my browser, I got to another login screen, this time for the D-Link router. “Admin/admin” didn't work here. Hmmm... maybe, “administrator/password”? Nope. I tried a few more obvious combinations and failed. Time to back up and think about this analytically. Now I know that most login systems don't allow blank passwords, but some do. So perhaps I had been overthinking it. Had I failed to guess the password simply because there wasn't any? Indeed. “Admin/[blank]” worked like a charm.

Once I got into the right router, the only thing I could see that might be wrong was that WEP encryption was enabled. Considering that the router login was admin with a blank password, I highly doubted my professor had been in these configuration pages at all, so I don't think he deliberately enabled WEP. While I would be taking off a layer of security by turning off WEP encryption, if neither he nor I could access his wireless network at all, than the WEP security was clearly not doing any good. As bad as it is to have your wireless network unsecured, WEP has caused me nothing but trouble. Every time I try to use it to secure a network, I've had to turn it back off again because half of the computers I want to connect, can't.

With WEP turned off, the wireless network began working again. Still no internet. Why not?

At this point it's best to approach the problem in stages. Can I ping my own address? Good. Can I ping the router? Good. Can I ping http://www.google.com/? No. What's between the router and google? Ah, yes, the cable modem. Cable modems are notorious for crashing and needing to be rebooted, so naturally they are designed without an accessible reset button and with no on/off switch to power cycle them. How hard would it have been to put a watch-dog timer in the hardware that reboots the modem if it can't ping out? These devices are designed with the assumption that nothing will go wrong. If these companies would admit to themselves that software is inherently unreliable, it would be the first step to making devices that are reliable.

I unplugged the router and waited five seconds before plugging it in. Instead of connecting me to the internet, the router flashed its power and link lights over and over. What the heck does that mean? Turning it off and on again did not stop the flashing. Hmm... If the router has a configuration page, surely the cable modem has one too. How to access it? In the router configuration page, the local network is 192.168.0.x; but the outside network is 192.168.100.x. If that is the network the router is using to talk to the cable modem, that would put the cable modem at 192.168.100.1.

The cable modem didn't require a password, because it doesn't have any user-changeable options. It does show status though. It said “LAN: Up” “USB: Down” (no USB is plugged in) and “CABLE: Down”. Bummer. The modem's event log page had more bad news: “DHCP failed” “Timing Sync Failure” “Failed to receive....” “Failed to receive...” (In other words, the cable modem's not getting any response from the cable company.)

Well, fiddlesticks. After all that, I still have no internet.

It turned out that the cable company was having technical problems; cable internet service was down in the entire area for nearly 24 hours.

Thursday, May 3, 2007

Giant Mackerel Gets Married

Lent is a time when Catholics try to identify something in their lives that is a bad habit, and sacrifice it for a month. I gave up Reddit.com for Lent. Actually, what I gave up was wasting time on the internet. I'm not sure there's a distinction.

It didn't go so well. I think I ended up reading Reddit more when I was trying not to, than I ever did before or since the Lenten period. At one point I reached Reddit link number #999. That's like sitting down to eat a few Cheetos, and ending up eating a whole bag instead of dinner.

It seems that all bad habits share a common feature - they involve consequences such that one might decide a priori that the activity is not worthwhile, but when broken down into pieces, each infinitesimal step does not entail enough harm to cause someone to stop. One more potato chip, one more cigarette (thank God I don't smoke), reading one more Reddit article - I used to think this kind of procrastination was my own peculiar personality flaw. I'm beginning to realize I'm not as alone in this as I thought.

In a remarkable expression of candid self-awareness, one of the founders of Reddit blogs about this very problem. In that well-written post, Aaron Swartz characterizes the basic problem: people might rather do things more substantial with their time, but "reading bite-sized blog posts is by far easier," and "looking at photos of sunsets or reading one-liners takes no cognitive effort."

I took a Bioinformatics class last year that was co-taught by professors from computer science and biology. The biology professor wanted to underscore the importance of the discovery of DNA, or perhaps just had a chip on his shoulder; he took pleasure in baiting the minority of computer science students in the class by telling us that the invention of the computer is nothing, completely irrelevant, compared to the enormity of the discovery of DNA and genetic engineering, and that we should all stop studying computers and study biology instead. Rather than let him irritate me, I only smiled - because it is laughable that he would say this, while not realizing his whole syllabus relies on a third technology which eclipses both in significance: the web.

So what do we do with the greatest invention of all time? What are we using the internet for? If you have Ruby (a computer language) installed on your computer, I can save you the trouble of reading 999 reddit links to find out. This Ruby program (from my Downloads page) rips every current reddit title and runs a modified Markov learning algorithm on the titles. Then it uses what it learned to generate sample titles in reddit "style". What results is a hilarious mis-mash. I'll leave you with a few of the most interesting tidbits it generated (these are machine-generated; I didn't make these up):

Giant Mackerel Gets Married
Giant Mackerel Gets Even Creepier
Baby Marmosets Are To Analyze Software Patents
Cockatoo Guarding Chocolate Good, Morbid Obesity Soaring
Even worse than one peep jousting: Two peeps
Anarchy On Sudafed Claims First Free Gps
Extreme D.I.Y. - Solitaire
Doomsday For How Blogging Can Die Of Education
Reddit Users To Prevent Manatee Deaths? Prevent Manatees!
Ask Reddit: what modern world?
I Read Reddit Users Are Small. [pic] This Pathetic Story
Anatomy Of Yoda [photo]
sex-mad? Mabye. Obsessed? With Chainsaw Could possibly be stopped
Grindhouse: Good movie or faked orgasm?