Alex Papadimoulis

Founder, The Daily WTF

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.


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.


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


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 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


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."


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)


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.