Recent Articles

Dec 2012

Classic WTF: Five Wrongs Don't Make a Right

by in Feature Articles on

Let's say you were given the requirement "ensure that all five lines of a shipping address contains valid characters." How do you suppose you would go about implementing such a requirement? Let's hope your solution would be far, far away from Buri's coworker's implementation which not only has a separate function for each address but manages to have an astonishingly unique method of testing for bad characters ...


Password Not Invalid

by in Error'd on

"While saving a new password, I sometimes get this message. It takes a lot of faith in assuming all is well and to just click 'OK'," writes Justin Stolle.


Classic WTF: We Use BobX

by in Feature Articles on

Christian’s first day at his new job started out just like many others in the professional IT world.

“Welcome aboard!” exclaimed Brian with an outstretched hand, “Great to see you again, c’mon in and we’ll get you all set up.”


Classic WTF: SuperRand

by in Feature Articles on

Nearly six years ago, Brian J gave up being a software developer to start a career in law enforcement. He specifically avoided the world of high-tech cyber crime, and wanted to start life anew as your everyday suburban cop. Of course, with a computer engineering degree and several years of IT experience, technology challenges tend to follow him wherever he goes.

For being a suburb, Brian’s department is pretty big and has a wide variety of posts that range from patrol to accident investigation. In addition, certain officers are trained to do certain things, and others have a preference... especially against the few horrible posts – such as manning the speed trap – that just suck the life out of most people for eight hours. As a result, shifts and schedules change from night to night.


Classic WTF: The Indexer

by in Feature Articles on

It's Christmas Eve here and, oh my, everywhere so we're taking the day off. Our hearts at TDWTF go out to you poor schmoes (all 5 of you) who are stuck having to work today.

A few kilometers left on Ruta Nacional 128, a brief stop at a control policial, a short trip down the unpaved Calle 33, and just like that, Sergio was at his destination. It was a top-secret Argentinean Government Facility.


Unused Plural Form

by in Error'd on

Stefan Sundin got this dialog while using Google Music.


Circuitous Support

by in Feature Articles on

Credit: Randy Pertiet@Flickr; Macro Computer Circuit Board #4After about six months of learning the ropes, and then actually getting good at the ropes, SJ decided that his job was pretty decent as far as tech support went.

Instead of just being some phone-drone for Initech support, SJ was the first line of defense. He spent his days filtering out the easy problems, passing the hard ones off to the system and network admins, and generally making sure Initech's customers (often sysadmins and developers themselves) got the solutions they needed. It was easy but meaningful work.


Recursive Whitespace Removal

by in CodeSOD on

C is a double edged sword. On one hand, it's simple and powerful enough that, given enough effort, you can accomplish just about anything you want. However, this power is limited insomuch that you don't have many of the friendly helper-functions that exist in higher level languages, such as string manipulation for example, unless you go ahead and create them yourself.

Case in point - consider the below function used to trim trailing spaces. Submitted by Victor, this code apparently runs in a system that processes financial transactions in real time. For the sake of the system and its users, I hope that there isn't a lot of whitespace.


Power Supply

by in Feature Articles on

MRI scans, while neat, do leave something to be desired in the “fun” and “comfort” departments. After surrendering every sliver of metal and some percentage of clothing, the patient must sit or lie stock-still in a cold room for long stretches of time. As the giant magnets do their work, ear-splitting tones and rhythmic pulses fill the room. For those who lie down to enter the giant magnet-coffin, it’s easy to feel like the Frankenstein monster in some mad scientist’s German techno experiment.

The noise is so bad that most facilities issue earplugs to their patients- but some, as Evi relates, spring for $1,500 headsets, and $10,000 systems to play music through said headsets. Seem steep? No doubt the 1–3 year warranties, ranging from $1,500 to $3,500, raise eyebrows too- but it was well outside the warranty period that Evi learned the true extent of the fleecing.


Ancestors

by in CodeSOD on

It’s important to have an understanding of genealogy; it can give you a connection to history. Even in code, we find a need to connect with our parents and their ancestors.

Kevin found some code that needed to connect a PictureBox with the Form that it’s displayed on.


Elevator Failure

by in Error'd on

Hey you - do you live in or around Pittsburgh? Wanna meet TDWTF staffers? If you answered yes and yes (or maybe) then forget about what you were going to do tonight and head on down to the Diamond Market Grill in Market Square tonight for TDWTF Pittsburgh Meetup - Part 2. Things kick off at 6pm...stop by and say "hi"!

And now, on with today's Error'd.


Tales from the Interview - You Wore a T-Shirt?!

by in Tales from the Interview on

You Wore a T-Shirt?! (from John)

Years ago, I applied for a challenging job that sounded really great – it asked for a mixture of Linux and Windows experience, some database work, some light experience with Solaris, and a lot of Cisco and networking – all areas that, believe it or not, I had extensive backgrounds in.


Time Flies

by in CodeSOD on

Alan's supervisor forwarded him a curious ticket - a recently hired employee was training on how to use the customer profile web page and the new user felt that that the countdown timer on the page wasn't behaving quite right.

What made the issue so curious? The 6 year old, internally produced site was used by tons of people day in and day out to support the business - heck, even Alan had used it briefly during his testing.


TDWTF Pittsburgh Meetup: Part 2

by in Announcements on

A few months back, Alex and the rest of the Daily WTF staff hosted a meetup in Pittsburgh. Alex is going to swing through Pittsburgh again this week, so we'd love to have another chance to meet the readers who can make it out.

Once again, we'll target Downtown, this time starting at the Diamond Market and Grill in Market Square, and depending on the mood, turn it into a downtown Pittsburgh pub-crawl.


Checkmate

by in Feature Articles on

In the 90s, if a continent-spanning national government wanted to communicate via a bulletin board system, they needed to code it themselves. And if they were going to invent the wheel, what language was better suited to the task than Visual Basic 2.0? Slap a pithy name on it- Chessboard and voila- instant success.

Daniel was the pawn tasked with protecting this particular king. In order to reduce network load, each site had their own copy of Chessboard, with their own security rules for access. Each had its own data-store, but users could browse to other sites, making it a truly “national” application. Most of the support issues were confusion caused by the neo-brutalist UI model used by Chessboard. To support the needlessly complex access rules, roughly 70% of the screens were dedicated to managing users in some way. There were at least twelve ways to ban a user from a given board, but no way to unban them.


One Version

by in CodeSOD on

Brian browsed the most recent check-in by the lead architect, and noticed that it referenced a file called TagFile.java, which didn’t actually exist. A quick search of source control showed that pretty much every project had its own version of this file. They were all basically identical, aside from the values in the static initializers:

import java.util.*;
public class TagFile {
    public static String       dateTime="2012-06-12 14:21:19";
    public static String       simpleDate="2012/06/12";
    public static String       builder="user1234";    
    public static Hashtable    hash=new Hashtable();
    public static StringBuffer sb =new StringBuffer();
    
    //initialize static values
    static { 
            hash.put("User ","user1234");
            hash.put("Build Date","2012-06-12 14:21:19");
    }
    
    //SNIP: some property accessors
    
    public static void main(String args[]) {
        System.out.println(printHashtable());
        System.out.println(getDateTime());
        System.out.println(getBuilder());
    }
}

(Situation) (location) has been cleared

by in Error'd on

Alli writes, "I'm not sure exactly what happened, but I'm glad to see that it got cleared up before it got too specific for SMS alerts."


Multiplying Strings

by in Representative Line on

It was supposed to be simple. The plan was that Alex would temporarily inherit support an old VB e-commerce website for a week while a colleague was out on vacation. With the web being out there for years and years, Alex assumed that most of the old bugs had been squashed leaving him with a nice and quiet week on his hands. As it turned out, Alex had assumed incorrectly.

Shortly after taking temporary ownership, an issue arrived where small discounts were being hugely exaggerated on the invoices. Naturally, this resulted in the issue being made into Alex's top priority.


Trauma Center

by in Feature Articles on

Paul's first day at Redacted Commodities and Trading, LLC. started with a coffee and a muffin, and ended with trauma leave.

 

New Blood


A Bit Misguided

by in CodeSOD on

It’s hard to get too far as a programmer without dealing with bit-masks at some point in your career. Barry’s co-worker made sure to build a nice, easily re-usable block of code to help with that. This simple block can simply be copy-pasted anywhere bit-masks are used. And it is.


            

The Budget is Through the Roof

by in Feature Articles on

Bridget worked in a large R&D department for a software company. The main offices had long ago filled up, and R&D moved to a distant office building well away from the main campus. The building was less than ideal, especially if you listened to the network guys talk about pulling cable. It was old, it was dreary and the roof leaked, the furnace was wonky, and the kitchen had never actually gotten a hot-water line. Still, it was a place to work.

The fiscal year ended in September. When no budget appeared by October, the rumors started to fly. Worst case scenarios were bandied about. Eventually, the scuttlebutt got so deep that the R&D head, Greg, sent out a blast of emails telling everyone not to be concerned. Instead of mollifying the staff, the sheer volume of, “You have nothing to worry about,” messages made everyone worry.