Recent Articles

Jan 2016

Who Needs an Interface when you have Tape?

by in Error'd on

"We spent a good deal of time developing our customer information display software, to make it easy for our users to update the daily menu screen outside our restaurant," Steve M. wrote, "Someone, however, noticed that the price of the Fish Steak Crunch was wrong, and decided to take a more hardware-based approach to doing the update."


I Hate the Lord of the Rings

by in Feature Articles on

Today, we're breaking out something a little different. I put this together more for fun than anything else, and we piloted it around in the Side Bar, along with a few other shares.

After some feedback, we're happy to bring this to the front page, and we plan to produce more of videos in this vein as a recurring periodic feature.


Utter Filth

by in CodeSOD on

Terrell inherited some database stored procedures. Like all good, Enterprisey stored procedures, it was written in PL/SQL. Unlike most Enterprisey procedures, it had a clear purpose: to clean your dirty inputs.

The actual problem: based on user input, the PL/SQL code needed to write a temporary file to the filesystem. Since user input is full of filthy, illicit characters, this procedure needs to clean them up.


The Productivity Leader

by in Feature Articles on

Jane took a job at a big financials company. The pay and the benefits were the first draw, but she was really sucked in by the visions of building analytics and juggling billions of dollars with cutting edge data mangling techniques. “Big data” came up in the interview many times, along with “cloud”.

The first cold blast of reality was when she was given her developer desktop: a Windows XP box with 4GB of RAM and a CPU that could get lapped by the processor in a BlackBerry. “Oh, is this just a dumb terminal I use to connect to your cloud?” Jane asked.

Productivity versus hours worked, showing a steady decline year over year.

OutputCache All The Things

by in CodeSOD on

Treasure chest color

Steam. AT&T. Marks and Spencer. Bebo. What do they all have in common? One morning, as customer support tickets rolled in at her online retail firm, it became Belle's job to find out.


There's Nothing to See Here

by in Error'd on

"Really. There's nothing to see here. Move along," wrote John A.


The Helpful Customer

by in CodeSOD on

Sven built a PHP-based website on contract then handed it off to his customer, Bob.

“You won’t be getting a lot of support calls from me,” Bob said, “because I actually know a thing or two about PHP. I’ll be maintaining this myself.”


Foxxy Professionalism

by in Feature Articles on

It was the mid-nineties and the Iron Curtain in urban Kerblekistan had come crashing down. Everything was in turmoil, and people were trying to make up for all of the years lost behind the locked borders by trying everything with enthusiasm. The WWW was still in its infancy, but that didn't stop the budding entrepreneurs.

The cover of the FoxPro developer's guide.

Enter a young whippersnapper, still in high school. Daddy hooked him up with a buddy of his at a certain state institution. Now don't go imagining secret agencies or ministries-of-defense; we're talking more like parks-and-recreation. Therein was a department that still had a nice chunk of unspent budget. In the sweet tradition of bureaucrats everywhere, they were looking to spend it and hopefully wind up with something to show for it.


Reloaded Commands

by in CodeSOD on

William Heimbinger joins the ranks of developers who come to us to confess their sins. This particular sin was committed when he was but a young child of fifteen years old, which raises more questions than it answers.

Young William was writing Perl and building an anti-spam bot for IRC channels. As he wrote code, he wanted to quickly reload the module to test it, but actually learning how to reload modules looked like too much work. William decided to reinvent that wheel, using a hammer he already knew.


The Backup Pipeline

by in Feature Articles on
Dick was the main man in charge of his homegrown facilities-management system known as Q-Max. His brainchild was utilized across a large office complex to enter and track building maintenance tasks. Whenever a sink was broken, toilet clogged, or a foul-smelling science experiment had to be exterminated from a fridge, Q-Max was there to track and route the incident.

While that was its original intent, Dick wound up selling the office managers on expanding its role to include reporting that would help them make budgetary decisions. It helped them determine which maintenance guys deserved a raise and which buildings needed renovations the most. So despite the maintenance department despising Q-Max because it made them do stuff, management loved every bit of it. Little did they know how precarious the system was on the backend.

Travan™TR-3 Magnetic Tape Cartridge (8744993952) Dick focused on keeping this amazing application running, and let the company's "Disaster Recovery Team"- one guy named Pete- worry about the worst case scenarios. They kept a regular offsite backup of its data so that in case of something catastrophic like a meteor strike, Q-Max would not go the way of the dinosaurs. Their backup system was quite simple, yet had a necessary workaround step - Every night around midnight an Oracle backup was created on the database server. From there, they copied to an offsite tape backup. Due to infrastructure limitations- bandwidth and reliability, mostly- this mirroring process had to run to get the backup to a location the tape robot could get its iron clutches on.


Blame the Computer

by in Error'd on

Jason M. wrote, "A city park has a computer problem so unsolvable, that they made a sign about it."


The Flasher

by in CodeSOD on

Michael H sends us some code that probably deserves a NSFW warning for exhibitionism. This code is a confusing bit of metaprogramming that… well, shouldn’t be allowed near schools or playgrounds.

function load_class_public($class) {
        static $classes;
        if (! $classes)
                $classes = array();
        $classname = $class . '_Publicified';
        if ($classes[$classname])
                return $classname;
        $codez = file_get_contents(PATH . '/classes/class.' . $class . '.php');
        $codez = preg_replace('/\bprivate\b/', 'public', $codez);
        $codez = preg_replace('/\bprotected\b/', 'public', $codez);
        $codez = preg_replace('/\bclass\s+' . $class . '\b/', 'class ' . $class . '_Publicified', $codez);
        $codez = preg_replace('/\<\?php/', '', $codez);
        eval($codez);
        $classes[$classname] = $classname;
        return $classname;
}

The Carte Blanche Pattern

by in Feature Articles on

"Rejoice! Rejoice! Emmanuel shall come to thee, O' Israel!"


Ch-ch-ch-changes

by in CodeSOD on

Archie poked around in his company’s billing system. This was a mistake, because that system is implemented largely in PL/SQL, and only a developer made from the sternest stuff can deal with PL/SQL.

Like most PL/SQL applications, the Oracle database is the closest thing they have to version control. Each developer makes changes in the live dev environment and then hopes for the best. They don’t use TOAD or SQLPlus or any “normal” tool for making these changes- they have to use an in-house developed GUI, because that GUI tracks their changes and writes rows into a database called “VersionDB”. When they finish a patch and want to release the changes to their customer sites, they send a copy of the VersionDB and let a simple script apply all of those changes.

It works about as well as you’d expect.


Management Reality

by in Feature Articles on

Merriam-Webster says that synonyms of stupidity include boneheadedness, brainlessness, denseness, dim-wittednes, dumbness, mindlessness, senselessness, thickness, vacuity and witlessness (among others). Perhaps they should add management to the list.

A company breakroom, with vending machines

For some reason, managers tend to make leaps-of-faith in the realm of technology. If they think that they know the meanings of two words, then there must be a connection between those two words. Unfortunately, whether the connection is real or imagined, they seem to proceed as though it were always real.


Let's Party like it's 2005

by in Error'd on

"I can't tell if it's a proofreading or a 'Y2k15' glitch," Ken L. writes.


Good Idea, Bad Idea

by in CodeSOD on

After years of neglecting their command line tools, Microsoft decided to try and build a grown-up set of administrative tools, and released PowerShell. Nearly a decade later, and many of their flagship services still don’t integrate neatly with PowerShell. Good Idea, Bad Idea The syntax is a bit messy, and the promises of an object-oriented shell never quite came to fruition. PowerShell is a great idea, executed poorly. For all that, it still offers certain advantages compared to the Unix family of shells, and is certainly worlds better than ol’ CMD.EXE.

Speaking of good ideas executed poorly: backups aren’t a good idea, they’re a great idea. And when Tommy took over as an Active Directory engineer, he was happy to hear that his predecessor had left behind a script that backed up all their user data on a daily basis. Tommy was significantly less happy when he saw the script.


Let Them Eat Cookies

by in Feature Articles on

As a Python developer, SEO was far outside of Ian’s toolbox, more in the realm of expensive social media consultants. However, when his friend Alec asked for help, he knew he couldn’t turn him down.

Alec worked at LightBarn, a lighting supply company, and was overseeing their SEO optimizations. Alec explained that no one could actually find the company’s website with relevant keywords on popular search engines. “I looked all the way to page 150!” Alec said. “I don’t get it. We have plenty of inbound links.” Alec had worked for months writing a blog on the company’s site, and his posts were routinely linked to by other industry sites.


A SASsy Import

by in CodeSOD on

After ten minutes of Mike staring at the screen unmoving, Jill sighed. As the newly minted tech lead, she knew that she had to help unwedge problems. But she also knew that Mike had been tasked with a task which should have been simple, had the project been developed in their team. Alas, it had been thrown over the wall for them to maintain, as a “reward” for cleaning up so much else.

The calculations for generating quotes for customers were, for some complex scenarios, quoting too low; they were missing some items. The originators of the quote system had used Excel, so there was probably a hard-coded range to be updated. She’d asked Mike to fix it, create a playbook for this system and create a ticket sketching out what might be needed to make the system more resilient and maintainable. Excel would still be required, for the actuaries wouldn’t hand over formulae in anything else, but perhaps some jiggling into independent sheets and just running summaries over “the whole sheet” would reduce the pain. Jill had thoroughly cautioned Mike that he did not want, at this point, to discover the paperwork and bureaucracy to change how the calculations were performed, so the only changes to be made in this first approach were to be the minimum necessary, while keeping the style and solution intact.


TDWTF API

by in Announcements on

Happy New Year! Have we got some great news for you. Subramanian has contributed a RESTful API for accessing our articles, which we’ve deployed. So now you can get started on your New Year’s resolution of writing and sharing more code.


Don't Click That

by in Feature Articles on

The Big Red Button (3085157011)

The year was 2004, and Scott S. has just begun his internship at IniBank: an underdog financial institution that would, over the years, grow up to be one of the biggest players on the market. Despite being fresh out of college with little experience under his belt, he quickly found his way around the corporate culture and acclimated to the Application Development Department.


Best of 2015: Byte Me

by in Best of… on

Happy New Year! Today's "best of" is the "best" code to copy file data that I've ever seen. Originally from September. --Remy


Nibbles in a byte