Recent Articles

Sep 2008

Sticking to the Method

by in Feature Articles on

Long before the √-button on calculators, and the now-antique slide rules and logarithm tables, people actually had to calculate square roots by hand. Like so many other pre-Computer Age tasks, square root calculation isn’t really complicated, it’s just tedious. The simplest – and, as it happens, the oldest – technique for this the Babylonian method: guess the square root of a number and then continually refine the result by taking the arithmetic mean of the result and the quotient of the number and the result, until you’re satisfied with the precision. In other words:

<script type="text/JavaScript">
  var numbr = 5, guess = 2;

  do { guess = 0.5 * (guess + numbr/guess); }
  while (confirm('Refine Further? ' + guess));
</script>

dog eats man

by in Error'd on

"After dialing Lenox's toll-free number," Tim Wilde wrote, "I encountered an error message being read to me by a friendly female computer voice. At least the URL it read me was using RFC1918 IP space... though I would love to be able to visit it and find out what I was missing on the actual call!"


(download mp3 file)

UPDATE: Reader Brian "Benanov" Kemp shares this fun remix.


The Magic Wand of Generic

by in CodeSOD on

J. K.'s boss loves the term "generic." Developing a feature that prompts if one specific field is left blank, that will only be used on that page? Make it generic enough to work on any page. Working on an application that will only ever be used by the local government in Podunk, MA? Make it generic enough to be able to easily change every line of text into Swahili, just in case. He didn't know the ins and outs of what was involved to make this possible, he just wanted his team to wave their collective genericification wand over the application's code.

This is precisely why he was so upset when an email form that was supposed to be generic wasn't working all of the time. It had been built to convert any HTML form with a properly named From, To, and Subject line into an email. And it worked for the most part, until they tried to apply it to a new form with more fields than others that used the control.


A Crapton of Candy

by in Souvenir Potpourri on

Ever since the first Free Sticker Week ended back in February '07, I've been sending out WTF Stickers to anyone that mailed me a SASE or a small souvenir. Nothing specific; per the instructions page, "anything will do." Well, here goes anything, yet again! (previous: Makin' It Fit).


"I recently came across a rather immense in-store credit at BJ's Wholesale," wrote Steve "snoofle" W. (Mattawan, NJ). "Since I usually manage to lose credit slips before I get a chance to use them, I decided to burn through it. After as much back-to-school shopping as is possible there, I wandered the canyons of the warehouse and happened upon the candy aisle. Normally, I'd pass it by, as none of us have any willpower, but then I thought about Alex's dire lunch situation, and figured this would help."


Serious Fricken Bureaucracy

by in Feature Articles on

If Ben E. was given three words to describe his job, he’d use bureaucracy, bureaucracy, and after filling out Form 811B-AW (Request to Use More Than Three Words Form), serious fricken bureaucracy. But alas, when one works for The State, things like serious fricken bureaucracy, vast documentation, and threats of being hired are simply par for the course.

 When he first started as an Application Reports Developer for The State, Ben wasn’t at all cynical. While he was certainly aware of the bureaucracy at large government offices, the office he would be working at had all of twenty people. And since they’re quite a distance from The State’s capitol, he naïvely concluded, people would naturally work as a team instead of teaming-up to avoid work.


A Problem at the Personal Level & More

by in Tales from the Interview on

A Problem at the Personal Level

From Shari

I arrived a few minutes before my interview and, after notifying the receptionist, took a seat in the lobby and patiently waited for 2:30 to come. When the clock struck quarter to three, I inquired with the receptionist to make sure that 2:30 was the correct meeting time. While she clicked through the company calendar to verify, an employee brisked past the desk and mentioned that he was taking a late lunch and would be back soon.


Not a Good Sign

by in Error'd on

Mike W. doesn't know what this means, but is pretty sure that it isn't good.


Scarlet's Letter

by in Feature Articles on

It was the dirtiest look that Derrick had ever seen. As he stood in the foyer, paralyzed by his wife’s dagger-like glare, his mind rushed through all the things he could have possibly done wrong. Did I forget to pick up the kids? Was it someone’s birthday? Crap, it isn’t our anniversary, is it? After a few-second-long silence that lasted an eternity, Derrick nervously stammered a greeting. “Uhh, hi… honey… I’m home?”

She clenched her jaw as her eyes tensed with anger. Without abating her piercing glaze, Derrick’s wife slowly raised her right hand to eye level. Her tight fist gripped a several-page document bearing the unmistakable logo of Scarlet Financial. Derrick grimaced, realizing exactly how much trouble he was in.

Taking a Step Back


2.25: Rescued

by in Mandatory Fun Day on


Constantly Expanding

by in CodeSOD on

Close your eyes for a moment and visualize with me. (Hopefully you have text-to-speech turned on.) I want to try some guided imagery on you.

Your daily grind is over. You're no longer maintaining a huge application that your whole team hates. You're sitting alone in a peaceful meadow. There is a small mailbox here. Your computer is in front of you, and your favorite IDE is loaded up on the screen. You're starting a new project — a project in which you will guide the overall design. Your business rules are well-defined and you know them like the back of your hand.


syntax.vb

by in CodeSOD on

For nearly two years, Hank T. tried his best to avoid the CEE system. He even made an effort to not know what CEE stood for (though he was pretty sure it was Customer something Engagement). But alas, the inevitable happened and he was finally tasked with fixing a bug in CEE.

Years ago, the CEE system was created by a developer who lived by The One Rule: there are no rules, not even The One Rule. And not surprisingly, his code showed for it. To investigate the bug he was assigned to fix -- Customer Versions aren't sorting properly -- Hank dove in to CustomerClass.vb, one of the thousands of VisualBasic.NET code files that made up the application.


The Silver Scream

by in Feature Articles on

Phil was living the dream, working on a Hollywood feature film. The film's budget was in the $35M range, putting it toward the low end for feature films. This movie in particular would utilize a lot of green screen, and they planned to film entirely digital. The director had (correctly) decided that JPEG-style compression that was common to most tape formats was not acceptable, and that they'd need something that could handle raw, uncompressed high-definition video. They were making a movie, after all, not some podunk town's weather report!

Because of the sheer volume of raw data, they needed a professional-grade Digital Field Recorder (DFR). We're talking eight-disk RAID-5s, video capture cards in the tens-of-thousands-of-dollars range, tons of memory, ruggedized cases, etc. Phil's production company knew this, and since they knew of only one vendor at the time that provided hardware specific to their needs, they began their negotiation. Phil saw a golden opportunity here.

The Golden Opportunity


2.24: Abandon Ship

by in Mandatory Fun Day on


Searching for the Silver Lining

by in Feature Articles on

"Hi, honey! How was your first day?" Jon's wife greeted him with a smile. Jon didn't look as cheerful, however — he was white as a sheet. His first day had not gone well.

Day One

"Jon!" Hartman barked the new employee's name as though he was a recruit on his first day at boot camp. Startled, Jon shot up out of his seat, returning a "Sir, ye- Yes?"


Those Responsible Have Been Sacked

by in Error'd on

From Vanessa Thomas: "Line 1110 of the source code just made my day."


The Greatest Idea Contest

by in Feature Articles on

After spending a few years working at a large, faceless corporation, John W. decided that it was time to move on to a smaller, friendlier company where he could actually make a difference. He eventually settled on "Primatech," a software services company with a dozen or so developers. What really sold him was how receptive they were to change. Each month, they had a "Greatest Improvement Idea Contest" in their dev meeting, where the developer with the best idea for improvement would win a $100 bill. Surely, John figured, a company like that would be rife with best practices.

It didn't take too long, however, for John to question his career move. The first sign that things worked a bit differently at Primatech was when the CEO burst into a rage over a minor bug in their flagship application and slammed his door hard enough to break the jamb. But still, John was confident that he'd be able to avoid the CEO and focus on what he really wanted to do: develop software.

I Want It Now


2.23: Option 8743B-2

by in Mandatory Fun Day on


Office Supply Amnesty

by in Feature Articles on

"It's tough times all around," Matt D. wrote, "and that means we all have to make sacrifices. After receiving this email from management, I'll make sure to do my part and ration my paper clips."


Keeping It Stupid Simple

by in CodeSOD on

"Not too long ago," writes R.S., "a coworker left the company for greener pastures. His motto was Keep It Simple and, until now, I wasn't sure how simple he liked things."

"This is one of my favorite snippets of PHP code from his own, unique authentication process."


SQL Injection Protection * 3

by in CodeSOD on

SQL Injection seems to be a pretty common theme around here on TDWTF. It's not so much pointing out SQL Injection vulnerabilities (aside from that one state that leaked a whole bunch of SSNs), but instead exploring all those "unique" ways that developers try to address the problem. Well, here are three more to add to the mix.

"I found this particular snippet in the external sales portal at my company," wrote Ben, "it's a technique that appears throughout the site in various queries. This was their attempt to protect the database from SQL injection attacks."


Color Printing on Seven & More Corporate Helpdesk Stories

by in Feature Articles on

Color Printing on Seven (from Simon)

"I'm no longer able to print color documents," a trouble ticket from a manager on floor seven read, "the first six copies came out fine, but the rest are in black and white. I need 50 color copies."


2.22: A Budget Line Item

by in Mandatory Fun Day on


Rule Number One

by in Feature Articles on

Chareth was a junior developer, and he wasn't happy about it. Every task that was assigned him from a senior developer was like another dagger made of salt and lemon juice being jabbed into his heart and exploding. The tasks were insulting, too — increase a font size here, add a "sign out" link there — child's play for a guru developer in junior developer's clothing like Chareth.

When Yuriy assigned Chareth a relatively simple task, he didn't expect much trouble. Chareth was to build a simple stored procedure that could calulate sales tax based on state, order total, and zip code. He turned in his first attempt for code review, and promptly failed — too much extraneous code where a much simpler and easier to maintain solution would work. He turned in his second attempt, and along with it a paragraph defending the code from his first try. His code didn't pass muster this time, either.


Aack, a Deal!

by in Error'd on

Sho Fukamachi was surprised to see such great price a new car. "Unfortunately," Sho added, "even that price is too high for such an ugly, crappy car." I'll reserve my opinion until I figure out what that price translates to in USD.


(still live)


Tenacious Dave

by in Feature Articles on

When we last met Dave, he was all about keeping things on the fast track. So fast, in fact, that he rushed several changes with the potential to break everything straight to production on his first day. For better or for worse, his tenacity remained a burden companion long beyond his first day.

Dave utilized a new hipster management philosophy called "overbearing." The main tenets of the philosophy are that 1) you have to be overbearing, 2) you have to be a jackass, and 3) you have to be an overbearing jackass. Dave became known for popping up at peoples' desks, asking one irritating question ceaselessly.


2.21: Realization

by in Mandatory Fun Day on


My str_replace() Can Beat Up Your str_replace()

by in CodeSOD on

There was a small bug in the PHP order form that Jared L. had developed: the form would complain that "$1000" is an "invalid numeric value." While technically true, Jared's boss wanted to make the form as fool-proof as possible, and asked Jared to fix it.

"No problem," Jared affirmed, "I'll make sure to have it strip those out."


Classic WTF: The Complicator's Gloves

by in Feature Articles on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

The Complicator's Gloves was originally published on January 16th, 2007. Another fun, tangentially related article is The Complicator's Bicycle.



A Smorgasbord of Classics

by in Coded Smorgasbord on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

This article is a jumble of jumbles, pulled a handful of Coded Smorgasbord-style posts; this was definitely a fun series I'd like to bring back, so please do send in your "more-or-less fun snippets of code like ones that we've all written at one time or another."



Classic WTF: Job Interview 2.0: Now With Riddles!

by in Feature Articles on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

Job Interview 2.0: Now With Riddles! was originally published on May 15th, 2007, and is one of my personal favorites.



Magenta Kong

by in Mandatory Fun Day on

One of my all-time favorite reader comics was Matt. C's #205432 ("Magenta Kong"). It was one of the many great reader comics on 2.6: A Roadblock.

Since then, Matt. C has done the unthinkable: he turned Magenta Kong into an actual Flash-based game. It's built from entirely scratch in ActionScript without a single ROM hack in sight.


Classic WTF: The Sorcerer's Apprentice

by in Feature Articles on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

The Sorcerer's Apprentice was originally published on January 23rd, 2007.



Classic WTF: The Phantom of The System

by in CodeSOD on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

The Phantom of The System was originally published on August 2nd, 2005.



Classic WTF: A True Ninja Hacker Is Like The Wind

by in Feature Articles on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

A True Ninja Hacker Is Like The Wind was originally published on July 20th, 2006. This article also marked a turning point for TDWTF: prior to this, nearly all articles were focused around bad code; starting here, I changed the direction a bit to explore Curious Perversions in Information Technology that go beyond the code.



The 1.0 Alternates

by in Mandatory Fun Day on

Since we're in Classics Week, I wanted to share a couple Series 1 comics that ended up getting cut. They star Zach, the lovable FOSS Fighter that also got the cut.

Alt1.22: Some Alone Time

Alt1.24: Thank Goodness


Classic WTF: Laboring Holiday

by in Feature Articles on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

While digging through the archives, I came across this fun email (from I.Y.) that was originally published on September 4th, 2006.


Classic WTF: To the Hexth Degree

by in CodeSOD on

It's a particularly busy week for me: on top of a few looming deadlines, I'll be at Business of Software 2008 in Boston. So, I figured it'd be the perfect opportunity to revisit some classics.

To the Hexth Degree was originally published on March 24th, 2006 and, to this day, it still holds the title of the Worst Hexadecimal Conversion Routine.