Recent Articles

Aug 2012

Luck of the Draw

by in Error'd on

"One of these icons closes the current window, one completely exits the program," observed Sam Oldak.


PIN Panic

by in Feature Articles on

Credit: racheocity@Flickr; # 54 :: 02/23/10 :: My door handleBill T's morning was off to a really bad start. First, his alarm went off late. This forced him skip his morning coffee which, in turn, made him so groggy that he blew right through a stop sign on the way to work causing a near-miss with some guy on a bicycle. A passing police cruiser noticed the event and Bill was issued a citation, the writing of which resulted in him arriving almost an hour late to work.

And now, just when things couldn't get any worse, his security fob didn't work.


The Race Case

by in CodeSOD on

"I'm trying to figure out some code and I don't even know where to start with the WTFs!" writes Rachel. "The design has introduced me to a new level of terrible. The naming convention is inconsistent, and the WTFs just keep coming..."

"Here's one of my favorite snips of code. Apparently names are all numeric, and everyone has to be White, Hispanic, Asian, or Indian."


Healthy Competition

by in Feature Articles on

“This one’s going to be a little different,” Tom said.

Rich agreed, although for the wrong reasons. He thought it was going to be different because this was their first really big contract. Rich worked for Tom at a “new media” company young enough to have that “new company” smell. They had just landed a contract with Initrode to add some major features to their website.


Data? Data data. Data.

by in CodeSOD on

It's natural for a development team to spread the work out. Each member writes small modules, and then the modules are all assembled to implement the business functions the software requires. Sometimes, each developer has a distinct touch and style, and you can tell, just by naming conventions, who was responsible for which block of code. And sometimes, you get blocks like this.

  var srcData = data;
  if (data.data && data.data.data) {
      data = data.data.data;
  } else if (data.data) {
      data = data.data;
  }

  if (!data) {
      return;
  }
Data, data. Data data? Data. Data! Data data data, data data… data.

It Doubles as an Oven!

by in Error'd on

"It's a good thing I decided to test this machine out," writes Jim, "We had been looking to replace / repair our oven, and it seems we can just bake on the hard drive."


Square Peg Meets Round Hole

by in CodeSOD on

Have you ever been faced with this scenario? You need to unscrew a Phillips head screw but you only have a similarly sized flat head screwdriver available.

I have and boy was it ever frustrating.


Can of RAID

by in Feature Articles on

"The rent must be cheap," Alex mused as he pulled into the muddy field that served as a parking lot. He guided his car into a spot beside another car, which happened to be up on blocks. The building he was here to visit was a double-wide trailer that had started rotting before Alex was born and didn't intend to stop until well after he was dead.

It wasn't a very nice office. Alex was there because his employer owned it, and the handful of employees located at this site depended on its local RAID for file storage. Sometime over the weekend, the RAID failed, and now he needed to fix it.


The Unimportant Clients

by in Feature Articles on

Credit: Marcin Wichary@Flickr; Data processing center, pt. 5About a decade ago, Coyne's employer at the time hosted various application systems for multiple clients running on their IBM host.

The clients ranged from a high profile Fortune 100 client all the way down to companies that were so small that they would probably rank in the Fortune 10,000,000's...and it was up to Coyne to do a Disaster Recovery Plan (DRP) for one of the clients' application systems. Specifically, the applications were responsible for payroll, direct deposit, etc.


Globally Fiscal Year

by in CodeSOD on

It's easier to teach a non-programmer to program in an object oriented language than it is to teach a Cobol programmer to do the same. That's my experience, and I think Clint would agree. He sent in this VB6 block that he inherited, developed by a self-proclaimed Cobol fanatic. There's not a lot code here, but nearly every line has something… special.


            

Beware of the Banana Cream Pie Blizzard

by in Error'd on

"I was looking up the point values for Dairy Queen in the Weight Watchers iOS app," writes Vince, "and I think that I'm going to have to pass on ordering the Banana Cream Pie Blizzard."


There's Always Room to Expand

by in CodeSOD on

"I was going through old e-mail from several years back I ran into this gem," writes Lianna. "This snippet, with data anonymized, comes from the logs of the database as some of the queries that were performed by a particular PHP system:"

update tmp set f76 ='p' where f0=1961520010330;
INSERT INTO tmp (f0,f18,klther) VALUES ('1961720010330','985356431','bestaand');
update tmp set f1 ='' where f0=1961720010330;
update tmp set f2 ='' where f0=1961720010330;
update tmp set f3 ='M' where f0=1961720010330;
update tmp set f4 ='J.' where f0=1961720010330;
update tmp set f5 ='Doe' where f0=1961720010330;
update tmp set f6 ='' where f0=1961720010330;
update tmp set f7 ='Somestreet' where f0=1961720010330;
update tmp set f8 ='123' where f0=1961720010330;
update tmp set f9 ='1001' where f0=1961720010330;
update tmp set f10 ='AA' where f0=1961720010330;
update tmp set f11 ='SOME CITY' where f0=1961720010330;
update tmp set f12 ='0123' where f0=1961720010330;
update tmp set f13 ='456789' where f0=1961720010330;
update tmp set f14 ='[email protected]' where f0=1961720010330;
update tmp set f15 ='1440513' where f0=1961720010330;
update tmp set f16 ='jdoe123' where f0=1961720010330;
update tmp set f29 ='1195073' where f0=1961720010330;
update tmp set f20 ='1001' where f0=1961720010330;
update tmp set f21 ='AA' where f0=1961720010330;
update tmp set f22 ='0123' where f0=1961720010330;
update tmp set f23 ='456789' where f0=1961720010330;
update tmp set f76 ='p' where f0=1961720010330;
update tmp set f48 ='' where f0=1961720010330;
update tmp set f49 ='' where f0=1961720010330;
update tmp set f50 ='' where f0=1961720010330;
update tmp set f51 ='IEG' where f0=1961720010330;
update tmp set f30 ='1287342' where f0=1961720010330;
update tmp set f59 ='AQ' where f0=1961720010330;
update tmp set f61 ='' where f0=1961720010330;
update tmp set f75 ='' where f0=1961720010330;

The Process that Never Failed

by in Feature Articles on

Richard fumbled with his key card, taking care not to accidentally spill his coffee as he entered the conference room. Normally, he was as much a morning person as the next guy, but for him, arriving to work for a 7AM meeting was best suited for the birds. Richard had some hoped that this meeting would at least involve some donuts, but he knew better. After all, they don't title happy project kickoff meetings "Damage Control".

When Richard arrived at the conference room, everybody else was in the same hazy state he was, each nursing a large cup of joe and awkwardly attempting to stifle a yawn. Everybody that is except for Richard's director who nervously got down to business.


GUGUID

by in CodeSOD on

GUIDs are unique, but are they unique enough? There is, of course, a slim chance of a collision. Sure, you're more likely to be struck by a meteor and lighting while winning the lottery on a Tuesday during Lent while driving your Ferrari to the diner for pancakes, but it can happen!


Refresh Your Virus Scanner

by in Feature Articles on

Timmy threw open the door to the team room. Panting, he cried, "We're being hacked!"

Blair and the rest of the team slouched into action. They knew the web server was down, but that was hardly unusual. The "web server" was Blair's desktop from five years ago, reformatted and turned into a host for their home-grow project-management software. It dwelled under his desk, away from the light, and was not generally considered mission critical. The fact that it was down, again, didn't rate a high slot on anyone's priority list.


You Don't Exist. Go Away!

by in Error'd on

Chris got this error while playing around with Xcode. Though he could prove to the contrary, he was given no choice other than to agree.


Representative Line - jQuery Search n' Replace

by in Best of the Sidebar on

Out on the The Daily WTF Forums, user dynedain found this gem while doing maintenance on a site that's a huge pile of static HTML files:

$('.bottom_content a').each(function(){ var temp =
              $(this).html().replace('ClientName¬ÆClientService','ClientName®ClientService'); $(this).html(temp); }); 

Common Functions, not Common Sense

by in CodeSOD on
Ben inherited a an application from a fellow employee on the fast track to retirement. How fast? Well, these are some sample methods in a thousands-of-lines-long class file called, appropriately, "Functions".
	public static string ReturnEmptyStringIfNullElseValue(string value)
		{
			if (value == null)
			{
				return "";
			}
			else
			{
				return value.ToString().Trim();
			}
		}

That isn't the worst, most useless block of code possible. Neither was his method to turn strings into ints.


There's a Rat in my Computer, Naughty NAS, and other Support Stories

by in Feature Articles on

There's a Rat in my Computer (from M. Fragger)

A man called in distraught. "There is a rat in my computer!" 


The Long Goodbye

by in Feature Articles on

Herwig smiled at Greta as he entered the glass-walled copy-center. "Excuse me, but do you mind if I ask you a few questions?"

Greta smiled back. Over the past week, they'd certainly seen enough of each other. "Of course not."


Kentucky Fried Cat

by in Error'd on

Ok, everyone, let's pitch in so Kristof Mattei can finally get this folder of his deleted.


Oh, so THAT's what's wrong!

by in Feature Articles on

Hey - just a quick reminder - if you haven't checked out our free Daily WTF T-Shirt Giveaway sponsored by our friends at New Relic, you might want to get on it before it ends. Supply is limited to 250, so sign up soon!


As submitted by the user. Click for big version!John Kupski received a call from a user recently about a failed laptop. The irate user complained that his laptop was dead, had not worked at home all weekend, and he had no idea what had happened to the unit even though it had stayed put on his dining room table the entire time.


SQL Splits

by in CodeSOD on

"I should probably start by saying that I am not a SQL expert," Paul wrote. "Sure, I've written my share of SELECT statements, plenty of UPDATE statements, and even a few ALTER statements, but beyond that... nada."

"Fortunately, we do have a SQL guru at work that I can learn from, and thankfully, his code is right there, in the database. Imagine my delight when I uncovered this 2,045-line snippet of SQL Magic that, so far as my non-expert mind can tell, attempts to split a name like 'HARTLEY JR' into two parts."