Recent Articles

Feb 2014

**ERROR IN FETCHTITLE.SQL**

by in Error'd on

Stephanie F. writes, "Not sure what this survey will be about, but I look forward to taking it!"


Split Second Load Balancing

by in CodeSOD on

In case you're not familiar with the concept of a load balancer, the purpose of having one is to spread requests across multiple, identical servers associated with it so as to give the requester the best possible experience. As an added bonus, you can take a box out of load, patch/fix/update it, and throw it back into the fray as the other servers, if you're doing things correctly, can temporarily handle the additional load.

Bottom line - load balancers are cool ...but it can be complicated and/or expensive to implement what is often a hardware based solution. So what can you do? Well, for starters, you could code your own.


Temporally Confused

by in Feature Articles on

Alex, web developer for Chronos Industries, thought she might be going crazy when the company's VPN server kept disappearing. Alex's VPN software would connect to the server without issue, but every half hour or so it would disconnect. It made FTP-ing any large files an exercise in frustration.

Her friend Karl, a research assistant from the upstairs Temporal Lab, was trying to tell her in layman's terms about one of his projects when it happened again. Until now she hadn't had any witnesses to confirm it when the IT department investigated.


Code that Works

by in Coded Smorgasbord on

The first step to working with dates is to learn when to use the built in APIs. The second step is to learn how to do basic arithmetic, as Ron shows us.

if (wishDate.Hour < 10)
{
   while (wishDate.Hour < 10)
   {
       wishDate = wishDate.AddHours(1);
   }
}
else if (wishDate.Hour > 16)
{
   while (wishDate.Hour > 16)
   {
       wishDate = wishDate.AddHours(-1);
   }
}

Translation Server Error

by in Feature Articles on

Val worked for a German electronics company that produced most of their hardware in an Eastern European plant. German wasn’t spoken there, but the plant employed translators to bridge the communication gap.

The first test units of Val’s major new product were about to hit production. His head engineer, Schwierigkeitmacher, would be visiting to the plant to ensure everything was in order.


Thoroughly Undefined

by in Error'd on

"I saw this while trying to scan and deposit a check into my bank account," Esteban wrote, "I'm not sure what to tell customer service."


Coffee Beats Wireless

by in Feature Articles on

Some people just can't function without their coffee. Jane had the rare distinction, in JD's opinion, of being a person who functioned pretty poorly even with her coffee—and she always seemed to have a mug in hand. Today was no different: she had her signature travel mug halfway to her mouth when she caught sight of JD approaching her cube with a replacement keyboard. Her eyes narrowed when she caught site of the cord wrapped haphazardly around the big black rectangle.

"I am not using a wired keyboard!"


Free TDWTF T-Shirt Day, Round 2

by in Announcements on

It's been a long while since our last Free Mug Day or Free T-Shirt Day. Too long, in fact. But wait no more: today is a new Free T-Shirt Day!

My company, Inedo, has decided to step up and sponsor this round of The Daily WTF T-shirts.


The Best Shopping System EVER

by in CodeSOD on

Dani was asked to replace a shopping system (that had been developed by a Highly Paid Consultant) with a better one. Dani expected to find high quality, well organized code that would be easy to modify. Undoubtedly, there would be some database housing all of the data.

Dani searched the code for the database connection to know where to connect and found this in a file named: shop$db.asp:


The Build of the Baskervilles

by in Feature Articles on

Dave sat in the conference room with his supervisor, Chilton. Every other participant of this meeting, supervisors of remote teams, looked on from a subdivided, giant projector screen. Each remote office was in a different time of day.

"Release 2.12 of TaskMaster was successfully pushed out this morning, UK time," Chilton said. "So far the user feedback has been above average. The new CSS transparent menus were a great addition from your team, Dave. Well done."

Dave nodded modestly.


Christmas is Cancelled

by in CodeSOD on

Murray’s company needed an easy way to tell whether or not a given date was a banking holiday or not. Someone wrote this function for MySQL .

CREATE FUNCTION `IS_HOLIDAY`(a_date datetime) RETURNS char(5) CHARSET utf8 COLLATE utf8_bin
   READS SQL DATA
   DETERMINISTIC
BEGIN

   DECLARE is_holiday char(5);

     select (CASE WHEN (DAYOFWEEK(a_date) = 1 OR DAYOFWEEK(a_date) = 7)

                      THEN 'Yes' ELSE 'No' END) INTO is_holiday;

   RETURN is_holiday;

 END

Please Remit Nothing Immediately

by in Error'd on

"I want to change my payment plan with Orange Mobile and get a new phone," writes David, "However, I can't even log in (or pay them) until I hand over 0.00GBP. I give up."


TC119a()

by in CodeSOD on

Matt recently made some changes to a “legacy” application. Unlike most legacy applications, this one was well instrumented with unit tests. Matt’s changes failed some of those unit tests, so he went to look and see what he needed to change to update the tests.


Best of Email: A Bad Opportunity, Bad English, Bad Math & More!

by in Feature Articles on

Don't forget, The Daily WTF loves terrible emails. If you have some to share, mail in your mail!


Unique vacancy you say? (from Michael H.)


Total Recall: The Directory's Cut

by in CodeSOD on

By day, Curtis was a PHP developer for a small ISV. The people he worked with were enjoyable and the work itself was decently challenging. All in all, it was nothing special.

However, in the evening, Curtis changed. Well, not 'changed', so much as charged. His clients, that is. You see, Curtis moonlighted for a number of small, developer-challenged companies, helping them build and maintain their Internet presence.


The Customer is Always Right

by in Feature Articles on

E. T. wrote to tell us of a support tale from days long gone by at a company long since acquired by a much larger behemoth. A customer had called in, entered all of his information, but hung up before a human got on the line. The support system generated a nameless ticket which got randomly assigned to one of the support folks. Then the customer called back, entered all of his information again, and got E. T.

The customer wanted to delete slice 0 on his system. For those of you not familiar with this, in *nix, slice 0 is the root of the file system and basically points to where everything on the disk is located. Deleting slice 0 is the equivalent of deleting everything on the entire hard disk. While there are the occasional disk corruptions that require this action, they are exceedingly rare, and once done, you are forced to reinitialize and re-install the operating system.


While Supplies Last

by in Error'd on

"In the inventory section, it says they have 1 quadrillion units of crab rangoon in stock," writes Michael, "With that many, you'd think that crabs would be extinct."


Date Formatting Done Right

by in CodeSOD on

Dates are complicated things. There are many different ways of storing them, and even more ways to present them. Converting them from one format to another always seems to challenge certain individuals. For this reason, the designers of most modern language libraries have taken it as part of their task to provide date handling utilities to deal with the nitty gritty of this task.

Most people appreciate the help and gladly use the built-in tools.


User Rejection Testing

by in Feature Articles on

The next feature confused Tim. After plucking all of the low-hanging fruit, the only requirements left were the ones that were difficult to understand or poorly specified in the functional documents. Right now, Tim had a fairly nice e-commerce system for handling most of the products and processes it needed to, but there was one requirement he didn’t understand: “System must calculate VAT appropriately.”

The system was complex, and served such a wide variety of products that there were several VAT calculations that could be correct. The specification didn’t define what “appropriately” meant in this case, and given the costs of being wrong, Tim didn’t want to guess. He rode the elevator all the way up to the lofty halls of the executive floor, where he found Reggie, the head of the finance department and primary customer contact for the e-commerce site.


The Midnight Cowboy Coder

by in CodeSOD on

The ball had just dropped, and Eric was taking the stairs to the fifteenth floor two at a time. Initech's New Year's party was in full swing, but it Eric wasn't simply in a hurry to join the festivities. He'd been watching the support queue all night, and at midnight the new monitoring program lit up like Times Square. The program was supposed to be simple: The new security cameras Initech had installed in their headquarters dumped video files in a folder every hour, and the powers-that-be wanted to make sure they were working without being obliged to keep an obssessive eye on the filesystem. Eric's colleague Ted was put in charge of solving the problem before the party, and he'd dumped his solution onto a production server in the nick of time. All had been well... for the first hour.

Eric burst through the balcony doors, out of breath. Around him, fellow Initechnicians were pouring champagne and trying to remember the inscrutable lyrics to Auld Lang Syne. Ted had attached himself to a gaggle of salespeople in sharp blue suits, one of whom was handing around cigars. Before Ted could lay hands on a lighter, Eric clasped his shoulder.


The Killer Product

by in Feature Articles on

In the early 2000’s, Eric worked for a small music retailer transitioning to “e-business”. The dot-com bust crippled it, and it wasn’t long before a larger predator gobbled it up. Eric now found himself in the employ of an electronics and entertainment giant. Amongst their weaponry were a huge catalog of songs, a line of MP3 players, and ample cash reserves- more than enough to squander on an acquisition they didn’t need. Eric and his group found themselves twiddling their thumbs for months.

Then iTunes reared its head, and suddenly Apple was a dangerous new player in the music arena. iTunes had to be driven to irrelevance, and the best way to do that was to follow them to market with a frantic catch-up music player and storefront whose mediocrity and compromised functionality would dazzle the world.
MP3 logo
Eric was tapped to work on this “iTunes Killer”. The project kick-off was centered in Los Angeles, with a video conference spanning the rest of the world. Eric was “asked” to fly down from San Francisco to meet the project manager, Mr. Vernon. The two of them would be working closely together.