Archive for the ‘Feature Articles’ Category

A Bit Off Kilter

Tuesday, December 8th, 2009

There was something that seemed a bit off kilter about Victor C’s new boss. He was a nice guy and all, but his social skills seemed to be somewhat lacking. There weren’t any glaring red flags, but Victor noticed a few things in the interview – nervous leg bouncing, awkward small talk, and a way-too-frequent throat-clearing – that weren’t exactly typical. Then again, it was Victor’s first real job, so he hardly had a frame of reference. Maybe all programmer-turned-CEO’s had a few quirks like that?

Although the company was relatively small (about twenty people in total), the pay was very reasonable and it was exactly the position that Victor was looking for a web developer with a tiny bit of network administration on the side. His first day was pretty normal as far as first days go — paperwork, acclimation, source code setup, etc — and he even got a friendly text message from John on his way home from work.

Hey Vic, glad to have u on 
board! How is everything 
coming along?

Victor felt it was a nice gesture and responded in kind.

Hi John, thx for asking. So 
far, so good! Got good start 
on things in 1 day. Have a 
great night, c u in the AM!

Thinking nothing more of it, Victor was surpised to see another message from his boss.

Good to see. So what did u
get done today?

Nothing wrong with some chit-chatting, Victor thought to himself, it's good relationship building! He responded back.

Aside from paperwork, got 
the codebase downloaded and
running; also started to
look at the buffer issue.

And then another text came from John.

Nice. U take any breaks thru
the day?

Before Victor could even formulate a response, another message zipped in.

I mean, good to take breaks
and all. Do u find you made
good use of your time?

Victor was a bit taken aback by the messages and carefully crafted a response.

Agreed. I think I struck a 
good balance today.

Over the next hour and a half, the messaging continued. John quizzed Victor on almost every aspect of his day, from what he thought of the current codebase to whether he had thought of a solution for the buffer bug. And then he requested that Victor install an Instant Messanger client on the admin’s workstation. There was a good forty back-and-forth messages that evening, ending with Victor’s at around 8:00PM.

Well, I'm off to dinner with
the family. We'll catch up 
in the morning. G night!

As Victor was leaving for work the next morning, he looked at his phone for the first time since dinner the previous night and found twelve new messages in his inbox. They were all from John, and started with a simple question.

Hey, so do you think we can
set up a new virtual server
for testing 64 bit?

The next few messages were a simple follow-ups.

Get msg about 64 bit srv?

Dunno, could be worth doing?

Hey, u there?

The next few messages got progressively more unbalanced.

anyone there?

how come ure not replying?

what are you dooooing?

finish dinner yet???

They crescendoed to the final message of the night.

Have you run away?

Victor was hoping — nay, praying — that John had a truly strange sense of humor. His hopes were quickly quashed the moment his phone rang. It was John.

“Vic, buddy,” John said in a relieved tone, “where have ya been? I was up all night fretting! You can’t just disappear like that!”

In retrospect, Victor should have responded with a restraining order. But alas, it was his first job and he didn’t want to lose it on his second day. He tried explaining to John that he had gone out to dinner, shut his phone off, and then came home and went to bed.

“Of course,” John said in an agreeable tone. “We really value communication here, and you’ll need to restructure some of your home time to accommodate the needs of the company.”

Again in retrospect, there were a lot of things that Victor should have said, but he said he’d try his best. Victor added, “in the future, just ‘check out’ with me before going to bed for the night, and to ‘check in’ when I got up in the morning. I mean, I’d hate to wake you up!”

Fortunately, the night-time messaging mostly died down after that, though it was replaced with even more bizarre behavior. During the day, John would “make his rounds” a few times each hour, which consisted of him going to each and everyone’s desk to get a status update. It was never in a harsh, why-aren’t-you-done-yet manner; it was more need-to-know-every-detail-about-everything and keep-up-the-great-work.

Leaving — whether for lunch or at the end of the day — almost always prompted the same response for John: “now don’t forget to come back!” To the casual observer, such a statement could easily be mistaken for a mild joke, but Victor was convinced that he was sincere. On several occasions, John asked Victor if he was “planning to run away.”

It may have taken a couple months, but Victor eventually did run away. Far, far away. And he never looked back.


Sponsor Appreciation, Paper eBook, Confused Occupancy, & More

Friday, December 4th, 2009

Please show your support for The Daily WTF by checking out the companies that have been kind enough to sponsor us. And, in doing so, I’m sure you’ll find some pretty cool products and services built by like-minded developers and IT professionals.

 

The Daily WTF Sponsors

Microsoft WebsiteSpark   Microsoft WebsiteSpark - a great program for web shops and freelance web developers and designers where you get some great software (Visual Studio Pro, SQL Server, Server 2008, etc), at no upfront cost for three years; it also provides support and resources to help grow business
Rackspace Cloud   Rackspace Cloud - massively scalable hosting for .NET (2,3,3.5) PHP, Ruby, etc., with unlimited sites & mailboxes, simple online provisioning, and an enterprise clustered platform that's supported by real people.
Peer 1   Peer 1 - provides award-winning Managed Hosting, Dedicated Hosting, Co-location, and Network services offered through 15 data center across North America. With over 10,000 businesses hosted on their legendary SuperNetwork™backbone, PEER 1 delivers one of the highest server performance and network outputs in the industry.
Mindfusion   MindFusion - a great source for flow-charting and diagramming components for a variety of platforms including .NET, WPF, ActiveX and Swing
Software Verification   Software Verification - software engineering tools for memory leak detection, code coverage, performance profiling, thread lock contention analysis and thread deadlock detection, flow tracing and application replay on the Windows Vista, 2003, XP, 2000 and NT platforms.
Atlassian   Atlassian - the folks behind JIRA (which, in turn inspired Manual JIRA) wanted to let you know that they're not a "follow the rules" software company who realizes that there is no single recipe for practicing agile development. They were once hungry for practical tips, so they thought they should share their agile story.
SoftLayer   SoftLayer - serious hosting provider with datacenters in three cities (Dallas, Seattle, DC) that has plans designed to scale from a single, dedicated server to your own virtual data center (complete with racks and all)
SlickEdit   SlickEdit - makers of that very-impressive code editor and some pretty neat Eclipse and VisualStudio.NET tools and add-ins, some of which (Gadgets) are free. Check out this short video highlighting just one of SlickEdit's Visual Studio integration features.

And now, back to our regularly, completely off-topic scheduled program.

 

"There is something so fundamentally wrong with this," David Daniel notes, "I bought an 'eBook' from the Arizona State University bookstore. At checkout, I wondered why they wanted me to choose a 'shipping address' and a 'carrier'... and now I know. They FedEx'ed me the eBook."

 

Carlos Santander spotted this at one of the rooms in the New Yorker Hotel in New York City.

 

Sam Ashmore writes, "I came home one day after they 'upgraded' the cable, and I found this."

 

"I found this graffiti on a wall," Marco writes, "I guess some people really couldn't deal with the move to NTFS?"

 

"I found this 'jack battery' at a friend's flat," writes Martin Haimberger, "the cable which comes out of the wall supplies them all! What a great engineer."

 

"I don't really know where to put a red frame to mark the spot," Norbert writes, "maybe around the whole picture?"


view entire box

 

"We told you our Optional ROM Placement setting was risky," Hae Yu writes, "but did you believe us? Noooo!"

 

Chris writes, "I think they forgot something."

 

"Waitaminute," writes Ryan Blace, "so how am I supposed to get in?"

 

"It might have been helpful to have an instruction to 'read page 61 first' on the front of the manual," writes Paul Webb

 

"I was a bit confused when I saw the price difference on the two Leo bars," Wouter Verhelst commented, "needless to say, I went for number 51."

 

"When the soap runs out," Hans Holmberg wonders, "where are you supposed to download more?"

 


Special Delivery

Tuesday, December 1st, 2009

Brad’s phone rang with the telltale tone of an inner-office call. “Yeah,” he briskly blurted out as he picked up the phone, “what’cha ya need?” That was actually his nicewayof answering the phone. As the senior trader at Æxecor, one of the world’s largest energy trading companies, Brad didn’t need to impress anyone and, in his mind, displaying anything less than vicious hubris would be a sign of weakness.

“Err,” the receptionist nervously answers, “there’s a… err, delivery for you, sir. They—”

“Hmphf,” Brad’s scoff cut her off. “So just sign for it, then! Is that really that hard to do? You can do that, can’t you?”

“Well sir,” the receptionist winced, “they’re asking for mooring instructions? And we need to pay wharfage charges? They said you’d know. I’m at a loss.”

“Fine,” Brad scowled, “I guess I have to do everything around here!” He slammed down the phone and marched out of his corner office. Despite Æxecor’s location – the “old docks” district – their office was one of the most posh in the city. On one end of the expansive, former warehouse sat the executive suites, which had a tremendous view of the city skyline. The other end – where Brad was headed towards – was the reception which overlooked its own, private bay on the river.

“Okay, I’m here!” he angrily announced once he stepped foot in the lobby. “So let’s do this! What do I need to—”

Brad stopped mid-sentence. His eyes were immediately drawn through the floor-to-ceiling windows and onto the river bay that Æxecor’s building overlooked. There was an absolutely gigantic barge – nay, an armada of tightly-connected barges – overfilled with enormous piles of coal that was attempting to dock in front of the building. “What… the… fuuu—”

Photo credit: Kordite@Flickr

“You mus’ be Brad,” a cheerful voice jumped in. Brad’s eye’s shifted towards the scruffy fellow wearing some sort of workman’s uniform who was sitting in one of the reception chairs. “Now first and foremost, how in the Sam Hill are we ‘sposed to moor this boat? I count two cleats, but we sure as heck can’t hitch these. And, shoot, do you even have a bulk berth?”

For once, Brad was speechless. He had absolutely no idea who that man was and he could hardly understand a word he said. Plus, there was that gargantuan vessel that was slowly moving towards the building. “Uhh,” he stuttered, “wait. Are you delivering… coal? To… uhh, us?”

“Well, yeah! Twenty-eight thousand tons of the good ol’ black gold!” The workman sarcastically furrowed his brow adding, “I mean, we did get the right address, har har. This is Æxecor? And this is Pier 53? And you are Brad, the fella who ordered it, right?”

It was that moment that Brad’s palm almost immediately made contact with his forehead. He realized that something must have really gone awry: instead of virtually trading 28,000 tons of coal, Brad had somehow ended up with 28,000 tons of real coal.

Commodity Futures Trading 101

If you’ve ever watched Trading Places, the 1983 classic starring Eddie Murphy and Dan Aykroyd, then you’re probably at least familiar with commodities markets. At a basic level, commodities such as gold, wool, and soy beans are sold by producers and, eventually, delivered to buyers. But Billy Ray Valentine didn’t strike it rich and bankrupt the Duke Brothers by hauling around Frozen Concentrated Orange Juice (FCOJ); instead, they worked the commodities market by buying and selling FCOJ futures contracts. Actually, that’s really the only way to trade in commodities.

A futures contract is pretty straight forward: you agree to buy X units of commodity Y at $N per unit at some fixed future date. While it might seem a bit strange for an individual to agree to buy twenty tons of pork bellies in April for $34,420 (even if he really loves bacon), the idea is to sell the to-be-delivered pork bellies long before April, and to sell them for more than $34,420. Just about every conceivable commodity is bought and sold in this manner long before the commodity is even produced. The whole point of all this trading is to shift the risk (and rewards) of fluctuating commodity prices from the producers (farmers, miners, etc) to the traders.

Of course, because commodity traders don’t actually want to be stuck with tons and tons of pork bellies, a whole series of middlemen — from the brokers to the exchanges to the clearing houses — work hard to ensure that, when you say "I’ll buy 300 tons of pork bellies for $518,000 in May," you don’t actually buy 300 tons of pork bellies for $518,000 in May.

Brokers, for example, will set up round-turn trades so that, for each futures contract purchased, an offsetting contract can be sold to whoever actually wants to buy the goods. The exchange’s automated trading systems have all sorts of rules-engines to make sure that obvious errors (like delivering truckloads of commodities to a commercial office park) don’t slip through. And finally, processors at the clearing house will double-check transactions to make sure they weren’t sent over in error.

All that said, it’s almost impossible for traders to actually buy the commodities they are buying. Well, almost impossible.

A Perfect Storm

Æxecor traded coal on only one exchange (the WTFSE), and they didn’t trade coal very often. As such, when WTFSE upgraded its public-facing, WebService-based API, Æxecor’s internal trading system could no longer communicate with it. With a couple pending coal trades, this presented a bit of a problem.

Fortunately, Æxecor had a staff of crack programmers, and they were able to hack together a solution that worked with the WTFSE’s new API. Essentially, the coder added a bit of XML to their trading requests, including this following snippet.

<AdditionalProperties>
   <PhysicallyDeliver>
      <value>False</value>
   </PhysicallyDeliver>
</AdditionalProperties>

Notice anything off about that XML? If you said, “value should be 0 instead of False”, then give yourself a pat on the back. As it turned out, WTFSE only recognized 1’s and 0’s to represent True and False and, if the value was nether 1 nor 0, it simply defaulted to 1. Whoops!

Now, this normally wouldn’t have been that big of a deal; to ensure accurate transactions, the WTFSE (and just about all other exchanges) sends back a trade confirmation with all of the original information encoded in their XML. That way, both parties have to understand each other’s data. On Æxecor's end, everything looked hunky dory, especially as a result of the following line of code.

bool physicallyDeliver = 
    (getNodeVal("PhysicallyDeliver").toLower() == "true");

Kudos to the developer for verifying the correct case... but, a string can be infinitely more things than simply "true" or "false". Such as "1" or "0". Whoops.

Even a mistakenly confirmed incorrect trade shouldn’t have been that big of a deal, since the clearing house would notice some pretty big problems with the trade. You can’t just call up FedEx and request delivery of thousands upon thousands of tons of raw material to some office complex downtown. Commodities can only be delivered to a fixed number of delivery points, such as warehouses adjacent to train yards or ports. Of course, since Æxecor’s offices were in located on Pier 53, a recently redeveloped warehouse district off the river, it would have seemed like the logical place to accept delivery of a whole bunch of coal, especially to a rules engine. Whoops.

Fortunately, the commodity futures trading market doesn’t rely entirely on software. There are back-office personnel on both sides of the transaction (and several places in the middle) to make sure that a trader doesn’t do something silly like accidently click the “physically deliver” checkbox, enter into round-turn trades that creates an instant net loss, and so on.

So with everyone looking over transactions, you’d think that someone along the way would have noticed that trading giant Æxecor asked for physical delivery of a million-and-a-half dollars worth of coal. Actually, someone probably did, but because the trade came from Brad, there was just no way it could be made in err.

As the senior trader at Æxecor, Brad made it very clear that no one — “not even His Holiness, the Pope” — shall question his trades. After all, Brad makes complex trading decisions that no one else could possibly comprehend. Sometimes he buys high and sells low. Sometimes he holds in a decline. Sometimes he refuses to sell at any price. Brad works in mysterious ways, and if he said “do it”, then it better get done.

An Early Christmas

“Now don’t go telling me that this coal ain’t yours,” the workman said defensively, sensing something was awry. “I mean, if you don’t want it, that’s your business. But this here is your coal, mister Brad.”

As much as Brad wanted to deny it, he knew it was his. And not only that, but he had haughtily confirmed, re-confirmed, and re-re-confirmed with Æxecor’s own back-office processing team. He had just assumed, like he always did, that the mouth-breathing paper-pushers couldn’t read English. As he played back the last thing he told one of the processors about the coal order – “what part of ‘execute my f*ing trade’ don’t you understand!?” – he wondered what he could possibly do with 56,000,000 pounds of real coal.

Try to imagine for a moment how you would unload a mountain of coal worth million-and-a-half dollars. Craigslist does have its limits, after all.

As it turned out, it was more difficult than Brad could have ever imagined to sell real coal. The commodities market really only deals in futures, and everyone who actually needs 28,000 tons of coal has bought it long in advance. And besides, who wants to buy coal from some guy named Brad? Eventually, after paying exorbitant wharfing, shipping, environmental, docking, unloading, loading, and multiple-fee fees, Brad was finally able to unload it for twenty cents on the dollar.

Ever since “The Big Purchase”, Brad has never been able to live down his mountain of coal. Every time he passed others in the hallway, he knew that they knew about the coal, and they knew that he knew that they knew. No one really poked fun or laughed at him, but it didn’t matter. Brad was no longer thought of the senior trader at Æxecor; instead, he was the guy who accidently bought all that coal.


Classic WTF: Smooth, Like a Factory

Friday, November 27th, 2009

It's Black Friday! For those of you stuck at work (or not in the US), here's a fun classic. Smooth, Like a Factory was originally published on November 9th, 2006.


Daren S knew that his days were numbered. He was a troublemaker bent on changing The Way Things Were and The Director was hot on his tail. Though Daren worked discreetly, improving his coworkers' productivity a little bit at a time, it only was inevitable that The Director would eventually find out. One does not become The Director by letting such things slide.

A financial services provider, Daren's company did a lot of data processing and aggregation from a lot of different sources. The Director acknowledged that their processes were "a little rough around the edges" but insisted that they ran "smooth, like a factory." An accurate analogy I'd say, especially considering what the typical industrial factory is like: poisonous steam pipes spewing death gas every three seconds; razor-sharp pinwheel governors spinning at different yet predictable intervals; and giant, spiked stampers slamming down on conveyer belts running different speeds in varying direction, all placed inconveniently at the entrance and exit so that they must be meticulously navigated to avoid a significant loss of Life Points. At least, that's what every factory I've been in was like.

Also like a factory, the company's processes were developed over several years by many different engineers who carelessly bolted additions to the diabolical machinery. The most convoluted of these processes was the bi-weekly Hedge Report. One of the business' most critical reports, it took two people two full days to create. It was also Daren's new maintenance responsibility and, consequently, his downfall.

The Hedge Report needed data from four different sources aggregated into a single SQL Server. The aggregation was entirely manual: spreadsheets were generated, copy/pasted to each other, emailed, processed with a special script, emailed again, and so on. Daren's first mistake was to create a Visio diagram that modeled this process. Everyone knew how it worked, so said The Director, and Daren could have just asked any one of the many people involved.

Daren's second mistake was to make a minor change to a VB5 application that extracted data from another SQL Server. Before his change, the application would inform its user of a null datum by crashing and leaving a half-processed file that required the user to dig through, go back to the original SQL Server source, and change the null datum to the string "NULL."  Though it shaved a few hours off of the report generation time, The Director felt it was a waste of time, because they had a completely suitable workaround.

Daren's third mistake would have been his suggestion to change an AppleScript that processed semi-raw data to a more manageable VBScript. But he was starting to learn. Although this AppleScript required that someone at another location logon to the company's only Mac workstation, run the script, and email back the results, Daren figured this would be a battle for a much later day.

Sadly, Daren never got to fight that battle. Fed up by Daren's constant requests to "improve" the process, The Director demanded to know what <em>exactly</em> was wrong with the ASP.NET module that Daren kept asking to change. After all, he personally oversaw the addition and paid good money on consultants to build it.

Daren printed out the Page_Load() method using a half-spaced six-point font with two "screens" per page. He highlighted the buggy and incorrect code, spliced the pages together, and went back to The Director's office. In a move that may not have been the wisest career choice, Daren held the first page in the air above his head and let the other taped-together pages cascade to the floor. With over seven-feet of highlighted code in hand, Daren said: "this is what's wrong with the code."