Recent Articles

May 2016

Too Sexy for my Support Portal

by in Error'd on

"Nice try ScreenConnect," writes J.R., "I'm wise to your supposed randomly generated access codes."


Say "Y" to Indexes

by in Feature Articles on

Henry was a hotshot developer working on a team that specialized in performance tuning. When other teams in his company had performance problems they couldn’t solve, Henry’s team was called in. Through profiling, analysis of algorithms, and database tuning, his team excelled at turning inefficient, slow, bug-ridden software into applications that actually did real work in a timely manner.

Usually.


The Latest Price

by in CodeSOD on

Relational Database are a great way to structure data, but they have their warts. Certain kinds of structures don’t model well relationally, some are difficult to tune for performance, and some queries are just expensive no matter what. Still, with some smart design choices, some indexes, and some tuning of the execution plan, you can make things work.

Hambai approached a tuning problem with that perspective. The database had a huge pile of financial information- stock transactions, commodity valuations, and currency exchange rates. When it was new, queries were fast, but now, years on, performance ground to a halt. One query that drew his attention was one for accessing the latest exchange rate for four different currencies. It was run frequently, and each access took up to thirty seconds.


Indomitable Stupidity

by in Feature Articles on

This is the story of Stacy and John.


Data Date Access

by in CodeSOD on

Perhaps the greatest evil Microsoft ever perpetrated on the world was putting a full-featured IDE on every end user’s desktop: Microsoft Office. Its macro system is a stripped down version of Visual Basic, complete with a UI-building tool, and when used in conjunction with Access, allows anyone to build a database-driven application. Anyone that’s spent enough time in an “enterprise” has probably inherited at least one Access application that was developed but somebody out at a manufacturing plant that magically became “mission critical”. Still, we can’t blame the end users for that.

There’s a special subset of developer though, that when trying to come up with an application that’s easy deploy, chooses Access as their development environment. “It’s already on all the users’ machines,” they say. “We can just put the MDB on a shared drive,” they say. And that’s how Ben gets handed an Access database and told, “figure out why this is so slow?”


Errord in Time and Space

by in Error'd on

Anonymous went to configure some settings and found his options were a little constrained.

A prompt that warns you to choose any value between 8 and 8


A Spiritual Journey

by in Coded Smorgasbord on

Hold your souls tightly, for today, we pierce the veil into the great beyond. We shall examine existential questions and commune with spirits. We shall learn what eternity holds for us all.

First, we must bring ourselves to the edge of death, into a liminal state where time does not pass, where the conscious mind takes a back-seat to the spiritual realm. Mark found this C# code to do the job:


Unprocessed Payments

by in Feature Articles on

Ivan worked for a mobile games company that mass-produced “freemium” games. These are the kinds of games you download and play for free, but you can pay for in-game items or perks to make the game easier–or in some cases, possible to beat once you get about halfway through the game.

Since that entire genre is dependent upon microtransactions, you’d think developers would have rock-solid payment code that rarely failed. Code that worked almost all the time, that was nearly unhackable, and would provide a steady stream of microtransactions to pay everybody’s salary. But who am I kidding? This is The Daily WTF! Of course reliable in-app payment code for a company completely dependent on microtransactions isn’t going to happen!


Unstandard Lib

by in CodeSOD on

One of the hallmarks of “bad code” is when someone reinvents the wheel. In many Code SODs, we show code that could be replaced with a one-line call to a built in, standard library.

That’s one of the the advantages to a high-level language operating on modern hardware. Andrew doesn’t live in high-level land. He does embedded systems programming, often on platforms that don’t have conveniences like “standard libraries”, and so they end up reinventing the wheel from time to time.


Double Play

by in Feature Articles on

How to play baseball, a manual for boys (1914) (14763970952)

Contracting seemed the best way for Ann-Marie to gain a foothold in the IT industry. She wasn't the best or the brightest, and her CV was heavy on toy languages and light on experience. But if she got a good solid chance, she knew her no-nonsense attitude and general intelligence would endear her to her boss.


Sorry About the Moon

by in Error'd on

"I have no idea what that giant glowing ball in the sky is. Space aliens, I suppose?" wrote Ian S.


The Difficulties of Choice

by in CodeSOD on

It’s no easy task combing through the submissions and choosing the right code sample.

Ulysses knows my pain. He recently inherited a Python codebase with plenty of global variables, no convention around capitalizing identifiers, inconsistent levels of indentation, and an AngularJS front end.


The EDI Fall Back

by in Feature Articles on

Chris M. was a developer at Small Widget Manufacturing. He and his coworker Scott were, in theory, assigned only to developing their in-house ERP software. However, with just one person running the company’s help desk, they often picked up anything considered “software-related.”

A ticket pinged Chris’s inbox: EDI Running Slow. It was from a sales rep named Brett, and like most tickets from sales reps, was marged Urgent. Chris decided to play ball, since Scott was tied up with something else. He called Brett, asking if he could elaborate.


Code Offsets - Version 2.0

by in Announcements on

The Daily WTF exists to point out coding horrors, but a few years ago we also took a swing at trying to prevent bad code. Long time readers might remember our 2009 initiative, Code Offsets. We are pleased to announce that Code Offsets are back, redesigned, and ready for you to make a difference (or just to make fun of your coworkers).

Babbage Offset

Essentially, the idea is simple. Code Offsets are a novel way to offset your (or your co-workers') crap code. Like carbon offsets, which aim to reduce emissions of carbon dioxide/greenhouse gases to compensate, or offset emissions made elsewhere, our Code Offsets are used to offset the bad code that already exists.


Finding a Path

by in Coded Smorgasbord on

Readers of TDWTF know all too well that dates are hard. Strings are also hard. You know what else is hard? File paths.

Like dates, and strings, most languages these days have libraries to simplify parsing filepaths. For example, in Python, you can use the os.path module to parse out the directory structure, the file, and its extension without too much effort.


That 70's Paper Mill

by in Feature Articles on

The late Seventies was a lucrative time for Finnish-based Kirkniemi Paperi, a paper production powerhouse. Puoval had a great opportunity to cash in on the profits by helping to integrate a completely automated, computer-based production system. His degree in electronic engineering was finally going to pay off.

Thanks to the invention of the Intel 8085 microprocessor, it became possible to turn trees in to paper quicker than ever. Puoval had a mandate from Kirkniemi ownership to spare no expense with getting the system up and running since their biggest competitor implemented a similar system the year before. But if they had a bumpy rollout, it would be incredibly damaging to both the company and Puoval's livelihood. Painting of paper-making at Hahnemühle


2,147,483,647 Channels ...and Nothing's On

by in Error'd on

"I think it's going to take me a while to catch up on my Radio 4 listening," writes Chris W.


What A Load

by in CodeSOD on

JCB 3CX Backhoe loader

In the mid-2000s, Amani was contracted to refactor a legacy codebase. He enjoyed breathing new life into old garbage, until the fateful day he came upon something completely unexpected.


Congraubullations

by in Feature Articles on

“Java and C# are kind of the same thing, right?”

Josh was a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn’t expect it to create that much work for him.


An Ant Pushes a Perl

by in CodeSOD on

It’s an old joke that Perl is a “write only language”. Despite some of its issues, back in the early 2000s, Perl was one of the best options out there for scripting languages and rapid-development automation.

Speaking of automation, build automation is really important. Back in the early 2000s, before Maven really caught on, your build automation tool for Java was Ant. Ant, like everything invented in the early 2000s, was driven by an XML scripting tool. Since it was tuned specifically for Java, it had some high-level operations to streamline tasks like generating proxy classes for calling web services based on a supplied WSDL file.


Mercy the Mercenary in… a Heated Argument

by in Feature Articles on

Last time, Mercy found out the political campaign she was working for didn't have a candidate that was in his best health- but they were pushing him into the governor's mansion anyway. In today's finale, she confronts a hacker and a harsh reality…

Mercy cringed as Ellis waved her over to his laptop. She left her usual workspace next to the hamilton server and headed to where Ellis had holed up. On his laptop she saw a YouTube video, playing one of Rockwood’s stump speeches. “We can’t have the YouTube logo on here anymore,” he said, indicating the “Righteous Rants” design. The red and white logo clashed loudly with the Thomas Kinkade-inspired backgrounds Ellis had picked at random from a stock photo site. “Can you make it go away? We can’t be seen to endorse a company like that.”