Recent Articles

Dec 2008

Classic WTF: The Harbinger of the Epoch

by in Feature Articles on

The Harbinger of the Epoch was originally published on June 20th, 2006. Happy New Year, and have fun fixing those "Date Not Found" bugs created by your predecessors who never would have thought their software would see 2009.


January 19, 2038 is a date which will live in infamy. It is on that day that the 32-bit integer storing the number of seconds since the beginning of The Epoch will overflow, causing death and destruction unseen by the world since the Y2K Bug. As they did in 2000, software will spectacularly crash, hardware will explode, appliances will go haywire and attack their owners, and nuclear missiles will simultaneous launch and destroy the world. Casper Kvan was reminded of this impending doom when one of his systems suddenly went down.


Classic WTF: A Function to Quit For

by in CodeSOD on

A Function to Quit For was originally published on July 17, 2006


It's easy to understand how Mike Hartnagel got himself into the classic "should I quit after three days?" dilemma. Who would have guessed that a single bullet point on the job description -- "utilizing some Excel Interoperability" -- actually described the architecture of the system: a horrid amalgamation of Excel spreadsheets interacting with C# interacting with other spreadsheets. Who would have thought that all other bullet points -- from "multi-tiered architecture using remoting" to "automated/integrated build process" -- were actually features they'd like to have at some point in the distant future.


Classic WTF: Saved By The Burst

by in Feature Articles on

This is the version of Saved By The Burst (originally published November 20, 2006) that was included as part of the IASA's Dependency Identification and Management collection.


One of the more popular ideas from the dot-com days was to create a Virtual Currency Exchange. It's hard to say why. Perhaps their founders believed that merchants and consumers really needed yet another “layer of abstraction” in e-commerce. Perhaps they thought that merchants would sign up in droves when they heard about the opportunity to give away another percentage of each sale to another middleman. Whatever the reason, consumers avoided the dizzying medley of incompatible exchanges, leaving only a single VCE contender (PayPal) to remain after the dot-com bubble (and all of the “real” money behind it) dried up.

A Perfect Partner


Classic WTF: The Challenges of Negation

by in CodeSOD on

It never ceases to amaze me the lengths that certain programmers will go to solve the simplest of problems. Like, say, negation.

When "n * (-1)" Won't do ...

Originally published on August 12, 2004.


Classic WTF: A Secure and Well-Ventilated Location

by in Feature Articles on

A Secure and Well-Ventilated Location was originally published on January 9th, 2007


A major part of Don Q's job is to fly out to construction sites and setup their computer network. Weeks before doing this, Don meets with the project manager to make sure that every one knows what needs to be done and how to do it. It's up to the project manager to make sure that the workstations, server, cabling, power, etc. are all in place before Don arrives, and Don makes sure to give concise but not insultingly-simple instructions on how to accomplish that. One of these tasks is simply: install the server in a secure and well-ventilated location.


Classic WTF: Bunker Buster

by in Feature Articles on

Bunker Buster was originally published on Febuary 19, 2007.


“Hope I’m not waking ya up, but we need a huge favor.” It was just past dawn on a Saturday morning, and Jack’s new boss was on the line. “We need you to replace some servers for the portal system.”


Classic WTF: Now That's A Neat Trick

by in CodeSOD on

Now That's A Neat Trick was originally published on September 9th, 2006.


Brian was excited to join an organization that boasts managing data for "93% of all health care facility inspections." That's important stuff, after all: inspections are essential to maintaining the integrity of facilities and can make the difference between life and death of its patients. But after eight months working there, Brian now looks for facilities in the "other 7%" for his personal health care needs.


Classic WTF: Diary of a Third-Class Programmer

by in Feature Articles on

Diary of a Third-Class Programmer was originally published on September 27th, 2007.


Most first-class (consultants & employees) and second-class (contractors) programmers don’t realize that there’s an entire class of programmers below them. These programmers – the third-class programmers – work in Developer Purgatory with far less responsibilities, no latitude to make any decision at any level, and always get assigned the “dirty work.” In fact, some even consider it an act of charity to call these poor folks “programmers” at all.


Classic WTF: Journey to the Center of the Database

by in CodeSOD on

Journey to the Center of the Database was originally published on June 5th, 2006.


It'll be a long while before Donnie will forget about March 5th, 2004. Early that morning (during one of the ungodly hours), Donnie received his first off-hours support call. Naturally, one of the "mission critical" applications (more specifically, one that Donnie knew only by name) was completely broken and needed to be fixed right away. With the primary and secondary support guys unavailable, Donnie was on his own.


What the Ad? - Executives So Cra-zay

by in Feature Articles on

Here at work, we use a Lanier Multi-Function Printer/Scanner/Fax/Toaster the size of a small car that does tons of things and does them pretty well. However, back in 1981, Lanier was in the business of selling systems, and if you think that their EZ-1 was simply a word processor, you'd best think again.


The 8 Report and Other Gems

by in CodeSOD on

Peter Korsten used to work with a truly brilliant and exceptional individual. Before leaving for greener pastures and better pay, one of his former co-workers left an indelible mark on their system via his rather unique approach to programming.

The Great 8 Report

One of these artifacts was the "8" report which consisted of the following SQL query: 


Sponsor Appreciation, Kitchen Error, a Bathroom Warning, & More

by in Feature Articles on

It's that time again! Sponsors: we greatly appreciate your help in paying the bills here at The Daily WTF. And, dear readers, thank for support TDWTF by visiting these fine companies and checking out their products & services.

 

Infosoft Global   Infosoft Global - the developers behind the seriously impressive FusionCharts v3: interactive and data-driven charts, gauges, and maps for web applications. Reasonably priced (starting at $69), fairly licensed, and cross-platform, it's certianly worth checking out their free trial.
Dabble DB   Dabble DB - the online database tool designed for end users, empowering them to build and deploy applications in minutes. Check out the brief demo and free your users from their spreadsheet cells.
Mindfusion   MindFusion - a great source for floatcharting and diagramming components for a variety of platforms including .NET, WPF, ActiveX and Swing
Mosso   Mosso - massively scalable hosting for .NET (2,3,3.5) PHP, Ruby, etc., with unlimited sites & mailboxes, simple online provisioning, and an enterprise clustered platform that's supported by real people.
Mozy Pro   MozyPro - business-strength backup for consumer-level prices. Ideal for corporations, small businesses, independent contractors, and self-employed, MozyPro's secure online-backup provides all the professional features you would expect from a full-service backup solution.
Rails Kit   Rails Kit - developers of the Software as a Service Rails Kit, which includes well-tested modules, controllers, and utilities to handle all the billing/account/merchant legwork for your RoR application.
SlickEdit   SlickEdit - makers of that very-impressive code editor and some pretty neat Eclipse and VisualStudio.NET tools and add-ins, some of which (Gadgets) are free. Check out this short video highlighting just one of SlickEdit's Visual Studio integration features.
Splunk   Splunk - Search, navigate, alert and report on all your IT data in real time. Logs, configurations, messages, traps and alerts, script, code, metrics and more. If a machine can generate it -- Splunk can eat it.
SoftLayer   SoftLayer - serious hosting provider with datacenters in three cities (Dallas, Seattle, DC) that has plans designed to scale from a single, dedicated server to your own virtual data center (complete with racks and all)
WTF   The Non-WTF Job Board - Powered by HiddenNetwork, it features some great job opportunities like:

Security by Posterity

by in CodeSOD on

When Rory was interviewing for his position he liked what he heard. A robust data access layer, and a company policy that dictated that if you get caught writing a non-parameterized query, you're tarred, feathered, and recommended for execution. Their rigidity and adherence to the practices, as well as an interviewer asking all of the right questions regarding secure coding and good design ultimately lead to his acceptence of the position.

Once he was finally in, he cracked open the code, excited to bask in the radiance of beautiful data access layers, secure code, and well-implemented design patterns.


Unhelpful Help

by in Error'd on

"I came across a device on the network running on our old IP range," Landy Bible writes, "since we are still trying to migrate things, I decided to try and figure out what was. After running NMAP, I discovered that telnet was open. I opened up a telnet session hoping to find clues as to what the device was. Following is the output from that session."

- IBM Network Card for Fast Ethernet 10/100BaseTX AppleTalk/NetWare/TCP Printer Server -

                    Copyright IBM Corp. 1995 - 1998.
                           All Rights Reserved.

-------------------------------------------------------------------------

Welcome to IBM Network Card for Fast Ethernet 10/100BaseTX

Enter username, or HELP> help

Enter username, or HELP> HELP

Enter username, or HELP> admin

Server> HELP
Please refer to your User Manual

Server>

Your Glitch Has Been Reserved

by in Feature Articles on

Photo credit: 'Rob React' at Flickr When Nick Martin arrived at work at 8:30am, it seemed like he was in for a good day. Warm bagel and coffee in hand, he strolled into the IT office ready to fire up his email and maybe do a little recreational surfing before jumping into a day's worth of work. However, this was not meant to be as he was greeted by a support issue already in progress. And by "greeted", I mean "a dreary mess of a woman in a pinstripe suit was storming his way". It was Darlene, a manager from the university's financial department and conveniently, he was the only warm body in the office.

"Do you NOTICE any DIFFERENCE between these two printouts, Nick?"


The Backup Snippet

by in Representative Line on

Generally speaking, Andrew tries his best to avoid the DBA team. It's not just because database administrators tend to be a unique breed (his colleagues were certainly no exception), but because of the "things" that he'd heard about the team. The sort of "things" that keep developers up at night and make them regret not becoming an accountant.

One day, while debugging an issue with their monitoring scripts, Andrew had no choice but to check with Thom, a member of Team DBA. It turned out that one of DBA's had recently updated their database backup script, but Thom wasn't really sure who did it, why it was done, or what it looked like before. So, he just sent Andrew the entire backup script.


Open Sesame

by in Feature Articles on

Emmanuel Florac and the rest of his officemates had a bit of a problem: while they could freely leave the office as they pleased, none of them could get back in. Undoubtedly, it had something to do with the new ironclad door and accompanying electronic locking mechanism that was recently installed. Try as they might, no one’s keycard would open the door.

Throughout the day, the office manager could not get a hold of the locksmith. Call after call after call ended with a simple, “we’re sorry, this voicemail box is full; please try your call again later!” As afternoon grew shorter and the evening approached, the jokingly-proposed “someone’s going to have to sleep at the office tonight” became more and more a reality.


Insider Secret

by in Error'd on

"I found this in Chat Magazine's Summer Special edition," Simon Byford writes, "I can't see myself taking advantage of this insider secret any time soon."


Validating a Date with a Sledgehammer

by in CodeSOD on

I think that it goes without saying that handling freeform user input, no matter the programming language, can be a tricky endeavor.  Having to work with code like today's SOD makes me appreciate the pain felt by this bit of code Catherine Palmer inherited. 

Now, I won't say that this function is necessarily terrible code, but when you consider that the field that code is intended to handle demands (in big red text) the entry of a date in a specific format (DD/MM/YYYY to be exact) and that it's meant to prevent a user from entering a date in the future, it'll leave you wondering why "TONY B" chose this exact plan of attack.

<script language="JavaScript">
<!--
function validate_futuredate(userdate)
//--- THIS DATE VALIDATION WAS DESIGNED BY ----//
//---    TONY B------- ON 02/05/2000 -----//
{
//---- get user date ---------------//
dday = userdate.value.substring(0,2)
mmnth = userdate.value.substring(3,5)
yyear = userdate.value.substring(6,10)

//--- get system date ---------------
curdate = new Date()
curyear = curdate.getFullYear()
curday = curdate.getDate()
curmonth = curdate.getMonth()
curmonth ++
//--- add one dayto curmonth as function produces zero for january ---//

strday=String(curday).length
strmonth=String(curmonth).length
//--- check that system day and month length greater 1 if not insert zero ---//
if (strday == 1)
        {
      curday = "0" + String(curday)
      }
     
  if (strmonth == 1)
        {
      curmonth = "0" + String(curmonth)
      }  
//--- create todays date to write back to input box on user input error ---//    
ddate1 = curday + "/" + curmonth + "/" + String(curyear)

//--- get length and value of user input date ---//
posit = userdate.value
poslen = posit.length
//--- check date contains 10 characters ---//
  if(poslen != 10)
    {
    alert("date contains wrong number of characters default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
//--- get first character of date make sure its less than 4 ---//
posit0 = userdate.value.charAt(0)
if (posit0 < "0" || posit0 > "3")
    {
    alert("date contains invalid DAY default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
posit1 = userdate.value.charAt(1)

if (posit1 < "0" || posit1 > "9")
    {
    alert("date contains invalid DAY default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
   
  if (posit1 == "0" && posit0 == "0")
    {
    alert("date contains invalid DAY default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
   
  if (posit0 == "3" && posit1 > "1")
    {
    alert("date contains invalid DAY default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
   
posit5 = userdate.value.charAt(5)
posit2 = userdate.value.charAt(2)
if (posit2 != "/" || posit5 != "/")
    {
    alert("date missing forward / mark default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }

posit3 = userdate.value.charAt(3)
if (posit3 < "0" || posit3 > "1")
    {
    alert("date contains invalid MONTH default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
posit4 = userdate.value.charAt(4)
if (posit4 < "0" || posit4 > "9")
    {
    alert("date contains invalid MONTH default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
if (posit4 == "0" && posit3 == "0")
    {
    alert("date contains invalid MONTH default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }

if (posit3 == "1" && posit4 > "2")
    {
    alert("date contains invalid MONTH default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
posit6 = userdate.value.charAt(6)
if (posit6 != "2")
{
    alert("date contains invalid YEAR default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }
posit7 = userdate.value.charAt(7)

if (posit7 != "0")
{
    alert("date contains invalid YEAR default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }

posit8 = userdate.value.charAt(8)
posit9 = userdate.value.charAt(9)

if (posit8 < "0" || posit8 > "9" || posit9 < "0" || posit9 > "9")
    {
    alert("date contains invalid YEAR at position9/10 default value set")
    userdate.value = ddate1
    userdate.focus()
    return (false)
    }

if (dday == "31" && (mmnth == "04" || mmnth == "06" || mmnth == "09" || mmnth == "11"))
  {
alert("wrong number of days in specified MONTH default value set")
userdate.value = ddate1
userdate.focus()
    return (false)
    }
   
  if (dday > "28" && mmnth == "02" )
  {
alert("wrong number of days in specified MONTH default value set")
userdate.value = ddate1
userdate.focus()
    return (false)
    }
    if (yyear > curyear)
    {
    alert("future dates are not allowed")
    userdate.value =ddate1
    userdate.focus()
    return(false)
    }
else if (yyear == curyear)
{
    if(mmnth > curmonth)
    {
        alert("future dates are not allowed")
            userdate.value =ddate1
            userdate.focus()
        return(false)
    }
   
    else if (mmnth == curmonth)
    {
      if (dday > curday)
      {
      alert("future dates are not allowed")
          userdate.value =ddate1
          userdate.focus()
        return(false)
      }
    }
}
 
return(true)
}
//-->
</script>
 

What the Ad? - Portability, 1980's Style

by in Feature Articles on

If early 1980's marketing is to be believed, then the guy hauling around dead trees in a faux leather case is doing it completely wrong.


Java Takes Down the Network

by in Feature Articles on

Photo credit: 'Csaba_Bajko' at Flickr "Alright! 11:02 a.m...Another five bucks for me!"

Once again, Ricky Fine had hit it big in the network technician over/under betting pool for predicting the time of the daily network outage. It occurred around 11am, every day, but not precisely. The network would pulse on and off around 60 cycles per minute, but again, not exactly.


Not Quite Chilled

by in Error'd on

"Personally, I prefer my wine a little chilled," Kevin Burfitt writes, "or at least below boiling point."


Bringing Up Baby

by in Feature Articles on

Ray's life was out of control, but not in a bad way – it was just that everything was happening all at the same time. His wife was in her eighth month of pregnancy, so they were back and forth at Lamaze classes, babyproofing, and converting the spare bedroom into a nursery. Not to mention that Ray had received a better job offer and accepted, meaning that he had two weeks of transition at his old job and would have to hit the ground running as an admin at the new place.

Neither Ray nor his wife had a spare second to just sit down and catch their breath, which made their anticipation for their upcoming trip even greater. The idea was to drive from the south to the north and back again, showing off their baby to friends and family. It wouldn't have been a problem since Ray had accrued over two weeks of vacation time at his previous employer. His new employer, however, wasn't terribly understanding of the request when it came up. Ray begged and pleaded, and eventually worked out a compromise – he could take his trip as long as it started after he'd been there for a month.


#ifdef WTF

by in CodeSOD on

Something gives Dave the idea that several of these #ifdefs shouldn't actually be used...

      1 #ifdef BOGUS
      1 #ifdef BRUT_HAS_A_BUG
      1 #ifdef BUG92283
      2 #ifdef commented_out
      3 #ifdef DIRECTIO_ON
      1 #ifdef DONT_DELETE_PER_BOB
      1 #ifdef DONT_DO_THIS
      1 #ifdef DONT_LOG_IF_OK
      1 #ifdef HAS_NAMESPACES
      3 #ifdef HIDDEN
      1 #ifdef needed
      4 #ifdef NOTDEF
      1 #ifdef NotDefined
      1 #ifdef NOTDEFINED
      1 #ifdef NOTDEFINED
      2 #ifdef NOTNEEDED
      2 #ifdef NOT_NEEDED
      1 #ifdef NOT_REQUIRED
      1 #ifdef NOT_USED
      1 #ifdef NOT_USED_DELETE
      9 #ifdef NOTYET
      1 #ifdef NOTYET_NEEDED
      1 #ifdef old
      1 #ifdef OLDWAY
      1 #ifdef OLD_WAY
      1 #ifdef REAL_DELETE
      1 #ifdef SLEEP_DOESNT_WORK
      1 #ifdef TESTING_ONLY
     14 #ifdef TOO_MUCH_DEBUG
      2 #ifdef TOO_MUCH_INFO
      1 #ifdef TOO_MUCH_LOGGING
      1 #ifdef USE_OBSOLETE_CODE
      1 #ifdef USE_OLD_VERSION
      5 #ifdef USE_QUANTIFY
      7 #ifdef USE_STDIO_FILE
      1 #ifdef use_this
      1 #ifdef USE_TIME
      1 #ifdef UTIL_GLOBAL

Waiting to Excel

by in Feature Articles on

It was Seth's first day on the job. He had just completed the usual paperwork and orientation stuff, when his new boss Gabe said: "Why don't you take care of Issue #88743?"

Seth loaded up their issue tracker and eagerly navigated to #88743. The ticket read as follows:


McDialup

by in Error'd on

John W. snapped this on Memorial Day off of I-95.


Thirty X's

by in CodeSOD on

In today's fast-paced world of cell phones, Sega Nomads, and turn signals, we don't have time for anything. That's why we have acronyms. Just try to read until the end of this: International Business Machines Corporation. Congratulations if you're still awake – the rest of us non-MENSA types will keep referring to it as IBM.

At Chris N.'s employer, they needed the ability to look up acronyms' meanings, so one of Chris's predecessors got cracking on a solution. Not one to buy into that whole normalization thing, he created a table like the following:

ROWID ABBR_CDE ABBR_TXT
867 IBM INTERNATIONAL
868 IBM BUSINESS
869 IBM MACHINES
870 IBM CORPORATION

Thawtf

by in Feature Articles on

Not too long ago, Eric J. signed up for Thawte’s Personal E-mail Certificates service. While reviewing the various account settings, he noticed something odd. One of his “Lost Password” security questions read What was your alarm code to the Lindsay Bar in Trinity 1999?

Seeing that Eric didn’t have a house alarm in 1999 and, in fact, didn’t even know where Trinity was (let alone the Lindsay Bar), Eric was pretty sure that it was some kind of mix-up. He changed the security question back to What was your alarm code? and hit submit. No dice. When the page reloaded, it added the Lindsay Bar right back in the question.


Google Botched

by in Feature Articles on

With more than 1 million dollars spent in R&D, Brandon's software company wasn't keen on paying an outside firm to develop its new product's site. The product manager, however, was adamant that the company outsource.

"The last thing we want to do is risk our huge investment," the product manager reasoned. "Not only could our developers overcomplicate things, but they could very well neglect key features such as search engine optimization and usability, either of which would be disastrous to a successful product launch."


What the Ad? - Big Promises

by in Feature Articles on

I'm not saying that some advertising is prone to exaggeration, but sometimes, on occasion, the truth might be stretched at least a little bit.  Here are a few ads that I came across that I thought may be overstating their abilities just a little bit.

If "THE LAST ONE" is to be believed, any idiot can now write completely bug-free programs in plain English. All for only $600? More proof that my college education was only worth the certificate of attendance that I got out of it.


A Hatchet Job

by in Feature Articles on

Sebastian sat near a window, enjoying a hot dog in the warmth of the sun. The day was going wonderfully so far – he was the first to get to the newspaper that was left in the break room daily (and usually gutted by noon), he'd found a quarter face up near his desk, and his hot dog was particularly good since someone had left relish in the fridge with a note inviting anyone to help themselves. At first, he hardly noticed the hurried, heavy footsteps coming in behind him – "My f–cking VPN connection is broken again! Can't you stop fiddling with the god damn network‽"

Oh man... someone's getting it good! Sebastian sat motionless, afraid to turn around and catch some residual ire from whoever the CEO was yelling at. Chewing slowly, he kept eavesdropping. "Four weeks. Four f–cking weeks my connection's been on again, off again."


The Sky's the Limit!

by in CodeSOD on

This code was sent to John W. by the support staff of one of the larger software vendors with the stated purpose of determining how much memory a program could use on one of the corporation's Unix servers. 

#include <stdio.h>
#include <malloc.h>
 
int
 
main ()
{
float f;
char *p;
 
   while (1)
   {
      p = malloc(102400);
      if (!p)
         {
          printf ("malloc returned NULL\n");
          exit(1);
         }
  
      f += 102400;
      printf ("%g\n", f);
      printf ("%g %f %f MB\n", f, f, f/1024000);
  
   }
}

The Great Excel Spreadsheet

by in Feature Articles on

Photo Credit: 'pit-yacker' at FlickrFresh out of school, Maxim was able to score himself a pretty sweet entry level position in a small private bank. Rather than being responsible for maintaining the company's static phone book on the corporate intranet or some other stereotypical entry level thing, he was placed in the understaffed Publications department to do some surprisingly heavy impacting IT work.

The department's job was to produce and distribute various financial reports including the most important one of all - the Recommendation List. This list was considered mission critical for the bank as it contained the official recommendations of what stocks and bonds to buy or sell and was sent out to managers and customers alike. A bad recommendation could make or break the financial managers, not to mention the customers whom invested their money with the bank, who made decisions based on this information.


Variable Shrimp

by in Error'd on

"Hmmm," Michael pondered, "the 4-minute Shrimp takes 10 minutes to prep and 7 minutes to cook... maybe it only takes 4 minutes to eat?"


The Long Way toUpper

by in CodeSOD on

Have you ever found yourself writing a function to do something that seems pretty simple, then months or years later you find out there's a built-in function to accomplish exactly what you were doing? Maybe you didn't know where to look or the built-in function's name was confusing. I'd argue that Java's toUpperCase() does not fall in this category.

Somehow I imagine that if you were to reverse engineer the built-in method, it wouldn't look like this implementation (submitted anonymously):