Remy Porter

Computers were a mistake, which is why I'm trying to shoot them into space. Editor-in-Chief for TDWTF.

Dec 2012

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.


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());
    }
}

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.