Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2025-07-01 20:16
CodeSOD: Polish Elections
Far away across the Atlantic, in the mythical land of Eastern Europe, where the sun don't shine and wild beasts roam the roads, lies a little country called Poland. Known in the world for its cheap manual labor and fondness for strong alcohol, it has for years been the butt of every national joke in almost all parts of the globe. But people here (or at least those who haven't run away yet) have been working hard to combat those pesky Eastern Bloc stereotypes, and as such, the country has in recent years seen a lot of social and technological progress. That last one, of course, comes with one notable exception: the government sector.Obviously, most countries' governments have a love-hate relationship with technology- but the Polish government invariably tends to be special. Between national-level exams being leaked by putting them in an unprotected folder with directory listing turned on, and the Social Insurance department buying 130,000 floppy disks in the year 2008, our government's technological proficiency has us ranking slightly below Elbonia. And so, when it was announced that the next local elections would be far more computerized than any of the previous ones, everyone trembled in fear.The election day came and passed. At that point, everything was still done using pen and paper, so nothing had a chance to break. But soon after, the Polish Electoral Commission announced that the election results might be "slightly delayed". At the same time, someone in one of the local commissions with access to the software used in vote processing noticed an odd .pdb file with debugger symbols in the program folder. Being a good citizen, they immediately took a decompiler, restored the source code in full, and put it on GitHub for everyone to see.Now, the following part might not be for the faint of heart. Here's one of the most notable source files from that GitHub repository.This particular piece of code had one simple task: taking XML files with election results and generating an HTML file with an official election protocol. There are many ways to approach that task. The more clever people would probably go for an XSL transformation. The slightly less clever ones would use an HTML template and fill it with data. This code, however, does not try to be clever. It aims to keep things simple, using an old and trusted way to achieve its goal:
Error'd: An Odd Form Factor
"I was searching on Texas Instruments' web site when I found a block diagram for an oddly-shaped tablet," writes Renan B., "I mean, Gigabit Ethernet? PCI Express? I had no idea that they could squeeze in all these features!"
Consultant Designed Success
Circa 2005, using XML and XSLT to generate HTML was all the rage. It was cool. It was the future. Anyone who was anyone was using it to accomplish all-things-web. If you were using it, you were among the elite. You were automatically worth hiring for any programming-related task.Back then, Richard was working at a small web development company. In this case, "small" means the boss, whoe was a bright guy, but who had absolutely no knowledge of anything -web, -computer or -technology related would make all decisions relating to hiring, purchasing technology and creating technology procedures.Although Richard was trained as a developer, he had been doing some integration work on small client web sites while the company pursued bigger goals of developing a web portal framework that would allow them to pump out dozens of web portals. To help with the overall architecture, the boss hired an Architect who specialized in intelligent transactional agents. One of his claims to fame was a system he had previously built to map data to presentation HTML via XML and XSLT. The boss was impressed by his understanding and use of these technologies, and based almost entirely on just that, hired him.The architect spent several months analyzing the underlying data and all the state transitions that would be required, as well as the target HTML into which it had to be morphed. Then he spent several more months coding up the framework. One of the key pillars on which this framework was built was the extensive use of XML and XSLT to convert all the data into something a browser could interpret to render.When the consultant began to integrate his work with the rest of the infrastructure, lots of little problems started to pop up. For example, source control was really just copying the source tree to a dedicated directory on one developer's laptop. When the consultant had to deploy his latest jar, he would copy it to a network share, from which the developers would copy it locally to use it. However, at some point, the moving of the jar file became significantly less important than the using of the contents of the jar file, and the bug reports began to pile up.This particular application was basically a corporate directory categorized by region, commerce-type and category/sub-category/actual-category. There were 13 regions with about 4000 businesses, 4 commerce-types and about 300 categories. Any experienced developer would expect that searching for a specific business in region A, type B and category C would be quite fast. It would be reasonable to expect the query to complete in far less than one second. In practice, when all criteria were used, the web server timed out most search queries at 30 seconds.Apparently, the consultant decided that every little thing should be its own class. No matter how small. A data object containing a Date was insufficient. No, there were separate objects to hold day, month and year, all of which were wrapped in a MyDate object. Ditto for time. Ditto for day of week. Ditto for everything else you could imagine. Then, to really test the capabilities of the IO subsystem, network and silicon, he would query every record in the entire database, construct objects for every component, sub-component, sub-sub-component, and so forth via Hibernate, and scan the list using the slowest possible mechanism in the Java language: instanceof, to see if an object was of a particular type before attempting to use it for purposes of comparison. To make matters worse, it repeated this entire process three times for each query; once to check if each business was of the proper instance for the region, once for the commerce-type and once more for the category.Richard replaced the whole thing with a simple stored procedure that ran in less than 100ms.Having dealt with that, Richard and peers told their boss what they went through and asked him to fire the consultant. He agreed, but only after the consultant would modify his framework to support multiple portals on the same system.After two weeks, the consultant proudly proclaimed that the system now supported as many portals as they wanted. The procedure to enable this capability was to copy the entire project and rename it for each additional web portal.Having ripped out all of that framework, they never even got to try out the part of the framework that morphed data into XML to be XSLT'd into HTML.In the end, everything that the consultant did was trashed and rewritten by Richard and his peers in about a month.Upon reflection, Richard learned that just because you have knowledge of how to use one tool doesn't mean that you are an expert in everything. He also learned that an otherwise intelligent boss can make really stupid decisions if he doesn't have the requisite experience in the relevant field.[Advertisement] Use NuGet or npm? Check out ProGet, the easy-to-use package repository that lets you host and manage your own personal or enterprise-wide NuGet feeds and npm repositories. It's got an impressively-featured free edition, too!
CodeSOD: The Address Shuffle
The best thing about being a consultant, in Ashleigh's opinion, was that you got to leave at the end of a job- meaning you never had to live with the mistakes your pointy-haired supervisor forced on you.This client, an online retailer, just needed an update to their Web.release.config file to resolve their session-management issue. Ashleigh had been hired for a two-week contract, and on Wednesday of week two, the fix went live. Of course, she wouldn't get paid if she didn't manage to look busy, so Thursday morning, she was scrambling for a quick fix to add to the pile.That's when Betsy, the manager, popped by the temp cube. "Hey, I just got some new code from the offshore team. Mind taking a look at it?"Normally, Ashleigh would decline such a dubious honor; today, however, it seemed easier than digging at the growing pile of minor defects, so she agreed. The method in question was meant to eliminate blank lines in the middle of the address on an invoice, because it "looked weird" to the accounting department.Sure, whatever, Ashleigh thought. Dubious cost-savings were hardly unusual in a company that offshored their main development team and paid Ashleigh's exorbitant fees to clean up after them.
Announcements: Free (New) TDWTF Mug Day!
Last year around this time, we did a Free T-Shirt Day. You all gave some great feedback, so I thought we'd try it again with a Free Mug Day!My company, Inedo, will be once again sponsoring this round of The Daily WTF mugs. Although we haven't yet released our v5 of BuildMaster yet, we've made a lot of big improvements since last year, and thought this would be a good opportunity to show them off. The mugs will be the same, serious grade as always -- but this time, they'll feature the brand-new logo (unlike the one below).
Tales from the Interview: Limit as Sense Approaches Zeno
It’s an uncomfortable truth in our enlightened, 21st-century utopia, but we often don’t know how to deal with people that deviate slightly from the norm. Jim knows a thing or two (or three) about this, because he has a Bachelors of Science with three majors: Computer Science, English, and Mathematics. Let’s not dwell on how such a thing could be possible; consider instead the strangest reaction Jim ever encountered to his unusual credentials.The developer position at Competitive Telecom Systems seemed straightforward, and a good fit for Jim’s skills and experience. When Jim’s interview time had arrived, a man found him in the reception area and shook his hand.“You must be Jim. I’m Ted. We’re very excited to have you here today!”Ted led Jim through a maze of beige corridors to a nondescript conference room and took a seat across from one of his associates.“This is Fred,” Ted said, indicating the man across from him. He then nodded towards the third man, sitting between the two at the end of the table directly across from Jim. “And this is Crispin. We asked him to join us especially to meet you.”“That’s right,” Fred said, “he came as a favour.”Jim greeted Crispin, who said nothing, never raising his eyes from the document he was reading.Ted began the interview with a simple programming question that Jim correctly identified as a string-reversal variant before describing an effective solution. Ted nodded, but paused for a moment before asking,“So, what, did you take a few CS and English electives as part of your Math degree?”“Well, no,” Jim said. “My school offered a triple-major track, and I took it. I’ve fulfilled the requirements for all three of my majors.”“Of course, of course,” Fred said, taking the reigns from his colleague, “we just want to get an idea of where your focus lies. Would you say you consider yourself more of an Arts major that dabbles on the Science side of things, or the other way around?”“I suppose if I had to choose, I am applying for a developer role. So I see myself as a Computer Scientist first and foremost,” Jim furrowed his brow, trying to determine what his interlocutors wanted to hear. Were they afraid he didn’t have what it took to be a developer? That the variety of subjects he’d studied meant he couldn’t commit to a given task? The conversation went back to typical questions, Ted alternating with Fred, each of them unable to resist circling back to Jim’s unusual degree. All the while, Crispin remained absorbed in the document. He turned it over and over, as though trying to memorize the words on each side of the single sheet that Jim eventually recognized as his résumé. When Fred and Ted had run out of steam, and Crispin still seemed unaware that a candidate sat across the table from him, Jim leaned forward and asked if they had any other questions for him.Ted and Fred turned to their grim colleague, the one whose presence in Jim’s interview had been specially requested. Crispin let Jim’s résumé flutter to the desk, raised his head, narrowed his cold, grey eyes.“I have a question, Jim. A Math major would know about integration and differentiation, right?”“Of course,” Jim nodded. “Basic calculus…”“Yes. And a Computer Science major would have encountered the concepts of black-box and white-box testing?”“Yes, black-box is where you test the external interfaces of a given module without assuming knowledge of its internals, while white-box—”“Good. And, as an English major, you must have spent a lot of time drawing comparisons between works?”“I did, yes…” Jim leaned forward, peering at Crispin, unsure what these questions were building to.“Okay Jim,” Fred said, “Now, listen closely.”“This is why Crispin came today,” Ted added.Crispin cleared his throat and glared at his lackeys. “Here’s what I need you to do, Jim,” he said. "I want you to compare the concepts of integration and differentiation with those of white- and black-box testing.“In your own words, of course.”Jim gaped. Ted and Fred sat back, arms crossed, expressions indicating their satisfaction.“Crispin spent two days with your résumé, just to come up with that question,” Ted said.“That’s right; no one comes up with questions as challenging as Crispin’s,” Fred said. “When we saw your education history, we knew we had to call him in.”“Yes, yes,” Crispin waved them aside, “that’s fine. Well, Jim? What do you and your three majors have to say for yourselves?”Jim racked his brain, trying to conjure anything that could relate seemingly arbitrary concepts from different disciplines to one another. He was on the brink of muttering… inverse something, when reason asserted itself. He politely explained that he saw no way to compare those particular concepts. Glowering, the triad informed him that they had no further questions, and they would let him know their decision. The attentive reader of this publication will not be surprised to learn that Jim failed to get the job, and, though his career has since taken him elsewhere, he is still considering a new course of study to determine, with academic rigour, what an acceptable answer to Crispin’s masterstroke might have been.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
CodeSOD: A Small Closing
Dario got a call that simply said, “Things are broken.” When he tried to get more details, it was difficult for the users to pin it down more clearly. Things would work, then they wouldn’t. The application would run, then it would hang, then it would suddenly start working again.He knew that his co-worker, Bob, had been doing some performance tuning, so that was probably the right place to look. “Bob, have you made any changes that might cause weird behavior?”“No, no. I’ve just been optimizing the file-handles.”“Are you just using jargon to sound like you know what you’re talking about?”“No! I mean, I’ve just been optimizing how we manage our file-handles so that we don’t leave them open.”“Oh, that makes sense. Show me..”Proud of his clever solution, Bob showed him:
Error'd: Practice What You Preach
"I think Oracle might want to read one of their own books on how to use MySQL," writes Mike.
The ShaoLinux Monk
Looking at the resumé, Paul felt like they’d found the perfect person for their data warehouse project. The resumé had all the relevant qualifications and experience needed to make a remarkable ETL tool. Paul talked to the candidate, Brad, briefly during the interview process. “It says here that you’re proficient with Linux and have extensive database knowledge.”
Coded Smorgasbord: Efficient WTFery
Some horrible code is acres of awful, thousands of tortured lines of mess and horror. Some developers can compress their WTFs down into a handful of lines.For example, Zlatko was working with a Node.js developer who was big on unit tests. Unfortunately, that developer didn’t understand that you couldn’t write a synchronous test for an asynchronous method- the test will always pass.That’s why this code, buried in a callback, passed:
Barely Broken In
One day in winter, during that blissful dead stretch between Christmas and New Year’s, Chris was startled out of a deep sleep. He reached for his blaring cell phone, squinting at the painfully bright screen.
CodeSOD: Variables Everywhere, But Not a Stop to Think
SharePoint. What can you say about it? Among other things, it's designed to help you manage and present content. It's supposed to make things easy for you. If you want some customization, just write some code to do whatever and configure it to run at the appropriate time for the appropriate page(s).Of course, this leaves open the possibility that folks who may be something less than experts might author said customizations.Paul is responsible for numerous customizations written by developers long gone from their project. One particular customization was to perform some clean up. At first, it was run once per day. Over time, that grew to running 8+ times per day on each of several servers.One day, the customization stopped working. Naturally, there was no record of it anywhere in source control (thank you predecessor coders).Having no alternative, the code was decompiled into the following loveliness:
Error'd: An Interesting, Cryptic, and Artistic Error
"Proof that there's a poet living deep within each of us...even developers," Ed writes.
CodeSOD: Accurate Comments
Kevin L saw the program crash with a null pointer exception. This lead to digging through stack traces, logs, and eventually the commit history to figure out who was responsible.The code itself is a simple “string padding” function, the sort of thing that when people screw it up, you just have to wonder why. This variation on that theme, however, gives us that rare treat: an accurate comment that describes the function.
Getting Wired
It had been a very long weekend.On Friday, the CIO of Brendan’s company announced that something big was in order and details would be revealed Monday morning. Questions quietly circled around the office for the rest of that day. Were people getting laid off? Was a customer unhappy and withholding payment? Was the software division being sold to East Kerblekistan?…and many of these unanswered questions transmuted into rumors.Come Monday morning, the staff shuffled into the company’s largest conference room to hear the news. Andy, the CIO, showed up fifteen minutes late as usual. He had reached CIO status not by being punctual, smart, knowledgeable, or even particularly effective. Instead, his sharp dress, smooth tongue, and slick presentations got the job done. He had a bright can-do attitude, knew all the right buzzwords (and could occasionally string them together into something resembling a sentence), and anyone without a technical background (most importantly the CEO and the Board of Directors) saw him as a technical genius.Today Andy was positively beaming. This was far above and beyond his normal self-important pomp and arrogance. From his wide smile and ecstatic mood, Brendan half-expected him to whip out a Nobel Prize, or Turing Award, or Oscar, and self-congratulate in front of the entire IT staff.“Employees of Initech! I am proud to announce that we are finally moving into the 21st century!” Andy began. “I’ve spent the past several months in research and negotiations, and because of my hard work Initech has just been awarded a half million dollar federal grant to update our network to wireless technology! This will completely reinvigorate and synergize the company, and is a fundamental key to our plan for winning several high-dollar federal contracts for the fiscal year of 2005. Our commitment to technology is vital to our core business principles, and this upgrade will prove to prospective clients that we are serious about advancing the state of modern technology. When they tour this office and experience our brand-new wireless network, they will have no choice but to choose Initech for all of their needs!”At that point, Brendan sighed in relief and mentally checked out as Andy kept talking for the next 45 minutes about how great this network upgrade would be for business.Not long after, Andy announced a new Network Upgrade Task Force, which he would be personally overseeing, to plan and execute the upgrade. Brendan was tagged as a vital part of the team, with tasks right on the critical path.Initech already had a reliable wired network, and nobody was complaining about the lack of wireless access. Brendan tried to question why the network upgrade was even needed, but Carl, the team leader and one of the company’s domain administrators, pulled him aside and politely told him that questioning the CIO’s plans would be a career-ending error.Over the next several weeks the team of twelve developed a plan. They started simple, trying to provide wireless access to the few areas where it would make sense, but soon Andy interfered, demanding wireless access in the places that didn’t make sense. The plan became more and more complicated, resulting in dozens of wasted man-hours spent drawing up new hypothetical network diagrams. Eventually, it was decreed that Initech’s entire building, all 14 floors, would be covered by the new 802.11g-compliant wireless network. A wireless access point was to be installed in each room, and each workstation would be assigned a USB external Wi-Fi adapter. Each office room had between 5 and 30 workstations, depending on the team and duties.Outside of one of the planning meetings, Brendan pulled aside a few of his teammates. “We’re going to have over a thousand PCs all join the same wireless network? And have almost 150 wireless access points all within the same building? This is NOT going to work!”Carl shook his head in agreement. “We can’t fight Andy on this, remember what happened to Al and Gerald last year?” Brendan recalled: unemployment happened. “We just need to do the best we can. Andy’s set his mind on it, but if we can survive the beginning, we can quietly improve things once he moves on to The Next Great Project.”The project plan was completed and the other executives rubber-stamped it. On a Friday six weeks later, the Network Upgrade Task Force waited for the regular office staff to leave. They had until Monday morning to get everything set up.By noon on Sunday, every WAP had been installed and configured, Ethernet switches from each office were removed and placed in storage, and every desktop workstation had a shiny new USB adapter connected. Andy decided that full-scale testing was unnecessary, but he did allow them to connect a few random systems to the new wireless network for testing. The new network technically worked. With only a few PCs on at once typical throughput had dropped from 100 megabit to only 15 or 20, but they had wireless! Andy ordered the team to write a memo of instructions on how to join a PC to the network, and one was printed and distributed to each workstation in the building except for the few they’d set up themselves. The CIO declared the project a success and ordered pizza for the team in celebration.Monday did not go well for anyone on the upgrade team. Brendan personally spent nearly 16 hours that day connecting hundreds of workstations to the wireless network because the users were unable to follow the instructions correctly. As additional workstations were brought online, the network slowed to a crawl. Initech’s internal web sites and applications became unusable for most users, and throughput tests consistently returned kilobit rates which were barely double-digit, if they succeeded at all.Andy was absolutely furious and stormed through the building, red-faced, bellowing at the members of the upgrade team as they fought to connect workstations to the network. “What the hell is wrong with you people? This stuff was all working when we left yesterday! It was working! Find out what you did wrong and fix it! We HAVE to get the network working, contracts worth millions of dollars are on the line! Do you hear me?!” He stormed off, and the team managed to slip away to a distant conference room.“Alright, what are we going to do?” Carl said.“Can we go back to the old wired network and not tell Andy? Pretend we’re using wireless?” Brendan asked.Carl shook his head. “He may be an idiot, but he’s watching us too closely. We’ll all be gone if he finds out we aren’t actually using WiFi.”“There’s just too many wireless devices too close to each other,” responded Brendan. “I walked around the office with my personal laptop and a WiFi monitor. All the access points are channel-hopping like mad trying to find a clear channel. I can’t even connect unless I’m within a couple feet of an access point.”Alex, a quiet engineer from the hardware division, spoke up. “It works if you’re close to an access point?” Brendan nodded. “So what if we can get everyone that close?” Puzzled glances were exchanged. “Remember Project Sapphire from two years ago?” he added. “That government project Andy bought all the equipment for and then we didn’t win the contract? We still have several pallets full of USB extension cables from that!”The idea was crazy, but they decided to test it in a couple offices. They strung up USB extensions and relocated each workstation’s external WiFi adapter, situating them all within a foot or so of the nearest access point. And by golly it worked! Throughput was only a few megabits, but the connection was generally reliable!As they finished the first round of testing, Andy showed up, ready to chew the team out for not fixing the network yet. Carl explained that they had a possible workaround and his anger mellowed a bit. “As long as it’s working by tomorrow.” He huffed and stormed out.By eight o’clock the next morning, every single WiFi adapter in the building had been relocated. Bandwidth was limited to 2 - 3 Mbps due to contention, but at least network timeouts were rare. Despite the unsightly mess of WiFi adapters piled around each access point, Andy was pleased. “See, this is why I picked you guys, I knew you’d make it work! This is the kind of ingenuity that makes Initech the best in the industry! Good work! Get us through today, and you can all have tomorrow off.”By the end of the day, the team finished configuring the last remaining workstations and corrected a few relatively minor issues. The network was drastically slower than it used to be, but was “fast enough” for most of the staff. At the next full-staff quarterly meeting, Andy gave a forty-minute presentation about the resounding success and ROI of the network “upgrade”.Brendan rolled his eyes and decided to update his résumé in case he got involved in whatever Andy’s next scheme would be.[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
CodeSOD: Abuse of Properties
Every .NET programmer is familiar with the concept of properties. They’re a nice language feature, allowing the programmer to inject little bits of logic into the process of retrieving or setting the value of a field. A getter can, for example, lazily initialize a field when it’s first used, and a setter can validate the value before it’s set. Even a simple property with no logic beyond providing access to a backing field can be made useful by appearing in an interface or being overridden by a derived class.An important aspect of properties is that to the outside user, they appear almost no different from a regular field. As such, they’re supposed to behave like regular fields. Any visible side effects beyond what’s necessary are heavily frowned upon, and the developer who uses the property can reasonably expect it to provide transparent access to data from his point of view.KallDrexx’s coworker, however, was forced to deal with code made by people who didn’t seem to understand the “transparent” part– or, in fact, any part…
Tales from the Interview: Role Reversal
Ki and Morgan had an on-again, off-again relationship, but not because they couldn’t commit; Morgan was Ki’s dedicated recruitment agent at Impracticable Resources. Ki had to admit he left every other recruiter she’d dealt with in the dust. That’s why she was excited when he described the position at Initech: Ki had started as a web designer and migrated into Java development, and Initech was looking for exactly that to be the glue between their Java and UX teams. Eight short weeks ago, the initial phone screen had gone well.Gerard was Ki’s would-be boss’s name, and warned her straight away that Initech was procedure-friendly; every box on their list had to be ticked and accompanied by its own list of ticked box-ticking-assurance boxes, supplemented by a list of ticked box-ticking-assurance-box-ticking-assurance boxes before they could bring her on board.“I am very impressed by what I see,” Gerard said. “We want to bring you on-site, for our standard gauntlet of interviews. Sound good?”“Definitely,” Ki said. “When would you like me to come in?”“We’ll let you know,” Gerard said, “your recruiter will give you a call.”Morgan did give Ki a call, almost three weeks later.“Ki, how’ve you been?”“Good. Waiting to hear about the Initech position, I guess… You?”“Yeah, Initech. They seem really interested in you! Can you do Thursday afternoon?”Ki stumbled out of Initech’s offices two-and-a-half hours after her arrival, exhausted but happy. Her interviews had gone extremely well. Gerard, who was head of the Java team, Celia, head of the UX team, and Armin, the lead designer, all agreed that she was at the exact nexus of design and development acumen that the job required. On the phone that afternoon, Morgan glowed to the extent one can glow via audio.“Ki, the job’s as good as yours!”“That’s great! Did they send you an offer?”“Well… no. Knowing Initech, they’ll need you to come in again for a second battery of interviews. I’ll give you a call when they’ve been in touch.”So that was that, for another three weeks.“Good news, Ki!”“You’ve got a lead on a company that hasn’t outsourced their hiring to a glacier?”“Even better: Initech wants you to come in next Tuesday. Now, for this set you’re going to need a portfolio of previous work. You met Armin and Celia last time? Well, they’ll be grilling you on your presentation. That’s why I’m giving you all this notice!”Ki looked at the past weeks sitting long and empty on her desktop calendar. “Uh, thanks.”Gerard, Celia, and Armin were all glad to see Ki again, and somehow (perhaps because they had three weeks to prepare) they each had almost an hour of questions for her before her portfolio presentation. But she passed with flying colours and, on the brief tour of the office, Gerard apologized for the amount of time the whole process was taking. “If it were up to me,” he said, “you’d start tomorrow. But HR still wants to have a word with you, and the whole team is headed out West for the annual general meeting at Initech HQ. I’ll be sure to put in a good word for you with the bigwigs out there!”Ki thanked Gerard and left. Soon after, she called Morgan.“So Gerard tells me good things!”“Yes, they seemed happy with me… again. But apparently there’s one more interview—did they mention when they’d be back from their visit to HQ?”“Let me see… oh, yes, here’s Gerard’s email. Looks like you’ll be sitting down with HR on… hmm… uh, June 9th.”“That’s two weeks from now.”“Sure looks that way! Sorry, Ki. But this is going to be awesome once we’ve crossed the Ts and dotted the lowercase Js!”And so Ki found herself up late on the night of June 10, having heard nothing from Morgan, Gerard, or Initech’s HR department. She was turning her mobile over and over in her hand, weighing her need to know against the possibility that Morgan, on the East Coast, would be asleep by now.“Hell with it,” she told herself, “if he didn’t want midnight phone calls, he should’ve gone into used-car sales.”“H-Hello?” Morgan sounded groggy, but Ki held firm.“Hi Morgan, it’s Ki. I’m sorry to call so late, but I haven’t heard from Initech, and I’m wondering if they got in touch with you. I’m sure you understand that, after eight weeks, I really need to get some closure.”There was a long pause on the other end, followed by a deep sigh. “…Ki, it’s… complicated. Really, I don’t know how this happened.”There was that sinking feeling, the one that starts in your stomach and descends to places unmentionable. “How what happened, Morgan?”"Well, I’ve got this email here from Initech HR. Apparently, in the wake of their annual general meeting at Initech HQ, it was decided that the role you’re applying for would be better suited to a less-technical candidate. I don’t know if they mean someone who just does web design, or what.“I’m really sorry about this, Ki. It sounds like you’re out of the running.”“I don’t understand,” Ki said. “You’re saying they changed the job so I’m no longer a shoe-in?”“I suppose that’s what I’m saying. Yes.”“Well… okay. I’m sorry to hear that. Goodnight, I guess?”“Goodnight, Ki…”“Oh, Morgan?”“Yes?”“Try to find me a position in computer vision or compiler design next, okay?”“Huh?”“That way, when they downgrade the position, I’ll be a perfect fit.”“Goodnight, Ki.”[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
Announcements: London and Amsterdam TDWTF Meet-ups
I'll be in London this week (Thus Feb 12) and Amsterdam next (Tues Feb 17), and thought it'd be a perfect opportunity for another The Daily WTF meet-up. Here's a pic from a previous year's London meet-up:
Error'd: Vacuums and Prints 20 Pages Per Minute!
"At first, I was a little skeptical about buying a 3rd party battery, but after looking at the extra features, I'm sold!" writes Emily S..
Representative Line: How to Validate a URL
There's an old joke among programmers, particularly those who have had to use regexes more often than they're comfortable with:
To Spite Your Face…
“I’ve got a gig for you,” said the recruiter.Clive, like many freelancers, weighed the contents of his bank account versus the daily rate he was promised, and decided that any gig was for him under those conditions. This one sounded mostly okay; an insurance company needed a new software package that would help them leap through some regulatory hoops. As a bonus, they wanted someone who could teach their devs the latest tools and techniques… like source control. Clive aced the interview, and started a week later. There was already an email waiting in his work inbox, from someone named Brandon. It read: “See me.”That nose won't know what hit it…Brandon lurked in his office, adhered to his mid–90s ergonomic chair like it was an appendage. He glared over his monitor and stared at Clive. “You work for me,” he said.In monosyllables and four word sentences, Brandon revealed that no one who participated in the hiring decision would have any day-to-day contact with Clive. Clive reported to him, and him alone.“Okay… well, when I was hired, they said that they wanted me to set up Subversion. Should I get started on that?” Clive asked.“No.”“May I ask why? Do you have another preference? Would you like to discuss the options?”“No.”Clive waited. Brandon didn’t expand. He simply stared at Clive. Stared, and stared.Clive slunk back to his cube and got started on looking at the code base. It currently lived in a file share, using the “file.pl.old”, “file.pl.old.old” versioning convention. The code was Perl, and unreadable by even Perl standards. It had grown in a culture here “parsable means runnable”, included no comments, and had absolutely no tests. Clive’s only ally was Lee, another head-hunted expert who also reported directly to Brandon, and had a two week head start on understanding the code. When Clive got stuck, he poked his head around the cube wall and asked Lee.Like a glacier grinding down a mountain, Clive slowly worked his way through the code. After about a week, he was developing a small degree of confidence. Then an email from Brandon arrived: “See me.”“You’re disrupting the dev team,” he said.“What?”“You and Lee are making too much noise. This is an office, not a social club.”“That’s crazy. I’m just asking him questions about the work we’re doing! What, do you want us to schedule a conference room just to ask questions?”“Yes.”Brandon stopped talking and resumed his staring contest. He stared, and stared… Clive got the point and scurried back to his cube.The requirements were complex and evolving, which wasn’t unusual. Only one user, Carole, actually knew what they were, which also wasn’t unusual. Clive sent her an email with a handful of questions, and tried to get some work done. He waited for a few days for her reply, and as he found new questions, he sent more emails.In a week, he had sent nearly half a dozen, but got no reply. He sent more, asking for status updates. Over this time, he had more questions. He tried calling her, but it dumped to a full voicemail box. He tried scheduling a meeting, but Carole never accepted.And then an email from Brandon arrived: “See me.”“Carole says you’re harassing her,” Brandon said.“What?”“You send her emails, even after she answers your questions. She said you called a meeting but didn’t show up for it. This needs to stop.”“That’s crazy. She never replied, and I can show you my inbox to prove it.”“Carole doesn’t use email,” Brandon explained. “An intern prints out her emails, and she replies via inter-office mail. She’s very busy. You have the requirements document. Implement it, and stop bothering her.”“What, you want us to implement a solution without ever talking to the business user who knows the requirements?”Brandon stared at him. And stared. And…With Lee’s help, Clive made some real progress over the next few months. They learned their way around the absurd date format (measured as the number of days since April 3rd, 1974, except when it was measured in the number of months since the preceding Monday, except when it was measured in the number of weeks since the following Sunday). They worked past the fact that no one was allowed to upgrade past Firefox 3, or the fact that they couldn’t run overnight jobs because all of the servers were turned off at 6PM sharp. Carole didn’t communicate, Brandon just stared at them, and the rest of their co-workers treated them like plague carriers.A few weeks before their six month stint expired, Clive was digging through the company network drive, searching for a spreadsheet containing sample data. He found one named after the recruiting company that placed him, and hoped that it was something useful. It was, after a fashion.The spreadsheet was a report illustrating exactly how much the recruiting company was getting paid to provide Clive and Lee. The fees were so abusive a used car salesman would have blushed. Change tracking and collaboration was enabled on the document, which meant Clive could read comments made by various users.From the senior management level, there were comments like, “It doesn’t matter how expensive it is.” Accounting warned, “We won’t have the money to pay annual bonuses, if we do this!”Brandon had left his own note: “Our business is too special. They will fail. This is a waste of money. They will fail.”The pieces clicked into place. Brandon hadn’t been making a prediction; he was making a promise. And he’d kept it- there was no way that Clive and Lee could deliver what was originally promised in the next few weeks.Then an email from their recruiter arrived. “That company still wants added staff. Do you want to re-up for another six months?”Having learned from Brandon, Clive sent a one-word reply: “No.”[Advertisement] BuildMaster is more than just an automation tool: it brings together the people, process, and practices that allow teams to deliver software rapidly, reliably, and responsibly. And it's incredibly easy to get started; download now and use the built-in tutorials and wizards to get your builds and/or deploys automated!
CodeSOD: Head in the Tag Cloud
When most folks create something, be it carved, welded or coded, they take pride in what they're creating. It's a reflection of their soul. It's personal. They care.However, once you tell someone that their stuff will be in or on something that is someone else's responsibility (aka.: problem), they often take less care in what they're putting there.To me, the phrase The Cloud can be safely replaced with Someone Else's Computer in every conceivable context; load-distribution; storage; file transfer; etc.As such, all too often, when something is to be in/near/on/associated-with any-or-all-things-cloud, the folks who build it tend to do somewhat lower quality work.Ayken recently inherited an old website that quickly turned out to be a management nightmare. Every veteran who is used to fighting such ancient demons knows that every PHP project comes with ridiculous stuff like this trim-function that was clearly written in complete ignorance of the existence of regular expressions:
...5253545556