header image
 

I thinks this qualifies for the daily wtf…

buy viagra lowest price cheap generic viagra order cialis in us order cheap viagra online cheap cialis in canada buy discount cialis viagra price find cheap viagra online generic viagra low cost viagra buy sildenafil in canada erectile dysfunction buying generic viagra cheap cialis from canada cialis 10mg buy viagra online buy sildenafil cheap buy cheapest cialis cialis rx order viagra no prescription buying viagra buying cialis online buy viagra from india cialis cheapest price order cialis cheap online order no rx cialis cialis 10 mg overnight viagra tablet viagra buy generic cialis online cialis bangkok buy generic viagra viagra canada find viagra online buy and purchase sildenafil online cheap generic cialis viagra rx no prescription cialis find cialis 50 mg viagra viagra vs cialis buy sildenafil online order cialis without prescription cheap viagra online cialis information viagra cost 100 mg viagra purchase viagra viagra viagra from canada buy viagra internet drug viagra online purchase order cialis no rx discount cialis discount viagra discount viagra without prescription viagra without rx certified viagra find discount viagra cialis no online prescription cost of viagra find cialis without prescription buy discount viagra online buy cheap cialis lowest price cialis viagra pharmacy online viagra cheap sale viagra order viagra online cheap cialis tablet order cialis overnight delivery buy cialis low price cheap viagra without prescription cheapest cialis price viagra online without prescription buy sildenafil low cost compare viagra prices online buy cialis on line buy cialis generic impotence viagra tablets buy viagra generic cialis buy viagra low price viagra purchase best price for viagra 25mg viagra buy cialis from india cialis drug order viagra on internet low cost cialis buy discount viagra impotence treatment viagra pill order viagra from us buy sildenafil in uk overnight cialis cialis soft tab viagra medication cialis cheap impotence pills discount cialis online cheapest cialis online order cialis from canada cialis no prescription viagra cheap drug cheap viagra tablets buy viagra without prescription viagra online pharmacy viagra approved find cheap cialis cost cialis buy viagra on line cialis 20 mg buy cialis cheap cheapest viagra free cialis buy cheap cialis online pharmacy cialis cialis without rx cialis overnight shipping compare cialis prices online cheap cialis overnight delivery cialis tablets 20 mg cialis order viagra from canada cheap viagra from usa buy cheap viagra internet cheapest cialis 10 mg cialis purchase cialis buy sildenafil citrate cheap cialis no prescription order generic viagra cialis online cheap cheap cialis on internet drug cialis buy sildenafil internet cialis from india no rx cialis viagra cheapest price where to buy cialis order cialis in canada cialis medication cialis pharmacy discount cialis no rx cialis no rx required viagra overnight shipping cialis sales buy cialis from canada cialis prescription cheap viagra in uk purchase cialis overnight delivery cialis price where to buy viagra viagra no rx required cheap viagra overnight delivery viagra india buying generic cialis cialis malaysia cialis pill cialis for order cialis soft order viagra in canada generic viagra online cialis for sale impotence medication online viagra viagra soft viagra pharmacy purchase viagra overnight delivery buy cialis on internet cialis canada order discount cialis online buy viagra overnight delivery cheapest viagra price buy cialis from us cheap cialis from usa generic cialis cheap viagra no rx lowest price for cialis buy sildenafil online without a prescription viagra vendors cost of cialis generic viagra cheap cialis free delivery viagra in malaysia viagra uk find cialis online order viagra without prescription find discount viagra online cheap cialis from uk drug viagra cialis in uk cialis without a prescription viagra in australia find no rx cialis drug cialis online purchase cialis free sample buy cialis internet viagra generic find cheap viagra cheapest generic cialis online find cheap cialis online compare cialis prices order viagra no prescription required viagra us cheap viagra in usa find discount cialis purchase cialis no rx no prescription viagra cialis online viagra no online prescription fda approved cialis cheap cialis pharmacy buy viagra no prescription required cialis side effects viagra in uk viagra no prescription viagra in us cialis pharmacy online find viagra cheapest generic cialis cost viagra buy viagra cheap buy cialis in canada buy cialis no prescription required buy cialis us order cialis from us 100mg viagra free viagra find discount cialis online cheap viagra cialis buy online cialis overnight buy sildenafil canada cialis 20mg cheapest cialis prices viagra without prescription order cheap viagra cheap price viagra buy no rx viagra purchase viagra no rx pharmacy viagra find viagra no prescription required cheapest generic viagra cialis in malaysia cialis purchase buy cialis lowest price order no rx viagra cheapest generic viagra online order viagra cheap cialis where to order viagra fda approved viagra buy no rx cialis purchase viagra without prescription cheap cialis no rx cialis online stores cheap cialis in uk find cialis on internet certified cialis price of viagra purchase cialis online cheapest viagra prices find viagra on internet buy cheapest cialis online buy discount cialis online buy viagra from us buy cheapest cialis on line cialis cheap drug buy cialis online cheap find cialis no prescription required cialis us cheap viagra pill viagra free sample cheap viagra tablet viagra online cheap cheap cialis in usa cheap cialis without prescription order viagra no rx order viagra cheap online viagra prescription discount cialis overnight delivery cialis australia buy viagra on internet cialis buy drug order viagra in us cialis vendors cialis tablet viagra drug viagra tablet cialis cost cheap cialis tablets cialis discount buy cialis in us online pharmacy cialis sale cialis cheap viagra on internet buy viagra in us discount viagra overnight delivery 25 mg viagra cheap price cialis buy cheapest viagra cheap viagra no rx viagra online stores order generic cialis viagra online review best price viagra cialis overnight delivery cialis pills cialis online review buy cialis overnight delivery order viagra overnight delivery buy viagra no rx cheapest sildenafil citrate viagra free delivery viagra sale 50mg viagra buy cialis without prescription cialis prices tablet cialis find viagra without prescription viagra order buy cheap viagra online viagra pills cialis in bangkok cialis without prescription order discount viagra buy viagra in canada viagra bangkok lowest price for viagra pharmacy online cheap cialis online viagra for sale cialis cheap price discount viagra online impotence cure cheap cialis internet approved viagra pharmacy cialis approved cheap viagra from canada 10mg cialis viagra prices cialis in us compare viagra prices cialis vs viagra viagra internet cheapest viagra online buy cheapest viagra online online cialis viagra side effects generic cialis online buy cheap viagra order cheap cialis online viagra online viagra malaysia buy cheapest viagra on line order cialis no prescription required cialis buy approved cialis pharmacy viagra in bangkok cheap viagra pharmacy order cialis no prescription lowest price viagra cialis sale order cialis online order cialis on internet order discount viagra online best price cialis cialis no rx viagra buy online online pharmacy viagra cheap cialis pill cheap viagra in canada cialis online without prescription cheap viagra from uk cheap viagra internet find no rx viagra buy sildenafil in spain order cheap cialis order discount cialis impotence drugs buy cialis no rx purchase cialis without prescription viagra overnight delivery viagra discount no rx viagra buy generic cialis viagra without a prescription buy viagra us discount viagra no rx viagra soft tab viagra cheap price cialis order purchase viagra online cialis generic viagra information discount cialis without prescription viagra buy drug buy cheap cialis internet cialis internet 20mg cialis buy viagra cialis in australia viagra australia viagra buy generic drugs viagra from india buy viagra online cheap buy cialis cialis from canada pfizer viagra price of cialis cialis uk viagra overnight buy generic viagra online buying viagra online buy cialis online viagra for order cheap viagra no prescription viagra sales generic cialis buy viagra from canada best price for cialis order cialis cialis online pharmacy buying cialis where to order cialis cialis india

The encrypted hard drive project I was working on last quarter for my ECE 347 class is continuing into this quarter, as the other group member and I ran into some last minute issues with the hard drive (turned out to be a loose SATA cable) which prevented us from finishing the code. We were running into a huge number of bugs with my groupmate’s code, and when the hard drive disappeared from the system we called it a night. The other group member, who shall remain nameless, left Northwestern this quarter (no, it wasn’t Kurt ;)), and so I’m continuing the project on my own. As such, it was necessary for me to start modifying his portion of the code written for the project.

It is far and away the worse code I have ever seen. Every couple of lines, I find what seems to be a snippet of code specifically designed to win the “daily wtf of the year award.” After reading through the first page or two of some of his code, I decided to rewrite everything from scratch. I’m usually the type to try to keep as much code as possible, so I’m valiantly trying to incorporate as much of his code as possible, but there’s not anything salvageable in this mess.

The guy who wrote the code I’m rewriting was an interesting fellow. He certainly seemed bright. My suspicion that he wasn’t the sharpest knife in the drawer began after I pointed him towards a couple of papers to read for a (unrelated to the hard drive encryption project) mixed-mode placement algorithm we were working on. After a couple of days, he approached me and said he had spent “hours reading them” and that he knew enough to be comfortable starting to develop an algorithm. At this point, I was very impressed. I had read the papers quite a few times, and still didn’t quite know which methods I wanted to incorporate into our algorithm. I started into a technical discussion of my initial ideas, and he seemed to listen to and understand what I was saying. I was hoping that he would be able to provide some feedback on my ideas, indicate any obvious errors I was making, and maybe put forward some of his ideas. No such luck. His responses to my questions for feedback were limited to “That sounds good…”, “Should be fine…”, and “Yeah, just do that…” No problem, I thought, he’s just a bit timid, and doesn’t want to completely smash my silly ideas. I decided to get him to be a little more forthcoming by asking him to give me a quick rundown of what impressions he got from the different papers.

Utter. Disaster.

Although he had “read the papers for hours”, not only did he not understand the content of the papers, he did not understand the mixed-mode placement problem itself. As we had been working on this project for weeks, I was more than slightly dismayed. How could he have felt okay working on the project without understanding the problem we were trying to solve? Eventually, I ended up sitting down with him and developing an algorithm (a quite decent one too, I might add). At each step, I explained what I was doing, and asked for any feedback, criticism, or other ideas. All I got was blank stares. I did the writeup on the final algorithm, and sent it to him with an explanation of areas I’d like expanded on, in a last ditch effort to get him to contribute something. He replaced a few instances of the phrase “high quality solution” with “rather good answer”, added a diagram (an incorrect one), and sent it in. Although he sent in what was essentially a partially incorrect version of my first draft (without consulting me), we received an A on the project, which was a pleasant surprise. Despite the good grade, his complete lack of participation (in fact, his harmful participation) caused me to worry about his performance on his part of the encrypted hard drive project, with good reason as it turned out.

I wish I could post all of the code from the project here, but it would be an absolute chore to read. He seems to have an uncanny knack for introducing complexity where an obvious, concise solution exists. One of the simpler examples (there are much, much worse examples, but they are far too long to post here) of this is in his function to check whether the usb key is inserted or not.

He wrote the following:
checkusbkeyin = "sh usbtest.sh"
line1 = int(0)
while line1 != int(1):
# wait one second before trying again
# don't even think of taking this out to gain speed; benchmarking it without makes it up to 1 second faster but adds constant requests
time.sleep(1)
if line1 != int(1):
# Puts "1" in the file /mnt/usbkeyin if usbkey inserted and "0" if not
os.system(checkusbkeyin)
f = open("/mnt/usbkeyin")
line1 = int(f.readline())
f.close()

Which calls this shell script to generate the file queried by the python script:
if ! mount /mnt/usbdisk 2>/dev/null; then
echo "0" > /mnt/usbkeyin
else
echo "1" > /mnt/usbkeyin
fi

Here was my replacement:
mountkey = "mount /mnt/usbdisk"
# Now wait for key insertion
keyin = False
while keyin != True:
# Check for key
if os.system(mountkey) == 0:
keyin = True
# Don't want constant mount requests
time.sleep(0.1)

One of the first frightening sections I came across was his “unique” method of generating text output. Using Python like this should be a criminal offense. This guy really, really likes copy and paste coding:

Pregenerated output (Why? Who knows? There were 30 lines of this):
password00char = "/bin/lcd 2 ''"
password01char = "/bin/lcd 2 '*'"
password02char = "/bin/lcd 2 '**'"
password03char = "/bin/lcd 2 '***'"
password04char = "/bin/lcd 2 '****'"
password05char = "/bin/lcd 2 '*****'"
password06char = "/bin/lcd 2 '******'"
...continues...

The actual display output:
# do the star display
dispstar = keycounter % 15
if dispstar == 0 and keycounter > 0:
os.system(cpassword01char)
elif dispstar == 0:
os.system(password00char)
elif dispstar == 1 and keycounter > 1:
os.system(cpassword02char)
elif dispstar == 1:
os.system(password01char)
elif dispstar == 2 and keycounter > 2:
os.system(cpassword03char)
elif dispstar == 2:
os.system(password02char)
elif dispstar == 3 and keycounter > 3:
os.system(cpassword04char)
elif dispstar == 3:
os.system(password03char)
elif dispstar == 4 and keycounter > 4:
os.system(cpassword05char)
elif dispstar == 4:
os.system(password04char)
elif dispstar == 5 and keycounter > 5:
os.system(cpassword06char)
elif dispstar == 5:
os.system(password05char)
elif dispstar == 6 and keycounter > 6:
os.system(cpassword07char)
elif dispstar == 6:
...continues...

His ability to mangle code extends beyond Python however. I checked some of the C code he wrote, and was appalled at some of the errors I found. Again, there are far too many to post here, but here’s a very simple example:
char tty[9];
strcpy(tty, "/dev/ttyS0");

I can only assume he doesn’t understand C’s null termination of strings, and also doesn’t understand that, while arrays do start from 0, allocating an array of size 9 does exactly that, ie: indices 0 through 8 in the array are valid. He’s putting 11 characters into an array which can fit 9. Nearly every line of his code has bugs like this. I’m petrified that I’ll see his name as a contributor for an open source project.

In addition to this, the actual authentication method he used for the usb key doesn’t actually check the the usb key at all. Since he decided to store the keyfile on the hard drive itself, you can insert any old usb key and it will work just fine. His menu code is structured such that the smallest bug in any subsystem of the entire device will cause a complete meltdown. In fact, when we were about to present the rather nifty menu system we managed to complete to our professor when he insisted on making “a few quick changes.” I advised him to not touch anything, but he went ahead and “fixed up” some of the code. By the time our professor showed up, nothing was working. He just shrugged, and told our professor to write him a check for the money he spent in parts (including the $80 for the LCD screen he shorted out, and its replacement which he nearly destroyed before I had a chance to mount it).

He has since ceased responding to email, which could have been a problem, as he set a BIOS password for some reason. Luckily, clearing the CMOS also cleared the password, allowing me access to the BIOS setup. I worked on the new code a bit today, and it’s coming together quite nicely. It’s functional, fast, and a bug in one section won’t cause any problems outside of it’s own little area of functionality. I plan on posting the code, and pictures of the actual encrypted hard drive (taken with my new camera), when it’s completed.

The usual random notes:

  • I’m taking a “human computer interaction” course this quarter, which I’m looking forward to. Since it’s likely I’ll be doing some multimedia GUI development, it’ll be good to have some UI design experience.
  • I’m also taking a VHDL class, and the professor is great. Should be a lot of fun, and quite useful.
  • Suse 10.0 is still running strong, with 61 days of uptime now, and 30638 remote SSH attempts.
  • Why the sudden departure from NU, Kurt? Any specific reason for leaving?
  • I am now running Wordpress 2.0. Amazingly easy upgrade. Took about 10 minutes.
  • The weather here is awful.

~ by Andrew on January 4, 2006.

10 Responses to “I thinks this qualifies for the daily wtf…”

  1. If it’s CS330, I took that HCI class last winter quarter. If it’s run the same way as last year (meaning every year), the actual design-aspect is super light-weight. The class is discussion-type (where articles are assigned to be read, then they’re discussed in class–I think there’s a more technical term for this type of class), then every few weeks, groups present their designs or re-designs of an interface for a typical, future device. For example, one of our assignments was making an interface for a cell phone that could store 10GBs of pictures. The challenges were more fun than enlightening. There’s something to be said for “fun,” but there’s also something to be said “substantial.” The readings are fairly interesting, but you won’t apply much of their content to the projects unless you really try, and you’re a brown-noser. Not to say the class wasn’t fine, just that it, unlike both a lot and very few other classes, is what you make of it. If you want to make some glorious UI for a useful program (x264 needs an interface and stat!), you can, as you choose your final project, but be wary of ending up in a bad (randomly-assigned) group. In short: good class, but it’s what you make of it. And make sure that you don’t end up with anyone from Fiji in your group; the whole “pot-smoker” fraternity stereotype is very true.

  2. I realize it’s not going to be a challenging class. I’m pretty much finished with all the classes I have to take though, and I don’t really want to graduate early. I’m hoping it’ll be fairly easy, so I have time to perfect my ECE 347 project, but still interesting. I also need some UI design skills. And yes, I’ve worked with someone from Fiji before. I won’t make the same mistake twice. ;)

  3. Whoa, you got me. I wasn’t expecting you to figure out I was gone for quite a while, even with the awkward phone call I gave you just before leaving. One of the reasons I’m on a sabbatical is so that I can take some time and figure out what I want to do - college has become a real chore, and I was barely staying afloat with no real goals. So I’m going to save my time and my parents’ money, and figure out what it is I want to get out of higher education. When I’m ready, I’ll come back (probably at the beginning of the 2006-2007 school year).

    I’m looking forward to upgrading to Wordpress 2.0, particularly because in the backend they’ve replaced all inline Mysql statements with function calls to allow it to become database-independent. I’m rooting for a port to Postgresql, at which point I’ll convert my Gallery2 installation as well.

  4. I had the unfortunate experience of spending some time in the same class as your nameless group member. I found him to be slightly different than discribed. For example, he did not feel the need to not talk, but did so in plethera. Fortunately he didn’t say anything worth listening to, so I felt free to ignore him.
    It turns out he also had a number of odd quirks. First, he was a vegan (nothing out of the ordinary), but also refused to drink anything other than water (which struck me as odd). Second, he complained continuously about the service provided in the general Northwestern Computer Labs. When I questioned on him why he didn’t just use his own computer it led to the third thing: he refused to connect to any network. Later of course, this was qualified as certain networks (which for all intensive purposes included all he might reach). On top of all this, he had some weird preoccupation with bit vectors, which I’ll never understand.
    The list goes on of course, and I was shown a bit of his code for a different class, which included if statements on variables that were just assigned, and a failure of understanding switch/case.

  5. I ran into all the problems you mentioned with him as well. The “I won’t use NU network services” thing was a huge hindrance. Eventually I persuaded him to connect our development computer to his dorm ethernet jack, but he insisted on spoofing a MAC address and using a static IP, which meant that it was almost always down. You’re right about him not knowing how to stop talking. I once mentioned I was buying a new microwave, and he managed to talk my ear off for an hour about the different kinds of microwaves on the market. Thankfully, I don’t have to deal with him any more, and the new code is working wonderfully. The new menu system takes ~15 lines of code (thanks to lambda), whereas his took ~350 lines.

  6. Yo Andy, if you’re graduating this quarter, we gotta get together sometime for a meal and a chat.

  7. Nope, not graduating this quarter. Just taking a nice easy schedule next quarter. ;)

  8. How ’bout you update this so I’m not stuck rereading the same WTF stuff over and over and over again? Hmph.

  9. Yes, I realize I’ve neglected my site a bit recently. I’ll post soon. Really. :-)

  10. Ping. Now post a pong!

    NOTE: “ping” and “pong” are not some new blogging meme, like the “best blonde joke in the world” or some such nonsense. I personally made it up just now to remind Andy to post his further exploits. Gimmick infringement will be tolerated.

Leave a Reply

You must be logged in to post a comment.