Jake Vinson

Dec 2008

Security by Posterity

by in CodeSOD on

When Rory was interviewing for his position he liked what he heard. A robust data access layer, and a company policy that dictated that if you get caught writing a non-parameterized query, you're tarred, feathered, and recommended for execution. Their rigidity and adherence to the practices, as well as an interviewer asking all of the right questions regarding secure coding and good design ultimately lead to his acceptence of the position.

Once he was finally in, he cracked open the code, excited to bask in the radiance of beautiful data access layers, secure code, and well-implemented design patterns.


Bringing Up Baby

by in Feature Articles on

Ray's life was out of control, but not in a bad way – it was just that everything was happening all at the same time. His wife was in her eighth month of pregnancy, so they were back and forth at Lamaze classes, babyproofing, and converting the spare bedroom into a nursery. Not to mention that Ray had received a better job offer and accepted, meaning that he had two weeks of transition at his old job and would have to hit the ground running as an admin at the new place.

Neither Ray nor his wife had a spare second to just sit down and catch their breath, which made their anticipation for their upcoming trip even greater. The idea was to drive from the south to the north and back again, showing off their baby to friends and family. It wouldn't have been a problem since Ray had accrued over two weeks of vacation time at his previous employer. His new employer, however, wasn't terribly understanding of the request when it came up. Ray begged and pleaded, and eventually worked out a compromise – he could take his trip as long as it started after he'd been there for a month.


#ifdef WTF

by in CodeSOD on

Something gives Dave the idea that several of these #ifdefs shouldn't actually be used...

      1 #ifdef BOGUS
      1 #ifdef BRUT_HAS_A_BUG
      1 #ifdef BUG92283
      2 #ifdef commented_out
      3 #ifdef DIRECTIO_ON
      1 #ifdef DONT_DELETE_PER_BOB
      1 #ifdef DONT_DO_THIS
      1 #ifdef DONT_LOG_IF_OK
      1 #ifdef HAS_NAMESPACES
      3 #ifdef HIDDEN
      1 #ifdef needed
      4 #ifdef NOTDEF
      1 #ifdef NotDefined
      1 #ifdef NOTDEFINED
      1 #ifdef NOTDEFINED
      2 #ifdef NOTNEEDED
      2 #ifdef NOT_NEEDED
      1 #ifdef NOT_REQUIRED
      1 #ifdef NOT_USED
      1 #ifdef NOT_USED_DELETE
      9 #ifdef NOTYET
      1 #ifdef NOTYET_NEEDED
      1 #ifdef old
      1 #ifdef OLDWAY
      1 #ifdef OLD_WAY
      1 #ifdef REAL_DELETE
      1 #ifdef SLEEP_DOESNT_WORK
      1 #ifdef TESTING_ONLY
     14 #ifdef TOO_MUCH_DEBUG
      2 #ifdef TOO_MUCH_INFO
      1 #ifdef TOO_MUCH_LOGGING
      1 #ifdef USE_OBSOLETE_CODE
      1 #ifdef USE_OLD_VERSION
      5 #ifdef USE_QUANTIFY
      7 #ifdef USE_STDIO_FILE
      1 #ifdef use_this
      1 #ifdef USE_TIME
      1 #ifdef UTIL_GLOBAL

Thirty X's

by in CodeSOD on

In today's fast-paced world of cell phones, Sega Nomads, and turn signals, we don't have time for anything. That's why we have acronyms. Just try to read until the end of this: International Business Machines Corporation. Congratulations if you're still awake – the rest of us non-MENSA types will keep referring to it as IBM.

At Chris N.'s employer, they needed the ability to look up acronyms' meanings, so one of Chris's predecessors got cracking on a solution. Not one to buy into that whole normalization thing, he created a table like the following:

ROWID ABBR_CDE ABBR_TXT
867 IBM INTERNATIONAL
868 IBM BUSINESS
869 IBM MACHINES
870 IBM CORPORATION

A Hatchet Job

by in Feature Articles on

Sebastian sat near a window, enjoying a hot dog in the warmth of the sun. The day was going wonderfully so far – he was the first to get to the newspaper that was left in the break room daily (and usually gutted by noon), he'd found a quarter face up near his desk, and his hot dog was particularly good since someone had left relish in the fridge with a note inviting anyone to help themselves. At first, he hardly noticed the hurried, heavy footsteps coming in behind him – "My f–cking VPN connection is broken again! Can't you stop fiddling with the god damn network‽"

Oh man... someone's getting it good! Sebastian sat motionless, afraid to turn around and catch some residual ire from whoever the CEO was yelling at. Chewing slowly, he kept eavesdropping. "Four weeks. Four f–cking weeks my connection's been on again, off again."


The Long Way toUpper

by in CodeSOD on

Have you ever found yourself writing a function to do something that seems pretty simple, then months or years later you find out there's a built-in function to accomplish exactly what you were doing? Maybe you didn't know where to look or the built-in function's name was confusing. I'd argue that Java's toUpperCase() does not fall in this category.

Somehow I imagine that if you were to reverse engineer the built-in method, it wouldn't look like this implementation (submitted anonymously):