Recent Articles

Jul 2012

Midaslocator.com Zip Codddde Validation

by in Feature Articles on

Recently, Marc came upon a dilemma that all car owners can relate to - his next oil change was due soon.

Hoping to take advantage of Midas' online appointment scheduler, he found his nearest Midas garage at http://midaslocator.com/ and started entering his information. Unfortunately, when it came time enter his address information, Marc noticed something peculiar - the form validation wouldn't accept his zip code, or any zip code for that matter.


Fruity Loop

by in Feature Articles on

They might have been chipping their code out of the living mountain with stone tools and classic ASP, but they weren't primitive. Colt's development team still required code reviews of all of the classic ASP code before it went to production. Sure, most of the time, an ASP code review ended with, "ARGH WHY WHY MY EYES THE PAIN!", but the code still got reviewed.

During one review, Colt noticed something odd about his co-worker's file-upload module. The module was meant to handle pretty small CSV files, and even had a check to ensure they weren't larger than expected. That wasn't the odd part.


Sponsor Appreciation, The Operating System Cannot Run, and More Error'd

by in Error'd on

TDWTF Sponsors

New Relic   New Relic - As a long time sponsor of The Daily WTF, we are honored to have New Relic sponsor our first line of TDWTF t-shirts in years! Deploy their awesome web-application performance monitoring software and receive one of our limited edition tshirts FREE!
JRebel Logo   JRebel is a JVM-plugin that makes it possible for Java developers to instantly see any code change made to an app without redeploying. JRebel lets you see code changes instantly, reloading classes and resources individually and updating one at a time instead of as a lump application redeploy. Download your FREE Trial Today!
Inedo   Inedo - the makers of BuildMaster, the free, and easy-to-use, web-based deployment and release management tool. Going far beyond Continuous Integration and into Continuous Delivery, BuildMaster delivers a series of robust features unparalleled by other build-promote-deploy-distribute tools.
Conduit   Conduit - increase revenue by creating a custom Community Toolbar. With a toolbar unique to your business, you'll connect and engage with your users, extend your reach, boost traffic to your site, and build brand awareness.

And now back to our regularly scheduled program...

 


Denumerating the DayOfWeekEnum

by in CodeSOD on

"When I first found this custom 'enum'," writes Garrett Hopp," I had assumed that my predecessor had re-implemented the DayOfWeek Enumeration. I suppose that wouldn't be that big of a WTF as discovering the built-in DayOfWeek does involve using a search engine... which many developers seem to struggle with."

"But upon closer inspection, I realized it's a bit more than that, and is a really clever way to write (int) DateTime.Now.DayOfWeek. After all, that'd just be lazy."


A Heated Situation

by in Feature Articles on

Recently, some new people transferred into Evi's group after being swallowed up as part of a intercompany shuffle. After everybody got nestled into their new pocket of the cubicle farm, the topic of bringing over their server hardware came up.

The department's server room was the obvious choice for where to put the equipment, because well, that's where everything else was already.


Free TDWTF T-shirt Day!

by in Announcements on

Last September, our good friends and long-time sponsor New Relic helped us put on the infamous Free TDWTF Mug Day. The feedback from everyone was overwhelmingly positive: not only did they get to try out a pretty cool application performance monitoring service, but they got one of the coveted TDWTF mugs.

Well as you may have gathered from the title, we're at it again. After years of stalling, we’re finally putting out some new The Daily WTF T-shirts. And even better, you can get one of these limited-print T-shirts without even having to pull out your wallet.


Lucky Pointing

by in Representative Line on

"When I look at the way that my predecessor wrote his code," Benedikt B wrote, "I can't help but wonder if he understood pointers as well as Kramer understood write-offs."

"The fact that our C++-based application manages to not crash for nearly a whole day is nothing short of a miracle, especially since the only decision process behind whether to use &, *, ::, or –> seemed to be whichever compiles and recovers the cleanest after a try/catch failure.


Net -5

by in Error'd on

"I got this bill from Comcast," James Wilkinson wrote, "apparently it was due 5 days before it was generated."


Does Not Compute: Rodents, Dendro-computing, and More

by in Feature Articles on

I guess it's been quite a while since I did the last Does Not Compute, but here goes another round! Please do send in your own stories, and who knows, in a few years we may see another .

Rodents (from Milo)
A while ago I was working as IT support for several research stations. One day we got a strange call.


St. Louis Days of .NET 2012

by in Announcements on

Yes, I suppose The Real WTF™ is a conference named St. Louis Days of .NET, but like most curiosities there's a good reason. What used to be a single day (and an aptly named) event turned into three days of sessions, networking, and all sorts of other exciting things for  .NET developers. And it's at a casino, which means I'll be raking it in with my Perch Roulette Strategy, in addition to doing a talk or two.

Speaking of which, here's the talks I'll be giving…

Ugly Code: Beauty is in The Eye of the Beholder


Take a Walk on the Client Side

by in CodeSOD on

"Performance matters," Bob was told on his first day. The company prided itself on using the latest, cutting-edge techniques, and emphasized the use of client-side code to keep the application responsive.

One day, while tracking down a JavaScript error, he got a very good picture of how their client-side code actually worked:


Confessions: The Phone Number

by in Feature Articles on

"One morning," wrote Justin Reese, "my client reported that was a strange bug on a certain page in an app I built for them. Where the contact information for a series of offices was being displayed, all the information was correct except for one piece: the phone number. For multiple locations, the phone number displayed was the same: 214-748-3647."

"I ran a quick query against the database to make sure that the phone number records were indeed correct, and in fact they were. Many of the phone numbers were 214-numbers (being that we're in Dallas and all), but there were only a handful of expected duplicates. Not nearly as many as were being displayed. More peculiarly, on my local machine, the phone numbers were displaying just fine. I tried them out on the test site, only to find they were working there as well.


Dpogf sf odf !qAspo

by in Error'd on

"I spotted this at Heathrow Airport Terminal 4 just after the security check," wrote Ergin Salih. "One of the monitors is obviously trying to tell us something that nobody seems to be interested in, it just bounces around the screen."


The MySQL Wrapper Wrapper

by in CodeSOD on

Hey Pittsburgh Readers – I'll be in town this weekend, so who's up for grabbing a couple drinks tomorrow, Friday (July 13) Night at Market Square? Mark, Remy, and I will be there -- just drop me a line and we'll catch up. Oh, and I'll make sure to bring a TDWTF Mug for you if you’d like one (just let me know).


"A fairly ambitious project at work necessitated some extra, temporary help," wrote Richard, "and that meant it was time to bring on another contractor. After interviewing a number of different candidates, I found one that seemed to fit the bill. He had the necessary PHP skills, knowledge, and experience – and most importantly, he was will willing to work at the rate my company was willing to pay."


Just a Warm-Up

by in Feature Articles on

Brian worked for the American government. Specifically, he worked for a small branch on a very small project with a budget so small that it was governed by the laws of quantum mechanics. To cut costs, the pointy-haired, grey-suited bureaucrats that ran the office found all sorts of inventive ways to save money, most of which were just minor nuisances that could generally be ignored.

One particularly annoying technique, however, was that they set the thermostats at 55ºF, then locked them in plastic cages so that those pesky and expensive developers wouldn't waste precious government funds on wasteful things like "heat", "comfort" and "having fingers that aren't blue at the tips". In a state like Hawaii, that might not have been a problem, but these poor developers lived in the other non-contiguous state in the Union, in a place where the average summer temperature was a hair shy of 60ºF.


The Object Test, a New PI, and More SHEEIT

by in Coded Smorgasbord on

"I've been trying to fix up the last project a colleague completed before heading for greener pastures," wrote Philip Tyre. "After finding this comment, I'm beginning to have bad thoughts about what I may find lurking around..."

//  Apparently, in at least on situation, a Statically declared public
//  variable will hold its value across different browser instances making calls to the
//  same web page.
//  For now, reset these variables on Page_PreInit.

Sponsor Appreciation, Bad Magic Numbers, and More Error'd

by in Error'd on

TDWTF Sponsors

New Relic   New Relic is basically a magical, real-time performance and user monitoring tool that works on virtually any web platform: Java, Ruby, PHP, .net, Python, Ruby on Rails. I'm not sure how it works (magic?), but it's incredibly easy to use and is pretty inexpensive. Remember: performance is a must-have feature!
ISVCon Logo   ISVCon - You know how to write software. Selling it is the challenge. That's where ISVCon comes in. Spend three days in Reno, Nevada between July 13-15 getting an intense education in sessions across two tracks on topics including mobile platforms, social network marketing, game development, and cloud computing. Register today!
JRebel Logo   JRebel is a JVM-plugin that makes it possible for Java developers to instantly see any code change made to an app without redeploying. JRebel lets you see code changes instantly, reloading classes and resources individually and updating one at a time instead of as a lump application redeploy. Download your FREE Trial Today!
Inedo   ProGet - a NuGet package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds. It's a NuGet Server that's incredibly easy to set-up and install, plus it comes in a Free and Enterprise edition.

And now back to our regularly scheduled program...

 


Tale of the Cryptic Encoding

by in CodeSOD on

Lee S. nodded gently as she re-read the message-board post.

Someone named Robbie had created a posting asking for assistance in resolving a problem with a simple Visual Basic .NET console application. It was used to retrieve and process product registrations and credit card transactions via the Internet for a piece of niche shareware.


Unconditionally Useless

by in CodeSOD on

"The code that I maintain was originally developed when OS/2 Warp was considered new," Danielle writes. "One of the biggest challenges I have is that the original coders are long gone, and the comments they left behind aren't exactly useful."

"They were firm believers in commenting not only the beginning of a conditional if-block, but also the end block. In theory, that can be helpful... but in practice, not so much."


For Whom the BEL Tolls

by in Feature Articles on

Photo Credit: dklimke @ flickr Although Martin had been a programmer at the company for several years, he was never was able to escape his second-rate status. And how could he? With two rockstar programmers at the helm, he was lucky that their brilliance didn't outshine him to a third- or even forth-rate status. Heck, he was just lucky to be in their presence.

The rockstars were known for a lot of things, and one of those things was always developing their own version of the wheel. Usually, with a rotary engine built inside. If a project called for a car, it was an okay fit. When it called for an airplane… well, they'd just build a carplane. A boat? Try a carboat. A beverage cooler? You don't even want to know.