Everything2
Near Matches
Ignore Exact
Full Text
Everything2

Stupidest thing you've coded just to see if you could

created by Hermetic

(idea) by Hermetic (6.8 y) (print)   ?   (I like it!) Mon Jul 10 2000 at 0:03:10

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.


(idea) by ccunning (2.8 mon) (print)   ?   (I like it!) Mon Jul 10 2000 at 0:39:25

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.

(idea) by imago (1.5 y) (print)   ?   (I like it!) 1 C! Mon Jul 10 2000 at 1:02:31

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.


(thing) by sydnius (3.6 y) (print)   ?   (I like it!) 1 C! Mon Jul 10 2000 at 2:18:16

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.

(idea) by getzburg (2.3 y) (print)   ?   (I like it!) 3 C!s Mon Jul 10 2000 at 2:18:35

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."

(idea) by illusionist (7.5 mon) (print)   ?   (I like it!) 2 C!s Tue Jan 02 2001 at 6:42:47

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."

(idea) by FlameBoy (1 mon) (print)   ?   (I like it!) 1 C! Tue Jan 02 2001 at 12:32:48

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.


(thing) by JeffMagnus (4.8 y) (print)   ?   (I like it!) 1 C! Tue Jan 02 2001 at 13:55:43

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.


(thing) by Ground Control (3.5 y) (print)   ?   (I like it!) Tue Jan 02 2001 at 14:44:55

"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.


(idea) by nocodeforparanoia (1.2 d) (print)   ?   (I like it!) 3 C!s Sun Jan 07 2001 at 17:30:11

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.


printable version
chaos

Mersenne Twister JenniCam TMTOWTDI Dumb things people wish they hadn't said
for(int *p=0;;*(p++)=0); Inefficient hello world programs EBCDIC ♥
Coming out of deep hack mode I Miss MIDI Video Game Soundtracks Dexedrine Prices should have no more than 2 significant digits
10 steps to becoming a Perl Ninja pseudo-random Hey, Mr. DJ, I Thought You Said We Had a Deal CFML
Fallen Madonna with the Big Boobies What to do if you've got too many votes on your hands ColdFusion Ouija board
Captain Crunch Perl as a functional language random number generator computer programming
No more writeups are being accepted for this node. If you have something to add that you feel is important, write it up in your Scratch Pad and ask a god or editor to take a look at it. If you feel you have something to add to this node, post it on your Scratch Pad and contact an editor.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Look at this mess the Death Borg made!
E2 Hospitality Index
Killing A Vampire: A Cross-Cultural Survey of Methodology
Watching my mother die
Semaphore
Marshall Applewhite
I wish I was carrying cigarettes
joy is like curing hiccups
Oscar Wilde
War of the Roses
Gospel of Thomas
Lady Jane Grey
Dr. Seuss
I left you a note and you replied to it
New Writeups
Heitah
Why I love Everything2(person)
trixingee
Dungeon Mastering for the first time(idea)
Netrat0
It's Called Subtext, Honey(person)
eyeofthebeholder
The Dragon(idea)
Heitah
consist, comprise, constitute, or compose(idea)
Meezzio
Gotlandssnus(thing)
argv
Astral Plane(idea)
Madara
One Winged Angel(fiction)
Tom Rook
Talk is cheap(poetry)
shaogo
Adelle Davis(person)
Aerobe
race car g sfjsgsd(poetry)
Binah
Dream Log: July 5, 2008(dream)
StrawberryFrog
Forgotten things in space(idea)
antigravpussy
velvet revolution fairy tale(idea)
Heitah
Nerve agent VX(thing)
Everything 2 is brought to you by the letter C and The Everything Development Company