Recent Articles

Jan 2010

Oh, I see.

by in Error'd on

"I'm pretty sure that the price tagging software at Forever 21 trims the beginning and end of the Description field," George. "Either that, or these are more popular than I realized."


Classic WTF: The Network Batch File Virus

by in Feature Articles on

The Network Batch File Virus was originally published on March 15, 2007.


The early 90s were exciting. Tim Berners-Lee invented HTML and created the first of the many internets we have today. A bunch of dancing dudes in foil costumes built the first Pentium processor. And who can forget Eritrea gaining independence from Ethiopia? Well, I could, but I wasn't following Ethiopian politics so much those days.


Break Out

by in CodeSOD on

“I’m continually amazed by the unique and clever solutions developed by my colleagues,” Mark writes. “And I should say, I don’t mean ‘amazed’ in a good, innovative-idea-to-save-company-money sort of way. It’s more a wow, that’s more wrong than I could have ever imagined sort of way.”

“Take, for example, this snippet of code that I found recently.”


Nobody Does Business on December 31st!

by in Feature Articles on

Steve's phone gave its distinctive internal ring.

"Steve! Hey! Happy New Year, man! Jeff here from Corporate AR!" the caller was speaking a mile a minute. "I sent you a critical email. Did you get it yet?"


Meaningless Progression

by in CodeSOD on

"One of our desktop applications has a progress bar in it," Bryce N. writes, "and as I was working more and more with the code, I noticed that the progress bar would progress to a seemingly random part in the bar, but never past the halfway mark. This would probably be ignored, if it weren't for the fact that I noticed that my breakpoints would only be hit when the bar reached the 'random' mark."

"While I was trying to discover why, I found this in the code:"


Scientific Phonation

by in Error'd on

"Drat!" Arttu notes, "the limits of displaying long numbers caught me again!"


Bad Code Offsets: Open Web Innovation

by in Feature Articles on

By now I'm sure you've heard of the Bad Code Offsets project. I announced it here back in November and gave a pretty exciting update in December, where we were able to give a whole bunch of money to some great open source projects. But what was especially exciting was the The $500 Good Code Grant.

Tell us how your free and open source project prevents bad code from being created and show us how $500 would make a real difference in your project
— or —
Propose a new, free and open source project and show us how $500 would help you get it started


Avoiding the Splice

by in Bring Your Own Code on

One mistake that rookie carpenters will often make is to measure for trim molding – baseboard, casing, crown, etc – by the linear foot. Take the casing on a 7’ door, for example. Each leg of the door requires 84” of trim and the header needs 32”. If your house has 16 doors, and each side of the door needs 200” of trim, then that adds up to 533’ 4” (16 x 2 x 200”). And since you can get casing in 16’ boards, you’d need to order 34 boards to get the job done, right?

Not quite. You’d actually need 38 of those 16’ boards. Although each 16’ board can easily fit two 7’ door legs, the remaining 24” should be scrapped, as a splice in a header casing is about as professional as modHmm. And while door casings are relatively easy to measure for, baseboard and crown molding can get trickier.


The Russian Plan

by in Feature Articles on

"If you want My Space or American-On Line web pages," Dmitri confidently told the Wall Street executive before taking another long drag on his cigarette, “then hire New York programmer to build.” He exhaled, filling the air in the posh Moscow bar with even more smoke, then leaned in to say, “but if you need real, smart, mathematically strong system, then you hire Russian. Who you think build Google? Russian!”

Dmitri’s words were mostly redundant. Even before flying to Moscow, the executive was convinced that The Russian Plan was the only way to go. As Dmitry put it, the perfect storm of a bankrupt Russian trading house, mixed with contract disputes, Kremlin intervention, and an untimely death or two, allowed him to acquire the source code and intellectual property rights to an advanced, realtime foreign exchange trading system.


Piecemeal SQL

by in CodeSOD on

I can see it now.  Everybody will say how the following bit of Java code that Shawn C. has sent in isn't actually a WTF and is, in fact, quite brilliant.

To a point, I agree - the code works, and leaves the door open for accomodating changes to the structure of the SQL queries themselves. Especially if, some day, in a far flung future when, from out of space, a runaway planet comes hurtling between the Earth and the Moon, unleashing cosmic destruction casting civilization into ruin, forcing mankind to re-invent the standard keywords used to retrieve information from databases.


Divisive Placeholder

by in Error'd on

"I spotted this poll in the September 30th edition of the The Herald Sun," writes Geoff, "while I'm strongly in support of 'here here here question here here here', it is clearly a hotly contended topic."


Almost Any Key, Screwed By Dell, and More Support Stories

by in Feature Articles on

They're All Idiots, Too (from Aaron Salo)
The CFO stormed in my office, with an unmistaken look of frustration on her face. "I just spent half an hour on the phone with T-Mobile," the grumbled, "I can't get my new BlackBerry to check my email!"

"Okay, let's see," I said, "Is it giving you an error?"


Helpful SQL Helpers

by in CodeSOD on

"I recently had the chance to work on one of our projects that has been in development for longer than I have been employed here," writes Phillip, "back when the project was first started, a large part of it was outsourced overseas because, well, that was all the rage back then."

"I was assigned a few relatively simple tasks, which afforded me the opportunity to poke around the code for a bit. One of the first things I found was this, right at the top of SqlHelper.cs."


Test No Software Before it Ships!

by in Feature Articles on

During the 1990's, Advanced Technology Solutions (ATS) was one of those companies that dabbled in several different buzzword-worthy markets: dial-up Internet service, custom system configuration, web development, to name a few. None of these were complete disasters, mind you, but none could be considered all that successful either.

While this would ordinarily spell disaster for a business, everything continued to stay afloat and chugging along nicely thanks to ATS's CEO Scott Slokum and his ability to raise capital for future projects. Although the source for Scott's capital was always the same — his wealthy elder brother who funded his ventures to keep him out of the family business — the money always came through when needed. As a result, Scott could move the firm as impulse took him, usually based on something he'd read in that week's issue of InfoWeek without much concern for profitability.


The c-bitmap

by in Feature Articles on

Not too long ago, Johnny D worked for a large worldwide electronics company that designed controllers and devices for all sorts of industries. Like many global corporations, Johnny had the usual problems dealing with international leadership and being such a small part of a large machine.

One request that came down the pipeline was that, since a new line of display units came out, Johnny would need to port some old controller code to the new platform. Of course, because the code had been transferred to and from different groups over the years, the specific compiler used to compile the code was long lost and forgotten, leaving Johnny with a whole host of problems and errors during compilation. In fact, he wasn't even sure how it passed any compiler, as there were no makefiles and over warnings and errors.


Need Have Have

by in Error'd on

"Apparently," James noted, "my standard license doesn't include need have have."


I Guess So, Computer Skills, and The Temporary Offices

by in Tales from the Interview on

I Guess So (by Stuart Whelan)
The company I worked for was hiring a C++ developer, and I was assigned the job of hiring the candidates. When the scheduled start time of 1:30PM came and went, I went to the lobby to see if there was a scheduling mix up. At around 1:50, while I was chatting with the receptionist, a disheveled fellow walked in the door. "Is this Omni-tech?" he asked.

Subtly looking at the giant wall relief with our logo, I assured him it was. "You must be Gary," I asked.


Insert Comma?

by in CodeSOD on

"While browsing the code base of a recently inherited project," Joey L writes, "I found this curious method."

    private String insertComma(String src){

           StringBuffer result = new StringBuffer();
           try {
                           char d = '"';
                           result.append(d);
                           result.append(src);
                           result.append(d);
                  
            } catch (RuntimeException e) {
                logger.error(e);
            }
            return result.toString();
         
    }

The Little Red Switch

by in Feature Articles on

no, do NOT touch!On the back of your desktop computer, somewhere on the power supply unit, there might be a little red switch that toggles between 110/115 and 220/230 volts. You’ve probably never had to use that little switch, and you’ve likely avoided flipping it unnecessarily, lest bad things might happen. In fact, had it not been for the preceding sentences, you might not have even thought of that switch for at least a few more years. That had certainly been the case for Byron Schield, until he took a new job as an “IT Generalist” for a burgeoning logistics provider.

“Hey, Bryant… err Brandon… Brian?” The IT manager was clearly struggling to remember Byron’s name. In fairness, it was Byron’s first day – his first minute of his first day – and they had only met one time before. “Byron! Yes, Byron. Can you run to Workstation 306? The PC there is having some issues.”


The Integer Cache

by in CodeSOD on

A few months ago, Hugh accepted a contract assignment to work on a Java project and, ever since starting, his day-to-day has felt a bit like the old game of Zork: a maze of twisty passages, all alike. So far as he can tell, a large part of the system was created by a chimpanzee (possibly orangutan) that received a treat whenever it pressed a giant button marked "Copy and Paste". One of the class files that Hugh has spent a bit of time working on has over 10,000 lines of code and at least one method that's over 2,500 lines long.

As Hugh navigated through the numerous methods like processEntry1, processEntry2, etc., he noticed an interesting pattern start to emerge.