Recent Articles

Sep 2010

Internal Standards

by in Feature Articles on

An internship always looks good on a resume. An internship with a Fortune 500 company looks even better. When Bonnie was offered such an internship at a major company's satellite office, she snatched the opportunity.

Matt, her mentor, tossed her as much development work as possible. Most of it was the scut work that the full-time developers didn't have time to do, but Bonnie had a lot of freedom to solve problems how she saw fit. One of her larger tasks was to add a few pages to an ASP.NET application handed down from the Corporate offices. Corporate wrote it, but the local office required some features it didn't have.


ISelfAware, Very Thorough, Crazy Hashmaps, and More

by in Coded Smorgasbord on

Seeing that I somehow neglected to publish an article yesterday, I figured today would be a great day for a big ole smorgasbord of interesting code. Enjoy!


"I found the following code in our core architecture library," Steven writes, "I could make a smart-ass comment about needing a reference to get a reference, but I think the code speaks for itself."


The Hidden Database

by in CodeSOD on

Back in the days of the first Internet Bubble, Tom received a call from his colleague Steve. They were both contractors, working for the same elite contracting company, and Steve had run into a problem with a Perl script he couldn't figure out. Tom, being a bit more experienced in the arcane art of Perl, was confident he could help out.

The Perl script had started out as a quick hack by an in-house developer, and was little more than a simple CGI script that managed the company's website account database. Apparently, it had run "instantly" many months back, but as of late, it was seeing heavy use and taking a few minutes to run. Worse, it was "occasionally" losing data. And by occasionally, I mean most of the time: it'd typically took an a good three or four attempts to create an account or change a password.


OUCH!

by in Error'd on

Ian wonders, "and what precisely are they selling at this toy store?"


The Discothèque Option and More Support Stories

by in Feature Articles on

The Discothèque Option (from Tony Kollias)
Working in Europe, where English is often a second language, we often get some interesting support calls. One of my favorite is from a few years back, where a user was having a problem with her internet connection dropping every few minutes.

After spending a good fifteen minutes diagnosing and checking things on my end, I was unable to see anything that would have caused the problem. Even the logfiles – which detail unexpected connection drops – were clean. Nothing seemed to be the problem.


Magic Number 7

by in CodeSOD on

"One of the first things I like to do when working a new contract is dive into the code and work my way around to understand it," Emil wrote, "one line of code that looked like a good start was this."

private ISelecteVariableProperties[] Iselecvariablelst 
    = new ISelecteVariableProperties[ 7 ];

Hack School

by in Feature Articles on

Daniel wasn't terribly surprised that the principal wanted to see him. After all, Daniel had dropped off a note with a link to the school's new website earlier that day. Principal Dauterive probably wanted to review it with him.

Dauterive glared at him from across the desk. "Daniel," he said sternly, "we need to talk about your recent hacking."


In the late 90s, the term "the Web" was just entering common usage. Daniel's rural Texas school district had strongly encouraged its schools to jump on this bandwagon.


Dying of Thirst

by in Error'd on

"If you are really thirsty, then you might be disappointed by this all-digital touch-screen soda vending machine," Scott Selikoff writes, "someone remind what was wrong with the 'old' ones that worked for decades?


In a Barrel

by in CodeSOD on

Doug's PMO has begrudgingly agreed to move from the Waterfall model to Agile. They've been working through a project plan to make the transition, but unfortunately, it looks like they're still a long way off.


Very Special Strings

by in CodeSOD on

Passwords are a very special type of string. When you type your password into an input box, a • appears instead of the letter you typed. They’ll often contain characters that are really hard to type (like the ~ symbol), and when they get put into a database they’re sometimes encrypted with some sort of “hash”. Plus, passwords can even get too old and expire.

Indeed, strings that are this special need special handling. At least, that’s what Pavel’s colleague must have been thinking when he developed this method and included into the company's common code library.


The Test Machine

by in Feature Articles on

The Test Machine seemed a bit out of place as it sat there, nestled between cubicles in Christophe’s office. Actually, calling it a “test machine” seemed a bit inappropriate, too, much like calling an aircraft carrier a boat, or referring to a house mover as simply a truck. It was huge – no less than seven feet tall, four feet wide, and three feet deep – and weighed a solid ton or two. This marvelous machine was as modern as it was massive, sporting several state-of-the-art computers, power supplies, instruments, relays, ignition coils, fuel injectors, and everything else one might need to test automotive electronic control units (ECUs).

In those days, ECUs were becoming exponentially more complex with the integration of microprocessors, real-time processing, and communication between other ECUs. And as a result, testing individual and networked ECUs was becoming exponentially more complex. Christophe’s company, however, promised a unique solution: software-driven automated testing to validate the virtually endless combinations and permutations of input conditions that exist while operating a vehicle.


Dave.cpp

by in CodeSOD on

Noah Finkelstein's coworker Dave was a strange fellow. When he wasn't mumbling to himself in his cubicle, he could be found in deep thought at the snack machine, pondering whether to get animal crackers or Lorna Doones. He'd always get the Lorna Doones, but swear that next time, he'd go for the animal crackers. And everyone was well aware of this, as it was one of the few things the socially-awkward programmer would talk about.

One day, Dave approached Noah with a rather odd question: he wondered if there was a way to un-commit a file in subversion. Puzzled at the request, Noah explained that he could just rollback to a previously committed version, which would effectively un-commit the change. "No, no, no," Dave said in a more-flustered-than-usual tone, "I know that, but I need to get rid of the old version."


Displaying FAILURE

by in Error'd on

"I was trying to update my ESXi server, but it took over an hour, so I rebooted the system," writes Erik, "a few seconds later, the update program failed with this error."


Truthful Strings

by in CodeSOD on

Like virtually all modern languages, C# has a built-in Boolean data type. This means that the only values eligible for variables of that data type are true and false, and unfortunately not FILE_NOT_FOUND. In addition, all data types in C# have a ToString() method, which does just that; for Booleans, it returns the appropriate of the two constants System.Boolean.TrueString or System.Boolean.FalseString.

So given that (which, you probably already knew anyway), how would you convert a Boolean to its string representation? If, like Malcolm colleague, you answered the following, give yourself a point!


'Tis a Gift to be Simple

by in Feature Articles on

Insurance is a complicated industry at the best of times. At one firm, it was made more complex by the Policy Entry system. A Third Party Administrator(TPA) negotiated a policy with a client, then documented the changes in a rather hefty spreadsheet. The TPA would then call the data entry clerk at Bells-Torgo Insurance and verbally relate the contents of the spreadsheet.

Corey did the rational thing and suggested, "Hey, maybe we can automate this!" It was a straightforward operation, with a clear and well understood mapping between the TPA's sheet and the Policy database. Corey wrote up a design document, which included a diagram to sum the entire thing up in a way a manager could understand.


CAPTCHA'd

by in Error'd on

What's that, you say? We should have an entire Error'd dedicated to CAPTCHA images? Sure, why not!


Alex van Herwijnen spotted this interesting problem presented...


The Best, The TDWTF Interview, and The Storm-out

by in Tales from the Interview on

The Best (from Chris)
A while back, I helped interview for a programmer position on the web team. After talking to a number of candidates, we finally settled on an older gentlemen, probably in his late 50s. It wasn't an easy decision. Not only were his salary requirements above what we planned to pay, he had a few personality quirks. For example, a large part of his interview entailed him describing how he was a master composer of music, and had published songs in nearly every genre, including country, rap, pop, etc. But no matter, his experience and technical skills were top-notch.

After making an offer that met his salary requirements, the candidate made a counter offer: fifteen-thousand dollars more annually plus a signing bonus. Unfortunately, our budget couldn't accommodate that, and we declined. Negotiations after that failed, so we formally rescinded the offer for employment so we could talk to more candidates.


Accounting for Complexity

by in CodeSOD on

"I was recently assigned to work on a team that maintains a fairly large product," writes Aaron, "at first, I was a bit overwhelmed by the complexity of the architecture. There were countless layers of abstraction, thousands and thousands of classes, and design patterns galore. Since it was such a large project – and my first large project – I figured that the architectural complexity was simply par for the course."

“Then I started looking at the code a little more closely. If I had two words to describe it, they’d be ‘unnecessary complexity.’ And if I had one snippet to describe it, it would be this.”