Thursday, November 8, 2007
I noticed that web pages were taking a long time to load, which is strange since my cable internet is normally very fast. Then my laptop's wireless connection to my router
started dropping out within seconds every time it reconnected.
I opened my site monitor and found that new non-broadcasting wireless networks were suddenly popping up on channels 1 and 11, and the strongest one was on the same channel as my router. Though my connection kept dropping out, I managed to connect to the admin page on my router long enough to move it to channel 6. It's not a good idea to use the wireless network to do router configuration, but I wasn't too worried about someone spying on my router password out of my packets because I run WPA-2 encryption.
After I moved to 6, someone opened a new nonbroadcasting network on channel 8! Usually, 1-6-11 are the three channels used. These are chosen because they are as far apart as you can get; the intermediate channels interfere slightly with each other. It is possible that someone might choose 8 knowing that it would interfere with my 6. I thought, "they're trying to squeeze me out."
Haha, they don't know who they're messing with. I went into my router again and this time I sliced my broadcast power down as low as it would go: 3 percent.
You might think, that if you are in a wifi jamming war, you would want to make your signal as strong as possible. That's brute force thinking. The Zen way to beat them is to make it so they don't know your signal is there at all. A signal that is too strong is a common security risk for wifi networks; if you instead use only the minimum signal you can get by with, you reduce the chances of someone eavesdropping on your signal from far away. By setting my broadcast signal so low, hardly any of it spills outside the walls of my house.
Once I had the signal turned down so that my jammer couldn't see my network, I switched channels one last time - from 6 down to 5, so that it would both be farter from 8, and odd instead of even (if that matters -?). Though my 3% signal only gets two bars on my meter, it still runs at the full 54 MBps, and I haven't been knocked offline since.
Friday, November 2, 2007
I wasted no time in opening up the work computer that had been scrambled by the power surge, and I set the jumper to clear the CMOS. When the procedure was finished, the computer magically came back to life.
Later that day I got to thinking... Isn't it strange, I told myself, that the computer at work which I fixed by clearing the CMOS had exactly the same symptoms as my dead motherboard at home. For some reason, though I instantly knew to clear the CMOS on the work computer, when my home computer had had the same problem, it had not even occurred to me to check that!
My computer has been dead for a month while I struggled to find the time to set up a new motherboard and hard drive with it. I pulled my old motherboard out of the trash and set the jumper to clear the CMOS. I had already parted out all the pieces of the computer that the motherboard went in; I would feel like a fool if a 2 minute procedure could have saved that computer. "If this works, I'm won't know whether to be happy or pissed at myself."
I cleared the CMOS. The motherboard, which I had thrown away, the loss of which had thrown me off work and gaming for a month - the motherboard worked.
Wednesday, October 10, 2007
I came to regret having wasted the space on my external drive, so a few weeks ago I prepared to clear off the drive and repartition it. But before I could start, the motherboard in my desktop was killed by a runaway power supply.
Between my junk box and donations from friends, I was able to gather a booty of no less than eight replacement motherboards, each of dubious origin and doubtful reliability.
Three motherboards evidenced fire damage; they had been toasted before I ever got them.
One motherboard worked, but only with a goofy old style of RAM and not with my fastest processor.
One went into nuclear meltdown in my lap.
Two more simply did nothing at all.
I saved the best one for last. With its beautiful silver coating and more features than even I will use, this motherboard was obviously targetted at gamers and custom system builders. The only caveat was that it dated from a couple years earlier than my old motherboard, so it would run my processor, but not as fast as the recently deceased board had. But it was the best candidate, and it was new in the box. Could it be, could this one actually work? My heart was in my throat as I connected the cables.
Anticlimax. Pack up and go home.
I don't think so. This motherboard, I mean you could just look at it, and you'd just know, it was too damn pretty to not work. Like seeing a shiny Corvette on the showroom floor and being told it doesn't run. Doesn't add up, does it?
When I get stuck, I try to put my problem in the larger context of the situation as a whole. So... This motherboard had to come from somewhere. I didn't know its history but I do know that someone had taken this expensive new motherboard and thrown it away. Now what would cause someone to do that? Maybe they bought it and it didn't work. I refuse to accept that it doesn't work. Then - what could cause someone to think their motherboard doesn't work?
And the antidote to user error? RTFM. It stands for "Read the F--king Manual," and it's good advice.
In the manual for the motherboard I found that a jumper was incorrectly stuck on where the power switch belongs. That's like holding the button in all the time; it won't turn on until you let go. Furthermore the presence of the jumper had led me to put the real power switch onto the wrong place. Someone had stuck a jumper where it didn't belong and the motherboard was just wired permanently off. I removed the jumper, and the system booted; it seems the original owner threw out something worth $200 rather than open a book and read about it.
Now we come to the foresight I alluded to in my title. Obviously I could not really have known ahead of time, but I might as well have. It turned out that my little Linux partition on my external storage drive was worthwhile anyhow. The hard drive I'd been using with my old motherboard was SATA, but my replacement motherboard doesn't have SATA. It meant that I couldn't boot the hard drive that had my operating system on it. Instead, I had to gut my external storage drive to get a P-ATA drive that would work with the replacement motherboard. And on the drive, there was the preinstalled Ubuntu partition, working just as well now that it is inside my computer as it did when it was outside in the USB enclosure. So I have an operating system for my computer after all.
Friday, July 27, 2007
Monday, July 16, 2007
That's my brother riding it in this picture. It was a 1962 Huffy; an English bicycle with a 3-speed hub. Completely irreplaceable - a collector's item these days. I liked it because I hate dérailleurs; with a 3-speed hub there's no chain derailing and you can change gears at any time, even at a dead stop. Despite half a century of age and neglect, the bicycle was in perfect working order. It had brand-new tires and I'd just installed all new cables.
I actually noticed the chain out of place a second before I put two and two together: "Hmmm... If I'm holding the chain... and the chain is broken... and it was on my bicycle last night... and today it was on the ground... Holy Crap! WHERE'S ME BICYCLE?"
It's a strange feeling one gets at this moment of realization. It reminded me of when I was three and let go of my balloon on accident. As I watched it disappear into the sky, I somehow understood that there was nothing that could be done to retrieve it. Something ought to be done - yet nothing could be done.
You let go of your balloon - it goes up and away. Simple physics. You leave your bicycle chained outside in a neighborhood of juvenile delinquents - it gets vandalized. Cause and effect.
Wednesday, July 11, 2007
But it's more fun to attack the bad ones.
By far the worst presentation I saw was blue text on a lime green background. In ALL CAPS. Incredible. It was so bad, I couldn't look away. It was like a cheesy horror movie. I can't remember at all what the research was about, but I was so fascinated by the abomination that I just had to make a spoof of it. See it for yourself.
Oh but it wasn't just the slides; his presentation style was... unique. Picture this: this guy loads his slides up on the projector and you can tell from his title page that it's going to be a terrible presentation. He steps out in front of the crowd, and says... nothing. He looks at us through round coke-bottle glasses a gives that deer-in-the-headlights look that only public speaking can inspire. (Did you know some people fear public speaking more than death?)
So this poor guy steps out and just looks at us for two minutes and I'm thinking, poor fellow, he's going to die of pure fright right there in front of me. When he finally spoke it was barely more than a mumble through the whole presentation.
A different presentation that struck me as funny was not bad in the usual sense, in fact it was a polished presentation and the speaker was well-practiced. Problem was, it didn't look like a research talk. It looked like a coporate motivational presentation. Straight out of Dilbert. "In order to maximize your profits, you want to minimize your costs and maximize your revenues!" Complete with a histrogram showing costs that are down and revenues that are up, but the chart doesn't mean anything because there is no Y-axis and no units! It was also full of motivationally meaningless phrases like, "The future is tomorrow's now!" and "Today is yesterday's tomorrow!"
That presentation was supposedly about data mining - stick to your subject, please!
Another presentation was about the effectiveness of a new teaching method. This was a good presentation but here I consider the work itself questionable. The researcher gave a pre-test to a student on a subject they were doing badly in, spent one hour tutoring the student, and then administered a post test. Naturally the students did better. Based on this data, the researcher declared the teaching method a resounding success.
Wait, no way. How is this science? Setting aside the issue that he has hand selected his subjects (it is not random) the form of the experiment is also bad. He has an experiment with a variable but no control. I suppose he thinks the pre-test is a control. That's not a control, it's your baseline for your measurements. A control would have been to administer the pre-test and post-test with one hour in between in which you did nothing. Or to compare it to doing the pre-test and post-test with a different tutoring method for one hour. Only then can you get a real comparative analysis.
I told the presenter I personally liked his teaching method, but I can't consider it objectively if he doesn't compare it to anything else. He said that in all of the previous literature, the other researchers in this field are doing what he does - comparing pre-test and post-test only for their own method.
In other words, it's ok because everyone is doing it.
(How much science would a scientist chuck if a scientist could chuck science?)
Some other things I found hilariously bad in other presentations:
- Slide transitions that make it take ten seconds for everything to finish. The speaker is trying to make her point but words are flying around like helicopters.
- Talking with your hands in your pockets. Good: you don't wave your hands around like a madman. Bad: Makes you look sheepish. "Ah gee shucks Mr. Wilson, I didn't mean nuthin' by it."
- Getting defensive over questions. The moment you get defensive, you've lost all credibility with the audience.
Tuesday, July 10, 2007
There is something odd about this conference.
I showed up Monday morning bright and early to check in for the conference right on time. I arrived to find nothing set up, and a sole conference organizer surrounded by unopened boxes. He told me "it was hot" so he "didn't feel like unpacking the registration materials." Come back later, he said.
It was on my way out of the room that I noticed the conference sign was written in magic marker. Like a lemonade stand.
To kill time I ate a continental breakfast in the hotel diner. Everything was stale. Usually continental breakfasts - especially at conferences - are complimentary; this one cost $4.70.
I was more concerned whether or not there was salmonella on the week-old boiled eggs.
I came back and registered for the conference. If you didn't have a receipt, they gave you a bank account number where you could transfer $ to attend the first day; when you find your receipt, they promised to refund your extra payment. But it was abundantly clear that it was very important that they get payment, and they wouldn't complain if someone wanted to pay twice.
Luckily I had my receipt, and a transcript of an email with Prof. J E which documented that I would be presenting a paper for my colleague. I was never to meet the mysterious JE, but I did get in to the conference with no trouble.
This is my first conference so I didn't know what to expect, but I was sure that I could expect a printed copy of the proceedings - that is, a printed schedule and a book containing all of the papers submitted to the conference. I got no such item. They gave us a CD, with the conference proceedings on it. Ok, this is the 21st century, I can dig this. Paper is dead. Long live digital media! Yet... it seems somehow an insult to hand us a mere CD when we were promised a book. Like they couldn't be bothered to print it out for us. What about a schedule? - they didn't even print that. It is a pain to pull out your laptop every time you want to know what's happening next, and I wanted to circle the talks I wanted to attend. You can't (easily) do this with a PDF.
The conference organizer (J E) did not show up; there was no explanation.
At least the rest of the proceedings began innocently enough. We had a guest speech called Forty Years in the Software Trenches. I love hearing stories about the early days of computing, and this guy's been around since the days of punch cards.
After the speech, BP, the assistant organizer, popped in to say that it was break time, and that there would be free breakfast food during the break times. (I'd just paid for breakfast. D'Oh!) I asked him if we could get our money back if the hotel erroneously charged us - he said, "Next time, if you're not so hungry, you can just wait until break time!"
I took break; what the heck, might as well snack again, since it's free. I loaded my plate with some petrified cinnamon buns and the archeological remains of a danish. "That'll be $4.70" I thought it was free! "No, not this - that. Only that side. The conference organizers only paid for what's on that side." D'Oh!
What was on "that side" of the buffet was: ice water, burnt cookies, and stale tortilla chips. Breakfast of champions, yes?
I considered coffee, but I'd made some in my room this morning. Good thing. A.B., from Tunisia, approached the coffee percolator. A hotel staff physically blocked her, dashing to place his body between her the percolator just as she reached for the spigot. "Can't have that," he said. WTF? "The conference organizers didn't want to pay for you guys to have coffee. So you can't have any. You can only have the ice water or the coke." (A fellow attendee later informed me that even the coke was cut with a great deal of water to make it go farther.)
AB and I sat at the same table and during the break discussed our disappointment in some aspects of the way the conference had been organized. BP, who you will remember was the assistant organizer, asked if he could join our discussion. I felt a little sheepish - had he heard us? - but AB took the opportunity to confront him (tactfully). "No coffee allowed at the coffee break? I never heard of such a thing!" she said. BP said, "No you see, different people have different tastes, yes? And you can't please everyone. So really, we can only give water." Amil said, "Yes, but no coffee? I've been to conferences in many countries, and this is the first I've seen that." BP said, "Yes but you see... in other countries, they are more hospitable. They are not so hospitable in America. So you see we cannot provide coffee."
Huh? That doesn't even make sense.
This wasn't getting anywhere, so I asked him my question: "You know, I was disappointed to not receive any printed proceedings, or a schedule." BP had a justification for everything: "Yes but you see this is better, because this way you can print out just what you want. You can go on the CD, you see, and click click click and get right to the paper you want to see."
Thanks. I know how a document on a CD works.
AB said to him, "Wait, he's got a point! Some of us don't even have our laptops here. How are we supposed to review the papers before the talks? It's not like you provided a PC available for us to use to at least view the CD." BP went on the offensive now: "Well I went to a conference in India and there they told us to bring our own laptops and I am not responsible if you didn't bring your own laptop. So you see it is really your own fault that you don't have your laptop with you." Amil countered, "But the rules for this conference don't say to bring your own computer!" BP had his story and stuck to it: "It is your fault!" he declared, "And as for us providing you a computer to view it on, that is not our fault either, ha ha, it's not like we can force the hotel to provide you with a PC."
Huh? Strange logic, these Indians have.
The content of the presentations varied widely in both quality and topic. There seemed to be no rhyme or reason to the selection criteria for papers.
There is a common scam involving books of poetry, in which gullible young writers are led to believe that their poetry is so good that a publisher wants to include it in their next book. Anyone will be accepted; as long as they buy a copy of the book. The book is expensive.
The basic concept appears over and over - short story contests, the who's who of students, etc. Might someone do that with a conference? Might someone have done that with this research conference? I haven't a bloody clue.
But I do know this: if they had, they would have made $400 - $800 off every person here.
Honestly this conference is not really a scam. It would be better to say that: it borders on scandalous. Hopefully the conference organizers learn to do better next time, and I know all of us attendees have learned an important lesson about being selective where we publish.
Monday, July 9, 2007
I’m flying to
Airport security, however, is one of the things I do not enjoy about traveling. The process of checking in through airport security gets more odious and invasive every year. I’ve traveled through many airports while I was in the Marines, but it has been many years since the last time I flew. I wasn’t sure what new pointless rules would have been added in my long hiatus from travel, but I knew to expect a sour experience.
As I stood in line waiting to go through the metal detector, it occurred to me that we didn’t feel the same way we feel when about to board a bus or standing in line to enter a public place. This was more like prisoners standing in line waiting for punishment. Why don’t they just make us strip naked and throw delousing powder over us like the scene at the beginning of the Shawshank Redemption.
After searching my bag the security guard informs me that my toothpaste, hair crème, and shaving cream are potentially dangerous chemicals and that I will only be allowed to take one of them with me, and in a quantity no greater than 3 ounces. And it has to be in a plastic bag. He kindly offered to escort me back out of security, so that I can go home and retrieve a plastic bag to carry my three ounces of the gel of my choice. And miss my flight.
And miss my flight.
I’m beginning to think there might be a market for 3 ounce bottles of combination shaving gel and hair crème that tastes like toothpaste.
If they are afraid of allowing these things on the plane, why allow 3 ounces of it? Why not just ban it? Nevermind that I can’t imagine what one could do wrong with these. Perhaps they are afraid I will shave the pilot, or give a pretty flight attendant a permanent bad hair day with my hair crème. I can’t even speculate what good the plastic bag does.
Monday, June 18, 2007
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?
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)?
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
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?
• 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?
• How did you come up with the idea?
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?
Me: "Um, it's supposed to be a scheduler, right?"
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
• Were you inspired by any WTFs that you encountered in your professional programming?
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?
• Would you replace calc.exe on Windows with your calculator?
P.S. Let me know if you'd like a WTF sticker.
Thursday, May 24, 2007
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.
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?"
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
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
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
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
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?
Wednesday, April 25, 2007
As a college student, this happens to me three times a year; the transitions of the fall, spring, and summer semesters drive also the availability of housing for college students. Whether it be the dorm kicking everyone out for two weeks between semesters, or campus apartments unwilling to extend a summer lease past August 9th when I can't move into fall housing until August 23rd, the gaps between semesters are not a vacation but a hardship for those of us who don't have anywhere else to go during those times. My parents would be willing to take me in, but they have such a small house that there isn't a bed for me to sleep on there. So in the interim weeks between semesters I become a modern gypsy, taking my car from place to place and staying with friends until my welcome runs out.
This semester is not too bad. One of my professors has kindly allowed me the use of his spare room, and we get along well. I am experiencing no physical hardship - only the mental anguish of trying to define home and coming up empty-handed. I have been provided a house to stay in, and hospitality, but it is not my home. In my heart, home is with my fiancee Melissa, but neither of us has our own place. Last semester, Melissa's week consisted of bouncing from Weatherford, to Edmond, to Norman, depending on where she needed to be for college or work. When we are married we'll have a home together, but for now we make do as best we can.
I drove to Weatherford today, but my professor happened to be out, and I felt funny about going into his house alone. So I picked somewhere far away and drove there until he would get back. It's times like this that my car means more to me than just transportation. It represents freedom, and a much needed piece of the familiar in unfamiliar lands. As long as I am rushing 78 mph down an unending stretch of freeway at least I am somewhere, doing something, which is infinitely better than nothing, nowhere.
Friday, April 20, 2007
On Friday mornings I do a teleconference meeting from home. Today the conference ran late and made me late coming in to work. I was just about to head down to the Johnson Space Center to go in to building 44 to get the paperwork I need to check out, when I got a call from a coworker. He said there was a man with a gun and security is on lock down!
I don't really have much more information than that yet, and what more I have heard so far is unconfirmed so I will not start any rumors with it. But it's just crazy; I mean, I work there! Let me tell you that Building 44 is not the place I would have in a million years expected to see this happen. It's been the most stress-free work place I've seen, and I can't imagine what would push someone over the edge.
Update: They have helicopters showing the building on the news on CNN. Unreal.
Friday, April 13, 2007
If you took an operating systems course in college, unless you went somewhere like Berkeley or Vrije in Amersterdam, it's likely that there was not a professor in your whole university who knew how to write an OS kernel from scratch and get it to boot by itself. Look, they're only human, ok? - most programmers wouldn't know how to do it. But it also means you came away from that class vaguely dissatisfied. Because if you take an operating systems class and never write your own simple kernel, it's like taking a driver's-ed course without ever getting to sit behind the wheel.
It's time we changed how we teach operating systems. Let's get started.
My first intention was to write one of these boot sector programs, because it would be a way to get code running on the machine completely by itself. There is just enough space in 512 bytes to write a very simple program. But that doesn't sound very useful, and besides, it's been done before.
So I wanted to contribute something new. Besides my idea of putting a toy operating system in the boot sector not being original, there is already a perfectly good boot loader program available. It's called GRUB. Why not put GRUB in your boot sector instead of custom code, and use GRUB to bootstrap your prototype OS? Suddenly what would have been weeks slogging through nasty bootstrap code isn't necessary. Things are looking up.
GRUB stands for GRand Unified Bootloader. If you dual-boot Linux and Windows, you may know GRUB can load your favorite operating systems, but did you know there's another reason it's called Unified? The people who developed GRUB looked at all these operating systems floating around; they all need many of the same things to happen as they boot, but each implements their own proprietary boot loader. They said, "What if there were a universal standard for booting an operating system? Then we could write one really good boot loader that would suffice for any operating system." They did.
What they came up with was the Multiboot Specification. It's a magic header that you include in a program to tell GRUB the information it needs to know to load your kernel. GRUB is smart enough to read a file system, so you don't even have to place your kernel in specific sectors or make some kind of wacky system file. Instead, all you have to do is compile a program as you would normally, and you can place the ordinary program file in any directory on the disk.
In an article I read recently, Julio Vidal describes how he made NetBSD Multiboot-Compliant. The article includes a detailed description of the boot process, and is an interesting read all around. Most importantly for us, though, the article links to some example code, from the GRUB documentation, which shows how to make a minimal kernel that is multiboot-compliant.
You can find that example code here: http://cvs.savannah.gnu.org/viewcvs/grub/grub/docs/#dirlist
Don't worry, you don't need all the files listed on that page - just three of them. You need boot.S, kernel.c, and multiboot.h. In order to illustrate the proof of concept (that, once loaded, I can run any code I want), I made a slight modification to the files which simply displays my own custom message after the kernel boots. You may want to work with the modified version in order to see where to put your own code, and because it is the version I used for these instructions, although the unmodified files should work too. You can get them from my downloads page: boot.S | kernel.c | multiboot.h
Now that you have the code, you need to compile it. For this, you will need to be running Linux. You'll also need Linux for the later steps involving GRUB, so you might as well get it now if you don't have it already. I recommend Ubuntu. Ubuntu comes on a Live CD, so you can run it from the CD without even having to install it. You can also install Ubutunu on an external hard drive or even a USB memory stick. (I will be posting another blog entry soon explaining how I did that.)
Compiling the code is the second major hurdle to cross. Most C programs link in libraries for things such as I/O and debugging. These C libraries in turn depend on an OS, or more specifically, they rely on making calls to the kernel of an OS. Well hold on a minute - we haven't got a kernel yet; that's what we're trying to make. Not only can we not rely on the the standard libraries, we have to make sure the compiler doesn't sneak external references in anyway (which it will try to do if you let it). So we have to use special compiler options to force the compiler to generate code that stands alone and has no external dependencies.
Open a terminal in Linux and type:
Then use this command (all on one line) to compile it:
gcc boot.S kernel.c -o mbs-kernel -ffreestanding -nostdlib -nostartfiles -fno-stack-protector
- -o mbs-kernel: names the output file
- -ffreestanding: means the resulting program should have no dependencies
- -nostdlib: tells the linker not to bring in the C standard library, which won't work in the kernel
- -nostartfiles: tells the linker not to bring in any C startup code
- -fno-stack-protector: is a fix for the error "undefined reference to '__stack_chk_fail'"
This produces the file "mbs-kernel" which contains our new kernel.
You may need to be root to do the rest of the steps. To switch to superuser mode so that you can run all the commands, type:
...and provide the root password when it asks.
Next we need to install grub to a floppy disk so that we can boot from it. It is possible to use a USB key instead, but I haven't figured out how to do that yet. So we'll use a floppy disk for this example.*
Open a terminal and type the following command:
grub --batch --device-map=/dev/null <<EOF
The above command starts GRUB in batch mode. Insert a formatted floppy disk and type these commands to install GRUB to it:
device (fd0) /dev/fd0
If you are using a USB external floppy (what I was using), then the device will be different. In that case, do not type the above, but use this set of commands instead:
device (fd0) /dev/sdb
USB floppy drive devices show up as /dev/sda, /dev/sdb, etc. Mine was sdb because I also have an internal SATA hard drive, and that occupies /dev/sda, so the floppy became /dev/sdb. If you have an ordinary IDE hard drive, then a USB floppy might be /dev/sda. How can you tell which one is your floppy disk? What I did was I used the Gnome file manager to mount the floppy disk (by double clicking its icon). Once I could see the contents of the floppy disk in the GUI file manager, I knew it had to be mounted. Then I opened up a terminal and typed:
That's a lowercase "el". It caused mount to list all the mounted file systems - I looked at the one that matched where my floppy was mounted and the device given was the device I used for grub. However, if I recall, the drive has to actually be not mounted for the GRUB install to work. So after you mount the disk to find out its device file, be sure to right-click on it in the file manager and select "unmount" before you attempt to do the GRUB install.
Now that we have GRUB installed, we need to put our compiled kernel onto the disk. Use the file manager to mount the floppy drive and copy the file mbs-kernel to the /boot directory of the floppy disk.
*Note: If you already have GRUB on your hard drive, you don't necessarily have to have a boot floppy at all for this exercise. If you are comfortable with the idea of changing the boot configuration of your computer, you can safely skip the GRUB floppy install steps above, and place your homemade kernel directly in your /boot directory on your hard drive next to your Linux kernel. When you boot, you can choose whether to load Linux or your own kernel.
The last step is to modify the menu.lst file to make an entry for your kernel. If you have put your kernel on a floppy disk, you should be able to go to
- A screen full of gobbledygook if you booted the default GNU example code
- A friendly message if you booted my version
In any case, as soon as you get the kernel to boot, you should immediately boot back into Linux, delete my code changes, and add your own code instead. This is your kernel.
If you want to go further, here are some resources:
Remember, you are starting with a blank slate. You won't have a filesystem driver, I/O, anything, until you put them into your OS. You are starting at the bare metal. One way of looking at it is that you have nothing holding up your code.
Another way of looking at it, is that you have nothing holding you back.
Thursday, April 12, 2007
This blog meets most of my needs, but I'm finding more and more cases where it just isn't enough. For instance, I want to include source code file downloads with some of my articles, and there isn't an easy way to do that through Blogspot. Fear not; my new web site does not replace this blog. I will be using my home page and the blog together.
I had been thinking about making a home page for quite a while now, and went to look for a paid web host tonight. I was just thinking, man, I wish Google did homepages too. That's when I stumbled upon http://pages.google.com/. Wow! My main concern when looking for a web host had been finding a site I can trust, and in that category Google definitely fits the bill! Since I already have a Google account, I had a page already waiting for me.
Anyhow, take a look. I'll have to warn you, I don't really "get" web design. So I will be keeping the site clean and simple to cover up the fact that I don't know how to do fancy. In the movie Walk the Line, when June Carter asked him how they get such a steady sound, Johnny Cash's character just looks sheepish and says: "Well, we'd play faster if we could."
Wednesday, April 11, 2007
We have a very high-tech Coke machine in the building I work in. It has a glass front so that you can watch what it does. Instead of just dropping your coke down a chute like a normal Coke machine, this machine has a conveyor belt that moves up and down like an elevator. In order to retrieve your beverage, the machine first moves the conveyor up to the "floor" that your drink is on. The bottle (which is stored upright) is pushed onto the conveyor. Then the conveyor belt moves the bottle sideways until it gets to the end of the belt where it enters - would you believe - a chute. It's fascinating to watch when it works, but the machine is often out of order. You see, the chute is only wide enough to accept an upright bottle coming off the conveyor. The entire machine was built on the assumption that the upright bottles would never fall over. Once a bottle does fall over (which is inevitable) the machine cannot get it off the conveyor belt, and other people's purchases pile up behind it. The Coca-Cola service man has to be called every time a bottle falls over on the conveyor.
No longer a dispenser of beverages, today the Rube Goldberg Coke machine stood there, with it's conveyor jammed with bottles, as an ironic monument to overengineering. A warning, if you will, to anyone who might forget the K.I.S.S. principle.
I joked about this with one of the NASA oldtimers I work with, and he followed it up with an interesting anecdote. That's nothing, he said. A while ago we used to have an upright ice cream machine. Any time the power went out, the ice cream bars inside would melt, and gallons of vanilla ice cream would drain to the bottom of the machine and out the hole in the front. It made a terrible mess in the hallway. Eventually, something was done about it:
The building I work in is packed with radio and computer equipment, so you can well imagine that any loss of electrical power is a big deal, as equipment has to be shut down properly if possible. For this reason, we have a written procedure that is followed when loss of power is imminent, to ensure that every important piece of equipment is taken care of.
I have it on good authority that, for many years, step one of the emergency power loss procedure read:
- Call the Bluebell Icecream company.
Saturday, April 7, 2007
This is bad because I'm allergic to certain house dusts, and the heating system seems to be a source of that kind of dust. I always get sick if the heater is running. Normally I would have the vent closed to prevent the allergens getting into my room, but until yesterday it was quite warm, and I can have the vent open for the A/C without ill effect.
I had heard a cold front was coming, but I can't believe it came as far down as Houston, and got as cold as it has. It triggered the heater, and now thanks to my allergy I have a case of the crud and a sore throat to keep me company for the next few days.
Despite not feeling well, I went ahead with my favorite Saturday pastime, which is to hit up the electronics and computer and book stores in order of their closing times. First I go to EPO electronics until they kick me out at 5 pm, then I wander CompUSA like a friendly ghost until they kick me out, and then on to Barnes & Noble which caters to night-owls and has a Starbucks to boot.
After reading about a foxhole radio made from a slinky, I decided I want to build my own radio (though not out of a slinky). Some of my most memorable electronics experiences involved building crystal radios and one-transistor radios from Radioshack kits when I was a pre-teen, but ultimately I became frustrated with the radios' unpredictable behavior and changed my focus to digital logic instead. I now realize that most of the unpredictability must have stemmed from my poor understanding of necessities like proper grounding techniques and controlling parasitic capacitance. With the experience I have now, I figure I could build some much better receivers and have some fun with it again.
That's why I went to EPO today - to get parts. EPO is a giant electronics store in south Houston. Like Radio Shack used to be but much better. It's an electronics geek's dream - they have components, kits, tools, testers, surplus junk, everything. It's like walking into the pages of a Digikey catalog.
I was surprised to find that they don't carry crystal radio kits. Not one. I guess nobody builds them anymore. Shame. They do have some other radio-related kits, but not what I was looking for. They also had a confusing array of ham-radio kits, but I'm not licensed to transmit ham radio and I wasn't sure which receiver to get either.
I was intrigued by a phase lock loop experiment kit they carry. It uses a digital phase lock loop chip (PLL) and a PIC microcontroller to give you a push-button, digital control over what frequency is generated. It was meant for sending, not receiving, but I thought, what if I run the output of an antenna amplifier (also available as a kit) into the phase lock loop chip? Then maybe I could make the PLL lock to a radio station by typing the station's frequency into the digital control.
It's a hell of an idea but the cost quickly got out of hand. The PLL kit is already expensive, and the antenna amplifier was downright overpriced for something so simple. Then I realized I needed some sort of "mixer" chip to compare the PLL output back to the antenna input, in order to skim the actual sound off the incoming signal. (The PLL locks you with the phase of a signal but the actual sounds of AM radio come from the signal's amplitude.) I found a general-purpose IF mixer chip that looked perfect for the job, but it was expensive too. I was expecting to spend, say, $35 tops today on a weekend project. Instead I ended up with an armload of parts that came to $90 and I didn't even know if the circuit would work or not, it was just based on a hunch!
I would have loved to test the idea, but I also need to be more careful with my money. Not to sound arrogant by comparing myself to the great man, but I live like Nikola Tesla did. I'm chronically broke, spending money on inventions instead of food. I'm trying to get away from that. When the items rang up to three times what I expected, a glimmer of rationality seeped in and I wondered, "when did my $10 crystal radio project become a $90 digital synchrodyne?" I stammered to the cashier that I couldn't afford it and made an embarassed and hasty exit with the items still on the counter. Sad. It would have been a fun project. Maybe some day I'll make enough money to do some of them.
My next stop was CompUSA. I more than half expected it to not be there anymore. When I first came to Houston, the CompUSA store here was the first one I had been to - they don't have them in the small town I'm from. Murphy's law dictates that since I liked the store, it would naturally have to go out of business soon. The CompUSA company decided this branch isn't bringing in enough profit, and decided to close it up. They've been having a going out of business sale for a month now.
They didn't seem very serious about it last time I was there. Most things were only 10% off. You call that a going out of business sale? Can you even call that a sale? I did get a great deal on a hard drive that time, but I decided to wait and see how much further the prices drop before I buy anything else.
Things have changed quite a bit since the last time. The store looks like a warzone! Now most things are 40% off, half the shelves are stripped, and people aren't so much shopping the store, as looting it. Everything is for sale, not just the products but the shelves too, for goodness sake. One of the store managers asked me, "Why don't you take a basket?" "Oh, good idea," I said. I picked up a shopping basket and behind it was a sign that said, "Why don't you take a basket? Only $4 each." Gee golly, they are serious.
This would be a good time for me to pick up a GPS navigator for my car. I probably burn $200 a year extra gas just from getting lost. The trouble is, I'm dead scared of blowing my money on a crappy GPS system when I could have a better one if I wait. They had some $200-range GPS units for sale at the CompUSA but they were all no-name brands. One didn't turn on at all, and the other could play music but reported "application .exe file not found" when you tried to view the map! This doesn't inspire my confidence in them.
"Even in the future, nothing works!" - Spaceballs.
You know that's the trouble with consumer electronics. Ultimately the manufacturers of these devices are collectively shooting themselves in the foot by sacrificing quality to save manufacturing cost. They've lost the consumer's trust. Even if you're willing to spend the extra money to buy a good product, how do you know you're actually getting something better? Are you really getting a quality piece of equipment, or did a major trademark just slap their logo on a craptastic piece of outsourced junk? Even for an engineer it's hard to tell unless you could look inside the case. Uncertainty is the real reason Americans buy tons of cheap plastic crap and fund a Walmart on every street corner. Given the choice between spending a little money on something cheap and crappy, or risking more money on something that might be better, the same, or worse, people will choose the devil they know and go with cheap over risky every time.
I felt rather bad for the people working at that store. I mean, here are all these shoppers, me included, acting like sharks in a feeding frenzy, yet the staff are being uncharacteristically polite to everyone, and no one is commenting on the larger tragedy that, at the end of this month, a dozen people will be unemployed. I asked one of the younger sales associates about it and he shrugged apologetically and said, "stuff happens". "Are they going to move you guys to another store, or just throw you out on the street?" "Well one guy was going to get reassigned but he quit instead, and there's one other person who got another position." "So, the rest of you...what happens?" "We get a severance package and...that's the end of it."
There were some crazy deals going on, like a TiVo version 2 for $100 and also a laser printer for the same, but I decided to forego the expensive items today and buy more smaller items. I got a USB floppy drive for my laptop for $23, and a book called "The Multi-Boot Configuration Handbook," which looks interesting. I also completed my collection of Swiss-tech keychain tools. I have so many tools on my keychain that I don't keep my keys on it anymore. I need to invent a utility belt that holds keychain widgets! It'll have to be inconspicuous, too, so my girlfriend will not be too embarassed to be seen in public with me.
Of course, what I really want is a Swiss army knife the size of a, well, just look at it! It's huge and it has every blade Wenger makes, but at $1200 it definitely costs more than the sum of it's parts. Kudos to them for having the balls to make something this cool, but they're totally undermining it by calling it "only a collector's item". I would really use this thing. That's got me thinking - how hard is it to hack a Swiss army knife? Why not buy a bunch of smaller Swiss Army knives, break them into pieces, and put together one big one with just the blades you like? Why not make it so the blades are easy to add and remove whenever you want? Then you can have a modular, customizable Swiss Army knife that's as wild and crazy as you want it to be.
I envision setting up an online web store where geeks could buy knife parts to combine together. You could buy blades for $5 each, custom handle-plate designs, and screws and nylon washers to put the knives together. They'd all be interchangeable but every person could have a unique knife, and you could accessorize to no end. A true geek toy.
Too bad the people who make the real Swiss Army knives would sue me out of business.
After CompUSA I went to Barnes & Noble. I've gone longer than usual without buying any books lately. It's not that I don't find books I'm interested in - just the opposite. I can't go to Barnes & Noble without finding a stack of books as tall as I am that I simply must have. I can't afford them all but I can't choose any to remove. So I end up getting none.
But I tell you I have never regretted buying a book. Never. For instance, I spent $143 on a stack of C# books two years ago - that $143 turned into a few thousand I made as a C# programmer right after that.
So I decided it's high time I bit the bullet and actually spent some money on programming books again. (Money has been the thread tying this entry together, I just noticed. It must be on my mind today.)
I had been thinking about getting a book on Ruby for ages now. I decided to get only one and get the rest later. I was drawn to The Ruby Way by Hal Fulton because of its Taoist references (I'm a big fan of the Tao Te Ching, and also The Tao of Programming), but ultimately I settled on the classic Pragmatic Programmer's guide, Programming Ruby, because the writing in it has a light-hearted tone that lifts my spirits. Yes, the old edition is available online, but there is more in the second edition and I still like to read from a real book instead of a computer screen.