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:
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:
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:
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:
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.
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.
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.
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,
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:
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:
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.
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!
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:
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:
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…
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!
It’s no easy task combing through the submissions and choosing the right code sample.Ulysses knows my pain. He recently inherited a Python codebase with plenty of global variables, no convention around capitalizing identifiers, inconsistent levels of indentation, and an AngularJS front end.He found this when investigating a bug:
Chris M. was a developer at Small Widget Manufacturing. He and his coworker Scott were, in theory, assigned only to developing their in-house ERP software. However, with just one person running the company’s help desk, they often picked up anything considered “software-related.â€A ticket pinged Chris’s inbox: EDI Running Slow. It was from a sales rep named Brett, and like most tickets from sales reps, was marged Urgent. Chris decided to play ball, since Scott was tied up with something else. He called Brett, asking if he could elaborate.“Normally, when I get an order from a customer,†Brett said, “I can just go into our ERP system and upload it, and it’ll get imported in fifteen minutes. If I get an error, I wait fifteen minutes and try again. That used to work, but now it’s taking longer than 45 minutes for it to upload.â€â€œIt’s probably just a scheduler that’s misconfigured,†Chris said. “I’ll look into it.â€Reappropriated HardwareSmall Widget Manufacturing used a custom-built EDI solution for transferring orders, blueprints, etc. between their customers and the plant. The whole thing had been delivered by some expensive third-party consultants just before Chris had started at Small Widget, after which the consultants vanished without a trace. They hadn’t even left behind documentation for the EDI software.Chris hadn’t yet dug into the guts of the EDI software, so he asked Scott where it was housed. “Dunno,†he replied. “Check with IT.â€Fine. So Chris went to IT, talking to Cori, who headed that department. After half an hour of digging through paperwork, she led Chris to a desktop box in a corner, covered in dust. On its case was a badge: Windows 7 Home, it said.“EDI runs on that?â€Cori nodded. “The consultants didn’t want to put it on some new hardware, so they dug this out of storage and installed their software on it. They didn’t even bother to reformat it.â€A Time-Saving FeatureBack at his desk, Chris was able to remote desktop onto the Win7 machine and began digging around. He checked the hard drive first, noticing that there was very little space left. The default Windows task scheduler was terrible, so anything usable must be custom-built. He noticed an application running in the taskbar with a clock icon. He clicked on it, spawning a console window.The highly-paid consultant’s EDI solution was little more than a long-running FTP app. Thinking that the app must be choking the disk with logs, Chris dug through the hard drive and found them.
The Daily WTF exists to point out coding horrors, but a few years ago we also took a swing at trying to prevent bad code. Long time readers might remember our 2009 initiative, Code Offsets. We are pleased to announce that Code Offsets are back, redesigned, and ready for you to make a difference (or just to make fun of your coworkers).Essentially, the idea is simple. Code Offsets are a novel way to offset your (or your co-workers') crap code. Like carbon offsets, which aim to reduce emissions of carbon dioxide/greenhouse gases to compensate, or offset emissions made elsewhere, our Code Offsets are used to offset the bad code that already exists.When you purchase a pack of Code Offsets, the proceeds go to a featured nonprofit group that helps promote good code through education, donations, or open source software.At launch that organization is TECH CORPS. They are an amazing nonprofit organization dedicated to ensuring K-12 students have equal access to technology programs, skills and resources that enhance early learning and prepare them for college and career.The Code Offsets themselves are bills that feature some of the most notable characters from the history of computing, the founders of the discipline from Babbage to Hopper.We’ve designed nine different bills, each offsetting a select amount of bad code. The bills available range from one line, all the way up to one thousand lines. They come in packs so you can keep a few for yourself, but still pass some out to any Paulas around the office. Also to celebrate the release of the project, we printed up some stickers for the first 1000 orders! (Mainly because Alex loves stickers) [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
Readers of TDWTF know all too well that dates are hard. Strings are also hard. You know what else is hard? File paths.Like dates, and strings, most languages these days have libraries to simplify parsing filepaths. For example, in Python, you can use the os.path module to parse out the directory structure, the file, and its extension without too much effort.As Chris discovered, though, some people like that effort. Why use things like os.path when you’ve got Python’s super-powered slice operator for splitting the string apart:
The late Seventies was a lucrative time for Finnish-based Kirkniemi Paperi, a paper production powerhouse. Puoval had a great opportunity to cash in on the profits by helping to integrate a completely automated, computer-based production system. His degree in electronic engineering was finally going to pay off.Thanks to the invention of the Intel 8085 microprocessor, it became possible to turn trees in to paper quicker than ever. Puoval had a mandate from Kirkniemi ownership to spare no expense with getting the system up and running since their biggest competitor implemented a similar system the year before. But if they had a bumpy rollout, it would be incredibly damaging to both the company and Puoval's livelihood.The system would have to control paper machines more than a hundred meters long, capable of moving paper through them at 80 kiliometers per hour (which would make for one wicked paper cut). While they were literally well-oiled machines, a small problem with any part of the production would bring things to a halt due to everything being interconnected. When paper-making stops, moneymaking stops and the bosses get angry.Despite the risk, Puoval was up to the task. He drooled over the hardware he was allowed to bring in to be the brains of the operation. He got to set up a whole army of blazing-fast 6 Mhz Intel 8085's, cages full of in-house built Eurocard logic boards, analog and digital sensors, kilobytes of tight machine code, the whole works. As a fail-safe, Puoval even set up a battery backup system, and line conditioning to prevent a power surge from frying his masterpiece.It was a long and difficult setup process, but Puoval's brainchild sparked to life and, amazingly, worked as intended right away. The output of the paper mill increased 40% and Puoval's bank account increased 100%. For over a year, it hummed along flawlessly cranking out gloriously large rolls of paper. But then, this feel-good story got beat to a pulp.Late one night around 11 PM, Puoval's phone rang. On the other end was the panicked 2nd shift manager of the mill. "Puoval! Are you still awake? GOOD! We need you in here ASAP! THE SYSTEM IS DOWN!""What do you mean it's down?" Puoval asked back through growing sleepiness."Well, the machines were running just fine, then out of nowhere, they just shut off and ground to a halt. Paper went flying off the rolls all over the place. It's like a gang of mummies exploded in here!""Ok, I'll get dressed and be in as soon as I can," Puoval sighed, unsure what to expect upon his arrival.While the 2nd shift line technicians cleaned up the paper disaster, Puoval headed for his control system. He half expected to see it charred and smoking, but everything looked fine. He ran some system diagnostics and nothing looked out of the ordinary other than the sudden cutoff in the logs when everything stopped. He began the lengthy startup process of the system and machines and the mill was back in action.When the bosses caught wind of the unexplained failure in the morning, Puoval was put on notice that it could not happen again. "Understood. I'm going to give everything a thorough inspection today, and stay late to make sure nothing weird is happening during 2nd shift," he assured the powers-that-be.Midnight rolled around and everything was still humming along. Puoval decided to head home but made it clear to the manager to call him immediately if even the slightest thing went wrong. Fortunately nothing went wrong that night. Or the next night. Puoval was ready to chalk it up to a one-time freak occurrence. But the 3rd night his phone rang around 11 PM again. "PUOVAL! WE NEED YOU NOW!"Puoval came in to find the same situation as three nights before. He got everything running again but in the morning the bosses demanded he work both 1st and 2nd shift every day until he had an answer. Two late nights came to pass without a hitch. But when the dreaded 3rd night arrived, he was on high alert. The clock ticked towards 11 PM and he began to sweat. Nothing could go wrong though, as he was watching his beloved system like a hawk.Just as he was sure nothing would go wrong this day, an innocent-looking cleaning lady strolled up pushing a large commercial vacuum cleaner. He watched her ignore the multiple signs around the cage of his computers that said "DO NOT USE THESE OUTLETS, EVER!" and begin to plug in her vacuum. Puoval sprang at her, shouting to stop.Not expecting his rapid advance, she had a look of dread come across her face. "But I need to clean?""Absolutely not! Not right here! You will bring this whole plant to its knees!" Puoval warned. Upon further explanation, the cleaning lady's behemoth vacuum was a new addition to the fleet. The smaller, economical one didn't draw enough juice to take Puoval's system down. Once this beast was plugged in to the forbidden outlet, which happened to be past the line conditioners, everything came crashing down. At least Puoval found his explanation, albeit a ridiculous one, so that he may retire from 2nd shift.[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!
In the mid-2000s, Amani was contracted to refactor a legacy codebase. He enjoyed breathing new life into old garbage, until the fateful day he came upon something completely unexpected.One of the webpages he tended to was making calls to a database. Amani couldn't figure out why at first, especially since there were no Ajax scripts on the page. But then he paid careful attention to the CSS details in the webpage's header:<link rel="stylesheet" href="/style/pictures.css.php"/>The stylesheet was a PHP file?Agape, Amani hunted down the file in question and unearthed the horror below:
In the mid-2000s, Amani was contracted to refactor a legacy codebase. He enjoyed breathing new life into old garbage, until the fateful day he came upon something completely unexpected.One of the webpages he tended to was making calls to a database. Amani couldn't figure out why at first, especially since there were no Ajax scripts on the page. But then he paid careful attention to the CSS details in the webpage's header:<link rel="stylesheet" href="/style/pictures.css.php"/>The stylesheet was a PHP file?Agape, Amani hunted down the file in question and unearthed the horror below:
“Java and C# are kind of the same thing, right?â€Josh was a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn’t expect it to create that much work for him.Most of the applications transferred to the new servers without any issues. Most. Of course, the one that didn’t transfer was the “mission critical†package. The ERP system didn’t have all the tools the users wanted for manipulating data, so they wanted a tool that could export some records to Excel, where they could edit them, and then reimport the data. The import process was reporting that it was complete, but actually crashed and didn’t finish the job (and for bonus points, left the database in an inconsistent state).Ray hadn’t implemented any logging, so Josh fired it up on his dev box and fed it an Excel file. The program cheerfully reported what it was up to at each step of the bulk loading process, displaying a message with a throbber image that turned into a check-mark when that step completed. Despite the crash, every message reported success.
“Java and C# are kind of the same thing, right?â€Josh was a Java developer, but his company was doing a big upgrade of some .NET applications written years earlier by a developer named Ray. Ray had left the company the previous year, and somebody needed to help port his .NET 2.5 code to .NET 4.0 and a new version of IIS. Josh was a team player, and also knew that newer versions of .NET were almost always backwards compatible, so he didn’t expect it to create that much work for him.Most of the applications transferred to the new servers without any issues. Most. Of course, the one that didn’t transfer was the “mission critical†package. The ERP system didn’t have all the tools the users wanted for manipulating data, so they wanted a tool that could export some records to Excel, where they could edit them, and then reimport the data. The import process was reporting that it was complete, but actually crashed and didn’t finish the job (and for bonus points, left the database in an inconsistent state).Ray hadn’t implemented any logging, so Josh fired it up on his dev box and fed it an Excel file. The program cheerfully reported what it was up to at each step of the bulk loading process, displaying a message with a throbber image that turned into a check-mark when that step completed. Despite the crash, every message reported success.
It’s an old joke that Perl is a “write only languageâ€. Despite some of its issues, back in the early 2000s, Perl was one of the best options out there for scripting languages and rapid-development automation.Speaking of automation, build automation is really important. Back in the early 2000s, before Maven really caught on, your build automation tool for Java was Ant. Ant, like everything invented in the early 2000s, was driven by an XML scripting tool. Since it was tuned specifically for Java, it had some high-level operations to streamline tasks like generating proxy classes for calling web services based on a supplied WSDL file.Actually, speaking of code generation, Carrie sends us this code block. It’s a Perl script that’s called from an Ant build. It runs after generating a class based off a WSDL. It parses Java code using Regular Expressions and injects a ListWrapper class which doesn’t adhere to the List contract. But hey, it does have a use strict declaration, guaranteeing you’ll get errors if you access uninitialized variables.
It’s an old joke that Perl is a “write only languageâ€. Despite some of its issues, back in the early 2000s, Perl was one of the best options out there for scripting languages and rapid-development automation.Speaking of automation, build automation is really important. Back in the early 2000s, before Maven really caught on, your build automation tool for Java was Ant. Ant, like everything invented in the early 2000s, was driven by an XML scripting tool. Since it was tuned specifically for Java, it had some high-level operations to streamline tasks like generating proxy classes for calling web services based on a supplied WSDL file.Actually, speaking of code generation, Carrie sends us this code block. It’s a Perl script that’s called from an Ant build. It runs after generating a class based off a WSDL. It parses Java code using Regular Expressions and injects a ListWrapper class which doesn’t adhere to the List contract. But hey, it does have a use strict declaration, guaranteeing you’ll get errors if you access uninitialized variables.
Last time, Mercy found out the political campaign she was working for didn't have a candidate that was in his best health- but they were pushing him into the governor's mansion anyway. In today's finale, she confronts a hacker and a harsh reality…Mercy cringed as Ellis waved her over to his laptop. She left her usual workspace next to the hamilton server and headed to where Ellis had holed up. On his laptop she saw a YouTube video, playing one of Rockwood’s stump speeches. “We can’t have the YouTube logo on here anymore,†he said, indicating the “Righteous Rants†design. The red and white logo clashed loudly with the Thomas Kinkade-inspired backgrounds Ellis had picked at random from a stock photo site. “Can you make it go away? We can’t be seen to endorse a company like that.â€Mercy could see the bags under his eyes.“We can’t,†she said. “It’s against the terms of service to hide the YouTube logo from the embedded player. There is a third-party video player that streams YouTube videos, which you can customize all you want, but it only works on browsers with Flash installed.â€â€œMost people have Flash, don’t they?â€â€œNot on iOS or Android,†she said. “Just about all of our volunteers use smartphones for voter canvassing and campaign communications. If you switch to Flash only, they won’t be able to watch videos on their phones.â€â€œSo they can just watch TV, then.â€â€œWhat about 18–24 year olds, all those young people that Rockwood wants to cover their college tuition? They rarely use desktop computers now. If they can’t watch Rockwood’s speeches, it’ll look like we’re purposefully ignoring them.â€At the bare mention of a demographic, Sullivan’s ears perked up and she came over. Mercy again explained the Flash situation.“Come on, Ellis,†Sullivan said, “the logo doesn’t look that bad. And it’s only for a few more days.â€Ellis’s eyes narrowed, but he soon rubbed them and turned back to his laptop. “I guess you have much more important things to do.â€Mercy felt Sullivan’s fingernails in her shoulder as the campaign manager pulled her away from Ellis. “Just let him be, Mercy. I told you what he’s going through with the boss.â€â€œHe gets away with a lot because of that,†she said. “Fine. I’ll just keep our servers up and running until after the polls close.â€â€œI hope you’ll stay on after that,†Sullivan said. “Imagine if you were part of our staff in Tallahassee. You’d be invaluable.â€â€œI need to think about it,†Mercy said, meaning not just the job offer but Rockwood’s diagnosis. Did she really want to work for a governor who was suffering from dementia?She found her way back to hamilton. On the screen was a black-cloaked, hooded figure, with skeletal arms, floating above a lakeside castle.“Okay, who put up the Dementor?†Mercy shouted to the volunteers. No one was brave enough to come forward. She closed the image, then checked the logs on the load balancer. hamilton was unresponsive, likely a memory leak, so she triggered a reboot.But hamilton didn’t boot back up. And Mercy smelled burning plastic.My Own Private Chernobyl“hamilton and jay are both out of commission,†Mercy said. Sullivan sat beside her, trying her best to keep up with Mercy’s explanation. “hamilton was the first. I noticed something was off when the load balancer reported that it wasn’t responding to requests. I figured a reboot would fix that. But then it didn’t come back. Just after that, jay did the same thing.â€It was well after hours. The phone operators had left, as no one wanted to hear a campaign call at 10PM. Ellis had escorted Rockwood home. It wasn’t a good day for their candidate, as he had stared listlessly at a wall for several hours, out of sight of their volunteer corps. Although Rockwood was out of it, the campaign was doing gangbusters, inching ahead of Packard in the polls.But that all could change if their hub went down just a few days before election day.“I decided to swap out hamilton’s hard drive, as that’s a common point of failure. I opened him up to replace the drive and I saw this.†Mercy spun hamilton around, showing Sullivan the server’s internals. She pointed to a gummy piece of plastic underneath a heat sink. “I smelled burning plastic earlier. That’s the CPU. We don’t overclock it, so that heat sink and the fans should have kept it cool.â€Mercy closed hamilton’s case. “I checked jay, too. Same thing. I thought there might be a recall on those boxes we got. We didn’t exactly buy top-of-the-line rack servers. So I called the manufacturer. There wasn’t any recall, but these CPUs do have a flaw. It’s called a ‘halt-and-catch-fire’ sequence. It’s a manufacturing flaw, a set of instructions that can cause the CPU to overheat.â€â€œWe didn’t accidentally make the CPU do that, did we?â€â€œNo. It’s all instructions that happen in kernel space — the operating system, I mean. Normal software shouldn’t even be able to execute it. Then I remembered something. Earlier today I was working on hamilton when Ellis asked about the YouTube logo. I stepped away for a second. When I came back, there was a picture of a Dementor open in the browser.â€â€œWhat’s a Dementor?â€â€œIt’s a Harry Potter thing. I thought maybe one of the volunteers was playing a prank, since I forgot to lock my screen. But I don’t think I did. I think someone used hamilton to plant an exploit on our servers.â€â€œWell, why did it affect one of the other servers if it was just on that one?â€â€œI think the exploit copied itself onto the other servers. It specifically targeted our buildout. It used a defect in how Chromium opens images to inject malicious code into kernel space, which copied itself onto the other web servers, that affect only the kinds of computers we bought. So they all have it.†Mercy sighed. “We need to hire some people. I’m really stretched thin on this.â€â€œWe need to keep this quiet, Mercy.†Sullivan frowned.“Barbie, I can’t fix this on my own.†Mercy hadn’t used Sullivan’s first name since she had begun working on the campaign. She sighed. “I can’t fix this.â€Sullivan took her hand. “You know, with all the staff we have coming and going, I thought it might be prudent to place some security cameras in headquarters.†She pointed to a poster of Rockwood in a corner; one of his eyes had a pencil-sized hole in the pupil, where a small camera could be placed. “If you remember when you saw this demented or whatnot, we could get the footage.â€Enlarge and EnhanceIt didn’t take long to find the culprit on the security footage. A man that neither Mercy nor Sullivan recognized had walked into headquarters, with black hair and black eyeliner. He wore a “Rockwood for Governor†shirt bought from the campaign store, not one issued to volunteers. He wandered through the crowd, grabbed a soda, then sat at the computer for about two minutes while Mercy was talking to Ellis. The footage was low-res, but to Mercy it looked like his fingernails were painted in alternating black and green. He inserted a USB drive into the front of the computer, opened the image of the Dementor, and left just before she got back to the computer.“God, that’s quick,†Mercy said. “He had to know how we operate.â€â€œIt’s too low quality,†Sullivan said. “We can’t make out his face.â€Mercy had an idea. “Hey, I wonder if he parked in the shopping center.â€â€œI have a camera pointing outside.†Sullivan switched feeds. This one was pointed through the glass storefront. The glare from the Orlando sun was intense, but they could make out the man walking to a black and green domestic car. She could make out three letters from the car’s license plate.“I think that’s enough to find him,†Mercy said.“I’ll call the county sheriff.â€â€œNo, wait. You said we should keep this quiet. If the cops show up, Ellis will know what’s going on, and the media could pick up on it. I don’t know how long it could take for the other servers to, well, melt down. You need to get Ellis to put our code up on Seashell Hosting, like we discussed a while ago. We can’t keep managing it here, and this is proof. But I’m going to track him down myself.â€Sullivan guffawed. “What, are you a bounty hunter or something?â€â€œI have some good friends,†Mercy replied.The Half-Blood HackerMercy called an ex-girlfriend who worked at the Orange County Sheriff’s Office, who was more than willing to help. She gave Mercy the culprit’s address. He lived in a white stucco apartment complex in Kissimmee. The walls of his apartment building were stained brown from rusty sprinkler water. She found his apartment number, banged on the corrugated metal door.He answered. His hair was nearly black, he was wearing black eyeliner, and he wore a Slytherin t-shirt and boxers.“I know you did it,†she said.A flash of recognition showed on the man’s face. He hid it with a fake smile. “I have no idea what you’re talking about,†he responded, in an affected British accent.“Ever heard of surveillance? Stupid Slytherin, 10 points to Ravenclaw. Let me in and I won’t call the cops.â€The false bravado left his face, and he opened the door for her. She stepped inside, noting that he was more than just a casual fan of the Harry Potter books. From the movie posters on the walls, to the many collector’s copies of books on his shelves, to a framed photo of Helena Bonham Carter by his bed.“A Dementor?†Mercy asked. “Seems pretty obvious.â€â€œIt’s a calling card.†The man sat at his computer desk, squirming.“Are you working alone?â€â€œI’ve been paid for my discretion.â€Mercy pulled out her phone. “Is it enough to cover bail?â€The man held up his hands. “Fine, it’s Packard.â€Mercy pocketed her phone. “Okay. What’s the fix?â€He giggled. “There isn’t one. I mean, maybe if it weren’t some web developer like you. Yeah, I looked you up on LinkedIn before I stopped by your headquarters. You put together that little cheap server farm yourself, I’ll bet. No, there’s no fix. Shutting down the hardware triggers the HACF sequence. Packard didn’t want everything down at once, because you people would know something was wrong and start digging. But I figure you’d apply rolling updates to each server, rebooting each time. Each one would fail, and you wouldn’t be able to guess why.â€â€œNo fix? I don’t have time to talk to you, then.â€â€œHey, could I get your number—“ the man said, the clanging of his front door drowning out his voice.Executive Decision“We’re done for,†Mercy said, getting back to headquarters an hour later. She explained the situation to Sullivan, who was at headquarters, and Ellis, who was out with Rockwood on speakerphone. The servers would need to run flawlessly until election day. If they didn’t — if they required a software update or a memory leak forced Mercy to turn any of them off — they’d melt. “We need hosting. I mean it.â€â€œAbsolutely not,†Ellis said. “The boss is adamant.â€â€œYou have no idea what’s going to happen if–â€â€œI have work to do.†Ellis hung up.“Mercy, please.†Sullivan rubbed her temples. “Just … do what you can to keep the servers going. It’s only for a few days.â€Mercy considered her options. One: she could do her best to keep the servers up, and watch as they failed one by one, until election day came and there was nothing else that could be done. Two: she could buy more servers as others failed, but that could get expensive, not to mention tedious. Three: she could migrate everything onto Seashell’s safe hardware tonight, and risk Ellis’s wrath.In the end, Rockwood, a man who couldn’t remember a conversation he had five minutes ago, wasn’t worth it.“I’m moving the code to Seashell,†Mercy said. Her stomach felt heavy. “I’m leaving the campaign as soon as it’s done.â€Sullivan sunk into her chair. “I won’t stop you. I won’t stop you moving the code, and I won’t stop you leaving. I know it’s your choice.†She smiled wanly. “And Ellis won’t have any idea how to get the code back onto those servers, so it’ll stay running until after the election’s over.â€Mercy made the call to Seashell Hosting. Despite the late hour, they were excited about hosting Rockwood’s campaign and offered affordable rates. In a few hours she had transferred everything to their servers: the database, the code, their internal files. After that, she asked a technician to restart their virtual server, in case some rack-mounted unit suddenly melted. Nothing happened.After she grabbed her things, she shook Sullivan’s hand. “I’ll keep in touch,†the older woman said.Mercy drove home.At her apartment, she turned on her laptop. She played the stump speech Rockwood gave in Stoneford, the one responsible for his meteoric rise and her own time with the campaign, one that would soon see him in the governor’s mansion in Tallahassee. She didn’t pay attention to the words this time. All she could see was a scared old man, desperately improvising to hide the fact that he couldn’t remember what he was doing. In the beginning, Mercy thought he was brilliant. But in the end, he simply had been making it up the whole time. [Advertisement] Application Release Automation for DevOps – integrating with best of breed development tools. Free for teams with up to 5 users. Download and learn more today!
Last time, Mercy found out the political campaign she was working for didn't have a candidate that was in his best health- but they were pushing him into the governor's mansion anyway. In today's finale, she confronts a hacker and a harsh reality…Mercy cringed as Ellis waved her over to his laptop. She left her usual workspace next to the hamilton server and headed to where Ellis had holed up. On his laptop she saw a YouTube video, playing one of Rockwood’s stump speeches. “We can’t have the YouTube logo on here anymore,†he said, indicating the “Righteous Rants†design. The red and white logo clashed loudly with the Thomas Kinkade-inspired backgrounds Ellis had picked at random from a stock photo site. “Can you make it go away? We can’t be seen to endorse a company like that.â€Mercy could see the bags under his eyes.“We can’t,†she said. “It’s against the terms of service to hide the YouTube logo from the embedded player. There is a third-party video player that streams YouTube videos, which you can customize all you want, but it only works on browsers with Flash installed.â€â€œMost people have Flash, don’t they?â€â€œNot on iOS or Android,†she said. “Just about all of our volunteers use smartphones for voter canvassing and campaign communications. If you switch to Flash only, they won’t be able to watch videos on their phones.â€â€œSo they can just watch TV, then.â€â€œWhat about 18–24 year olds, all those young people that Rockwood wants to cover their college tuition? They rarely use desktop computers now. If they can’t watch Rockwood’s speeches, it’ll look like we’re purposefully ignoring them.â€At the bare mention of a demographic, Sullivan’s ears perked up and she came over. Mercy again explained the Flash situation.“Come on, Ellis,†Sullivan said, “the logo doesn’t look that bad. And it’s only for a few more days.â€Ellis’s eyes narrowed, but he soon rubbed them and turned back to his laptop. “I guess you have much more important things to do.â€Mercy felt Sullivan’s fingernails in her shoulder as the campaign manager pulled her away from Ellis. “Just let him be, Mercy. I told you what he’s going through with the boss.â€â€œHe gets away with a lot because of that,†she said. “Fine. I’ll just keep our servers up and running until after the polls close.â€â€œI hope you’ll stay on after that,†Sullivan said. “Imagine if you were part of our staff in Tallahassee. You’d be invaluable.â€â€œI need to think about it,†Mercy said, meaning not just the job offer but Rockwood’s diagnosis. Did she really want to work for a governor who was suffering from dementia?She found her way back to hamilton. On the screen was a black-cloaked, hooded figure, with skeletal arms, floating above a lakeside castle.“Okay, who put up the Dementor?†Mercy shouted to the volunteers. No one was brave enough to come forward. She closed the image, then checked the logs on the load balancer. hamilton was unresponsive, likely a memory leak, so she triggered a reboot.But hamilton didn’t boot back up. And Mercy smelled burning plastic.My Own Private Chernobyl“hamilton and jay are both out of commission,†Mercy said. Sullivan sat beside her, trying her best to keep up with Mercy’s explanation. “hamilton was the first. I noticed something was off when the load balancer reported that it wasn’t responding to requests. I figured a reboot would fix that. But then it didn’t come back. Just after that, jay did the same thing.â€It was well after hours. The phone operators had left, as no one wanted to hear a campaign call at 10PM. Ellis had escorted Rockwood home. It wasn’t a good day for their candidate, as he had stared listlessly at a wall for several hours, out of sight of their volunteer corps. Although Rockwood was out of it, the campaign was doing gangbusters, inching ahead of Packard in the polls.But that all could change if their hub went down just a few days before election day.“I decided to swap out hamilton’s hard drive, as that’s a common point of failure. I opened him up to replace the drive and I saw this.†Mercy spun hamilton around, showing Sullivan the server’s internals. She pointed to a gummy piece of plastic underneath a heat sink. “I smelled burning plastic earlier. That’s the CPU. We don’t overclock it, so that heat sink and the fans should have kept it cool.â€Mercy closed hamilton’s case. “I checked jay, too. Same thing. I thought there might be a recall on those boxes we got. We didn’t exactly buy top-of-the-line rack servers. So I called the manufacturer. There wasn’t any recall, but these CPUs do have a flaw. It’s called a ‘halt-and-catch-fire’ sequence. It’s a manufacturing flaw, a set of instructions that can cause the CPU to overheat.â€â€œWe didn’t accidentally make the CPU do that, did we?â€â€œNo. It’s all instructions that happen in kernel space — the operating system, I mean. Normal software shouldn’t even be able to execute it. Then I remembered something. Earlier today I was working on hamilton when Ellis asked about the YouTube logo. I stepped away for a second. When I came back, there was a picture of a Dementor open in the browser.â€â€œWhat’s a Dementor?â€â€œIt’s a Harry Potter thing. I thought maybe one of the volunteers was playing a prank, since I forgot to lock my screen. But I don’t think I did. I think someone used hamilton to plant an exploit on our servers.â€â€œWell, why did it affect one of the other servers if it was just on that one?â€â€œI think the exploit copied itself onto the other servers. It specifically targeted our buildout. It used a defect in how Chromium opens images to inject malicious code into kernel space, which copied itself onto the other web servers, that affect only the kinds of computers we bought. So they all have it.†Mercy sighed. “We need to hire some people. I’m really stretched thin on this.â€â€œWe need to keep this quiet, Mercy.†Sullivan frowned.“Barbie, I can’t fix this on my own.†Mercy hadn’t used Sullivan’s first name since she had begun working on the campaign. She sighed. “I can’t fix this.â€Sullivan took her hand. “You know, with all the staff we have coming and going, I thought it might be prudent to place some security cameras in headquarters.†She pointed to a poster of Rockwood in a corner; one of his eyes had a pencil-sized hole in the pupil, where a small camera could be placed. “If you remember when you saw this demented or whatnot, we could get the footage.â€Enlarge and EnhanceIt didn’t take long to find the culprit on the security footage. A man that neither Mercy nor Sullivan recognized had walked into headquarters, with black hair and black eyeliner. He wore a “Rockwood for Governor†shirt bought from the campaign store, not one issued to volunteers. He wandered through the crowd, grabbed a soda, then sat at the computer for about two minutes while Mercy was talking to Ellis. The footage was low-res, but to Mercy it looked like his fingernails were painted in alternating black and green. He inserted a USB drive into the front of the computer, opened the image of the Dementor, and left just before she got back to the computer.“God, that’s quick,†Mercy said. “He had to know how we operate.â€â€œIt’s too low quality,†Sullivan said. “We can’t make out his face.â€Mercy had an idea. “Hey, I wonder if he parked in the shopping center.â€â€œI have a camera pointing outside.†Sullivan switched feeds. This one was pointed through the glass storefront. The glare from the Orlando sun was intense, but they could make out the man walking to a black and green domestic car. She could make out three letters from the car’s license plate.“I think that’s enough to find him,†Mercy said.“I’ll call the county sheriff.â€â€œNo, wait. You said we should keep this quiet. If the cops show up, Ellis will know what’s going on, and the media could pick up on it. I don’t know how long it could take for the other servers to, well, melt down. You need to get Ellis to put our code up on Seashell Hosting, like we discussed a while ago. We can’t keep managing it here, and this is proof. But I’m going to track him down myself.â€Sullivan guffawed. “What, are you a bounty hunter or something?â€â€œI have some good friends,†Mercy replied.The Half-Blood HackerMercy called an ex-girlfriend who worked at the Orange County Sheriff’s Office, who was more than willing to help. She gave Mercy the culprit’s address. He lived in a white stucco apartment complex in Kissimmee. The walls of his apartment building were stained brown from rusty sprinkler water. She found his apartment number, banged on the corrugated metal door.He answered. His hair was nearly black, he was wearing black eyeliner, and he wore a Slytherin t-shirt and boxers.“I know you did it,†she said.A flash of recognition showed on the man’s face. He hid it with a fake smile. “I have no idea what you’re talking about,†he responded, in an affected British accent.“Ever heard of surveillance? Stupid Slytherin, 10 points to Ravenclaw. Let me in and I won’t call the cops.â€The false bravado left his face, and he opened the door for her. She stepped inside, noting that he was more than just a casual fan of the Harry Potter books. From the movie posters on the walls, to the many collector’s copies of books on his shelves, to a framed photo of Helena Bonham Carter by his bed.“A Dementor?†Mercy asked. “Seems pretty obvious.â€â€œIt’s a calling card.†The man sat at his computer desk, squirming.“Are you working alone?â€â€œI’ve been paid for my discretion.â€Mercy pulled out her phone. “Is it enough to cover bail?â€The man held up his hands. “Fine, it’s Packard.â€Mercy pocketed her phone. “Okay. What’s the fix?â€He giggled. “There isn’t one. I mean, maybe if it weren’t some web developer like you. Yeah, I looked you up on LinkedIn before I stopped by your headquarters. You put together that little cheap server farm yourself, I’ll bet. No, there’s no fix. Shutting down the hardware triggers the HACF sequence. Packard didn’t want everything down at once, because you people would know something was wrong and start digging. But I figure you’d apply rolling updates to each server, rebooting each time. Each one would fail, and you wouldn’t be able to guess why.â€â€œNo fix? I don’t have time to talk to you, then.â€â€œHey, could I get your number—“ the man said, the clanging of his front door drowning out his voice.Executive Decision“We’re done for,†Mercy said, getting back to headquarters an hour later. She explained the situation to Sullivan, who was at headquarters, and Ellis, who was out with Rockwood on speakerphone. The servers would need to run flawlessly until election day. If they didn’t — if they required a software update or a memory leak forced Mercy to turn any of them off — they’d melt. “We need hosting. I mean it.â€â€œAbsolutely not,†Ellis said. “The boss is adamant.â€â€œYou have no idea what’s going to happen if–â€â€œI have work to do.†Ellis hung up.“Mercy, please.†Sullivan rubbed her temples. “Just … do what you can to keep the servers going. It’s only for a few days.â€Mercy considered her options. One: she could do her best to keep the servers up, and watch as they failed one by one, until election day came and there was nothing else that could be done. Two: she could buy more servers as others failed, but that could get expensive, not to mention tedious. Three: she could migrate everything onto Seashell’s safe hardware tonight, and risk Ellis’s wrath.In the end, Rockwood, a man who couldn’t remember a conversation he had five minutes ago, wasn’t worth it.“I’m moving the code to Seashell,†Mercy said. Her stomach felt heavy. “I’m leaving the campaign as soon as it’s done.â€Sullivan sunk into her chair. “I won’t stop you. I won’t stop you moving the code, and I won’t stop you leaving. I know it’s your choice.†She smiled wanly. “And Ellis won’t have any idea how to get the code back onto those servers, so it’ll stay running until after the election’s over.â€Mercy made the call to Seashell Hosting. Despite the late hour, they were excited about hosting Rockwood’s campaign and offered affordable rates. In a few hours she had transferred everything to their servers: the database, the code, their internal files. After that, she asked a technician to restart their virtual server, in case some rack-mounted unit suddenly melted. Nothing happened.After she grabbed her things, she shook Sullivan’s hand. “I’ll keep in touch,†the older woman said.Mercy drove home.At her apartment, she turned on her laptop. She played the stump speech Rockwood gave in Stoneford, the one responsible for his meteoric rise and her own time with the campaign, one that would soon see him in the governor’s mansion in Tallahassee. She didn’t pay attention to the words this time. All she could see was a scared old man, desperately improvising to hide the fact that he couldn’t remember what he was doing. In the beginning, Mercy thought he was brilliant. But in the end, he simply had been making it up the whole time. [Advertisement] Application Release Automation for DevOps – integrating with best of breed development tools. Free for teams with up to 5 users. Download and learn more today!
"I came across this while submitting to a background check for a new job," writes Jay S., "Good to know that felonious behavior in Boston is perfectly acceptable."
"I came across this while submitting to a background check for a new job," writes Jay S., "Good to know that felonious behavior in Boston is perfectly acceptable."
Caleb scored his first intership at a small, family-owned print-shop. Much to his surprise, the day before he started, their primary web-developer left for a bigger, more lucrative job. His predecssor was an experienced programmer, but came at solving problems in his own unique way. This meant no comments, no functions, no classes, SQL injection vulnerabilities everywere, and cryptic 500-character one-liners stuffed into the value attribute of an input tag.Caleb spent his first day just trying to get the code running on his dev machine. On the second day, he sat down with a more experienced co-worker to try and understand some of the queries. For example, there was one query that needed to return product details sorted in some meaningful fashion- like by name. Weirdly, though, the page wasn’t sorting them by name, except when it was- no one who used the product search understood the sort order.Cabel dug in, expecting to see some variation on this:
Caleb scored his first intership at a small, family-owned print-shop. Much to his surprise, the day before he started, their primary web-developer left for a bigger, more lucrative job. His predecssor was an experienced programmer, but came at solving problems in his own unique way. This meant no comments, no functions, no classes, SQL injection vulnerabilities everywere, and cryptic 500-character one-liners stuffed into the value attribute of an input tag.Caleb spent his first day just trying to get the code running on his dev machine. On the second day, he sat down with a more experienced co-worker to try and understand some of the queries. For example, there was one query that needed to return product details sorted in some meaningful fashion- like by name. Weirdly, though, the page wasn’t sorting them by name, except when it was- no one who used the product search understood the sort order.Cabel dug in, expecting to see some variation on this:
David pulled his headphones off when he heard a loud harrumph behind him. One of his project managers loomed in the doorway, and had obviously been standing there for some time, trying to get David’s attention.“You pulled from Staging-Core branch into the Version–2 branch and broke Liam’s changes,†the PM said.David wracked his brain, trying to remember this particular PM’s name. He’d met so many during his short time at this company that he couldn’t keep them straight. “Uhh… we just had a release, right? Since I was working in Version–2, I pulled the latest version in. I thought I was the only one in there on this project right now…â€The PM shook his head. “I don’t know how you did things at your old job, but here we’ve got policies and procedures. This isn’t some tiny startup- we’ve got a dozen developers in this office, fifty more in India, another dozen in Mexico, and nearly a hundred testers. I’ll send you a meeting invite so we can discuss…â€The PM wandered off, mid-sentence, but was instantly replaced by another. This one David recognized- Lisa or Linda or Lindsey or something. “Liam tells me you’re breaking branches in our code control system,†she said. “I’m not sure how things worked at your old job, but this isn’t some tiny startup. Our codebase is over 1.2 million lines of code. I’ll send you a meeting invite so we can discuss…â€Over the next quarter of an hour, David was visited by the ghosts of project management past, present and future, each with dire comments about David’s ability to follow policy and the promise of a follow-up meeting. By mid-afternoon, his calendar for the next week was filled with meetings.A normal organization might do work in individual feature branches and when a feature was complete, they’d migrate those changes back to the root or trunk branch for release. People working in other feature branches should, at some point, pull those changes down into those branches. When and exactly how that happened was a possible topic of debate, but David’s new workplace wasn’t interested in a debate.“You simply don’t pull changes down into lower branches. Ever.â€David sat at a conference table, surrounded by project managers he didn’t recognize.“That’s why we have a Changes Under Merge team,†one of the PMs explained. “It’s for safety. Changes made by developers stay in one branch, and the Changes Under Merge team move them back up the tree, following the Change and Release Approach Policy.â€If David needed changes synced between branches, he needed to work with the Changes Under Merge team, which was a four-person group who understood how the 20+ branches in their codebase related to each other. If, for example, David needed a feature merged in, he’d need to look up all of the changesets that were used to create that feature. He’d then send them- as an Excel spreadsheet- to the Changes Under Merge team. Someone from that team would then cherry-pick just those changes and use TFS’s “baseless merge†tool to pull those changes into his branch.Conversely, when he had a feature ready to go, he wouldn’t merge it up the tree. He’d compile a list of changesets and pass them off to the Changes Under Merge team, which would then pull the changes from his branch into Integ-Core, for integration testing by QA (there were no automated tests, because, as one of the PMs put it, “Automated tests only test your automation. You need real humans for real tests.â€). Once the feature passed Integ-Core, the QA folks would request that the changes get merged into Strategic-CombRes, using the same cherry-pick and baseless merge approach. From there, the “finished†feature entered a twisty labyrinth of project management processes that David didn’t need to worry about. His feature would hop around the various Strategic Branches for awhile, and someday, maybe, make it back up into the Production branch.David took his scoldings, did his best not to roll his eyes, and got back to work when the project management machine decided that he’d been punished enough. For the next six months, he basically ignored everything he knew about branches, and just rigorously tracked his changesets so that he could pass them off to the Changes Under Merge team. Eventually, he started to hear whispers- a major release was coming, and everyone’d need to put in some extra time to make sure it went off without a hitch.Lisa/Linda/Lindsey descended on his cube on the eve of the release. “Now, since this is your first major milestone,†she said, “I wanted to stop by and review what’s going to happen. You’re going to get a list of changesets from the Changes Under Merge team. You need to look at the latest version of the Production branch and verify that all of your changes are in there. And no, you can’t just look and see if the changeset IDs are in there, because sometimes changes get overwritten by later changes. You’ll need to manually verify every line you’ve written. You’ve got two hours.â€This was six months worth of work. David didn’t even know where to begin with “verifying every line†he’d written. And in only two hours? It was impossible. Instead, he focused on spot-checking the release while wishing he’d been allowed to write some automated tests around his features. So far as he could tell, everything looked okay, so he signed off on the release.The release crashed and burned. Since the company didn’t have a backout plan, and since their branching structure was convoluted, they couldn’t simply pull the previous version out of source control and redeploy it. Instead, every developer pulled the latest version of the Production branch and worked until 2AM trying to patch all of the problems in it.There were a lot, and when the blamestorming session finally came around, several project managers were pointing their fingers at him. “You said all of your changes were in the final product, but it looks like Liam’s changes overwrote some of your changes.†“We need people that are going to follow policy.†“We need people who show real diligence.†“We don’t think this organization is the right fit for you.â€It wasn’t until he was 45 minutes into the meeting that David realized he was being fired. He wasn’t entirely certain that all of the PMs realized it either, because a few of them kept the meeting running. “Obviously,†one of them said, “while David was at fault, this problem is also a management problem. We need to expand the management team so that we can avoid these problems in the future. And since our headcount just shrank…â€
David pulled his headphones off when he heard a loud harrumph behind him. One of his project managers loomed in the doorway, and had obviously been standing there for some time, trying to get David’s attention.“You pulled from Staging-Core branch into the Version–2 branch and broke Liam’s changes,†the PM said.David wracked his brain, trying to remember this particular PM’s name. He’d met so many during his short time at this company that he couldn’t keep them straight. “Uhh… we just had a release, right? Since I was working in Version–2, I pulled the latest version in. I thought I was the only one in there on this project right now…â€The PM shook his head. “I don’t know how you did things at your old job, but here we’ve got policies and procedures. This isn’t some tiny startup- we’ve got a dozen developers in this office, fifty more in India, another dozen in Mexico, and nearly a hundred testers. I’ll send you a meeting invite so we can discuss…â€The PM wandered off, mid-sentence, but was instantly replaced by another. This one David recognized- Lisa or Linda or Lindsey or something. “Liam tells me you’re breaking branches in our code control system,†she said. “I’m not sure how things worked at your old job, but this isn’t some tiny startup. Our codebase is over 1.2 million lines of code. I’ll send you a meeting invite so we can discuss…â€Over the next quarter of an hour, David was visited by the ghosts of project management past, present and future, each with dire comments about David’s ability to follow policy and the promise of a follow-up meeting. By mid-afternoon, his calendar for the next week was filled with meetings.A normal organization might do work in individual feature branches and when a feature was complete, they’d migrate those changes back to the root or trunk branch for release. People working in other feature branches should, at some point, pull those changes down into those branches. When and exactly how that happened was a possible topic of debate, but David’s new workplace wasn’t interested in a debate.“You simply don’t pull changes down into lower branches. Ever.â€David sat at a conference table, surrounded by project managers he didn’t recognize.“That’s why we have a Changes Under Merge team,†one of the PMs explained. “It’s for safety. Changes made by developers stay in one branch, and the Changes Under Merge team move them back up the tree, following the Change and Release Approach Policy.â€If David needed changes synced between branches, he needed to work with the Changes Under Merge team, which was a four-person group who understood how the 20+ branches in their codebase related to each other. If, for example, David needed a feature merged in, he’d need to look up all of the changesets that were used to create that feature. He’d then send them- as an Excel spreadsheet- to the Changes Under Merge team. Someone from that team would then cherry-pick just those changes and use TFS’s “baseless merge†tool to pull those changes into his branch.Conversely, when he had a feature ready to go, he wouldn’t merge it up the tree. He’d compile a list of changesets and pass them off to the Changes Under Merge team, which would then pull the changes from his branch into Integ-Core, for integration testing by QA (there were no automated tests, because, as one of the PMs put it, “Automated tests only test your automation. You need real humans for real tests.â€). Once the feature passed Integ-Core, the QA folks would request that the changes get merged into Strategic-CombRes, using the same cherry-pick and baseless merge approach. From there, the “finished†feature entered a twisty labyrinth of project management processes that David didn’t need to worry about. His feature would hop around the various Strategic Branches for awhile, and someday, maybe, make it back up into the Production branch.David took his scoldings, did his best not to roll his eyes, and got back to work when the project management machine decided that he’d been punished enough. For the next six months, he basically ignored everything he knew about branches, and just rigorously tracked his changesets so that he could pass them off to the Changes Under Merge team. Eventually, he started to hear whispers- a major release was coming, and everyone’d need to put in some extra time to make sure it went off without a hitch.Lisa/Linda/Lindsey descended on his cube on the eve of the release. “Now, since this is your first major milestone,†she said, “I wanted to stop by and review what’s going to happen. You’re going to get a list of changesets from the Changes Under Merge team. You need to look at the latest version of the Production branch and verify that all of your changes are in there. And no, you can’t just look and see if the changeset IDs are in there, because sometimes changes get overwritten by later changes. You’ll need to manually verify every line you’ve written. You’ve got two hours.â€This was six months worth of work. David didn’t even know where to begin with “verifying every line†he’d written. And in only two hours? It was impossible. Instead, he focused on spot-checking the release while wishing he’d been allowed to write some automated tests around his features. So far as he could tell, everything looked okay, so he signed off on the release.The release crashed and burned. Since the company didn’t have a backout plan, and since their branching structure was convoluted, they couldn’t simply pull the previous version out of source control and redeploy it. Instead, every developer pulled the latest version of the Production branch and worked until 2AM trying to patch all of the problems in it.There were a lot, and when the blamestorming session finally came around, several project managers were pointing their fingers at him. “You said all of your changes were in the final product, but it looks like Liam’s changes overwrote some of your changes.†“We need people that are going to follow policy.†“We need people who show real diligence.†“We don’t think this organization is the right fit for you.â€It wasn’t until he was 45 minutes into the meeting that David realized he was being fired. He wasn’t entirely certain that all of the PMs realized it either, because a few of them kept the meeting running. “Obviously,†one of them said, “while David was at fault, this problem is also a management problem. We need to expand the management team so that we can avoid these problems in the future. And since our headcount just shrank…â€
One of the more difficult things for beginning programmers to pick up is computer-minded thinking. Sure, if you're reading this, it's probably easy for you to look at a system and plot out how to get the outputs you want in one area out of the information you have in another. For someone who's been programming for years, it's practically second nature. When mentoring interns or teaching beginners, however, it can readily become apparent just how strange this mindset can be to newcomers.We don't know this date-parsing code was written by a newbie ... but we have our suspicions:
One of the more difficult things for beginning programmers to pick up is computer-minded thinking. Sure, if you're reading this, it's probably easy for you to look at a system and plot out how to get the outputs you want in one area out of the information you have in another. For someone who's been programming for years, it's practically second nature. When mentoring interns or teaching beginners, however, it can readily become apparent just how strange this mindset can be to newcomers.We don't know this date-parsing code was written by a newbie ... but we have our suspicions:
We return with the penultimate installment of the tale of Mercy, the Mercenary Developer. Last time, she implemented a countdown clock- but nobody told her what it was counting down to, because nobody knew.It was standing-room only at Rockwood for Governor campaign headquarters. All the tables had been pushed to the walls or folded and stowed away; most of the chairs were stacked. Volunteers milled about, eating delivery pizza, wings, and (probably spiked) soda.Mercy and Sullivan, two of the few people who got chairs, sat close to the widescreen TV set up near the phone banks. It was tuned to a local network, broadcasting a feed from USF, a couple hours down I–4 from headquarters.The first Florida gubernatorial debate had started merely five minutes ago, and already things were testy.“This is a question from Facebook,†said Carson Cooper, the moderator. “It says: ‘I am concerned that Florida will keep municipal broadband and Google Fiber from taking root in the state, while big cable interests operate without competition. How would you address the need for better practices in the cable industry?’ Packard, we’ll start with you.â€Packard gave his response. “I think we ought to protect the interests of American companies, Carson. And that means standing behind our friends in the telecom industry, and keeping government out of the internet business!â€â€œRockwood, your response?â€â€œWe briefed him on this,†Sullivan whispered to Mercy. “He just has to say his lines.â€Their candidate gave his most confident smile. “I don’t know if Packard has ever had to look at a cable bill in his life.†Laughter from the volunteers. “My real-estate clients have all told me how expensive it is to get cable, to get internet. The gigs are too much, Carson, too much.â€â€œOh, no,†Sullivan whispered. “It was ‘the fees,’ not the ‘gigs.’ He sounds like a roadie.â€Mercy cringed. “He should have just said cable internet is too expensive.â€The democrat, Hewlett, waffled through a non-response. After he finished, Packard focused his attention on Rockwood. “For a real estate developer who’s made his living flipping houses, you suddenly know a whole lot about how the telecom industry works.†The TV audience laughed, but the boos from the volunteers drowned it out. “Tell me one thing, Mr. Rockwood. What is one forward-looking innovation that you, your company, or your campaign has launched? Because I can name at least a dozen at the pharmaceutical firm I founded.â€â€œI agree,†said Hewlett, hoping to get any kind of airtime between Rockwood and Packard.Rockwood got that glassy look in his eye again, which Mercy had noticed more often since the “countdown clock†incident a few weeks ago. There was something off about Rockwood whenever he got that look. It lasted three whole seconds; next to her, Sullivan had balled her hands into fists.“Rockwood, your response?†Carson Cooper said.Rockwood snapped out of it. “I’ll tell you something, Packard. Now I’m sure you’ve made some big improvements to whatever diet pills you manufacture in big pharma, but here’s something that will affect all Floridians. You know how hard it is to understand tax code? I don’t know if you’ve ever seen a return in your life, I mean with your own eyes. Well, our campaign has laid out a revised tax code for Floridians. Lower sales taxes for everyday goods. Fair and proportional property taxes. And a non-income profit tax that only affects the wealthiest Floridians … which includes you, I’m not sorry to say. Tomorrow, we’re launching a new mobile application that tells you exactly how much more you’ll owe. And for most Floridians, that number will be zero.â€The volunteers applauded, drowning out Carson Cooper’s voice. Meanwhile, Mercy’s stomach did a somersault. “A tax code app? Tomorrow?â€â€œI do believe that’s the first time he’s mentioned it,†Sullivan replied.“Did he just make that up on the spot?â€â€œWell, it can’t be that hard, can it? Just like building a website.†Sullivan faked a gracious smile.“You have no idea.â€Built != Launched“This is how hard it is to launch a new mobile app in a day,†Mercy said. She, Ellis, and Sullivan had gathered after the debate in the conference room. Rockwood was off to St. Petersburg and Tampa for some barnstorming after his performance, which the media had characterized as “fresh†and “unpredictable,†not terms they used in a complimentary fashion. “I could do it in a week. I can’t do it in 24 hours.â€â€œWe don’t have a week,†Ellis said. “John said we’d have it up in 24 hours. That’s what we have to do.â€â€œYou know what, Ellis,“ Sullivan snapped, â€Maybe you should let the one who’s actually going to build the mobile app tell us how it can be done.â€â€œWell, I’ll go get Rockwood as soon as his stump speech is done and I’ll tell him. You’ll see how he likes that kind of news.â€â€œLook,†Mercy held up her hands, “do you want to hear what I have to say or not?â€Ellis and Sullivan quit squabbling.“Here’s what has to happen. I need to build it first. I can use PhoneGap — it’s a framework that uses HTML, so it’s like a web page inside an application. I’ll need the campaign’s tax reform policy written up.â€â€œUh, we don’t have that yet,†Ellis said.“Do you need it?†Sullivan asked. “Could you just build the application and put it in later?â€â€œIt’s a tax policy application,†Mercy said, her voice cracking. “There’s no application without knowing how the new taxes will work. That’s the whole point.â€â€œI’ll get something tomorrow morning,†Ellis conceded.“I can build most of it out tonight,†Mercy said. She reminded herself to buy some energy drinks on the way back to her apartment. “Tomorrow I’ll make changes to the algorithm based on our new tax policy. We won’t have much time for testing, so I’ll get some volunteers to help.â€â€œGreat, we can get it built by tomorrow afternoon,†Ellis said. “It’ll be done in 24 hours.â€â€œNo, it’ll be built in 24 hours,†Mercy said. “It won’t be live in 24 hours. It still has to get on the Apple store and Google Play.â€â€œSo, can’t we just make an account and put it up?†Sullivan asked.“Apple takes at least a week to approve an app. If you’re lucky, and we’ll be a new publisher with no prior releases. They’ll drag their feet.â€â€œOkay, so we make some phone calls,†Ellis said. “Can’t be that hard.â€â€œHave you ever tried to call Apple? I mean, not just tech support.â€â€œLook.†Ellis steepled his hands on the table. “It’s going to happen. You’re going to find a way to do it. End of story.†Without even a dismissal, Ellis left the room.“What’s his deal? Was it the debate?†Mercy cracked her knuckles. Her wrists already hurt from the arduous typing they’d endure tonight.“I can’t talk about that, honey,†Sullivan said, leaving the conference room.Tax CodeBy 4AM she had a working prototype of the application. It took a user’s gross income, property values, etc., and spit out a dollar amount, based on what she knew about Florida tax law. Mercy figured the campaign’s tax policy wouldn’t be very complicated, either adjusting individual percentages on specific values, fiddling with the base percentage, or some combination thereof. She headed back to the office to be ready for when Ellis could get her their tax policy platform language. She took a nap, sitting next to the web server hamilton.Around 8AM, a hand shook her shoulder. It was Ellis. He shoved a piece of paper in front of her. “Here’s what we came up with a few weeks ago.â€It was a 17-circle Venn diagram. Arrows were drawn from circle to circle around the circumference, making it look like a giant recycling symbol. Houses, boats, and other property icons dotted the diagram. There were no numbers anywhere on it.Mercy said as much to Ellis.“Look,†Ellis said, “The actual property rates and percentages won’t actually change. Just the way they’re calculated. Just make it look like it’s saving our constituents money. The actual tax laws will get worked out in the legislature after Rockwood’s elected.â€Mercy rubbed her eyes. She started redrawing the Venn chain link into an algorithm flow chart, then crumpled that up, adjusted a few values in her own algorithm, and prepped for QA.Failure to LaunchMercy was struggling to keep awake as two volunteers, a brother and sister attending UCF, tested on an iPhone and an Android tablet respectively.“Whoa, hey, those boxes showed up again,†the brother said. He handed Mercy his iPhone.“It’s the stupid glyphicon font. I must have moved the files by mistake.†Mercy dug through her codebase, double-checked the font locations and her font-face CSS declarations, and recompiled. She pushed the new package to cato, the intranet server for the campaign, and brother and sister re-installed their apps respectively.“Looks good on mine,†the sister said. The brother nodded in agreement.“Okay, thanks.†Mercy yawned. The app was mostly bug-free — or as bug-free as she could make it in just over 12 hours — and ready to ship. While she had been finishing the app, Sullivan had set up accounts on Google Play and the Apple Store. Mercy logged into the Google Play account, uploaded the Android installer, and hit “Publish.†That would be the easy part.But getting Apple to play along would be harder.She put the iOS installer into the campaign account, then tagged it for review. An email came back, with just what she expected: it would take nearly a week for Apple to respond.Meanwhile, Rockwood was coming back from his barnstorming in Tampa and St. Petersburg, and would want to see the app in action when he arrived around 6PM. Six hours left.Against her better nature, Mercy scoured her LinkedIn connections. She had made numerous contacts at local conferences. Surely someone worked at Apple, someone who could pull a few strings in the review process. As she searched, her eyes began to close. She felt as though she were falling out of her chair, and she jolted awake.There wouldn’t be anyone she knew, and besides, she didn’t have the money to bribe anyone to speed up the process. She headed for the conference room. “Wake me in a couple hours,†she told Sullivan. Inside, she rolled up a sweater for a pillow, locked the door, shut off the light, and went to sleep.Beta ReleaseSullivan’s knocking woke Mercy. She checked her phone. It was 5PM.“When’s he getting here?†she said, her voice muffled.“He’s on his way from the airport,†she replied. “Ellis has already called and said you couldn’t get the app finished.â€Mercy groaned. “It’s done, it’s just not on the Apple Store—“Mercy realized it didn’t need to be. A few iPhone and iPad owners unlocked their devices, allowing third-party apps to run on them. She could just put a “beta†of the application for download on their site. Only jailbroken devices could run it, but she could say she released the app in the 24-hour window Rockwood wanted.She dragged herself out of the conference room, head pounding from an enormous caffeine withdrawal. She slumped in front of hamilton, logged onto the campaign blog, and wrote a post. “Download Rockwood’s Tax Code App Here!†the post said. At the bottom was a link to the iOS installer, which she had copied to the public servers. She made it clear it was a beta release, and that as soon as it hit the iOS store it would no longer be available. But it was published, and just in time.Sullivan met Rockwood as he came in the door, before Ellis could get a chance to talk to him. “The tax app is up on the web!†she said. “We got it done.â€â€œTaxes? I released my tax returns months ago,†he said, chuckling.Ellis sandwiched himself between Sullivan and Rockwood. “Let’s get you situated,†he said, ushering the candidate through a few loitering volunteers. Rockwood put on his best smile, but seemed like he didn’t know where he was.“I’m gonna sleep for three days,†Mercy said to Sullivan, as she left headquarters. But Sullivan followed her out to the parking lot.Sullivan began, “I should really tell you–“Mercy said, her voice short, “I don’t have time–““–John has non-Alzheimer’s dementia.†Sullivan’s usual southern tea-sweet tone was gone. “He was diagnosed just after he announced his campaign. I first noticed the symptoms a couple years ago. He’s lucid most of the time, but he’s having a lot more episodes recently. Ellis and I are basically running things until John gets better. You’re the third person to find out.â€â€œAfter you and Ellis?â€Sullivan nodded. “Please keep this to yourself. It’ll kill his chances if—““I can’t deal with this right now,†Mercy said. “I’m taking the next few days off.†She got in her old Honda and drove home. When she got there, she turned off her phone, covered herself in three blankets, curled up, and slept. [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
We return with the penultimate installment of the tale of Mercy, the Mercenary Developer. Last time, she implemented a countdown clock- but nobody told her what it was counting down to, because nobody knew.It was standing-room only at Rockwood for Governor campaign headquarters. All the tables had been pushed to the walls or folded and stowed away; most of the chairs were stacked. Volunteers milled about, eating delivery pizza, wings, and (probably spiked) soda.Mercy and Sullivan, two of the few people who got chairs, sat close to the widescreen TV set up near the phone banks. It was tuned to a local network, broadcasting a feed from USF, a couple hours down I–4 from headquarters.The first Florida gubernatorial debate had started merely five minutes ago, and already things were testy.“This is a question from Facebook,†said Carson Cooper, the moderator. “It says: ‘I am concerned that Florida will keep municipal broadband and Google Fiber from taking root in the state, while big cable interests operate without competition. How would you address the need for better practices in the cable industry?’ Packard, we’ll start with you.â€Packard gave his response. “I think we ought to protect the interests of American companies, Carson. And that means standing behind our friends in the telecom industry, and keeping government out of the internet business!â€â€œRockwood, your response?â€â€œWe briefed him on this,†Sullivan whispered to Mercy. “He just has to say his lines.â€Their candidate gave his most confident smile. “I don’t know if Packard has ever had to look at a cable bill in his life.†Laughter from the volunteers. “My real-estate clients have all told me how expensive it is to get cable, to get internet. The gigs are too much, Carson, too much.â€â€œOh, no,†Sullivan whispered. “It was ‘the fees,’ not the ‘gigs.’ He sounds like a roadie.â€Mercy cringed. “He should have just said cable internet is too expensive.â€The democrat, Hewlett, waffled through a non-response. After he finished, Packard focused his attention on Rockwood. “For a real estate developer who’s made his living flipping houses, you suddenly know a whole lot about how the telecom industry works.†The TV audience laughed, but the boos from the volunteers drowned it out. “Tell me one thing, Mr. Rockwood. What is one forward-looking innovation that you, your company, or your campaign has launched? Because I can name at least a dozen at the pharmaceutical firm I founded.â€â€œI agree,†said Hewlett, hoping to get any kind of airtime between Rockwood and Packard.Rockwood got that glassy look in his eye again, which Mercy had noticed more often since the “countdown clock†incident a few weeks ago. There was something off about Rockwood whenever he got that look. It lasted three whole seconds; next to her, Sullivan had balled her hands into fists.“Rockwood, your response?†Carson Cooper said.Rockwood snapped out of it. “I’ll tell you something, Packard. Now I’m sure you’ve made some big improvements to whatever diet pills you manufacture in big pharma, but here’s something that will affect all Floridians. You know how hard it is to understand tax code? I don’t know if you’ve ever seen a return in your life, I mean with your own eyes. Well, our campaign has laid out a revised tax code for Floridians. Lower sales taxes for everyday goods. Fair and proportional property taxes. And a non-income profit tax that only affects the wealthiest Floridians … which includes you, I’m not sorry to say. Tomorrow, we’re launching a new mobile application that tells you exactly how much more you’ll owe. And for most Floridians, that number will be zero.â€The volunteers applauded, drowning out Carson Cooper’s voice. Meanwhile, Mercy’s stomach did a somersault. “A tax code app? Tomorrow?â€â€œI do believe that’s the first time he’s mentioned it,†Sullivan replied.“Did he just make that up on the spot?â€â€œWell, it can’t be that hard, can it? Just like building a website.†Sullivan faked a gracious smile.“You have no idea.â€Built != Launched“This is how hard it is to launch a new mobile app in a day,†Mercy said. She, Ellis, and Sullivan had gathered after the debate in the conference room. Rockwood was off to St. Petersburg and Tampa for some barnstorming after his performance, which the media had characterized as “fresh†and “unpredictable,†not terms they used in a complimentary fashion. “I could do it in a week. I can’t do it in 24 hours.â€â€œWe don’t have a week,†Ellis said. “John said we’d have it up in 24 hours. That’s what we have to do.â€â€œYou know what, Ellis,“ Sullivan snapped, â€Maybe you should let the one who’s actually going to build the mobile app tell us how it can be done.â€â€œWell, I’ll go get Rockwood as soon as his stump speech is done and I’ll tell him. You’ll see how he likes that kind of news.â€â€œLook,†Mercy held up her hands, “do you want to hear what I have to say or not?â€Ellis and Sullivan quit squabbling.“Here’s what has to happen. I need to build it first. I can use PhoneGap — it’s a framework that uses HTML, so it’s like a web page inside an application. I’ll need the campaign’s tax reform policy written up.â€â€œUh, we don’t have that yet,†Ellis said.“Do you need it?†Sullivan asked. “Could you just build the application and put it in later?â€â€œIt’s a tax policy application,†Mercy said, her voice cracking. “There’s no application without knowing how the new taxes will work. That’s the whole point.â€â€œI’ll get something tomorrow morning,†Ellis conceded.“I can build most of it out tonight,†Mercy said. She reminded herself to buy some energy drinks on the way back to her apartment. “Tomorrow I’ll make changes to the algorithm based on our new tax policy. We won’t have much time for testing, so I’ll get some volunteers to help.â€â€œGreat, we can get it built by tomorrow afternoon,†Ellis said. “It’ll be done in 24 hours.â€â€œNo, it’ll be built in 24 hours,†Mercy said. “It won’t be live in 24 hours. It still has to get on the Apple store and Google Play.â€â€œSo, can’t we just make an account and put it up?†Sullivan asked.“Apple takes at least a week to approve an app. If you’re lucky, and we’ll be a new publisher with no prior releases. They’ll drag their feet.â€â€œOkay, so we make some phone calls,†Ellis said. “Can’t be that hard.â€â€œHave you ever tried to call Apple? I mean, not just tech support.â€â€œLook.†Ellis steepled his hands on the table. “It’s going to happen. You’re going to find a way to do it. End of story.†Without even a dismissal, Ellis left the room.“What’s his deal? Was it the debate?†Mercy cracked her knuckles. Her wrists already hurt from the arduous typing they’d endure tonight.“I can’t talk about that, honey,†Sullivan said, leaving the conference room.Tax CodeBy 4AM she had a working prototype of the application. It took a user’s gross income, property values, etc., and spit out a dollar amount, based on what she knew about Florida tax law. Mercy figured the campaign’s tax policy wouldn’t be very complicated, either adjusting individual percentages on specific values, fiddling with the base percentage, or some combination thereof. She headed back to the office to be ready for when Ellis could get her their tax policy platform language. She took a nap, sitting next to the web server hamilton.Around 8AM, a hand shook her shoulder. It was Ellis. He shoved a piece of paper in front of her. “Here’s what we came up with a few weeks ago.â€It was a 17-circle Venn diagram. Arrows were drawn from circle to circle around the circumference, making it look like a giant recycling symbol. Houses, boats, and other property icons dotted the diagram. There were no numbers anywhere on it.Mercy said as much to Ellis.“Look,†Ellis said, “The actual property rates and percentages won’t actually change. Just the way they’re calculated. Just make it look like it’s saving our constituents money. The actual tax laws will get worked out in the legislature after Rockwood’s elected.â€Mercy rubbed her eyes. She started redrawing the Venn chain link into an algorithm flow chart, then crumpled that up, adjusted a few values in her own algorithm, and prepped for QA.Failure to LaunchMercy was struggling to keep awake as two volunteers, a brother and sister attending UCF, tested on an iPhone and an Android tablet respectively.“Whoa, hey, those boxes showed up again,†the brother said. He handed Mercy his iPhone.“It’s the stupid glyphicon font. I must have moved the files by mistake.†Mercy dug through her codebase, double-checked the font locations and her font-face CSS declarations, and recompiled. She pushed the new package to cato, the intranet server for the campaign, and brother and sister re-installed their apps respectively.“Looks good on mine,†the sister said. The brother nodded in agreement.“Okay, thanks.†Mercy yawned. The app was mostly bug-free — or as bug-free as she could make it in just over 12 hours — and ready to ship. While she had been finishing the app, Sullivan had set up accounts on Google Play and the Apple Store. Mercy logged into the Google Play account, uploaded the Android installer, and hit “Publish.†That would be the easy part.But getting Apple to play along would be harder.She put the iOS installer into the campaign account, then tagged it for review. An email came back, with just what she expected: it would take nearly a week for Apple to respond.Meanwhile, Rockwood was coming back from his barnstorming in Tampa and St. Petersburg, and would want to see the app in action when he arrived around 6PM. Six hours left.Against her better nature, Mercy scoured her LinkedIn connections. She had made numerous contacts at local conferences. Surely someone worked at Apple, someone who could pull a few strings in the review process. As she searched, her eyes began to close. She felt as though she were falling out of her chair, and she jolted awake.There wouldn’t be anyone she knew, and besides, she didn’t have the money to bribe anyone to speed up the process. She headed for the conference room. “Wake me in a couple hours,†she told Sullivan. Inside, she rolled up a sweater for a pillow, locked the door, shut off the light, and went to sleep.Beta ReleaseSullivan’s knocking woke Mercy. She checked her phone. It was 5PM.“When’s he getting here?†she said, her voice muffled.“He’s on his way from the airport,†she replied. “Ellis has already called and said you couldn’t get the app finished.â€Mercy groaned. “It’s done, it’s just not on the Apple Store—“Mercy realized it didn’t need to be. A few iPhone and iPad owners unlocked their devices, allowing third-party apps to run on them. She could just put a “beta†of the application for download on their site. Only jailbroken devices could run it, but she could say she released the app in the 24-hour window Rockwood wanted.She dragged herself out of the conference room, head pounding from an enormous caffeine withdrawal. She slumped in front of hamilton, logged onto the campaign blog, and wrote a post. “Download Rockwood’s Tax Code App Here!†the post said. At the bottom was a link to the iOS installer, which she had copied to the public servers. She made it clear it was a beta release, and that as soon as it hit the iOS store it would no longer be available. But it was published, and just in time.Sullivan met Rockwood as he came in the door, before Ellis could get a chance to talk to him. “The tax app is up on the web!†she said. “We got it done.â€â€œTaxes? I released my tax returns months ago,†he said, chuckling.Ellis sandwiched himself between Sullivan and Rockwood. “Let’s get you situated,†he said, ushering the candidate through a few loitering volunteers. Rockwood put on his best smile, but seemed like he didn’t know where he was.“I’m gonna sleep for three days,†Mercy said to Sullivan, as she left headquarters. But Sullivan followed her out to the parking lot.Sullivan began, “I should really tell you–“Mercy said, her voice short, “I don’t have time–““–John has non-Alzheimer’s dementia.†Sullivan’s usual southern tea-sweet tone was gone. “He was diagnosed just after he announced his campaign. I first noticed the symptoms a couple years ago. He’s lucid most of the time, but he’s having a lot more episodes recently. Ellis and I are basically running things until John gets better. You’re the third person to find out.â€â€œAfter you and Ellis?â€Sullivan nodded. “Please keep this to yourself. It’ll kill his chances if—““I can’t deal with this right now,†Mercy said. “I’m taking the next few days off.†She got in her old Honda and drove home. When she got there, she turned off her phone, covered herself in three blankets, curled up, and slept. [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
Code is a window into the programmer’s mind. Our thought processes are laid bare, exposed and cemented for all eternity in keywords and symbols. It’s left there, waiting for another programmer to come by and wonder: “What were they thinking?â€That’s exactly what “seebs†was wondering, when he found this PHP code.
Rex had just been hired on with a large retailer as a Puppet Automation Engineer, tasked with using Puppet Labs to automate deployments of some SAP-py, enterprisey software. He was paired up with another Puppet Automation Engineer, Alexi. Alexi was the expert, and he was in charge of automating the company’s Sarbanes-Oxley (SOX) auditing.Alexei was a firm believer that the Customer Is Always Wrong, and Alexei Knows Best. As a consequence, he thought that any requirements he didn’t like could be changed to arbitrary ones he did like. If the customer wanted a report that provided some summarized sales numbers for the year and he thought that was stupid, he’d instead give them a report showing their top product’s Line-Of-Code count divided by the Dow Jones Industrial Average for the month. If they wanted to slice-and-dice their customer database by demographics, he would code up a line graph relating the number of characters in their last name to the average nightly lows on their date of birth.
As anyone who’s ever written a c-style char * string knows, strings are much more complicated than they look. This is even more true in this modern era of Unicode and character encodings and multilingual applications. How does “ä†compare to “a†or “á�John Moore’s company sent some code to a contracting firm. They needed to strip off any diacritics and unusual characters when they were comparing strings, so that “ä†and “å†were treated as the same character when searching- a not uncommon problem. In Java, there’s a special family of classes inheriting from Collator which can be used to solve exactly that problem. Now, most developers aren’t deeply familiar with these, so seeing a contractor that turns in a more “home brewed†approach is hardly surprising.This approach goes above and beyond. It starts out bad, but not horrible: convert the string to their character codes, and then look at each one. What follows is a textbook example of why you don’t write gigantic if-blocks using magic numbers as boundary conditions, including this gem:
In the continuing saga of Mercy the Mercenary, she continues to struggle with a political campaign- Rockwood for Governor- and its backwards approach to IT. Last time, she had an uphill battle getting the kit to keep their website up.The request seemed so simple, Mercy knew. Embed a video inside an email message.“I’m not saying it’s hard,†she said. “I’m saying it’s impossible.â€â€œThe boss wants it to happen,†Ellis said. “And that means—““That means we trust her judgment,†Sullivan interrupted. “But why don’t you try telling us why it can’t happen, Mercy? You can use kindergarten terms so Ellis can understand.â€Mercy sighed. “The HTML in email messages gets scrubbed by the client. What that means is anything the email client thinks is suspicious, such as a script tag or an iframe, gets taken out. The stuff that gets left in is just text formatting and images. Even if you got some embedded video code into a message somehow, email clients don’t have the Flash plugin available to load it.â€Ellis clicked on his trackpad, then spun his laptop around to show Mercy his screen. “Packard got it in somehow.â€Mercy examined the browser window. A message was displayed in Gmail from the Packard for Governor campaign. Just above the fold was what looked like a screenshot with a play button in the center. Just like a video player.“It’s just an image.†Mercy clicked on it, and the browser spawned a YouTube page in a new tab, a Packard for Governor campaign ad playing at full volume. Ellis hit pause halfway into the sentence “I’m Harold Packard and I approve this message.â€â€œLook,†Sullivan said, "Rockwood’s really stuck on getting this in. Is there any workaround?â€â€œIt won’t be a real video … but we can embed a .gif image.†Mercy, on her own laptop, found the Packard ad and ran it through an online .gif converter. It produced the first three seconds of the ad. “I can add a caption at the bottom, put a big play button in the center, make it look exactly like a video player. There’s no sound, but who wants sound to play when they open an email message?â€â€œDon’t mention that to Rockwood,“ Sullivan said. â€He’ll want sound playing on every email message we send.â€Mercy downloaded the .gif, noticing the size of the file. “Hey, we don’t want to embed a 3MB image in each email message. We should put this on our CDN server and link to it from there.â€â€œWon’t there be that little X icon if we do that?†Ellis asked. “I hate it when Gmail does it to our messages.â€â€œMost subscribers have our newsletter added to their whitelist, so they won’t all see that,†Mercy said. “We attach the template images to the email message, but they’re only a few kilobytes. We can’t send 3MB messages to all of our subscribers.â€â€œOur email provider’s giving us a discount this month,“ Sullivan said, â€and I know if Rockwood’s going to want to see the video in the email as soon as it’s out. And if he sees that X icon, he won’t be happy about it.â€Mercy shrugged. “Well, what’s 3MB when people have a TB of storage for email nowadays? I’ll get it done.â€â€œThat’s the kind of motivation I like to see.â€Mercy turned to see Rockwood in the doorway of the conference room. She wasn’t sure when he’d walked in.“Oh, I’ll make sure that video gets sent out,†Ellis said, with a straight face.“Ellis, if I was appointed Emperor of Florida tomorrow, you’d say it was all because of you.†Rockwood winked at the man as he sat in an empty chair. Mercy rolled her eyes.“Now, don’t give me that,†Rockwood said, addressing Mercy. “I have a task just for you. See, I need a countdown clock. You know, like the one in Mission: Impossible, the bomb timer.â€â€œJohn,†Sullivan asked, “when is this … bomb set to go off?â€â€œAugust 1st, one second after midnight. Think you can do that?â€â€œUh, sure,†Mercy said. “What happens when it gets to zero?â€â€œI’ll let you know.†With that, Rockwood left the conference room.“Well,†Sullivan said, “I’m sure he’ll let us know just what he wants in due time. So, can you make a countdown timer, Mercy?â€â€œSure can.â€// TODOCloistered away in her apartment, far from the squawking of the volunteers on the phone lines, Mercy built a countdown clock. Javascript programming didn’t lend itself well precision timing, but coding timers was easier than in other languages due to the setTimeout()/setInterval() methods and functions as first-class objects. In fact, Mercy had written countdown clocks for several past clients. She grabbed a recent copy of that code and modified it for Rockwood’s clock.