Recent Articles

Mar 2016

A Meaty Problem

by in Feature Articles on

“The scales are down again, where the heck is Andre?”

Roger had heard this cry often enough that he didn’t bother to poke his head out of his cubicle to see what the issue was. He worked for a meat-packing company. Sides of beef came in one side of the building, where they were sectioned and cut into smaller, grocery-store-friendly portions, and then shipped out the other side in refrigerated trucks. Along the way, the pieces of meat needed to be weighed multiple times. When the scales went down, production stopped.


Scrubbed Inputs

by in CodeSOD on

In this age of JavaScript everywhere, developers have to come up with all sorts of ways to work around the uglier segments of JavaScript. For example, Aaron found this block, which promises to scrub “false-y” fields.

require _ = require("underscore");

// recurses, use with care
var scrubFalseyFields = function (obj) {
    return  _.chain(obj)
        .pairs()
        .filter(function (pair) {
            var val = pair[1];
            if (_.isObject(pair[1])) {
                // recurse!
                pair[1] = scrubFalseyFields(val);
            }
            return val;
        })
        .object()
        .value();
};

Tested Backups

by in Feature Articles on

The “Big Boss” of Initech’s Australian division ran the Sydney office as his own personal kingdom. Work- or workers- he didn’t care for was banished to the hinterlands of the Melbourne office. For example, IT services was a “useless sack of morons who only know how to spend money,” and thus the entire department was banished to Melbourne.

Stewart C. lived in Melbourne, and was a new hire not long after the exile. The Melbourne office, with a 900km buffer zone protecting it from the whims of upper management, was actually a decent place to work. At least, until Brendan arrived.


The Last of His Tribe

by in CodeSOD on

"The best thing about working here," Jaeson was told by his boss Renee on the walkthrough of the dev area on his first day, "is that we work closely with the customers, meaning you never EVER have to cash checks the salespeople wrote: you're only held to what your team promised." This sounded good to Jaeson, who was considerably more concerned about getting away from his previous company's open floor plan than the possibility of customer interaction, but hey, he'd take the icing on the cake. It sounded like he was in for a very productive time.

"Let's see, where to put you," mused Renee, glancing over the pods of cubicles. "Aha, I think Zebra Tribe will work." Zebra Tribe, it turned out, was the name of a scrum team; Jaeson would be working closely with the other members of that tribe, as they were called, in the coming months in order to accomplish tasks during sprints.


An Identity Crisis

by in Error'd on

Ari S. writes, "Not only was the poor computer running Windows XP, it also had to suffer through having the Apple keyboard and mouse attached to it.


You Can't Always Count on Regular Expressions

by in CodeSOD on

After spending the most of the afternoon searching, trying to solve a rather vexing issue, Adam found exactly the solution he was looking for and wanted to squirrel it away for later reference.

Sure - he could have added to "Favorites" in his browser like on every other website in the world, but there was something about the "bookmark" button on this particular site that called to him. It was more than a dumb link, it was a counter telling you how many people had bookmarked a resource, and you could bookmark it yourself.


A Signed Release

by in Feature Articles on
Brody and his team of contract developers were nervously awaiting a major update to TexOil's member website to go live. Between a complete overhaul of the site and massive database changes, it would be difficult to roll back if anything went awry. They were only responsible for developing the software, however. The task of the actual deployments fell to Lars' release team.

The development and testing process had been rigorous, but Brody felt confident in his code after receiving UAT signoff the week before. There was even time for extensive load and stress testing this time around. Brody spent most of the weekend running builds and packaging up the code and database scripts so that Lars and Co. could prep the deployment first thing Monday. Barack Obama signs at his desk2

Lars strolled in an hour late Monday morning, seemingly unconcerned with the magnitude of the release before him. "Hey Lars," Brody greeted him. "It wasn't fun, but I got everything packaged for you guys to do your thing. So you should probably get started so we can hit the ground running tonight."


Finding the File

by in CodeSOD on

There’s one challenge we rarely think about when writing file-handling code: how do we know where the file actually is? Josh H. inherited some C# code that puts a lot of thought into that. A lot.


            

The New(ish) TDWTF

by in Announcements on

You might have noticed some updates to the site, although if we did our job right you won’t notice half of them.

What’s New?

We are saying goodbye to Discourse, our old forum and comments system. In its place reintroducing an in-house built system, thanks to the hard work of our newest team member Ben Lubar.


Back Away Slowly

by in Feature Articles on

Weekend work 2012-07-16 28 (7583096606)

It'd been two hours since Mike had gone to bed. Two slow, miserable hours of counting sheep, staring at the barely visible ceiling, and trying to shake off the stress of the last few weeks at work.


Adequate Enough

by in Error'd on

"Dell TechDirect's password policy is a lot like their computers," writes John, "Not the greatest, not the worse...just 'ok'."


String Cheese

by in CodeSOD on

Imagine you’re a Java programmer. You need to iterate across a list of strings. Your natural instinct might be to just use a for loop, and that’s proof that you’re not a true enterprise Java programmer.

Diether’s company is home to true enterprise developers, and they know how to get things done.


Admin From Hell

by in Feature Articles on

"Hello, everyone!"

Daniel's eyes slowly rose from his desk as his manager entered the room.


Encryption By Analogy

by in Editor's Soapbox on

Last week, US President Obama said something that is usually the sort of line we give the “idiot boss” character in one of our stories. From Ars Technica:

“I am not a software engineer,” Obama made his beliefs wholly clear. “You cannot take an absolutist view on this. If your view is strong encryption no matter what and we can and should create black boxes, that does not strike the balance that we’ve lived with for 200 or 300 years. And it’s fetishizing our phones above every other value. That can’t be the right answer.”


Code Changes Over Time

by in CodeSOD on

Code changes over time. Most of what developers do is manage changes to code. Dana inherited some pretty awful PHP, and decided to take some time to improve performance and make sure any errors thrown by the PHP were actually displayed nicely for the user.

While looking at the file-upload module, Dana found this:


In Soviet Russia, Birthday Translates You!

by in Error'd on

"Chrome translator apparently has issue with the numbers 11 and 30 when translating mail.ru to English," wrote Marc B., "Interestingly, the Russian version of the site displays the numbers properly, so WTF Chrome?"


The Self Test

by in CodeSOD on

I consider code cleanup to be important, almost as important as actually writing code, especially since I spend a lot of time doing maintenance and support. During idle time, I enjoy digging through existing code to find overcomplicated algorithms and dead code and see what I can simplify or even delete. While there may not be an immediate benefit, it makes future debugging far easier if you trim out dead code and shorten 3,000 line C files to 500 line ones. And quite often, subtle and difficult-to-diagnose bugs simply go away.

While doing this on one of our products, I found a very old public API that appears to have never been completed. At least I hope so, because there’s no way any of it does anything remotely useful.


It Can't Be Done

by in Feature Articles on

Decades ago I had several clients who insisted upon having two PCs on their desk. One would boot up into the word processor and the other would boot up into a spreadsheet program. No amount of instruction could teach these people that a computer can not only run multiple programs, but it can run them at the same time. To this day, these folks are still my clients, and happily paying me to support this arrangement.

Some people simply can not be trained.


JavaScript Obfuscation

by in CodeSOD on

We have to be careful about the articles we publish on TDWTF. We have a responsibility to our submitters, to protect their identity and anonymize the details of their stories. We have a responsibility to our readers- mostly to be entertaining.

Last week’s JSF–k story failed one of our readers. Poor Blazej didn’t find it entertaining- it gave him upsetting flashbacks to his own experience with a similar event.


The Swing of Things

by in Feature Articles on

While studying Java in college, Eugene had the great misfortune of being hired by a company that specialized in Java Swing applications. (For those of you who don’t know, Swing is a cross-platform framework for desktop GUI applications.) He was quickly swept aboard a new project: taking a new client’s poorly-implemented, buggy, and unstable PHP website and upgrading it to a new, clean, Java-based version.

The team quickly stumbled into a major roadblock. “This has to be a web application?” questioned Rob, the team lead. “You can’t do web with Swing. Why don’t we just write them a Swing application?”


An Error is Worth 10 Words

by in Error'd on

"This was a screenshot I took of an error message I got many years ago (when Win95 was fairly new) after opening one too many instances of Word," Andrew H. wrote.


Widgety Gadgety Boo

by in CodeSOD on

“The road of life twists and turns and no two directions are ever the same. Yet our lessons come from the journey, not the destination.” - Don Williams, Jr. (4719290483)

Ancient Coder submits for our review the following migraine-inducer:

This was a bug report about a very minor issue, a little warning box was not popping up. Simple, I thought, and I estimated it would take an hour to fix. Little did I know that someone had already poked at this issue and made this amazing log entry. I spent about half an hour trying to understand this code before I backed away, slowly.

The Swamp Cooler

by in Feature Articles on

Joe took a job as a programmer at a small shop. It was a huge pay cut, but his current employer was locked in a death-spiral of declining revenue, declining collections, and declining sales. It was time to get out, and his local market didn’t have a lot of options.

“We’re a small shop, so we’ll need you to help out with general IT stuff,” Joe’s boss, Jimmy, said. By “help out”, what Jimmy actually meant was “be the helpdesk tech, server tech, and if you have time, write some code”. On an average day, Joe’d be running from user desktop to user desktop, installing Excel or removing malware, before hustling to the server room to manually reboot a locked up box, then on his way out the door, he’d push some changes to the company’s website and pray nothing was wrong.


The Monthly Report

by in CodeSOD on

Karen, you need to run the monthly report while Ivan is on vacation,” Bruno asked.

“Wait, isn’t that just a scheduled job?”