Recent Articles

Sep 2011

$55.560000000000000002

by in Error'd on

David Lively spotted this at a Capital One ATM in Texas.


The Global Workaround

by in CodeSOD on

"In a strictly object oriented environment like C#/.NET," writes J.D., "there's really no such thing as 'global variables'. Sure, you can create a public class called 'Global' with a bunch of static fields, but the folks looking to (ab)use global variables generally have a hard time making that conceptual leap."

"I work with those people each and every day — most of them senior to me — and while they haven't quite made that conceptual leap, they have discovered a workaround."


The New Hire's a Bust

by in Feature Articles on

"Hey, Stan. Congrats on your promotion," John S. said without terribly much sincerity. Stan was a nice enough co-worker, but a promotion to VP doesn't mean much to a company that hands out promotions like glowsticks at a rave. Stan was now the 4th VP in the 30 person company. It didn't actually mean very much at all.

"Well, thanks John. I'm really excited. I talked to the other VPs, and they're all really enthusiastic about my proposals."


SingleQautedString(), RemoveMeFunction(), Human-Friendly Dates, and More

by in Coded Smorgasbord on

"Following the code-as-a-commodity principle," writes Jan, "our management team not only sends large projects overseas, but goes with the lowest bidder."

/**
 * @param str The string which must put into 2 Signle Quat
 * @return The single quated String
 */
public String SingleQautedString(String str) {
  return "'" + str + "'";
}

~QCCmp2Txt~

by in Error'd on

"I simply have no confidence in the products offered by ~QCCmp2Txt~," writes Jack B.


rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr and more Support Stories

by in Feature Articles on

rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr (from Ken Cox)
It was 1994, and I was working for a small weekly newspaper. One fine morning, the lady who handles subscriptions called me up to say that her computer had “gone crazy”, and that I need to help her right away. Being the closest thing to desktop support that the small paper had, I dropped what I was doing and went to see what she meant by “crazy”.

When I stopped in her office, I noticed that her screen was filled up with line after line of ever-expanding “r”s. Looking down at her keyboard, I saw that the “r” and several other keys were stuck down. Turning to her, I asked the obvious: “did you spill anything on your keyboard?”


Free TDWTF Mug Day!

by in Announcements on

A little while back, our friends at Microsoft bought the elusive The Daily WTF mugs for a whole bunch of readers. Unfortunately, many of you missed out — especially those who lived outside of the United States. But the good news is that our friends at New Relic are bringing back Free TDWTF Mug Day, and this time it's for everyone around the world!


Python Charmer

by in CodeSOD on

"I don't have a whole lot of experience in Python," writes Jakob, "in fact, when I was hired, the only thing I knew about the language was that whitespace was important."

"Fortunately — actually, unfortunately — it doesn't take a whole lot of experience in Python to recognize that my company's codebase is... well... sub-optimal. Submitted for your approval is a method used to generate a password, found in our network security library."


Get to da COPPA!

by in Feature Articles on

Corporate meetings about how new government regulations are impacting the business aren't the most interesting meetings. The intersection of corporate responsibility and politics is as exciting as watching a pumpkin rot. Derek tuned most of the meeting out, but got the important takeaway: "Due to new government regulations, we will have to massively overhaul our flagship products."

The same year that Google was founded, the Federal government was trying to figure out this whole Interwebs thing. They passed the Child Online Privacy Protection Act, and among its many "think of the children!" provisions, there were rules governing what sort of data web service providers could collect from minors without written parental consent. Derek's company made a set of Java-powered applications designed to let schools run websites that let students do homework online, which meant they needed to be COPPA compliant.


The Importance Scale and Dianne Wegg

by in CodeSOD on

The finance team at Matthew Riches's company has a unique way of determining which requests go to the top of their list and which ones the bottom. Instead of sorting by "date requested", their solution is to use a weighting function that assigns an importance value based on who made the request. It's nothing fancy: just a bunch of items in a database.

This system seemed to work for many years until the finance department was getting increasingly annoyed that a new starter in the IT department was able to get higher up the chain compared to his peers. This resulted in all finance requests from IT channeling through this single person, as it was likely to get reviewed sooner. As a new developer Matthew was asked to look into this weighting function as, no matter what the finance department did, changing the values in the database seems to have no effect.


Sponsor Appreciation, Unfree Parking, A Sincere Farewall, and More

by in Feature Articles on

Our sponsors help pay the bills so please, try to check out what they do!

TDWTF Sponsors

Aurigma Logo   Aurigma makes it incredibly easy for users to upload photos, documents, or any other kind of file directly into your app. Give your users the power to upload multiple files at once, resize photos prior to upload, and so many other things without any complications.
FusionCharts Logo   FusionCharts makes your data look stunning. With 2D, 3D, static, animated, and interactive charts, FusionCharts lets you visualize data in just about every way so that your data doesn't just look great, but feels great. Plus, FusionCharts is now available in HTML/JavaScript, too.
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!
BuildMaster   Inedo - the makers of BuildMaster, the v, and easy-to-use, web-based deployment and release management tool. Going far beyond Continuous Integration, BuildMaster delivers a series of robust features unparalleled by other build-promote-deploy-distribute tools. Oh, did I mention it's free?
SoftLayer   SoftLayer - SoftLayer is the innovation leader in Cloud, Dedicated, and Managed Hosting with 13 data centers worldwide. We integrate best-in-class connectivity and technology into the industry’s only fully-automated platform, empowering enterprises with complete access, control, security, and scalability

And now, back to our regularly scheduled, slightly off-topic program.


Clone Collector

by in CodeSOD on

Like the Rules of Optimization, there are two rules to follow for the touching .NET's Garbage Collector: (1) Don't, and (2) Be careful (for experts only). Most memory-related problems that developers experience in .NET do not require intervention of GC, but more an injection of sane code.

Joe's coworker — and self-proclaimed expert — was getting some pesky OutOfMemoryException errors while cloning objects. Knowing that it had to be a problem with garbage collection, he concocted this innovative solution.


The Cooling Kludge

by in Feature Articles on

photo credit: Strupey @ flickrAlex’s phone interrupted dinner with his Fiancée. It was the office. Again. The phone server had gone down, and that meant callers were being greeted with a busy signal instead of the friendly auto-attendant. As one of the few employees capable of toggling a server power switch, Alex asked for a doggy bag and headed to the office to reboot the server.

It was the third weekend in a row that the phone server had gone down, and Alex was getting a little tired of the mid-weekend interruptions. He didn’t mind providing the occasional off-hour support, but this was getting a little out of hand.


The Human-Readable Encryption Key

by in CodeSOD on

"One of the problems with encryption keys," notes Steve, "is that they're generally just a set of bytes, and humans can't read bytes. While one could certainly represent those bytes with a hexadecimal string, or even a little base64, it still looks like machine-language gobbledygook."

"Fortunately, VMware's Customization Specification Manager was able to solve this problem through the power of XML. Behold the encryptionKey and its simple, human-readable XML representation."


Kutta or Morasky

by in Error'd on

"I got this error while trying to run Portal 2," Sangwhan Moon writes, "I'd be glad to have a chat with these folks, but I'm not sure where I can catch them."


WTF Factor Authentication

by in Feature Articles on

Recently, when Jeff T’s credit union enhanced its online banking, it forced him to re-register his account under the new system. He thought that this was strange because, well, the "old" system was fairly reasonable. Beside the usual username and password, they had your typical Wish-It-Was Two Factor authentication and an even anti-phishing image presented during the logon process to make you feel that much more secure. It wasn't great, but it wasn't Harland Financial bad.

However, this new system didn’t inspire a ton of confidence. First, were the security questions. The previous security questions allowed for any old free-typed answer, but instead, they were replaced with different set of really dumb questions, each one limited to a dropdown of possible answers.


Verify[most]DOB()

by in CodeSOD on

"Back in 2001, I worked for a company that brought on a couple dozen highly-paid consultants to set up a series of websites," Mark Steyn writes, "I was one of a small number of permanent employees working alongside the consultants, and it quickly became clear that consultancy supplied us with a number of extremely talented developers who knew exactly what needed to done and how best to accomplish it. Unfortunately that number was 1."

"The remainder were... somewhat less capable. I'll cite as evidence this JavaScript date validation function I stumbled across when a bug report noted that a tester had experienced problems trying to sign up for the site. Their date of birth was consistently rejected. I forget the exact date, save that they were born on the 28th.


Source Control Done Right

by in Alex's Soapbox on

Your introduction to source control probably was a lot like mine: “here’s how you open SourceSafe, here’s your login, and here’s how you get your files... now get to work.”

For the most part, that works just fine. We’re already familiar with the nature of files and directories, so introducing the concepts of checking-in and checking-out aren’t a huge leap. Repositories, merging, and committing become second-nature just as easily.


Progree of enail Status

by in Error'd on

"I received this email regarding a rebate claim," Cam writes, "spelling aside, it's odd that they could automatically print the status of our claim, but not automatically select which status explanation to give us."


Common Educational Oriented Language

by in Feature Articles on

"The problem," Alex's guidance counselor explained, "is that you simply do not have enough elective credits to graduate high school."

In the latter half of the 80s the US was into terrible music and leaving children behind. Schools weren't run on standardized tests, but on credits and coursework. Alex had bounced around through a few school districts before landing in the River City Schools "Talented and Gifted" magnet school. He enrolled specifically because the district assured his family that the program would give him enough credits to graduate on time.