Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2024-11-23 03:31
Not A Fan
Larry worked in the IT department of a medium-sized financial company. Bright and early on what should have been a promising day, the phone rang. Larry cursed the caller ID for informing him that Graham was on the line. The resident old man of the office and bane of IT, he frequently disregarded sound advice and policy to satisfy his own whims.Powering past the foreboding that'd settled over him, Larry picked up the phone and forced out a greeting through teeth that were already set on edge. "Good morning, IT services. How may I help you?""Yeah. I need help with my computer." Graham skipped decorum to get to the heart of the matter. "It won't turn on."The computers the accountants used were old, but still in good shape. Larry hoped he'd be able to deal with this over the phone. "OK. Let's walk through some basic troubleshooting—""No!" Graham cut him off. "Someone's gotta come over here! I can't afford to be dead in the water with month-end coming up!"Larry stifled a groan. "Let me log the ticket in our system, and I'll be right over."He hung up, sparing himself another useless rant, and filed the ticket. That done, he left his cube to head for the accountants' corner. The heat from their ancient boxes ratcheted the temperature several degrees higher. Half a dozen whirring fans worked overtime, but only pushed hot air around in a futile exercise."Where the hell were you?" Graham reclined in his swivel-chair, greeting Larry with a scowl. "It doesn't take that long to walk over here."Larry tugged at his collar, ignoring the cheerful welcome. "Let's go through some basic troubleshooting, OK? I'm sure you already did a lot of this before you called—" Yeah, right, he thought to himself "—but I just wanna be thorough here. First, let's make sure it's plugged in."Graham didn't budge an inch in his chair, his expression unimpressed.Larry verified the computer was plugged in. The monitor powered on obediently, but the box remained dormant. Switching outlets didn't help."When did this happen?" Larry asked next. "Did it just shut down while you were in the middle of something, or did you shut it off yesterday and can't start it up now?""It was fine yesterday," Graham replied. "It won't start up today."Larry dug into more specific details, none of which helped with the matter at hand. "My guess is that it's some kind of hardware problem," he concluded with a sigh. "I'll probably have to take your machine to look into it further."Graham bolted upright in his chair. "Unacceptable! I need this fixed now!"In his peripherals, Larry noticed that Graham had taken to twirling something through his fingers. He glanced over for a better look, then gaped. Was that ... a screwdriver?Larry's viscera clenched up. Dreading the answer, he asked, "What'd you need that screwdriver for?"Graham glanced at the tool in his hand, then shrugged. "The sound the computer was making was bothering me, so I took out the source.""Oh, for ..." Larry stifled himself, then grabbed the screwdriver. Upon opening the box, he confirmed the fan was missing; a quick search determined its new home to be the trash can in the corner of Graham's cube. In the process of the fanectomy, Graham had also managed to unplug several wires and destroy the motherboard.Aware that it probably wouldn't stick, Larry nonetheless delivered a remarkably polite, profanity-free explanation about the risks of opening computers, and why one should never remove fans. Before returning to his own desk, he asked all of Graham's cube-neighbors to kindly warn him if they ever noticed a tool in their coworker's hands again. [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
CodeSOD: OhgodnoSQL
How about those NoSQL databases, huh? There’s nothing more trendy than a NoSQL database, and while they lack many of the features that make a traditional RDBMS desirable (like, um… guaranteeing writes?) , they compensate by being more scalable and easier to integrate into an application.Chuck D’s company made a big deal out of migrating their data to a more “modern”, “JSON-based” solution. Chuck wasn’t involved in that project, but after the result went live, he got roped in to diagnose a problem: the migration of data from the old to the new database created duplicate records. Many duplicates. So he took a look at the migration script, and found piles of code that looked like this:
Optimizing the Backup
Leslie, head of IT at BlueBox, knew there was trouble when one of her underlings called her at 3AM. “The shared server’s down,” she said. “Disk failure. Accounting can’t issue invoices, design can’t get to its prototypes, and the CEO just lost his PowerPoint for next week’s conference speech.”BlueBox, like many companies, kept many important documents on a shared server. It also held personal directories for every employee, and many (like the CEO) used it to store personal files. That data, totaling 100 GB, was backed up to a remote server every 24 hours. “Okay, swap out the disk and restore it.”“I can’t find the backup,” the underling replied.Leslie groaned, then rolled out of bed, booted her laptop, and RDPed into the remote server. The blood drained from her face: while there were backups of every other server that BlueBox need to operate, the shared server’s was missing.Bracing for the headache she would face at the office, Leslie made a call to a data recovery specialist. Later that morning, while the shared docs were being salvaged from the failed disk, Leslie prepped for the postmortem.The ConsultantThe remote server held 8 1TB HDDs in RAID 1+0, formatted with ZFS. With that robust configuration, it probably wasn’t be a hardware issue that caused the backup to disappear. It clearly had to be something wrong with the file system.Naturally, a ZFS consultant was hired.“I just don’t see how it’s possible for a 100GB file to ‘disappear.’” The consultant addressed Leslie and the rest of IT sat in the conference room. He gestured the air quotes. “ZFS uses copy-on-write transactions. While a file is getting rewritten, the old file data remains on-disk until the operation is completed. If there were a hardware failure during that time, the file-system would fall back to the old file data. It wouldn’t ‘disappear.’”“We’re paying you a lot of money,” Leslie said. “Why don’t you see for yourself.”A laptop was brought with an open connection to the server. The consultant grimaced as he opened the DOS command prompt, muttering something about Bash, then ran several commands to check the integrity of the file-system. As he worked, his mouth went agape, cheeks twitching. “No, it’s not possible… This is a fresh file. Are you sure the file wasn’t, well … deleted?”Leslie sighed. “Thank you for your time. Security will show you out.”Just Saving SpaceAfter spending thousands on a dead-end, Leslie decided to start with the basics, interviewing every member of IT about the day in question. After grilling several employees on her team, she called in Heather, who oversaw their backup solution.“There’s a scheduled task to perform the backup on the shared server,” Heather began. “I have it timed for 3AM.”“That’s close to when the backup failed. Does the scheduled task run a batch script?”“Yeah.” Heather opened the script on her laptop and showed her.Leslie’s stomach dropped. “Line 12 … you delete the old backup before creating a new one?”“I always delete the last backup before I do the next backup,” Heather said. “It helps save space and keeps the hardware optimized. All the other servers are set up that way.”It was all Leslie could do to keep herself from firing Heather on the spot.The SolutionLeslie watched as Heather rewrote every backup batch script line-by-line. 7 previous backups would be kept, with new ones written every 24 hours, and old backups would be deleted only after the most recent backup was written. The consultant was still paid, despite offering little help. His invoice led to upper management reconsidering ZFS for their remote backup solution.A few days afterwards, Leslie got an unexpected visitor. The CEO of BlueBox, effuse with praise, thanked her for finding his PowerPoint before the conference began. He offered a substantial bonus.Leslie handed the CEO a business card. It had the contact info for the data recovery specialist who salvaged the PowerPoint file from the failed disk. “You ought to give him one, too,” Leslie said, “since he saved your presentation.” [Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!
Error'd: A Case of Mistaken Identity
"Wow, even Google doesn't understand the current mess that is British politics," writes Mike R.
The Not-So-Highly-Paid Consultant
Consulting. It's as much art as science. You apply for a job to create/change some system, and need to bid an amount that not only covers your time, but leaves a little something extra in your pocket. Of course, we all know that requirements are never absolute, or even well thought out. As such, you need to build some extra cost into your bid to take this into account. Build in too much and you will be overpriced and not get the job. Build in too little and you will be under-priced and get the job at what will inevitably become a loss.Writing a contract that restricts the work to a specific list of features is nearly impossible because nobody ever thinks through what they want in advance (think about your last outsourced project). Given that, you need to be skilled at letting the client know that you will be nice and implement tiny things that are not in the spec for free, but anything that is outside the contract spec and takes any real time will be at an added cost (the art of saying no: why yes, we can add that feature, but it will take x weeks at a cost of y).During the start of January 2016, Sean was contracted by a local news organization to modify their news website for them. Their website was built using WordPress. Believing that it was just a simple addition of pages, footers, headers, and theme, he took the job, and agreed upon a deadline of January 31 with a very small fixed fee of $30 (yes, t-h-i-r-t-y dollars for several weeks of work). Sean felt relieved that he was not going to have to build a full-blown news website because he already had another project in his start-up on queue.My lawn-guy gets more than that for ten minutes of mowing.Sean was given the credentials to the web host they were using and started to work. Upon opening the website, it took more than 10 seconds for it to fully load. He felt sad but endured the pain because he believed the task was just "easy." In the first two weeks, doing the job felt good. He optimized the WordPress website a bit, added the necessary pages and footers, and added SEO. Everything was fine and Sean was ready to show them the website.A week later, the client called Sean and completely changed the requirements. They asked him to add a custom look on two of the pages, change the font, and add an interactive news map. That was not in the originally agreed-upon site design! Sean vigorously protested, but the client just said (non-verbatim), "Aww. Sean, you're a very good programmer! You can do it right? It can't be that hard."When people tell you how easy your job is, the best thing to do is to make them do it for themselves.Sean was not in a position to increase the cost of the job to cover the extra work, and could not do anything about it at that time. A week passed and he finished the custom look. He even had to pull in the source code from the website to his laptop because the loading was so slow that he could no longer bear it. What was left to be done was the interactive news map.Now I don't know anything about web design but that sounds like something that's significantly more complicated than you can do for $30, let alone on top of the other work.The interactive news map they requested was such that when the user clicked on a given province on a map, news for that province would be displayed on the bottom of the map. Sean did not know how he would implement that feature. It was certainly not in the cards given the original fee.Sean thought that they should receive service that was comparable to the fee they paid. He told to them that the interactive news map couldn't be done because of "technical stuff." They bought the excuse.What he gave them was a website that looked done but actually had a lot of visual bugs. What they asked him to do was to modify their website by just adding a couple of pages, a theme, and add the necessary information, and that's what he gave them.Before and during the start of work, Sean learned that he was the second programmer they contracted to develop their website. The first programmer they contracted was a friend of his who was also asked to modify the site and add an interactive news map. He bailed out immediately because of the discrepancy between the pay and the amount of work.To this day, their news website is still up and running, albeit really slowly. However, it seems that they haven't added their articles yet.It's like when you see job postings where they want an expert with ten years of experience in each of web design, Java, C++, C# and .NET, system administration and as a DBA in each of Sybase, Oracle, DB2 and SQL-Server, and their pay range goes up to $60/hour. And they wonder why they can't fill the job. [Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: Lunatic Schema-tic
One day, James’s boss asked him to take a look at a ticket regarding the “Cash Card Lookup” package, which had an issue. James had no idea what that was, so he asked.“I don’t know,” his boss replied. “I just know the call center uses it. You’ll need to talk to them.”James picked up the ticket and called the customer.“Oh, yes,” the customer replied. “We need this to get customer details based on their cash-card number. I think Timmy made it.”“Timmy? Who’s Timmy?”“He’s our tech guy. He sets up our computers, helps us when we have issues, that stuff. Let me transfer you to him…”Timmy had indeed made it, because he “did a little programming”. There was also the issue of internal billing- like many large companies, each business unit needed to charge other business units for their time. The software development team billed at $95/hr, but Timmy was already on salary to the customer service department.He had grabbed a spare box, slapped Linux and MySQL on it, then whipped up a simple Perl script that served up a web page for doing the lookup.Data entry, on the other hand, was a different problem all together. Knowing Remy’s Law of Requirements Gathering, Timmy gave them an Excel spreadsheet with a VBA macro that could connect to the MySQL database to do bulk uploads of data. "When James pulled up the code, he saw every horror he expected from Perl and VBA. When he saw the database, it got even worse. The data itself had a number of problems, the first one being that Timmy never set up a test environment, and instead, tested in production. And didn’t clean up the test records. Even worse, though, the VBA macro tried to sanitize the inputs, and handle escaping characters like the single quote, but it did it wrong, leading to records like:last_namefirst_nameOReilly KevinAs you might imagine, the database only had one table, and it was this code that really got James’s attention.
A Song of API And Fire
Emily didn't expect much excitement at her day job. She worked for a health insurance company, so most of her projects were pretty routine enterprise-level things: hooking up the accounting software to the billing software, managing mailing lists, the usual stuff. When she was given a minor role on a large project, she never dreamed it would be any different than the usual fare. She was unprepared for what she received: Project Aegon.Insurance companies reach out to people a lot: direct mail advertisements, mail to their subscribers, telemarketing phone calls, and the like. Before Project Aegon, each of the contact lists was housed in a different little kingdom. Subscriber information in the North, direct-marketing addresses in the Riverlands, and so on. Project Aegon was meant to unify these all into a single central repository, and that meant conquering several different application datastores and mastering them all in one location, establishing a new primary source of intel in King's Landing.Emily's part in this large debacle was Dorne, the email provider: think Mailchimp, but more enterprise. Dorne was an important target for the migration, as it controlled most of the company's outgoing email. However, it was a difficult target to attack strategically, as it used guerilla warfare in the form of a terrible API to protect its information. The API used XML, but it wasn't SOAP, preventing Emily from using a simple library to interface with it. It was far from REST as well; there was no rhyme or reason to the endpoint design, as it had grown "organically" over the years.For a time, Emily thought she was making headway when she discovered the existence of an API for querying the SQL directly. Surely that would be an easier method of obtaining up-to-date subscriber information? Then she saw the example query. She didn't make it any further than the following before bailing:
CodeSOD: Hanging By a String
We all know that truth is a flexible thing, that strict binaries of true and false are not enough.Dana’s co-worker knew this, and so that co-worker didn’t use any pidling boolean values, no enums. They could do one better.Now, we’re missing a lot of the code, but the pieces Dana shared with us are enough to get the picture…
Error'd: Not in Kansas Anymore
Eric G. wrote, "It looks like Dinerware, a point of sale system for restaurants, has a similar problem to the Scarecrow in the Wizard of Oz."
Classic WTF: The Circle of Fail
"Doctor, it hurts whenever I do this!" This classic ran back in 2013 -- RemyDuring Ulrich’s days as an undergraduate, he landed a part-time gig at a nuclear power plant. It was an anxious time to be on board at the nuke plant- the late 1990s. The dreaded Y2K loomed over all of their aging systems. One decimal point in the wrong spot at midnight on January 1st, 2000 and… well, nothing good would come of it.Ulrich’s job for the big conversion was more benign though. He needed to update the simple graphics on the monitoring program the nuclear technicians used to keep tabs on the reactor. The very basic macro language generated Commodore 64-quality graphics; it displayed the position of the control rods, neutron flux, water temperatures & pressure, turbine and generator stats, and how many three-eyed fish were caught in the neighboring lake. All of this was then shown on 10 massive CRT monitors mounted around the main control room.Ulrich worked diligently to get his screens prepared, and the day came for him to roll out the changes. They didn’t have a “test control room”, so the demo needed to be run live. He invited the engineers to gather ’round the monitors to see his spectacular new designs. When the program booted and Ulrich went to pull up the control rod screen, all 10 monitors went as black as the cloak on a member of the Night’s Watch. As the engineers chuckled, Ulrich turned bright red and ran back to the server room to see what happened. It didn’t take him long to realize that whatever he screwed up caused the entire mainframe to go down.Thus began a two-week battle to troubleshoot the mainframe issue, during which time the computer monitoring was completely unavailable. This caused the nuclear technicians to have to leave their air conditioned control room so they could use primitive analog monitoring tools from the 1970’s to check on the reactor. Every time Ulrich walked past one of them, he could sense them glaring and thinking “There’s that little pipsqueak that killed the monitors!”The tools Ulrich had to debug the program weren’t merely useless to him. They went beyond uselessness into outright opposition. The custom macro-language had no debugger or real documentation. The mainframe was purchased from the Czech Republic and one would have to know Czech in order to read the error logs. He was able to locate a sticker on top of the server with the phone number of the vendor. He was able to reach one of their ‘experts’ named Miklos, who asked him for the serial number of the product. Ulrich provided it but the expert retorted “That is not full number! This is too short. What you need help with? Toaster? Coffee maker?”Confused, Ulrich replied, “Ummm, a mainframe?” Had the nuclear plant bought their server from some sort of Czech Coffee, Toaster, and Mainframe Corp.? Miklos said “Oh no, Miklos can not help you. I give you number for Blazej. He does help with mainframe.” Blazej was an engineer at another nuclear power plant in the Czech Republic, who also had the same mainframe. Ulrich called there, not expecting much.Through a series of conversations with Blazej, Ulrich was able to finally narrow down the problem to the presence of circles in the screen outputs. Apparently drawing fancy circles was far too much for the monitoring program to handle. He removed all the circles from his screens, uploaded the changes to the mainframe and finally the engineers could see the reactor statistics on the bright, beautiful monitors; without any circles. The result was ugly, boxy, and barely readable, but it worked. Ulrich breathed a sigh of relief then decided to call Czech Coffee, Toaster, and Mainframe Corp. back to notify them of the horrible bug in their program.Ulrich once again got connected to his buddy Miklos. “Hi Miklos, this is Ulrich. I called a while back concerning our power plant monitoring program crashing the mainframe. You’ll be glad to know that Blazej and I were able to determine the problem. It all had to do with circles being drawn on the screen. I know it sounds silly, but that causes the whole mainframe to come down.”Miklos seemed to be offended by such an accusation. “You do a circle and server come down? You want Miklos to fix this? You stupid? If you know circle cause trouble, then DO NOT USE CIRCLE!” Miklos abruptly hung up. Ulrich shrugged it off since his job was done. He eventually finished his undergrad program before Y2K and moved on from the nuclear power plant. When New Years 2000 rolled around, he made sure he was far, far away at a ski resort just in case anyone else slipped a circle into the graphics and the plant melted down as a result.Nuclear Reactor image from the public domain [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
CodeSOD: Classic WTF: RegExp from Down Under
This particularly bad example of regular expressions and client side validation was originally published in 2009. I thought Australia was supposed to be upside down, not bass ackwards. - Remy"The company I work for sells vacation packages for Australia," writes Nathan, "and for whatever reason, they're marketed under different two different brands — redacted-travel.com.au and redacted-travel.com — depending on whether you live Down Under or somewhere else in the world."Nathan continues, "one of the requirements for the international website (redacted-travel.com) is to disallow people from within Australia and New Zealand to make bookings. But the way this is done from the front end... well, it's a real gem."
Classic WTF: Manual Automation
This article originally ran in 2014, and it's the rare case of a happy ending. They DO exist! -- RemyAikh was the new hire on the local bank’s data warehousing/business intelligence team. His manager threw him right into the hurricane: a project with the neediest, whiniest and most demanding business unit. Said business hated their unreliable batch process for archiving reports, and the manual slog of connect > find/create directory > upload > pray. They hoped the DW team would code to the rescue.Eager to impress, Aikh sketched out a simple, automated client/server solution. The business quickly approved his design and estimates. To mentor and keep the project on-track, Aikh’s manager assigned Dean, a more senior developer, to help out.
Independence Day
Today is the 4th of July, which is a holiday with historical significance in the US. Twenty years ago, Jeff Goldblum and the Fresh Prince defeated an alien invasion using a PowerBook and a hastily written computer virus. It’s such a big holiday, they’ve just released a mediocre and forgettable film about it.This scene has spawned many a flamewar. Anyone with a vague idea of how computers work may note that hardware architectures are complicated, and even with access to alien hardware and software, designing a virus capable of disabling all of the alien spacecraft in one fell swoop strains credulity. Some people point to a deleted scene which explains that computers are based on alien technology captured in Roswell, and thus, our computers are already compatible. Others mutter something about, “It’s just a movie, what the hell is wrong with you?” while rolling their eyes.Here at TDWTF, we know that no competently run IT organization is going to let its entire shielding system across an entire battlefleet be vulnerable to a single virus delivered to a single node on the network. We know the real story must be quite the WTF.Lisa graduated from the Aldebaran Institute of Technology in 1996, expecting the “rising tide” of the late 90s tech boom to carry her to wealth and riches. She went to a college job fair shortly before graduating, handed out some resumes, and tried to resist senioritis long enough to make it to the end of the semester.This is LisaA week later, she got a comm from a recruiter. “Hey, Lisa, I just saw your resume, and have I got an opportunity for you! An established invasion fleet with a proven track record of subjugating alien planets needs some junior engineers to provide tier–1 technical support. This is a great entry-level job, with 100% travel, which is such an amazing opportunity for a young Sectoid such as yourself- you really get to experience the whole galaxy. Now, the salary might not look like much, but you’ll also receive equity in the invasion, and you are absolutely going to make out extremely well- they’ve identified a planetary sector that’s completely unexploited.”Lisa was young, inexperienced, and the recruiter was very good at his job. She went in for an interview, chatted with Al (the head of IT), met a few of the other techs, and even got to meet one of the fighter pilots, who cut quite the dashing figure. Star struck and seduced by the promises of fantastic wealth (once they handle that minor, piddling problem of conquering the Earth and blowing up a few easily recognizable landmarks), Lisa signed on and boarded the mothership just a few days after graduation.Spoilers: that dashing pilot doesn’t look as dashing by the end of the movieOn her first day, Lisa was invited into Al’s office for some orientation. The office was little more than a closet, just off the main hangar bay. It was made even more cramped by Al’s insistence on covering the walls with the various certifications he’d earned in his career- A+, Net+, and in the fanciest frame, MCSE.“Now, I know you’re a college-educated wunderkind,” Al said, “but I got here through old-fashioned knowhow. The first and most important thing you need to understand is that we deliver IT services, and we’re not happy unless our users are happy.”A few days into the voyage to Earth, one of their users wasn’t happy- the Hangar Operations Officer was having issues with spacemail. Lisa went to his workstation to try and help.“My broodmate sent me pictures of our newly hatched clutch, but Outlook won’t let me open the attachement!”It was instantly obvious to Lisa what was going on, since the file was “familyphotos.jpeg.zip.exe”. “This is almost certainly not pictures of your clutch, but is probably a virus.”“That’s absurd,” the hangar operations officer said, his tentacles waving angrily. “My mate wouldn’t send me a virus!”“Well, it might not have come from your mate,” Lisa explained. “See, spacemail lets you claim the email comes from any-”“Look, are you going to let me get these photos or not?”“I can’t,” Lisa said. “They’re not photos.”“We’ll see about that!” the officer said. He commed Al directly. “I want you to know that your new tech is refusing to let me see my pictures.”“They’re quarantined as a virus,” Lisa said.“Oh, well,” Al said, “we can fix that. Let me just disable the quarantine.”“What?” Lisa cried.“Remember,” Al warned her over the comm, “we’re not happy unless our users are happy.”Cringing, Lisa watched the hangar operations officer open the virus. Fortunately, or perhaps unfortunately, it did open a window with a picture in it- a lewd picture of a Muton’s posterior- and flashed a message that “you have been pranked!”. For a finale, it inverted the mouse pointer.“I told you,” Lisa said, “that probably wasn’t from your mate. You’re just lucky it was a piece of joke software and not a dangerous virus.” A quick reboot set the mouse back to normal, and Lisa made sure the dangerous email was deleted before she handed the mouse back to the Ops Officer. “Please don’t open strange attachments in the future,” she warned.The next few weeks were mostly routine support, until that dashing pilot- Lieutenant Bradford- submitted a ticket about his fighter craft. It was stuck in a reboot loop- the main computer would turn on, print out an error message, and then reboot. Obviously, this needed to be fixed before the invasion started. Lisa fired up Gopher to try and find out what was going on.As it turned out, this was a bug in the v8.0.2 firmware running on the entire fleet of fighters. When the system clock’s battery started running low and the clock started to drift, the firmware had a bug that would trap it in this reboot cycle. This particular bug had been fixed in v8.0.5, which was released six years prior. The manufacturer had actually cut support for the entire v8.x.x series and was up to v11.x.x.You could fix it by replacing the battery and resetting the BIOS, which Lisa did, but she approached Al about these dangerously out of date software versions. “There’s been a LOT of bugfixes that our ships don’t have.”Al shook his head and laughed at Lisa. “See, you don’t get it. These software vendors, they just want to sell you new things. Trust me, the last time we tried to do an upgrade to the latest patches, they sent a tech onsite who kept trying to get us to buy new versions of all of their software. It’s a scam, Lisa, just a scam. Our users are happy, so why should we spend money with the vendor when we can just keep using firmware that works perfectly fine?”Two days before they arrived at Earth, a new ticket came in, this time from the invasion fleet’s Supreme Commander. It was a bit of a cluttered mess of a ticket, in that it didn’t represent one single issue, but instead the Supreme Commander wanted to vent about all of the problems she had with IT. Lisa interpreted the ticket as a series of bullet points:
Error'd: Not What I Had in Mind
Rob writes, "Sorry, but I'm not into Microsoft Office in that way."
Representative Line: The Validation Regex
Regular expressions are a powerful tool for validating inputs, but what if your input is itself a regular expression? Is there a regular expression that can validate regular expressions?Well, yes, if your regular expression engine supports recursion: /^((?:(?:[^?+*{}()[\]\\|]+|\\.|\[(?:\^?\\.|\^[^\\]|[^\\^])(?:[^\]\\]+|\\.)*\]|\((?:\?[:=!]|\?<[=!]|\?>)?(?1)??\)|\(\?(?:R|[+-]?\d+)\))(?:(?:[?+*]|\{\d+(?:,\d*)?\})[?+]?)?|\|)*)$/.Today’s Representative Line (which is more than a single line) comes from Ryan S, who found an implementation of isValidRegex which is perhaps a bit more elegant:
Analyze This
When asked to choose among several possible tools to do a job, qualified technical people look at the manual and test to see if the tool actually does what they need it to do. Is it reasonably configurable? Must it have root privilege to launch, or can it be installed as your application login id? Smarter folks will do a load test to see if it will scale beyond a handful of records and work with the expected volumes of data. And all of this will be combined to form an informed opinion as to whether the tool is appropriate for the task at hand.High Level Managers have a different approach. They are too busy to deal with mere technical details.After numerous outages at a large multi-national bank, a high level manager decided that they needed to do something to stabilize things, so he put together numerous charts to compare the various software packages that were available to automate solving their problems. There were slide shows, spreadsheets and myriad documents detailing how one tool was better than the others and that it would solve all of their problems.The only problem with his analysis was that it was not based upon actual features or testing, but on the sales brochures and promises made by the salesman.Not to let the facts get in the way of managing a problem, several suitcases of money were provisioned and turned over to the salesman in exchange for a full all-bells-and-whistles site license for the new tool. The new tool was brought in house and ran through a few simple test cases. Then it went live in production. Then it hit the fan.Bob was brought in to see why their applications were crashing in spite of their shiny new be-all end-all tool.Queries that should have completed in milliseconds took several minutes to complete. The tool was sucking up 80GB of memory just to launch in basic mode. And we're not even going to go into how the tool mistook email addresses for websites it had to crawl.The manager, realizing that the salesman had lied to him, had to deal with the spilled milk, and opted to forge ahead at all costs.Bob created a web app that alleviated the worst problems by pre-massaging input and query results. He could not push away a gnawing suspicion that he was merely repairing damage rather than adding actual value to the company.After about a year of this, the manager committed to drastic changes in the work processes. When Bob learned about this, he asked them if they'd even done rough, back-of-napkin estimations of the expected manual workload in the changed process; after all, they already had a wealth of data from the past year and estimations surely could be done given the new process was specified in substantial detail. After all, they had gotten burned on their 'analysis' of the product they bought to solve all the instability. He was met with blank stares.The new process was put in place and the amount of manual work tripled overnight.Bob put in a lot of overtime trying to fight all manner of fires. Still, he was only partially successful, as the task of developing an app to totally fix the situation for a huge and complex package on top of a pretty complex work process was out of the question for a single developer.After many, many months of this ongoing failure, the manager who started all of this had analysed the cause of the all of problems. The entire team was called in by the manager to a meeting. As could be expected, it was announced that the productivity was deemed too low while the risk and cost were too high, and so the entire team; analysts, lower level managers and Bob were laid off.The manager was promoted for recognizing the cause of the failures and was given more responsibility to oversee other projects in addition to his own. [Advertisement] Scale your release pipelines, creating secure, reliable, reusable deployments with one click. Download and learn more today!
CodeSOD: The Bare Minimum
Let’s say you needed to find the maximum and minimum values for a field in a SQL database. If you’re like most people, you might write a query like SELECT MAX(someval), MIN(someval) FROM table.That’s the least you could do. That’s the bare minimum. And do you want to be the kind of person who does the bare minimum? Kevin L’s co-worker doesn’t. He’s a Brian.
Logging, Retooled
In every company, there is a tendency to value code that was invented in-house over code that was, to put it bluntly, Not Invented Here. There is an eternal struggle to find balance between the convenience of pre-packaged code that is not fully vetted and the trustworthiness of code they themselves have written. As is typical in these tales, Jon's company got it wrong.When Jon was asked what logging solution he was planning to implement in his company's .NET-based application, he gave the right answer: log4net.No sooner had he spoken, however, than the room grew quiet. The locusts could be heard clearly from outside the window, screaming their disgust at the idea. Not-here! Not-here! Not-here!"Or ... maybe I could throw something together?" he suggested timidly."Splendid!" replied Jon's boss, Ned, heartily. "You can use my logger as a head start. Rolled it by hand back in my university days. It's much better than that log4net crap. Did you realize that piece of dung uses reflection? Reflection! Something as simple as a logger doesn't need anything as expensive as that."And Ned was right, in a way. His logger didn't use reflection; it hardcoded the method name into each log call made. But that's not all. In a bid to save on "expensive" new features Ned barely understood, the logger was held to a strict 2.0 code level, despite the project using the 4.5 framework. And in a flash of coursework-inspired brillance, he had implemented his own custom stack to store incoming logs—a move that entirely undid any cost savings achieved by avoiding reflection three times over.But Jon tried. He rewrote the stack structure, desperate to reclaim some of the cycles. He documented methods that confused him, hoping to leave the codebase better than he found it. And he tried and tried to make it work consistently.The days turned into weeks, and the project deadlines began to slip. Ned grew sterner and sterner with every depressing status meeting. "That logger can't possibly be responsible for all this! It was fine when I wrote it!""But sir, if we just pull it and use Log4Net—" Jon began."I don't want to hear another word about Log4net! Just get the project done!"And so it was done—weeks behind schedule, and with a tendency to drop log files in the event of a crash, just when you'd want them the most. Jon privately swore he'd never touch the logger again; come hell or high water, he'd use log4net next time and be done with it.It was three months later before he had another chance. Another desktop app needed to be built where logs would be mission-critical in the event of a disaster."Sir, about the logging—" Jon piped up."I know what you're going to say, and I won't hear of it," Ned cut him off."But sir, if you'll just listen a moment—""I said no and that's final: there's no way you'll be using that POS logger you put into production last time! No, you're going to have to write something custom from scratch, no getting around it!"Jon put in his custom, from scratch, two weeks' notice that very day. [Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!
Error'd: It Ain't Over Til It's Over
"Countdowns are hard, particularly once they run out!" writes Peter.
Dumb's The Word
Brent's latest software project contained a story for adding a word-cloud to a PDF report that was already being generated on a production server using Java. Instead of being handled by Brent's in-house team, the requirement was assigned—against Brent's wishes—to overseas developers whom the company had recently contracted to "add more horsepower" to things.Being fairly technical, the product manager found an example word-cloud library, linked to it in the ticket, and commented, "The output should look something like this."A month passed. Then, Brent reported into work one morning to find a new ticket in JIRA listed as blocking the word-cloud ticket. Its title was Having trouble launching Internet Explorer from Selenium on Linux servers (works fine locally on my Windows development machine).Brent's confusion left him paralyzed for a few moments. Then he realized, this was probably just a testing ticket that'd somehow gotten linked to the story by accident. To make sure, he called up Bobby, his counterpart from the contracting firm, who'd been the one to file the ticket."It's not a mistake," Bobby explained. "The story really is blocked.""OK, so, you're really trying to launch Internet Explorer on the production app server?" Brent asked. "You realize IE's not installed on that server, right? What do you need it for?""It's integral to the implementation I came up with," Bobby replied.Brent was afraid to ask. "How?""I couldn't find a native Java word-cloud library, so this is what I have to do to fulfill the specifications," Bobby said. "First, I take the PDF report data and serialize it to JSON. Then, I import Selenium into the production codebase. Then, I generate an HTML page and a Selenium script. Once Selenium is started, the script launches Internet Explorer and opens the HTML page. Once the HTML page loads, Selenium captures a screenshot of it. With Java, the screenshot is opened, cropped, and then embedded into the PDF report."Brent was stunned speechless."I got this to work on my local machine, but then I tried to test on a server and hit the error," Bobby continued.That's what you were doing all month? Brent marveled. "Uh, OK ... listen, the implementation you just described is unacceptable. I don't see why we can't keep it within Java. We're coming up on our deadline."Brent's eyes strayed toward the calendar tacked to his cubicle wall, showing him how few empty squares he had left to deal with this. He took a deep breath, composed himself, then donned his project manager hat to do the managerly thing."Leave this alone for now, all right? I'm going to speak with some of my developers and let you know what we decide to do from here.""OK," Bobby replied.Once off the call, Brent opened up Outlook and fired off a meeting request for the earliest possible time. A short while later, he looked upon his assembled developers within a dimly lit conference room, half of whom were more interested in their laptops than in the minor crisis Brent related to them."What can we do about this on short notice?" he begged. "Is there a native Java library that can generate word-clouds?"No amount of Internet-hunting turned up anything useful. Brent tugged at his collar. He'd been hoping Bobby had been wrong about that, and that a solution would only require a download and a few lines of code."All right. How hard would it be to code our own implementation?" Brent asked.Cheryl, who'd been typing furiously all meeting, finally let up on the keyboard and shoved away from the table. "Here, I just finished."As it turned out, her keyboard exercise had not been in the service of bashing trolls in comment threads. Everyone gathered to peek over her shoulder at the PDF-embedded word-cloud it'd taken her minutes to code and generate, an accomplishment that'd eluded their contractors for a whole month."Meeting adjourned!" Brent cried in triumph.[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!
CodeSOD: Built Up
In most languages, strings are immutable. As developers, we often need to manipulate strings- for example, constructing output through concatenation.Constructs like foo += " and then I appended this"; “solve” this immutability issue by creating a new string instance. If you’re doing a long round of concatenation, especially if it happens inside of a loop, this could get very expensive, which is why most languages also have a StringBuilder type, which allows you to append without all that overhead of new instances. Often, the advice is that you should prefer StringBuilder objects to string.Jonathan’s co-worker applied this advice without understanding why.
Putting the "No" in "Novell"
In the late 90's, Gregg was hired to administer a small Novell network at EduLoans, a student loan processing company. What it amounted to though was a toxic waste cleanup at a Superfund site. To say his predecessor, Loretta, was underqualified was a blunt understatement. The company wanted a network on the cheap, which included elevating a receptionist with slight technical skills to the ranks of Novell administrator. They figured the only training she would ever need was a two week hands-on Novell CNA course. Loretta returned from training with tons of free swag in tow. This included a CD-ROM beta version of Netware 3.12, with bold text printed across its face reading NOT FOR USE IN A PRODUCTION ENVIRONMENT. Ignoring that, she convinced the President of EduLoans that they could get by with this great free version so there would be more money to spend on hardware - and her raise.Fast-forward a couple years and the EduLoans network was barely functional. Things were fouled up so bad that the Administrator account could do nothing except delete existing user accounts, manage - but not create or delete - print queues, and setup automatic backups which the system would not actually run. Administrator could not even change its own password, nor could any of the other user accounts.Around the same time, Loretta was ready to start a family and decided to leave EduLoans just before having her first child. Thus, the need for Gregg arose. He was brought in to fix the mess, and do it in a very budget-conscious manner. So obviously having Novell technicians come in to help was out of the question.Combined with the Netware disarray was the crappy loan processing software EduLoans ran its entire business through. It had originally been written in COBOL then ported to MS-DOS batch files thousands of lines long. These mammoth batch files had to be run from a workstation, which resulted in pulling the entire million-dollar database over a 10 megabit Ethernet connection. The workstation would then process the transactions, send them back to the server, and print the results on 15" greenbar.Strapped for cash and not sure what else to do, Gregg unhatched a bold plan. He would personally take an upcoming three day weekend to wipe every hard drive at EduLoans to remove the scourge Loretta had setup. He would then use an existing Netware 4.11 license he personally owned the rights to from his last job and set up a fresh Novell network, re-install everything on the workstations, and connect it to the new clean network. From there he would take the backed-up application and database and set it up in a manner that it could run from a server. It might take him the entire 72 hours of the weekend, but it should work and he'd be hailed as a hero.In order to execute this plan, he would need signoff from Bob, EduLoans' Vice President and the only rung of the ladder Gregg ever had to run his ideas up to. Bob wasn't the most technical person, so it didn't usually take Gregg much effort to convince him. "Seems like a solid enough plan," he said. "If you're willing to burn up this glorious long weekend doing it, that is. Me, I'll be out of state on a golf course somewhere, so I am not to be bothered!" Bob thrust his index finger in to the air to drive home the point. "I'll see you on Tuesday once this mess is sorted out!"For Gregg, the 3 day weekend seemed like one long, never-ending day. He had all the workstations wiped and reloaded by Saturday night but the rest of the time was a total nightmare. The new network was more difficult to set up and configure than he originally anticipated. Once that was done, none of the workstations would talk to it until he found some obscure setting in the wee hours of Monday.After a power nap, he got to work configuring the server to run EduLoans' application. He came to find the documentation he was planning to use to help set it up hadn't been updated since the time Zubaz were cool. That led to a lot of guesswork and missteps, which eventually led to the sun coming up on Tuesday morning and a non-functional environment that EduLoans depended on for business.Bob strolled in an hour late, looking lobster-ish from too much sun on the golf course. "Gregg! Good morning. I forgot all about you being here this weekend. How'd it go?" Bob's tone suggested he expected everything went well and Gregg had worked a miracle. But the answer he got made him turn an even deeper shade of red. "We need to go explain this to the President, pronto!"Gregg was prepared to fess up to what he did, but did not anticipate the proverbial bus Bob was about to toss him under. "He acted alone! I told him this was a bad idea that could damage our business! But did he listen? NO!" Bob blathered on as Gregg sat there stunned. "I even tried calling him several times to see if he had any other ideas! I will not be held responsible in any way for this disaster!"If looks could kill, The Prez's icy stare would have struck Gregg down. Instead, he calmly spoke, "Gregg, I'm afraid your services are no longer needed here. Bob, please escort him out. After that, get on the phone to Loretta and tell her we will spare no expense to bring her back to get our network back to the way she had it!" [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
CodeSOD: Now There's a Switch…
You know what’s awful? If-then-elseif conditions. You have this long, long chain of them, and then what? If only there were a shorter, clearer way to write a large number of conditions.Oh, what’s that? There is? It’s called a switch statement? But doesn’t a switch statement only work on equality comparisons? I’d really like something that works on any condition.Fortunately for me, Sergej’s boss has found a way.
Error'd: Pirates, Your Days are Numbered
"If you pirate Windows 10, watch out," Norman D. wrote, "One week and 100 years from now, Microsoft is going to catch you."
Announcements: Our Next Kickstarter: Lairs Board Game
I've been a board/tabletop gamer for as long as I can remember, even before writing my first program (obviously, 10 PRINT "ALEX IS COOL" / 20 GOTO 10). After seeing how much you supported the Release! game, it turned out that a lot of you are into games, too.But since then, I've learned that games came be more than just a fun activity for us to do off-hours with our friends and family. They can also serve as a great team-building activity for developers and engineers.And it's not just the social aspect. Understanding and applying a set of fixed rules to achieve a desired outcome describes both writing software and playing games, and seeing how other team members think and apply these rules can create a better understanding, and facilitate better communication. That, and it's a bit more fun than most corporate team-building activities.Of course, this wasn't exactly the driver behind my next Kickstarter Project (or the othertwo games we've since launched), but it's one of the reasons I wanted to share it with you today.Here's a the short story on how the game works:
CodeSOD: Trained Developer
ASP.NET, like any other web development system, has a “role provider” system to handle authorization. With a small quantity of code, you can hook your custom security settings into this API and get authorization essentially for “free”. Not every organization uses it, because it’s not sufficient for every security situation, but it’s a good starting point, and it’s guaranteed that it’ll be covered in any ASP.NET training course.Paul’s employer recently found a new hiring strategy. Instead of hiring expensive, well qualified people, they hire completely inexperienced people on the cheap, and send them to training classes. That’s likely where this code started its life- cribbed from notes in a training class.
Coming of Age
When you discover the truth about Santa and the Easter Bunny, you die a little inside as you leave some innocence behind and begin to grow up.When you get your first pay check at your first real job and discover that the government gets the first bite, you get a little disenchanted as you grow up.When you realize that the prettiest members of the opposite sex aren't always as nice and sweet as you might fantasize, you face a reality of life and grow up.None of that holds a candle to the coming-of-age you experience as you find out about management in the workplace...D.H. was a student pursuing a degree in Computer Games Programming. The program required a year of work in the real-world workplace. He thought he was pretty lucky to find a job at a massive Consultancy and IT company. Unlike most of the 20 interns in the group, D.H. wound up with some actual hands-on experience as a developer.Toward the end of the stint, D.H. had developed a healthy fear of Management StupidityFrom the get-go, he discovered that real-world programming was vastly different from university homework problems. What he hadn't expected however, was for common sense to have been replaced entirely with "business sense", and for all coding practices to be thrown out of the window.When someone raised a defect because you could only select one out of several radio buttons on screen, management forced him to break functionality. There were radio buttons assigned to the question "Would you like to review your answers?" Yes, No, followed by two buttons: "Review" and "Continue". After the change, you could click no to review and then review anyway.We all know that you shouldn't trust user input. He discovered that a field that took 3 characters for a promotion code brought the application crashing down around it if the data was entered incorrectly.Or if someone has a surname with a space.Or if you share a house with someone with the same birth date and surname (twins, or a coincidental marriage spring to mind). Or if you need to handle international phone numbers.Or street addresses.And then he found this:
CodeSOD: Simulated Congealing
Simulated Annealing is a class of algorithms from moving through a search space to find a solution, balancing “good enough” results against a computational budget.John L has a co-worker that has taken this logic and applied it to writing code. Whenever code needs to change, he “randomly” changes the function in small increments until it works. The result is code that looks like this:
The Shield
Russell M. knew better than to tempt fate. The last time someone asked him about Big Telco’s network downtime, he bragged about not having any since he began … only for the network to go down within minutes. That time, a construction worker plugged a power drill into a UPS and drained it.This time, with no construction on-site, he couldn’t use that excuse.“No one can call anyone, anywhere, on our regional network,” the CEO rasped through a speakerphone. Russell sat in a conference room with the other four employees in SysOps. The executive board were all on the other line. “I want hourly reports … No, semi-hourly reports. If someone’s not calling me every thirty minutes about what’s been done, there’ll be a box and a pink slip at each of your desks come Monday morning.”The CEO had a flair for the dramatic, but Russell knew he couldn’t brush this one off, not after last time. “Okay,” he said to the rest of SysOps, “let’s do a visual check.”Throwing the Book at ItDown in the equipment room, a basement where phone books were once archived, Russell and the others visually inspected Big Telco’s CLEC infrastructure. All of the switches and other equipment were stored here. Russell and the rest of SysOps rarely came through for anything other than an emergency.Russell, checking that all of those boxes were still turned on, didn’t notice the three-inch-thick paperback manual splayed on top of a keyboard at first. He picked up the blue-and-white doorstop and put it back onto the shelf above. He switched on the monitor and checked the logs. Through bad luck, the manual had mashed just the right key combo to trigger a feedback loop in the network switch. This was what had brought down an entire regional telephone network: some bad commands triggered by a knocked-over equipment manual. However, Russell had no means to stop the loop from the console itself. He sighed, knowing the fire and brimstone about to come down on him.He rebooted the switch.The Tel-X FilesBig Telco’s investigative team arrived that Monday. Russell knew you never rebooted part of the network unless you had no other choice, because Big Telco would be obligated to file a report with the FCC. The investigative team, nicknamed “Scully” and “Mulder,” summoned Russell to the conference room.“Accounting estimates we lost a million dollars in revenue due to the outage,” Scully began. “That’s potential revenue, estimates for lost customers over eight quarterly cycles,” Scully continued. “So tell me: did you really have to reboot that piece of equipment?”“No other choice,” Russell said. “It would have kept the network down indefinitely.”“If I could speculate,” Mulder said, “you said that the book had fallen off the shelf. Could it have been sabotage? Do you think a member of SysOps could have done it?”“No one ever goes down there,” Russell said, “except us and custodial.”Mulder wrote on a notepad. “Check … custodial … for … recent … hires.”“I mean, you couldn’t have prevented it,” Russell continued. “Unless you chained the manuals to the shelves and put plexiglass over the keyboards.”“Is that your recommendation?” Scully asked.Installation ProceduresA shipping pallet stacked with boxes was delivered to SysOps the following week. Russell and the others unpacked them. Inside were twenty-something pieces of moulded plexiglass, along with hundreds of feet of thin chains. Russell read aloud the attached instructions.“‘Use a 3/4 inch bit to drill a hole in the spine large enough to pass the chain through. Only use three feet of chain per book.’” That would barely be enough to open the book on its shelf. “‘Each plexiglass shield has been custom-made for a single keyboard in the equipment room, per the latest inventory. Do not put a plexiglass shield over the wrong keyboard.’”After SysOps implemented the changes recommended by Scully and Mulder, Big Telco submitted its findings to the FCC, and it dodged a hefty fine for the outage.A few months later, one of the ancient book shelves collapsed onto on a console. The monitor shattered, but the keyboard, protected by its shield, remained intact. None of its sensitive keys had been pressed. [Advertisement] Incrementally adopt DevOps best practices with BuildMaster, ProGet and Otter, creating a robust, secure, scalable, and reliable DevOps toolchain.
Error'd: All Rights Reversed
Tim B. writes, "If you violate Laotel's rights, does this mean that you can sue them instead?"
CodeSOD: Lines and Lines and Lines of Order Lines
Darlene’s company uses Siebel for managing their enterprise. Like most enterprise software packages, it’s complicated, incomprehensible, and any significant maintenance depends on very expensive consultants.During an upgrade, one of those Highly Paid Consultants caught a new requirement: customers wanted to be able to change an order, replacing one product code with another, all the way up until the order went into fulfillment. Now, the logical thing would have been to cancel the changed order line and create a new one, but our HPC couldn’t quite figure out how to cancel an individual line item, so he just decided to delete it instead.This is the eScript (Siebel’s proprietary version of JavaScript) code he implemented:
A Costly Slip
It was a lazy, drowsy Saturday afternoon. The sun was shining, birds were singing. The kind of day when children should be playing outside, perhaps running bases in a sandlot someplace, carefree and smiling. Even indoors, thanks to the cost-saving measures at Big Online Retail Storeâ„¢ HQ, it was warm enough to send tantalizing daydreams of comfortable naps in soft places to the employees working the weekend shift.Production code pushes, of course, were anything but lazy. There were checks and balances, and the checks and balances had checks and balances. There was tension, and urgency, and the stakes were clear to all involved: don't you dare make a typo or you'll bring the whole company down. Most of the system was automated, and the rest of it was scripted by the developers who nurtured the system like a fussy toddler, willing to cater to its whims if it would just stop crying and let them get some sleep.On the wall of the Ops War Room, a bright red digital counter ticked down the days: 13 days until Black Friday. Printed memes were tacked to the walls around it, promising dire consequences for screwing up the deployments now. The developers working on hardening the systems were haggard, bleary, frayed around the edges, and, at the time of this story, home sleeping off the previous night's deployment.But there was a second system at Big Online Retail Store, one that had nowhere near the same oversight: the internal systems that monitored network traffic to the site and pulled out analyses from it. While the bean-counters were counting on the information it would provide during the Christmas season, the lead-up was so far more of a lazy river rafting ride, gently drifting toward the moment when the passengers would disembark and once more have to move under their own power. These systems didn't have teams of people dedicated to every aspect of their existence. Instead, a few developers maintained the dev and production environments, managing the servers themselves, the last vestiges of the maverick mentality that had gotten Big Online Retail Store this far.On this particular Saturday, our hero Ashton was given the task of commissioning five new servers for the distributed network. They had been provisioned in a data center, shiny and new and ready for production; the system was architected as a series of small components that could be hosted on any machine, so he had about 20 machines to reconfigure in order to spread out the load evenly.The building was nearly empty at this time of day, making it perfect for zoning out with some monotonous work and some nice, laid-back music. Ashton had definitely had worse Saturdays.The routine was pretty straightforward:
CodeSOD: A Dated Inheritance
Teppo works for a Finnish company that, among other things, develops a few mobile applications. This company is growing, and as growing companies do, it recently purchased another company.One of the applications that came with this company had a mongrel past. It started as an in-house project, was shipped off to a vague bunch of contractors in Serbia with no known address, then back to an intern, before being left to grow wild with anyone who had a few minutes trying to fix it.The resulting code logs in a mixture of Serbian and Finnish. Paths and IP addresses are hard-coded in, and mostly point to third party services that have long since stopped working. It has an internal ad-framework that doesn’t work. The Git repository has dozens of branches, with no indication which one actually builds the production versions of the application. The back-end server runs a cron script containing lines like this:
Patchwork
Most technical folks can recognize a developmestuction environment when they encounter one. The less fortunate among us have had one inflicted upon us. However, the one thing they all seem to have in common is that people simply make changes directly in production. I’ve encountered a place that takes the concept to a Whole New Level O’ WTF™.The company is a huge international conglomerate with regional offices on 5 continents, spread fairly evenly around the globe. The team for this particular project has several folks (developers, testers, QA, UAT and prod support) in each of the locations. Each region is mostly a self-contained installation of servers, databases and end users, but just to make it interesting, some of the data and messaging is shared across regions. Each region runs the normal business hours in its own time zone. As such, at any given time, one region is always doing intra-day processing, one is always in night time quiet-mode, and the other three are in various stages of ramp up, ramp down, or light traffic.The application is a monstrously large suite of Java applications. Since each region has its own Java support contract, different regions run the same code base on different versions of Java. Accordingly, the automated build process builds the entire tree in each of several different versions of Java. This brings up all sorts of region-specific problems when there’s an issue with a particular release of a JVM. Reproducing them back at development-central inevitably fails because we’re only allowed to install the version of the JVM for which we have a support contract.For those who aren’t familiar with it, the default Java class loader traverses a path, looking for individually specified files, or jar files that it can search for a given class. It will take the first instance of a class that it finds. This means that if there are two or more different versions of a class on the path, only the first one will ever get loaded, yielding the Java version of dll-Hell.Someone got the idea that to save money, we could abuse leverage the way the Java class loader works, and only have one set of machines in each region to provide dev, integration, QA, UAT and production environments. The basic premise is that you could introduce short-term-use classes earlier in the class path to ‘patch’ (override) classes that were already there.The class path search hierarchy was in this order:
Error'd: The Class B Bus
"The bus sign in one of Tel Aviv's train station gives out some interesting info on where to catch your next bus," wrote Eran C.
Editor's Soapbox: The Oracle Effect
In 800BC, if you had a difficult, thorny question, you might climb the slopes of Mount Parnassus with a baby goat, find the Castalian Spring, and approach the Pythia- the priestess of Apollo who served as the Oracle at Delphi. On the seventh day of the month, the Pythia would sanctify her body by bathing in the waters of the spring, drinking water from the Cassotis- a portion of the spring where a naiad was said to dwell- while the high priest would sprinkle holy water about the temple. Thus purified, they’d take your baby goat, lay it before the fires of Hestia, and cut it open to read your answer from its entrails. Unless it trembled the wrong way- that was a bad omen; they’d throw an exception and tell you to try again next month.All that ritual and pomp and circumstance creates something I call “The Oracle Effect”. We supply some inputs, and then a fancy, complicated, and difficult to understand ritual is applied to them. The end result is an answer or prediction, and our brains have an interesting blind spot: we tend to weigh the answer more by the complexity and difficulty of the process than the actual value of the process. Ritual creates realism.Which brings us to this study from Pro Publica, which discusses the use of “risk assessment” algorithms in the criminal justice system. Our “goat” in this case, is a collection of demographic and philosophical questions applied to a defendant. The ritual is a complicated statistical analysis (the mechanics of which are only known to the software vendor), and the end result is a simple number: on a scale of 1–10, how likely is this person to commit another crime in the future?Spoiler Alert: the software isn’t very good at this, and also may be racist. Very few people are looking at the actual accuracy of the results though, and instead, are focused on the process. The ritual looks pretty good, and thus, judges tend to use this risk assessment as a tool to help sentencing- high risk defendants get tougher sentences.Or take the US Transportation Security Administration’s use of “behavioral threat analysis”, which use a complicated analysis of “microexpressions” to identify terrorists in a quick glance. It’s about as effective as using phrenology to detect potential criminals. It doesn’t work, but there’s a process! And speaking of phrenology, a startup hopes to bring that back, and just like these other methods, their process has to remain a secret. “Gilboa said he… will never make his classifiers that predict negative traits available to the general public.”It’s not just “secret” processes, though. This applies to any sufficiently complicated ritual. In a more prosaic example, I’ve implemented a number of “dashboards” in my career. The goal is usually to take some complicated set of statistics about a business process or project and boil them down to a small collection of “stoplight” indicators: red, yellow or green lights. No matter how the dashboard starts out, before long, the process for manipulating the data gets complicated, arcane, and downright broken until everything always shows green, because that’s what management wants to see. The fact that the output has no real meaning doesn’t matter- there’s a complicated, difficult to understand process, which puts a layer of perceived truth on that shiny little green light.Even simple rituals can feed into this Oracle Effect. For example, PayPal doesn’t want to handle transactions for ISIS, which isn’t unreasonable, but how do you detect which transactions are made by honest citizens, and which by militants? What about just blocking transactions containing the letters “isis”? This seems like a pretty simple algorithm, but think about the amount of data flowing through it, and suddenly, it picks up the air of ritual- we have a magic incantation that keeps us from processing transactions for militants.Using algorithms and decision-support systems isn’t bad. It’s not even bad if they’re complicated! They’re solving a complicated problem, and we’d expect the resulting system to reflect at least some of that complexity. A recent conference hosted at NYU Law spent time discussing how we could actually avoid biases in policing by using well-designed algorithms, despite also pointing out the risks and dangers to human rights. These sorts of decision-making tools can make things better- or worse. They're just a tool.A few years ago, I stumbled across an ancient book on expert systems, because I find reading technology books from the 1980s enlightening. One of the points the book stressed was that an expert system/decision support system had two jobs: the first was to make a decision within its area of expertise, but the second was to be able to explain its reasoning. The output isn’t useful if it can’t be justified.Imagine, if you will, a toddler tagging along at the hem of the Pythia’s ceremonial robes. As the priestess goes through the ritual, this toddler interrupts at each step, to ask, “Why?” The Oracle Effect is, at its core, an appeal to authority fallacy in a funny hat. The antidote, then, is to refuse to accept the statements of authorities, no matter how fancy their ritual is. It’s not enough to say, “oh, well, the software should be open source, then!”, because that’s frankly neither necessary or sufficient. Decision-support systems can feel free to keep their inner workings secret, so long as they can also provide a convincing argument to justify their conclusions. And we know all too well that merely reviewing the code of a complicated system is not enough to understand how the system actually operates on real-world data.Many of our readers write un-sexy, line-of-business applications, below the waterline of the “Software Development Iceberg” (for all the Googles and Microsofts and Facebooks, most software development happens internal to companies that don’t make or sell software, to solve their internal business problems). These applications generate data and reports that will be used to make decisions. And this brings us to the call-to-action portion of this soapbox. Work against the Oracle Effect by building software systems that do not provide conclusions, but arguments. Resist throwing some KPIs on a dashboard without working with your users to understand how this feeds into their decision-making. Keep in mind how your software is going to be used, and make sure its value, its reasoning is transparent, even if your code is proprietary. And make sure the software products you use can also answer the important question about every step of their process: Why? [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
CodeSOD: Returnary
There’s a certain class of bad code we’ve all seen before:
The Mainframe Database
George, an independent contractor, usually spent his first day home from a business trip plowing through the emails that'd piled up in his absence. In the midst of this grind, he received a call from Lucinda, a Microsoft contact from South Africa."We have a small banking client with a tricky performance problem after migrating to SQL Server," she explained. "Apparently, it's so bad that they're about to ditch us and revert to their original COBOL system.""Oh, wow," George said, swiveling away from his keyboard. "Have you sent any techs over to look at it?""Yes. They couldn't find anything wrong." An odd little tone in Lucinda's voice indicated this wasn't the full story. "You're the best database performance-tuner we know. Could you call their IT manager and see what you can do?"George was a little suspicious. Nevertheless, he told her, "Sure. I enjoy a challenge."Lucinda gladly provided the contact details. From there, George phoned the client to see if he could indeed be of help."We spent a year implementing the system in SQL and C++." The client's IT manager pronounced spent as though he'd wanted to say wasted instead. "We were promised it'd be better, but it's even slower than our current system!""Was that implementation done in-house?" George asked."Yes—by Dawie, our top COBOL guru. He's the only one who deeply understands the business."Well, a COBOL guy couldn't be expected to be an expert on SQL or relational databases. To George, this was starting to sound like a slam dunk. Swoop in like a comic book superhero, impelement some indexing, head home a champion."OK," George said, "I'd like to do an onsite visit to see the problem. From there, I'll see what recommendations I can come up with. Just keep in mind: with performance issues, it's hard to make any guarantees.""I understand, really," the IT manager said. "Anything you do is appreciated! We're at our wits' end here."Despite his standard CYA disclaimer, George felt pretty confident in the weeks leading up to his visit to the client site. At the appointed day and time, the IT manager and Dawie met him in the lobby, and from there it was only a short walk to Dawie's cube.With apologies, the IT manager departed for a meeting."Have a seat," Dawie offered George. "I'll walk you through our system."The newly implemented system allowed specially authorized users to access and maintain customer data. There was no doubt about it, the performance left something to be desired. Queries returning fewer than 100,000 records each took more than a minute to process, making the simplest of tasks an exercise in Zen patience."Could we look at the database schema?" George asked."Sure." Dawie opened the management studio, drilled down to the database, then expanded the table list.Only one table appeared, named RECORDS.George frowned in confusion. "Are you logged into SQL Server properly? Maybe we're viewing this as a user with limited permissions, and this user can't see all the tables."The question confused Dawie in return. "'All the tables?' This is everything. Here, look."Dawie brought up the query window and did a SELECT * on the table. This brought up 60 rows of 2 fields: an auto-numbered ID column, and a Data column containing what looked like massive lines of text."Can we look at your code?" George sputtered.Upon switching to Visual Studio, the horror became all too clear. Dawie the COBOL guru had hit upon the idea to store each COBOL data file from the old system as text inside a SQL Server table. To retrieve a customer record, his code queried the RECORDS table, extracted the appropriate text value to memory, saved it to disk, then used file I/O to scan through and find the appropriate record. If customers were added or edited, the code wrote the updates into the text, then packed it back into the SQL record.Seriously? George struggled not to gape. "Did you ever receive any SQL training or anything?""I got some documentation that I breezed through." Dawie glanced around as though to find said manuals, which were thoroughly lost amid the decades of clutter upon his desk. He shrugged. "Honestly, when you've been around as long as I have, these systems all start to look the same.""Well." George tugged at his collar. "It certainly looks like you've done all you could. I'm sorry, but I don't think I'll be able to help out after all."Upon returning to his hotel, George called Lucinda, explaining the situation. "I can't help them. I'm not sure who can. You may just want to accept the account as lost.""Yeah. That's what our technical team said," Lucinda replied. "They didn't have the courage to tell the client, either." [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
CodeSOD: Classic WTF: Some Crazy Reason
It's Memorial Day in the US, which is a holiday remembering those who have died in wars, which we celebrate by not going to work and generally grilling something. I leave it to someone smarter than myself to unpack the deeper meaning there. What it means here at TDWTF is that we're digging back into the archives to treat you to a classic WTF. - Remy One time, out of boredom, I wrote a little utility called BitVerifier. It would loop over a folder and check every bit of each file. If the bit's value wasn't one or zero, it would prompt the user for the correct bit. At least in theory. I somehow never encountered a file with a "two" bit. But I got one key component right – an understanding of the valid range of values.Rob K.'s colleague didn't even get that far.
Error'd: Too Sexy for my Support Portal
"Nice try ScreenConnect," writes J.R., "I'm wise to your supposed randomly generated access codes."
Say "Y" to Indexes
Henry was a hotshot developer working on a team that specialized in performance tuning. When other teams in his company had performance problems they couldn’t solve, Henry’s team was called in. Through profiling, analysis of algorithms, and database tuning, his team excelled at turning inefficient, slow, bug-ridden software into applications that actually did real work in a timely manner.Usually.Henry was selected to help a customer with issues with a brand-new web application developed by another team in his company. Performance was terrible. Requests often timed out and the server’s CPU typically sat at 100% usage for hours at a time. The server admins had to restart server processes multiple times per day to keep the application running.He met with the lead developer of the other team to discuss their performance woes.“We’ve combed through every line of code,” the other developer, a young man named Colin, explained. “I don’t think it’s our code’s fault. I think it’s the database, but we already tried switching from MySQL to PostgreSQL and it made no difference.”After looking at a few profile reports, Henry agreed that something was off with the database. “Who wrote the database layer?”“Bob did,” Colin replied. “He’s our manager. None of us know anything about SQL so he did all the database work. But he’s on vacation for the next couple weeks.”“Well, let’s take a look at the customer’s database, see if anything stands out.” After some back-and-forth with the customer, they were able to get a copy of the database in question. It came in at over thirty gigabytes.Henry cringed when he opened the database up for inspection. The first thing he found was that primary keys and foreign keys did not always use the same datatype. Often, an ID would be a VARCHAR(36) while any foreign keys referencing it would be some other datatype such as NUMERIC, VARBINARY, or even BLOB, and queries were full of casts and other shims to make JOINing possible. For example,
CodeSOD: The Latest Price
Relational Database are a great way to structure data, but they have their warts. Certain kinds of structures don’t model well relationally, some are difficult to tune for performance, and some queries are just expensive no matter what. Still, with some smart design choices, some indexes, and some tuning of the execution plan, you can make things work.Hambai approached a tuning problem with that perspective. The database had a huge pile of financial information- stock transactions, commodity valuations, and currency exchange rates. When it was new, queries were fast, but now, years on, performance ground to a halt. One query that drew his attention was one for accessing the latest exchange rate for four different currencies. It was run frequently, and each access took up to thirty seconds.Buried deep in a Postgres stored procedure, Hambai found this:
Indomitable Stupidity
This is the story of Stacy and John.Stacy was a secretary. It wasn't a glamorous job; nobody won an award for being the best secretary, or even got much recognition save for a paperweight or gift card once a year on "Administrative Assistant's Day" as a sort of grudging nod to the necessity of having someone paid to greet visitors, answer phones, and schedule appointments. But it was Stacy's job, and she was good at it. She was attentive. She was organized. She had neat handwriting, a pleasant voice, a good memory, and a professional manner. It wasn't demanding work, leaving her free to daydream of being a pop star—and it paid well enough to pay for singing lessons. Her instructor said she had talent, and maybe in a few years she could try out for American Idol.John was IT support. It wasn't a glamorous job; your biggest perk was finding a fresh pot of coffee when you came in. But it was John's job, and he was good at it. John did his best to educate his users, and make sure that they understood how to use their computers, the network, and mission critical software. It might be a small network, without a lot of fancy administration tools and lots of manual steps, but it kept their business running.As always in this new digital age, Stacy had a computer. She'd prefer a tablet, but her company was a little old-fashioned, and anyway she guessed that typing would be easier on a keyboard, but her cousin Mike got a tablet last year for his birthday and it looked so much easier just touching the icons she wanted than trying to figure out where everything was hidden in the Start Menu, right? Stacy and her computer had a bit of a love-hate relationship. She loved email, and she hated the impersonal touch Word gave her memos, preferring to hand-write them when she could.Stacy spent a lot of time on Facebook. That was where she'd heard about Mike's new tablet, and about her nephew's first words, and about a really awesome singing audition at the mall that turned out to be a scam but wouldn't it have been cool if it was real? So she got a lot of emails from Facebook, and she dutifully opened every one to see what her friends were trying to tell her.Today's email was no different. It said right in the subject line: "Urgent message from FACBOOK!" That's weird, she thought for half a second, but I guess Facebook must be trying something new?So she opened the email, ready to see what was so urgent."You have received a private message with an attachment!." the body said.Odd—she wasn't expecting an attachment. Perhaps it was a video? Her friend Tracy said she'd recorded her performance at karaoke night. No, that wasn't Tracy's name; it was some stranger. Curious, Stacy scrolled up past the Facebook logo and blue header bar and right-clicked on the attachment. She selected Save As from the menu, just like John from IT showed her.She chose to put it on her desktop for now, and watched as it downloaded ... only to vanish.Had she done it wrong? No, that was exactly what she did for the memo her boss sent her last week to print and post around the building. Well, give it one more shot: right-click, Save As.Nothing.What followed was a protracted battle between the secretary and her definitely-not-as-cool-as-Mike's-tablet desktop PC. She tried saving it in another folder: no change. She tried renaming it in the Save As dialog: no dice. About to give up and call John, she finally noticed a piece of information she hadn't previously uncovered: whenever she tried to save it, a little bubble popped up by the clock, telling her the attachment was blocked.Aha! thought Stacy. Whatever this Norton thing is, that's what's blocking my attachment!She right-clicked on the icon, and there it was: a nice, handy Disable button.Stupid Norton. This is from Facebook, let me open it!Triumphant, Stacy downloaded the attachment.zip file to her desktop. Once she saw the icon, she knew what to do; John had taught her how to open those as well. She right-clicked on the icon (Computers are easy, just right-click on everything!) and clicked Extract Here.But victory was snatched from her pearly white jaws: "This archive is not valid."That stupid Norton thing broke my attachment! Stacy seethed, teeth clenched. I'll just have to write back.From there, she clicked Reply. Her message was drafted hastily, but not impolitely:
CodeSOD: Data Date Access
Perhaps the greatest evil Microsoft ever perpetrated on the world was putting a full-featured IDE on every end user’s desktop: Microsoft Office. Its macro system is a stripped down version of Visual Basic, complete with a UI-building tool, and when used in conjunction with Access, allows anyone to build a database-driven application. Anyone that’s spent enough time in an “enterprise” has probably inherited at least one Access application that was developed but somebody out at a manufacturing plant that magically became “mission critical”. Still, we can’t blame the end users for that.There’s a special subset of developer though, that when trying to come up with an application that’s easy deploy, chooses Access as their development environment. “It’s already on all the users’ machines,” they say. “We can just put the MDB on a shared drive,” they say. And that’s how Ben gets handed an Access database and told, “figure out why this is so slow?”The specific Access database Ben inherited was part of a home-brew customer-relationship-management package, which meant most of the queries needed to filter through a database of emails sent to customers. The SQL was already pretty bad, because it ran three times- once for all the emails with a certain timestamp, once for all the emails a minute earlier, and once for all the emails a minute later. Each query also filtered by the from-field, which really killed the performance since 25% of the emails were sent from the same email address- meaning the three queries did the same filtering three times, and Access isn’t exactly all about the optimization of SQL performance.What really caught Ben’s eye, though, was that the query didn’t use the built in dateadd function to calculate the one minute earlier/later rule. It used a custom-defined timeAdjust function.
Error'd: Errord in Time and Space
Anonymous went to configure some settings and found his options were a little constrained.Fortunately, real numbers are a contniuum, so Anonymous has an infinite number of possible values to choose from.Kaylee was poking through a codebase and found this DLL, which leaves us with so many questions.We’re left feeling inside out, and perhaps a bit unmoored in time…We’re losing track of time… how old are we? Benji found that question far more difficult to answer than normal…Then again, it’s hard not to lose track of time. Time and space are a continuum, and movements through space are also movements through time, and vice versa. Ricardo sends us this Italain train schedule:If you don’t read Italian, pay close attention to the ‘km’ field- which is measured in dates, apparently.As we all learned in Back to the Future III, trains are incredibly useful devices for time travel. As any time traveler knows, representing dates and times when you’re crossing history is a challenge. Nick stepped aboard the wrong train, and who knows when he might be now?This all gets so confusing. Is there some sort of error code we could report about all of this? Larry, do you have anything? Oh, you do? [Advertisement] BuildMaster integrates with an ever-growing list of tools to automate and facilitate everything from continuous integration to database change scripts to production deployments. Interested? Learn more about BuildMaster!
Coded Smorgasbord: A Spiritual Journey
Hold your souls tightly, for today, we pierce the veil into the great beyond. We shall examine existential questions and commune with spirits. We shall learn what eternity holds for us all.First, we must bring ourselves to the edge of death, into a liminal state where time does not pass, where the conscious mind takes a back-seat to the spiritual realm. Mark found this C# code to do the job:
Unprocessed Payments
Ivan worked for a mobile games company that mass-produced “freemium” games. These are the kinds of games you download and play for free, but you can pay for in-game items or perks to make the game easier–or in some cases, possible to beat once you get about halfway through the game.Since that entire genre is dependent upon microtransactions, you’d think developers would have rock-solid payment code that rarely failed. Code that worked almost all the time, that was nearly unhackable, and would provide a steady stream of microtransactions to pay everybody’s salary. But who am I kidding? This is The Daily WTF! Of course reliable in-app payment code for a company completely dependent on microtransactions isn’t going to happen!Ivan found himself debugging the company’s core payment library, originally written by a developer named Hanlon who happened to have a PhD in Astrophysics. Hanlon still worked for the company but had moved on to other roles. However, he reported a bug that Ivan had to fix. The payment library would never report PaymentValidationResult.Success, only PaymentValidationResult.Error. In-app purchases were completely broken- across their entire library of released freemium games- and this was obviously unacceptable.Ivan went spelunking but quickly found that the web service payment did indeed return PaymentValidationResult.Success when a microtransaction was successful. So what was the client-side library doing wrong? He opened that project up and found this:
CodeSOD: Unstandard Lib
One of the hallmarks of “bad code” is when someone reinvents the wheel. In many Code SODs, we show code that could be replaced with a one-line call to a built in, standard library.That’s one of the the advantages to a high-level language operating on modern hardware. Andrew doesn’t live in high-level land. He does embedded systems programming, often on platforms that don’t have conveniences like “standard libraries”, and so they end up reinventing the wheel from time to time.For example, a third party wrote them some software. Among other things, they needed to implement their own versions of things like trigonometric functions, random functions, square root, and so on- including atoi- a function for converting arrays of characters to integers. Andrew was called upon to port this software to slightly different hardware. In the header file, a comment promised that their atoi implementation was “compatible with ANSI atoi”. The implementation, however…
Double Play
Contracting seemed the best way for Ann-Marie to gain a foothold in the IT industry. She wasn't the best or the brightest, and her CV was heavy on toy languages and light on experience. But if she got a good solid chance, she knew her no-nonsense attitude and general intelligence would endear her to her boss.Or maybe it would have, if it weren't for Cindy the Project Manager.Cindy liked to chew gum at work. No, not chew—pop. It was all Ann-Marie could do to keep her face neutral during her onboarding, when Cindy handed over the employee handbook the team lead had asked her to deliver."So, like, these are our standards I guess? Whatever, you'll do fine, I'm not even worried."Once she was gone, however, things started looking up. Unlike the last few places Ann-Marie had contracted, this one had JIRA and used it heavily, requiring all commits to include a JIRA number for tracking purposes. In addition, she was pleasantly surprised to see a QA department, and reasonable handoff practices: to be handed over to QA, the build had to be passing on the CI server, and earmarked as a release candidate. Commit messages were vital for keeping track of items in progress. They had to be descriptive, yet concise, and no more than one commit per JIRA item so that a relationship between tickets and commits could be established and tracked.Yeah ... I could stay here, Ann-Marie decided. What's a little gum-popping in exchange for a Joel Number this high?And so, eager to please, she threw herself into her work. On the first day, she closed five JIRA tickets—all small fixes in disparate portions of the application—as she tried to get a feel for the codebase."Wow, you like, really know your stuff," Cindy said, stopping by at the end of the day. "Our last guy didn't do anything for four days. This is going to be the best Bug Blitz ever. Well done!"Ann-Marie stopped for a smoothie on her way home, confident she'd fit right in at this new job.It was day three before the first incident happened. She was off to another great start, closing two tickets before 10:00 AM. At first, she assumed that was why Cindy was walking over, until she saw the frown on her manager's face."So, like, I don't know if you read the handbook, but we have a policy of not closing more than one ticket with the same JIRA number," Cindy said."Yeah, right, so you don't have to pick apart commits if you send one feature but not the other. Totally cool, definitely a best practice." Ann-Marie wondered why this was coming up. Had she accidentally broken policy? No, she'd been careful. One change, one commit."Right, right. So what's up with 44 and 89?" Cindy asked, rattling off the numbers with a punctuative pop."Uh ..." Ann-Marie pulled up the JIRA tab on her machine, rapidly navigating to 89 and skimming over the comments. "Oh, right, 89! That was fixed by the commit I did yesterday for 45. It had the same root cause.""Riiight ... so they used the same commit," Cindy said."No, see?" Ann-Marie said. "Here, 45 was an error when downloading a document, and 89 was a blank document ID in the details for the document. The user couldn't download the document because it was sending them to a URL with a blank ID in it. The reason for that was because the file ID was omitted from the select columns in the database query that was shared between the two. By changing it so the document's file ID was included in that query, I killed two birds with one stone.""Right, yeah, see, two birds, one commit. We have a strict policy against that. This can't happen again."Ann-Marie blinked at Cindy. Was she just not getting through? "Surely something like this has happened before?"Cindy gave her a flat, vacant look. "Not really." Pop. "We cool?" Pop."I ... I really don't know what to say here," Ann-Marie replied, flustered. "I mean, I agree with the policy, it makes it easier to roll back if one fix is broken, but this? This is a different situation entirely.""You'll figure something out." Without waiting for a reply, Cindy turned and walked away.Wonderful, Ann-Marie groaned inwardly. What do I do now?Hoping against hope that she was just misunderstanding something, that someone else could enlighten her as to what Cindy's problems were and how to give her what she wanted, Ann-Marie took a walk to Garrett's cube. Garrett was a senior developer, one who'd been useful over the past few days as she'd rooted out a few harder-to-find bugs. Surely he'd run into this issue before. Maybe he'd even have an answer?"Ooooh, yeah. THAT policy," Garrett began, and Ann-Marie's heart sank. "Cindy gets a little OCD about this stuff. We know exactly what you're talking about. Different developers go about resolving it in different ways. I, personally, simply commit one thing in such a way that 'breaks' the other issue again. Like, in your case, I would have both included the ID column and then intentionally blanked out the ID in the details view for my first commit. That commit gets mapped to the download error JIRA ticket. Then, I commit a second change that undoes the blanked-out ID in the view, that goes to the other ticket. It leaves a sour taste in your mouth, but you get used to it."Ann-Marie sighed, feeling a headache creeping up on the edges of her temples. "I should have just marked it a duplicate," she mumbled to herself."Oh, no, Cindy doesn't like that either." Garrett assured her with a sympathetic look."Committed a whitespace change for the second ticket?" Ann-Marie fired back, not even bothering to get her hopes up."She reviews every single commit. Not that she's ever been a programmer, but she's taking night classes and has a keen eye for BS. Thankfully not keen enough to catch on to what we're doing with the intentional-breakage strategy, though."Ann-Marie sighed. "Well, that's me out of ideas.""Sorry," Garrett replied, a gentle smile on his face. "Sometimes you just have to throw in the towel and find a loophole."For the duration of the Bug Blitz, Ann-Marie did just that, committing 'accidental' breakages for each duplicate bug—and even, once, for a triplicate ticket.When the blitz finished and she was offered a permanent position, she politely declined. Stability was overrated.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
Error'd: Sorry About the Moon
"I have no idea what that giant glowing ball in the sky is. Space aliens, I suppose?" wrote Ian S.
...41424344454647484950...