Recent Articles

Mar 2014

The Fix

by in CodeSOD on

As one of the more experienced DBAs at RBC (Really Big Corporation, Inc), Marle was frequently called upon to review changes being proposed by her younger, less worldly-wise colleagues. This includes not just "pure" DBAs but also DBA wannabes (otherwise known as developers). Marle had no problem with this part of her job. People had mentored her when she was just getting started and paying back was just good karma. It was also, occasionally, the source for a really good WTF.

On a Tuesday morning, the following stored procedure to review came across her desk.


Dude Looks Like a Lady

by in Error'd on

The costume that Ray V. found reminds me of a certain Aerosmith song.


Bourne to be While

by in CodeSOD on

Alvaro M. used to work as a contractor for large US store chain where many things were accomplished via shell scripts. The majority of which were written by one guy who was the "expert" on scripting - a veritable scripting guru.

Scripts doing infinite loops and then sleeping for an hour were often the norm. The reasoning behind these being that "cron used too much server resources!" There was even a server where every user was allowed to put their scripts, that was painfully slow to use, partially because at any time you could see a couple hundred instances of 'sleep'...for example:


Hurry! The Daily WTF Survey Ends Soon!

by in Announcements on

Come April 1st, the survey page will disappear from all existence...leaving juicy data in its wake.

Is your data in there? If so thanks! If not, do it now! Get to the choppa!


Nobody Likes Andy

by in Feature Articles on

Everyone at Blackshaw and Blackshaw, or B & B, knew when Andy arrived for work. At 11 AM, the smell of stale beer and body odor would fill the office. John Little, Andy's coworker, could set his clock to it.

"Workin' hard or hardly workin'?" Andy said, slapping John's shoulder and leaving a patch of foul air hovering over him. He sauntered over to his desk, guffawing as he sat at his BBC Micro, playing some game he had bought down the street.


Chinese, Korean Japanese - It's All the Same

by in CodeSOD on

Matt H. and company recently added support for Cyrillic script to their PDF invoice generator when they discovered that none of the characters would print. The script used DOMPDF to convert the HTML invoices to PDF, and font handling across scripts can get a bit hairy, so it was not really a surprise. However, as he was digging through the code that generated the invoices, he found this little gem:

<?php
...
$body = mb_convert_encoding($body, 'HTML-ENTITIES', 'UTF-8'); 
 $body = preg_replace_callback('/(&#)([0-9]{4,})(;)/', function($matches) { 
 $code = $matches[2]; 
 if ($code<=19968 && $code>=40895) return $matches[0]; // not CJK 
    return '<span style="font-family:kochi-gothic">'.$matches[0].'</spank>'; 
 },$body); 
 $body = mb_convert_encoding($body, 'UTF-8', 'HTML-ENTITIES');
...
?>

Cheesy Karma

by in Feature Articles on

Chester was living it up. He worked for an in-demand contracting company, programming PLC controllers in an ancient language called “APT”. Very few organizations were experienced in APT, and Chester’s employer was often contracted to be a “firefighter”, when projects were ablaze and people were prepared to jump out of the windows to escape the heat.

Chester and his companion, Colby, were booked to work for the California Cheese Co.. The CCC was a notorious client. By paying late (or not at all), by inserting vague clauses into contracts, and by generally being complete jerks, they ensured the bankruptcy of their contractors- and bankrupt firms can’t afford to sue you for late payment. They would get millions of dollars worth of work done for hundreds of thousands. Chester’s firm was more cautious, more experienced, and more litigious than many of the CCC’s victims. They’d be receiving 100% of their payments, and not end up bankrupt.

Upset that they’d actually have to pay Chester and company, the CCC resentfully made the work experience as miserable as possible. They stuck Chester and Colby in a run-down trailer that smelled like curdled milk. It was a quarter mile from the main office, and the phones only worked when the temperature was between 67º and 67.85º, on a Tuesday, and even then only when you didn’t actually use them. This meant that even the most minor question involved a long trudge through a hot, southern California summer. By the time Chester got back to the trailer, he smelled like a brick of Limburger that had baked in the sun all day.


Ever Work with Offshore Development Teams?

by in Error'd on

"I have a feeling this position posted by Hawaiian Airlines might involve working with developers who are located offshore," writes Jeff Buck.


Government, Inc.

by in Feature Articles on

Big corporations are bureaucratic enough to make you say: "wtf?!"

Governments are bureaucratic enough to make you shout: "WTF!!!"


Test Driven Delay

by in CodeSOD on

The application that Motumbo works on has huge codebase and very few tests. The majority of these exist to test integration and interact with the DB or other external systems - they either print something out or rely on exceptions being thrown.

The rest, didn't actually work (e.g. reference local paths) and weren't executed in the main build. Instead, there's a separate build which runs them and succeeds even if they fail. Thankfully, this situation was correctly recognized as being ridiculous and the decision was made to clean house and either fix or remove the useless, broken ones.


Reader Survey & Tokyo Meet-up

by in Announcements on

It's been a long while since the look and feel of The Daily WTF has been updated. The last update was a little over six years ago when MySpace was still king, Twitter was a silly new fad, and the iPhone was but a few months old. We expiremented with a new look on the OMGWTF2 Contest Mini-site, and got some pretty positive feedback.

In an effort not to pull a Slashdot (or worse, the rename that shall not be named) , we wanted to ask you, the reader, what you think about an updated look and feel. So, even if you really don't have an opinion, please take a few moments to fill out the reader survey.


Change Request

by in Feature Articles on

Yet another high-priority support request buzzed into John's phone, just like the hundred before it, and the hundred sure to come. There wasn't any point reading the email. It'd just tell him what he already knew.

"eCommerce clients can't connect to the FTP server since this morning," John announced, entering the lair of Clayton, the company's Network Guru (self titled). "Is something wrong with the FTP server?"

"Nope."

Then silence. Clayton didn't look up from his monitor. His slicked hair shone with the glow of a thousand server-rack blinks.


Caching Debugs

by in CodeSOD on

Christian's team was writing a time-management application in Java and utilizing a third party library. The application needed to be up and running 24/7.

A few days after a recent release, a customer called in a problem report complaining that the JVM heap was growing in size over time until it crashed with an out-of-memory error.


A Delicious British Holiday Treat?

by in Error'd on

"I wasn't very impressed by the choices of chocolates offered around Christmas last year," David N. wrote.


Some Useful Bits

by in CodeSOD on

A junior developer recently left the firm that Graham works for. In an act of great kindness and generosity, before officially departing, he sent to the developer who had inherited his work a file titled 'Useful_Bits.txt' - some code that he had lovingly written and could potentially be reused.

The file included, among many other things, the below gems. The last one had reportedly taken ages to write but the departing dev got upset when it was pointed out that you could do it in one line by overloading ToString() or using string.Format()...


Spool Me Once

by in Feature Articles on

A support ticket first thing in the morning was bad. A critical support ticket, even worse. A critical support ticket for Xmain? Sara debated calling in dead, but too many people had seen her enter the building. With knots in her stomach, she opened the ticket and read the problem description.

No users at Hewville can open Xmain. They get an error saying it cannot connect to XM720H (not sure if this is a server name or what). Let me know if this is an issue you will be able to assist with or if you need more info. Thanks!


Knowing is Half the Battle

by in CodeSOD on

At Initrode, their main business is large-scale data warehousing. Their products are used by the biggest companies in the world, and to keep up with demand, naturally, they have hundreds of rock star developers churning out incredible solutions.

They also have Commander Joe.


It's My Network, I'll Configure it if I Want To

by in Feature Articles on

When Alex was a fresh young admin, he was assigned to provide network support for a team of master developers. These guys had years of experience and knew what they were doing, so when they asked for something to be set up, you could bank on their request being correct.

Alex recieved a request from one of the master developers to set up a VM for him and his team. Since it was a development machine, the developers were given root access.


Pixels are Expensive!

by in Error'd on

"I'm not quite sure what to think of the software developer who apparently thought that the perfect way to say you wanted to continue was to choose 'cancel'," Dirk wrote, "Maybe another button just wasn't in the budget"


Exceptional Recursion

by in CodeSOD on

Learning to handle exceptions properly, knowing when to catch, and when to throw them, is an art. Knowing when it’s a case to retry or to abort a process requires a deep understanding of the problem you’re going to solve.

This code, which Adam found, is a pretty bad example of what to do:


We are NOT Meatbots!

by in Feature Articles on

Sales, as everyone knows, is the mortal enemy of Development.

Their goals are opposite, their people are opposite, their tactics are opposite. Even their credos - developers "Make a good product" but sales will "Do anything to get that money" - are at complete odds.


Screwing Up the Screw Up

by in CodeSOD on

Highly Paid Consultants™ should be knowledgeable in their claimed area of expertise. One would assume that any consultant would have a basic understanding of what passing parameters to a function is for and how to utilize that concept in their chosen programming language.

One would be wrong.


The Out of Office Outage

by in Feature Articles on

The ICSP compliance application was a dull piece of software. Instead of managing Active Directory with one of the many off-the-shelf packages, this was built in-house, and helped the sysadmins manage user accounts, permissions and access. Despite the fact that this application had no right to exist, it did, and it was tied into so many IT business processes that ICSP was marked a “critical” application.

Kelly spent too much time with her hands deep in the entrails of this ugly creature. Since she “owned” it, she was the recipient of a panicked email: “ICSP is down! What did you do?” She had changed a few things is code, recently, but nothing had been released to test, let alone production. Quickly, she skimmed the email chain.