Mark Bowytz

Besides contributing at @TheDailyWTF, I write DevDisasters for Visual Studio Magazine, and involved in various side projects including child rearing and marriage.

Nov 2013

A Privacy Monstrosity on Top of a Coding Monstrosity

by in CodeSOD on

I don't think that this will come as much of a surprise, but websites capture the details of your visit.

We here at TDWTF use Google Analytics to see who visits our site, but don't panic - it's not in some creepy, quasi-legal, three (or four) letter government agency way - really we just want to have an idea of who our readers are. Interpreting the collected browser and GeoIP data can take some time, so thank goodness installing the hook to collect site stats is a breeze. Just copy/paste some JavaScript that Google tells you to add into the page you want to monitor, and you're good to go.


C++ is Bad!

by in Error'd on

"I tried to commit to SVN but unfortunately, this C++ is bad. Bad, bad, bad C++ this!," writes Alex.


A Method Gone Too Far

by in Representative Line on

The submitter of the below code, who chooses to remain Anonymous, recently started a job at a social media company as a software engineer. Seeing that they had never had anyone dedicated to their iOS product before, apparently they were quite excited.

Unfortunately for our submitter, the codebase is the stuff of nightmares - ternary operators stacked five deep on a single line, etc. There are no model objects, so they just pass around lots of dictionaries and strings thusly:


Never Mix Sushi with DML

by in Error'd on

Ross wrote, "My local Japanese restaurant has some pretty strict rules about working with databases while you eat."


Best atoi() Implementation Ever

by in CodeSOD on

Most people know atoi() - it's been in C since before it was ANSI C... but here's a little Objective-C nugget from some sample code that was sent to "help" Joseph H. implement a client for a web API.


-(char) atoi:(char) a{
    if (a >= '0' && a <= '9') {
        return a - '0';
    } else if (a >= 'a' && a <= 'z') {
        return a - 'a' + 10;
    } else if (a >= 'A' && a <= 'Z') {
        return a - 'A' + 10;
    } else {
        return 0;
    }
}

Can't YouTube and Google Get Along?

by in Error'd on

"Trying to get training on the new Google Apps console layout, I attempted to watch a video," writes Ari Sitnik, "Unfortunately, the owners of YouTube were not asked by Google to allow a higher number of views per day. If only the two companies would coordinate better!"


Fourth Time's the Charm

by in CodeSOD on

For those who aren't familiar, the script below is a wrapper to fsck.xfs - a script that is supposed to repair an XFS journaling filesystem upon boot-up of a Linux server.

Out of the box, it does nothing, thus leaving many admins to author their own hacked-together solutions, often in response to an immediate, urgent need. Usually, these type of quick fixes are kept under wraps from the powers that be, or rather, anyone who might be in any way the slightest bit script-literate.


I Am Error

by in Error'd on

"Some faculty members have a reputation for being scatterbrained, but Professor Error takes the cake," writes Matt E..