Alex Papadimoulis

Founder, The Daily WTF

Nov 2008

Why Indeed

by in Representative Line on

Having just inherited a mammoth, ASP-based ecommerce application created in a developmestuction by a handful of different consultants over several years, Ryan Davis found himself asking one question, over and over: why?

Why didn't they use some off-the-shelf ecommerce site? Why aren't there any comments, anywhere?? Why did anyone let the original developer near a keyboard, let alone allow him to program!? Why did I even bother coming in today!?!?


This Just In, What?

by in Error'd on

"I've heard of Gisborne, Ashburton, Darfield, and Kaikoura", writes Steve Chadbourne, "but that last town is a new one to me."


Choose Your Own Include File

by in CodeSOD on

It seemed like a simple request. "Please add 'MAINT-CNTRL-ADMIN' to the cost center dropdown for client #876." It was also Scott A's very first assignment, having recently started as a web developer for the B2B merchandise reseller.

The ecommerce application he was hired to maintain was ASP-based and had been developed over the course of several years by an outside consultant. During the job interview, the system looked pretty decent: it tracked orders, inventory, products, etc. The UI wasn't wonderful, but it worked.


Y2K Pedaling

by in Error'd on

"Thank goodness this bicycle I'm borrowing still works after Y2K," Robin Sheat notes, "I can't even imagine the programmer-hours required to bring it up to spec."


Stupid Coding Tricks: The T-SQL Mandelbrot

by in CodeSOD on

The bar for entry into CodeSOD is pretty straight forward: professionally-developed code that elicits that certain What The— reaction. Though there have been a few exceptions over the years, generally speaking, student code, hobbyist code, and amateur code need not apply. That said, I'd like to try something a little different today. Today's example is not technically professionally-developed, it's a Stupid Coding Trick.

"So I was bored at work one day," Graeme Job explains, "and wondered, what's the most useless thing I could do with my time without actually doing anything. Then it hit me. I could use T-SQL to generate... Mandelbrot."


The Steak Dinner

by in Souvenir Potpourri on

Ever since the first Free Sticker Week ended back in February '07, I've been sending out WTF Stickers to anyone that mailed me a SASE or a small souvenir. More recently, I've been sending out the coveted TDWTF Mugs for truly awesome souvenirs. Nothing specific; per the instructions page, "anything will do." Well, here goes anything, yet again! (previous: A Crapton of Candy).


It's not every day that one is treated to a nice, steak dinner. Even rarer is when said dinner shows up at your front door, completely randomly and unexpected. Brandon "galgorah" Leach (Boston, MA) wrote, "here's at least one lunch you shouldn't be able to complain about. Well, unless you eat this all in one sitting."


Status, Please

by in Feature Articles on

“Just give me a damn status!” growled Murray, the aging IT project manager who everyone thought would have been retired by now. In fairness, the fifty-nine year old’s job performance hadn’t waned one bit through his decades-long tenure at Bell Labs. In fact, some would even say that in his later years, he traded some of his trademarked ferocity for geniality. “Dammit,” Murry barked two seconds later at Tom Limoncelli, one of the developers sitting around the conference table, “I don’t have all day! Give me a status!”

“Okay, okay,” Tom nervously responded, flipping through some papers, “we’re… uh, 30% through AMQ, 60% percent towards AMA-2, and… err… 100% for DBD.” Murray frowned and gruffly murmured something unintelligible. That was his way of saying “thank you.”


A Touch of Genius

by in CodeSOD on

“I recently started on a new contract,” Vedran R writes, “and the experience has been rather… interesting. The project I’ve been assigned to is a VB .NET 1.1 web application, and the code is rather… bad. Now, I know that developers make all kinds of compromises because of lack of time or experience but this is just… well, here’s some of the code.”

“Why fix the problem where it originates, it’s much simpler to handle it this way!”


Go Phish

by in Feature Articles on

A few years ago, researchers at Harvard University and UC Berkeley published a rather interesting study about phishing. After running a usability study to see how well people can detect phishing attempts, they found that:

  • 23% of the study's participants did not look at the address bar, status bar, or the security indicators
  • 68% proceeded without hesitation when presented with popup warnings about fraudulent certificates
  • 90% were fooled by good phishing websites.
  • Neither education, age, sex, previous experience, nor hours of computer use showed a statistically significant correlation with vulnerability to phishing.

To make matters worse, the study's participants were actually trying not to get tricked. "Our study primed participants to look for spoofs," the researches explain, "thus, these participants are likely better than 'real-world' (un-primed) users at detecting fraudulent web sites."


Moving Technology Forward

by in Error'd on

"I saw this sign in the window of an empty storefront," Jason Sullivan wrote, "and I can't decide if the biggest WTF is using poster board, stencils and multiple colors of what appears to be chalk in their quest of 'moving technology forward', or the fact that they apparently made a mistake while putting the 'N' in consulting and just decided to use a bit of masking tape to correct it, rather than flip the board over and start again."


Slow-Motion Automation

by in Feature Articles on

Photo Credit: Pulpolux !!! @ Flickr Despite being considered a small player in the insurance field, Mike I.'s company writes $1.1 billion in premiums annually and has carved itself a nice niche in the area of non-standard automobile insurance. Non-standard is for drivers who are rejected due to things like too many speeding tickets, fender benders or DUIs. Like all other insurance companies, Mike's relies on complex custom software to quote and write its policies.

Complex is a bit of an understatement. Because the company does business in more than 40 states, it has to comply with each and every state's specific insurance regulations. Certain types of coverage aren't allowed in some states, deductibles vary everywhere and the limits seem to randomly change. One of the biggest challenges with such complex software is that testing becomes very difficult.


Not Quite $30

by in Error'd on

"I took this with my cell phone at the gas station," T. Bare writes, "I think there's something wrong with their rounding... unless there invented a new increment of the dollar that I'm unaware of."


Raiding the RAID

by in CodeSOD on

"I'm currently in the process of customizing the firmware for a RAID controller used in some of my company's products," jspenguin wrote, "The LCD Controller Module (LCM) is written in PHP and, as it turns out, an LCM is not quite what PHP was designed for. In addition to abusing exec() all over the place, they poorly re-implement functions that are built-in to PHP."

function strcenter($string, $len = LCM_ROW_LEN)
{
    //printf("%s\n", __FUNCTION__);
    $size = strlen($string);
    if ($size > $len) return $string;

    $divisor = ($len - $size) / 2;
    
    unset($new_str);
    for ($i = 0; $i < $divisor; $i++) {
        $new_str .= " ";
    }

    $new_str .= sprintf("%s", $string);
    
    for ($i = strlen($new_str); $i < $len; $i++) {
        $new_str .= " ";
    }
    //$test = strlen($new_str);
    //echo "len = $test\n";
    return $new_str;
}

function strleft($string, $len = LCM_ROW_LEN)
{
    //printf("%s\n", __FUNCTION__);
    $size = strlen($string);
    if ($size > $len) return $string;

    $remainder = $len - $size;
    
    unset($new_str);
    $new_str .= sprintf("%s", $string);
    
    for ($i = 0; $i < $remainder; $i++) {
        $new_str .= " ";
    }
    //$test = strlen($new_str);
    //echo "len = $test\n";
    return $new_str;
}


 function LCM_get_base_position($length, $tag=TAG_NONE)
{
    for ($i = 0; $i < $length; $i++) {
        $string .= "X";
    }
    
    switch ($tag) {
    case TAG_ENT:
    case TAG_SCROLL:
        $max = LCM_ROW_LEN - 1;
        break;
    case TAG_SCROLL_ENT:
    case TAG_UP_ENT:
    case TAG_DN_ENT:
        $max = LCM_ROW_LEN - 2;
        break;
    case TAG_NONE:
    default:
        break;
    }

    $string = strcenter($string, $max);
    //printf("%s: str = %s, max = %d, length = %d\n", __FUNCTION__, $string, $max, $length);
    $pos = strpos($string, 'X');
    
    if ($pos == false) {
        printf("%s: Failed to get postion\n", __FUNCTION__);
    } else {
        return $pos;
    }
}