Archive for the ‘Humor’ Category

LOLcode

Tuesday, March 30th, 2010

I just came across LOLcode. Best laugh I’ve had in a LONG time. This one’s even funnier than Tenne-C!

Google has even implemented it as a searchable language in Google Code Search. Sweet!

And to think, just today my professor mentioned that we might consider picking up a new language for the parallel-computing project for the class.

Hilarity, as the saying goes, ensues!

cp /dev/drillpress /dev/sda1

Thursday, February 18th, 2010

Paleotech Formatting. When it absolutely, positively has to be made unrecoverable…

A hard drive used by one of our financial gurus at work died. A recovery service was able to get most or all of the data out, and I was asked to handle the warranty claim for a new hard drive. We had purchased the “no-HD-return” option on the warranty, and Dell did a nice job getting us a good replacement drive the next day — but we still needed to make sure the old drive couldn’t be read by nefarious evildoers (should they decide to go Dumpster-diving and have a cleanroom).

I vaguely remembered reading that one suggested Best Practice for such a situation involved a drill press — which we just so happened to have available in the lab.

I dare say the data has done left the building.

Digital Is Better Than Analog. God Said So!

Saturday, January 30th, 2010

It’s true. God (at least the Christian one, as Jesus) said so Himself:

“But let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil.”
(Matthew 5:37, King James Version)

Newtonian Physics Demonstration

Sunday, December 13th, 2009

…courtesy of Mother Nature.

Guys, Joshua/WOPR said it best:
“A strange game. The only winning move is not to play.”

Just — WOW.

Friday, December 4th, 2009

Speaking of Bad Code, I just ran across "The Who-Knows Code".

Either someone out there has a very VERY sick sense of humor, or otherwise he or she should be tracked down (we might want to put the FBI on this) and restrained by whatever means necessary from ever using a programmable piece of technology ever again.

Don’t believe me? Go see for yourself. “GOTO Considered Harmful,” indeed!

Bad Code Contest!

Thursday, December 3rd, 2009

They don’t know it yet, but several of my fellow geeks at Drexel are about to be the recipients of some Bad Code Offsets.

They’re like carbon offsets, only for lazy geeks who take the easy (and often ugly) way out when writing code. Things like allocating a huge honkin’ array at runtime instead of coding a linked list, or doing a sort in n2 time instead of n*log(n), just because you couldn’t be bothered to implement Quicksort.

I know I’m guilty. My code gets more maintainable as I get older, but not very quickly. If style violations were actually illegal, I’d be on a first-name basis with most of the folks at the Criminal Justice Center downtown, just on the basis of the last microcontroller project I did alone. It’s part assembly (some of it autocoded by a hacked-together FreeBASIC program), part macros, and there would have been some C thrown in for good measure if I hadn’t run out of time. Prior to that, I did another project where a VBasic GUI running on one machine worked alongside a QBasic program running on another, driving a microcontroller running a program written in assembly — and none of it presentable. (I guess I’m one of those programmers that Dennis Ray warned us about, way back when!)

The best part about these offsets is that the money goes to open-source projects. (I chose Apache as the beneficiary for the offsets I bought.)

I plan on putting these offsets to good use by starting an impromptu Bad Code Contest. No rules, except that the badness has to be confined to one egregiously bad line of code in the language of your choice. Something of such horribleness that it would make Dijkstra shudder from half a world away, in the same way Obi-Wan Kenobi felt a disturbance in the Force.

Bonus points for the Bad Line Of Code being implemented in assembly!

Really for the birds

Friday, September 11th, 2009

Now I know what my friend Leon is talking about when he complains about slow Internet speeds in Durban, South Africa.

A company in South Africa, annoyed with the slow ISP connectivity available, decided to stage a race between their ISP and a carrier pigeon, to see which was a faster method of transferring 4GB of call center data logs to their branch office 80km away.

The pigeon won.

Not only that, but it blew their ISP away. In the two hours, six minutes, 57 seconds it took to complete the data transfer (one hour eight minutes flight time, plus uploading, downloading, etc), their ISP (Telkom) managed to transfer only 4% of the data. For this particular application, that’s 1/25 of a pigeonbaud, I suppose.

As Andrew S. Tanenbaum famously noted, “Never underestimate the bandwidth of a station wagon full of tapes hurtling down the highway.”

…Or, apparently, of a homing pigeon carrying an SD card. And this one wasn’t even highly motivated!

Thatsa lotta beer!

Monday, August 10th, 2009

The statute of limitations is up on this by now, I think…

Back in the day, several ne’er-do-well CS students were enrolled in a certain CS150/151 class/lab, taught by a certain D. Ray with a certain M. Ghose as a lab TA. As the legend goes, they were bored in lab one day (having finished the ridiculously easy assignment in a few minutes, but not being allowed to leave early). They got the idea to put into practice their newfound knowledge of unsigned long integers (32 bits of nonnegative goodness, on those machines) by writing a technological take on the age-old “bottles of beer” song known and loathed by school-bus-drivers everywhere.

The technological take was to make the computers “sing” the verses of “Four billion bottles of beer on the wall” by writing the verses out to a disk. The code looked something* like the following:

#include <stdio.h>
int main(){
   unsigned long long beernum;
   for(beernum=4000000000;beernum>0;beernum–){
      printf(“%llu bottle”,beernum);
      if(beernum!=1) printf(“s”);
      printf(” of beer on the wall,\n”);
      printf(“%llu bottle”,beernum);
      if(beernum!=1) printf(“s”);
      printf(” of beer,\n”);
      printf(“Take one down,\n”);
      printf(“Pass it around,\n”);
      printf(“%llu bottle”,beernum-1);
      if(beernum!=2) printf(“s”);
      printf(” of beer on the wall…\n\n”);
      }
   return(0); //Outta beer, outta here!
   }

They finished writing it, so the story goes, just before the lab period ended, and set it in motion, telling their friend in the next section that it might be a good idea to save his work. Apparently the sysadmins hadn’t heard of disk quotas, because the drives rapidly filled up with the verses of what had to be the world’s longest song. According to aforementioned friend, one of the sysadmins ran into the lab about halfway through the next section, asking for certain students by name.

The interesting thing is, Moore’s Law being what it is, while such files might not fit in a user’s disk quota, they probably wouldn’t crash the server, either; at about 124 bytes per verse, the “song” would take up about 496GB (depending on whose definition of a GB you use.) This would actually fit on the free space on my 1-TB drive on my workstation at home (MSRP of just under a hundred bucks.)

Moore’s Law rocks.

* OK, so this isn’t the original code by a long ways — but it gives the flavor. The original:

  • was written in Pascal, not C;
  • wrote to the disk instead of standard I/O, and
  • probably didn’t have the fancy “bottle” / “bottles” code

Linus Has Spoken

Thursday, August 6th, 2009

I was reading a recent article (“Real Men program in C”) recently, and came across a link in the comments to Linus Torvalds’ opinion on the whole C-vs-C++ thing. Let’s just say he doesn’t mince words. (This is an excerpt, but it captures the flavor of the original post.)

What Linus said.

C++ is a horrible language. It’s made more horrible by the fact that a lot of substandard programmers use it, to the point where it’s much much easier to generate total and utter crap with it. Quite frankly, even if the choice of C were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use C.

In other words: the choice of C is the only sane choice. I know Miles Bader jokingly said “to piss you off”, but it’s actually true. I’ve come to the conclusion that any programmer that would prefer the project to be in C++ over C is likely a programmer that I really *would* prefer to piss off, so that he doesn’t come and screw up any project I’m involved with.

C++ leads to really really bad design choices. You invariably start using the “nice” library features of the language like STL and Boost and other total and utter crap, that may “help” you program, but causes:

– infinite amounts of pain when they don’t work (and anybody who tells me that STL and especially Boost are stable and portable is just so full of BS that it’s not even funny)

– inefficient abstracted programming models where two years down the road you notice that some abstraction wasn’t very efficient, but now all your code depends on all the nice object models around it, and you cannot fix it without rewriting your app.

In other words, the only way to do good, efficient, and system-level and portable C++ ends up to limit yourself to all the things that are basically available in C. And limiting your project to C means that people don’t screw that up, and also means that you get a lot of programmers that do actually understand low-level issues and don’t screw things up with any idiotic “object model” crap.

Random Thought Of The Day

Wednesday, August 5th, 2009

I wanna know:

Why does Windows’ Task Manager list the size of the “System Idle Process” as nonzero? Also, why is it different, on different computers? My desktop apparently takes 16K of memory to do absolutely nothing, while my laptop (memory hog that it apparently is) takes 28K to do just as much nothing-per-second.

Now, I know 16K or 28K is a drop in the bucket these days — my laptop has 2GB of memory and my desktop has 3GB* — but honestly, why should doing nothing be anything more than a line or two of assembly?

* Yeah, 3GB. Not only does the 32-bit version of WinXP not always play nicely with 4GB of memory, but Core i7 processors have three memory pipelines, rather than the more understandable two or four. (Maybe Intel decided they liked Google’s “Don’t be evil” and decided to go with “Don’t be normal” or something. I dunno.) At any rate, Core i7s like their memory in threes. Go figure.