1. When I first learned CFML I wrote a ColdFusion virus.
When run, it would recurse the drive of the machine it was on and convert all .htm and .cfm (coldfusion) files to copies of itself. Of course, the only way for it to replicate would be to click a link on a system you have access to... Thank god for back up tapes. (It was an accident. I clicked the wrong link. I swear.)

2. Around the same time I wrote a JenniCam bot. It downloaded Jenni's current picture and saved it with a timestamped filename, every fifteen minutes. I let it run for a little more than two weeks. I got nearly 1500 consecutive pictures of Jenni, thoughout her life.
That sounds pretty cool until you think about how much time she spends sleeping, out of camera, etc. So, of 1500 images, about 4 were worth keeping.

Viva la geek.

That would have to be mod_auth_rand. Yes, the worlds most useless apache module, which randomly authentictes users... I actually wrote it as a practical joke on my boss... And it didn't contain any wussy libc rand() calls, oh no, it was Mersenne Twister all the way baby.

I wrote an X windows ouija board for the final project in my programming environments I class. This was about 9 years ago. It had buttons for each letter (and one for space). When the pointer moved over a button, the corresponding letter would print in the text box at the bottom of the window. The pointer would also move itself every few seconds, thanks to the XWarpPointer() call.

I'm pleased to say that the prof had a great sense of humor, and gave it a very good grade despite its singular defect: that it was possible for the pointer to warp itself out of the application window.

I once wrote a Z-80 assembler spectrum analyzer for a TRS-80 model III, using the cassette audio in port. This was a simple off/on gate that sensed voltage. In effect, it was a 1-bit ADC. The response probably only really detected up to about 1200 Hz. It was lame, and simply counted the cycles between transitions of the in port, and filled the appropriate frequency "bin". Tweaking the decay values resulted in something that actually did a job as a crude frequency analyzer.

Oh yeah, I also once wrote a little ditty on that TRS-80 that recorded 48 seconds or so of 8 KHz 1-bit audio (remember, we only have 48K of RAM), and then would play it backwards.
Once upon a time I got into an argument with my high school CS teacher about whether the Turbo Pascal random number generator really generated random numbers. Being fairly knowlegeable even as a freshman, I insisted (correctly) that it really only generated pseudorandom numbers and that no algorithm could ever generate a truly random number. She was fairly incensed, as this was in direct conflict with what she was trying to teach us at the time.

Now, before you all start dumping on the Rhode Island school system as being so idiotic as to hire a nitwit like this woman, I will just point out that she was fired not long after I left, when her incompetency was finally discovered. She then went back to her previous vocation, a franciscan nunnery.

Anyway, she staunchly insisted that TP could generate real, actual random numbers. So, while she continued with her lesson, I wrote a little ditty that would generate a random number, truncate it, convert it to ASCII, and output it to the line printer in the corner of the room. I sat for a moment, poised over the "compile and run" button, and briefly considered what I was about to do. With a mental shrug and a "Fuck it", I clicked. The 386 struggled for a moment, then smoothed back out, and the old, decrepit Epson began shrieking in protest. As Sister Ignorance frantically pushed buttons in an attempt to halt the outpouring of crap, I casually strolled to the printer and examined the output.

"Wow, look at that, recurring patterns!" She glared at me with those squirrelly little eyes, and I knew I was in for some trouble.

Two hours later, I had time to reflect on my sins as I cooled my heels in in-house suspension for the first of three days. But my contemplations were sweet, as I reflected on the last words of our sysadmin as I was dragged from her office, having been thoroughly chewed out for bolloxing the print queue.

"By the way, he's right. They're pseudorandom."
We had an ACM programming contest that was to write a program that printed it's own source code. The history behind these programming contests was that no one ever did them, or they were too hard and too obstruse (or poorly explained) that they were never quite worth it).

So one day, one kid suggested this contest (that we write a program that prints its own source code in C). The rules were that it had to use g++ (or gcc, which ever is your poison), and the standard preprocessor (no perl, scheme, JScript, whatever). The thing was, is that this kid, who shall remain nameless, had been working on it for three months (at least). I thought this was stupid and unreasonable, so I wanted to do something about it. It's been done a million times on the web (you can do it with number tables, and you can do it with interesting character sets and variable choices, etc). I was thinking up a way to do this, and then it hit me.

Let's do it in the preprocessor

That's right. I was determined to #include the code into itself in some sort of string, and print it out at runtime. It forced me to learn a TON about how the preprocessor works. I only worked on it for a few hours to mild success, although I was determined to beat that guy. I managed to get a program to print it's own source code with nine characters.

"#error hi"

...was the name of the beast. In the g++ precompiler, that stops compilation and dumps out the line it errored out on. Since it was only one line, it was the entire source. It was so simple and stupid. I did my best to make fun of the stooge who proposed the contest; or at least I made enough people laugh about it to be worth my headache.

To this day, the #include solution still eludes me. I go back to it sometimes in a spare moment. I'll come up with it sometime, but until then, it's still a little funny (and sad). "They never said it had to compile."
I once sent around 40 computer science students home early with a three character unix script file. I was just trying to learn about how the system worked and was messing about with scripts that spawned other scripts when I thought of this one. The file was called simply a and it's contents were...

a &

When it ran it ate up all the available processes on the server. This meant that I had no obvious way of stopping it running because there were no free processes that I could use to kill it. Unfortunately the whole class were working on the now overwhelmed machine and found they couldn't do anything with it.

Eventually, I got it by logging onto another server with access to the same hard disk and deleting the script file.

The stupidest program I have written has to be a program I wrote to annoy someone in the programming class before mine in high school. I knew this character always used the same computer that I did and that his class was always at the same time. I downloaded a C++ TSR library known as tsr100je.zip from SimTel and coded up a program that would stay resident and then launch at the appointed time. I then modified COMMAND.COM on the computer so it load a different file at startup than AUTOEXEC.BAT, and stuck my TSR into the new AUTOEXEC.BAT. I turned off my computer and then left.

Apparently, the program worked and it really perplexed its itended target and my programming teacher. She had me check the computer for virii when I was in class, so I removed the program from the new AUTOEXEC.BAT and that was the end of that.

Any way, the program would start off pretty benign: it would print random characters on the screen at random intervals. Then the real fireworks began. I had just learned how to change the colors in the color pallete in text mode, so I had the screen appear to fade to black. For effect, I had the program fade the monitor in and out for awhile using random colors. Finally, I disabled Ctrl+Alt+Delete and printed some random messages on the screen.

It was fun to write, but boy was it useless.

"Wheel Of Lunch". At this company where I worked for three weeks, we went out to lunch every day, often on the company's dime. It got to be so much mental effort to choose a restaurant that one of my co-workers set up a MySQL database with various information about nearby restaurants (e.g. vegetarian meals available, cheap vs. expensive) and I whomped up a little Perl script that would, given certain criteria, pick a place for lunch at random.

The really sad thing is, this tiny app was a lot more useful than the software that the company made its revenue from. But that's a story for another day.

One time in fourth grade I used my Captain Crunch secret code ring to write a note to my best friend that said, and I quote:

"Ms. Restivo has big boobies!"

Ms. Restivo, my 25-year old fourth grade teacher found it, and easily decoded it in about three seconds, then sent us both to the principal's office. It was the only time I was ever sent there, and the principal laughed so hard I was afraid he was going to die. I just about peed myself in terror. He went ahead and called my parents, who were rather less amused by the whole ordeal.

Log in or register to write something here or to contact authors.