You are not logged in.

#1 2005-07-25 18:10:10

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

source code hilarity

ok... so, I was looking through the source of scrunchy which is a very simple web server, written in one single c source file of about 20KB, and came across this gem:

    /* Are they on our shitlist? If so, send feces.
     */
    if (ip_block_all[prefix])
        send_feces (fd);
    if (ip_block_sub1[prefix] == second)
        send_feces (fd);
    if (ip_block_sub2[prefix] == second)
        send_feces (fd);

I almost died laughing... and I really wish I had the opportunity to write a send_feces function...

Anyone have any other diamonds-in-the-rough like this?

Offline

#2 2005-07-25 19:15:28

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,615
Website

Re: source code hilarity

rofl! great!


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#3 2005-07-26 12:20:37

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: source code hilarity

Came across this the other day
if (s.trim() == "" && s != null)


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#4 2005-07-26 16:41:45

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: source code hilarity

wdemoss wrote:

Came across this the other day
if (s.trim() == "" && s != null)

hah! that took me a bit... but I got it.

Offline

#5 2005-07-26 16:52:41

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: source code hilarity

well phrakture, u got me intrested (after i stopped giggling for a while...), so i browsed the sources a bit... seems the author is having a good sence of humor :

int send_feces (int fd)
{
...
    char *feces = "<html><body><font size=+3>Your IP looks like that of a hacker, thus I repel you.";
...

and he doesnt stop there :

int send_witty (int fd)
{
    char *witty = "<html><body><font size=+3>Only a girly-man would make a request such as you have just made.</html>";
...

smile

Offline

#6 2005-07-27 04:52:58

wdemoss
Member
From: WV - USA
Registered: 2004-01-18
Posts: 222

Re: source code hilarity

Here is another one from the same code base

List list = null;
try {
     list.add(new Object())
} catch (Exception e) {
     log.warn(e)
}
return list

Surprisingly it never worked quite right smile


Hobbes : Shouldn't we read the instructions?
Calvin : Do I look like a sissy?

Offline

#7 2005-07-27 07:41:49

mmgm
Member
From: Israel
Registered: 2005-05-26
Posts: 52
Website

Re: source code hilarity

There's a whole bunch of stupid code excerpts and dumb quotes about programming, right here

Offline

#8 2005-07-27 14:58:22

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: source code hilarity

This is from a Perl script I was provided at work:

# do the initializations...
do_inits();
# retrieve parameters for this report (from gjbprun)
retrieve_parms();
#delete the stored parameters
del_parms();
# do the sql preps
do_preps();

Then later:

# Call the procedure student_hdr
student_hdr();

This part isn't dumb, its just kind of funy:

$endoftime = '99990101';

talk about meaningful variable names... (I know exactly when I'm gonna die. My birth certificate has an expiry date)

Dusty

Offline

#9 2005-07-27 18:39:40

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: source code hilarity

$thissucks = 0;

I thought that was hilarious, but its even funnier when I realized it was in a block of variable definitions preceded by a comment saying "should probably start using more meaningful variable names"

Dusty

Offline

Board footer

Powered by FluxBB