Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2024-11-23 07:02
CodeSOD: The Difficulties of Choice
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:
The EDI Fall Back
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.
Announcements: Code Offsets - Version 2.0
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!
Coded Smorgasbord: Finding a Path
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:
That 70's Paper Mill
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!
Error'd: 2,147,483,647 Channels ...and Nothing's On
"I think it's going to take me a while to catch up on my Radio 4 listening," writes Chris W.
CodeSOD: What A Load
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:
CodeSOD: What A Load
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:
Congraubullations
“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.
Congraubullations
“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.
CodeSOD: An Ant Pushes a Perl
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.
CodeSOD: An Ant Pushes a Perl
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.
Mercy the Mercenary in… a Heated Argument
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!
Mercy the Mercenary in… a Heated Argument
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!
Error'd: What Happens in Massachusetts...
"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."
Error'd: What Happens in Massachusetts...
"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."
CodeSOD: Interned Sort
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:
CodeSOD: Interned Sort
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:
Twisted Branches
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…”
Twisted Branches
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…”
CodeSOD: See You Last Saturday
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:
CodeSOD: See You Last Saturday
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:
Mercy the Mercenary in… The App Store
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.
Mercy the Mercenary in… The App Store
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.
Error'd: Paula Lives
"While poking around on my brand new Galaxy S7, I was tempted to pick one ringtone in particular," writes Ronon D..
Error'd: Paula Lives
"While poking around on my brand new Galaxy S7, I was tempted to pick one ringtone in particular," writes Ronon D..
Coded Smorgasbord: Mysterious Mysteries of Strange Mystery
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.
Enterprise Automation
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.
CodeSOD: And It's Collated
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:
Mercy the Mercenary in… The (not so) Final Countdown
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.
Error'd: TAYLOR VS. TIME
You know that new Taylor Swift treadmill commercial? Looks like there's a little bit of a sync issue between the time on her phone and the analog clock icon at 0:05.
CodeSOD: Parsimony
When I was but a wee lass, the internet was still a wild, untamed place. Before the advent of walled gardens and minifiers, long before Facebook, you could learn everything you needed to know about web programming using one simple tool: View -> Source.Wide open fields of HTML, speckled with poignant blossoms of inline CSS! Table after table, each one hand-crafted and oddly indented! Gifs ripe for stealing: dancing flames, dancing babies, and 'under construction' signs! What a wonderful world of secrets lay hidden just two clicks away!Sometimes, in rare occasions, you can still see whole, unmolested Javascript functions in the source code of pages. Today's function comes from a credit union, ready and waiting to teach a new generation of programmers all about number parsing.
A Testy Voice
“This,” Gregor said by way of introduction, “is Jack. Jack’s our new highly paid consultant.”Rita shook Jack’s hand. Jack was the kind of person who entered a handshake with a dominant, overhand approach, and then applied too much pressure while he smiled at you. He wanted you to know, he was a take charge kind of guy.“Jack’s going to set up some automated tests of the IVR system,” Gregor said.Rita worked for a large health insurance company. Their customer facing phone system was a mission critical application. It was a programmable IVR- interactive voice response- application that needed to be able to service huge numbers of fairly routine requests. Like most things tied to the medical industry, those “routine requests” could be arcane, could be complicated with large numbers of details, and could end with something getting faxed to an office, because half the doctors’ offices they worked with didn’t exactly trust email.“More tests?” Rita asked. She wasn’t opposed to the idea, but she had written a huge number of test scripts to walk through the logic of the back-end system. But Jack’s tests weren’t back-end tests- he had a tool that could simulate actual phone calls.“What you’ve got is great,” Jack explained in a tone of voice that implied he didn’t think it was particularly great at all, “but what I’m going to do is better. It’s like the difference between unit tests and functional tests. We’re gonna do end-to-end functional testing now.”Rita was the expert on the IVR system, which meant she couldn’t escape Jack. He needed her help to understand some of the testing protocols they had in place. When testing a live system, it was very important to use some special data; for example certain patient names would cause the system to spit out dummy records, which kept their tests away from live data. There were many “gotchas” to this process, which Rita had documented thoroughly, and she guided Jack through.Jack assured her that he’d gotten it figured out, and went off to work. He deployed the expensive test package to several servers in their datacenter, doing an end-run around the operations guys and getting himself setup with admin privileges on the boxes. “We’ll never get this done if I have to send in tickets for every little thing,” he explained. After a few weeks, he pushed the “run” button, provided the results of the tests, and then, like most highly paid consultants, dried up and blew away on a stiff breeze that evening.A few days later, Rita got a ticket, escalated from Lisa down in HR. Rita was confused at first, because Lisa had a printer issue, which wasn’t exactly in Rita’s domain, but apparently it was printing out a patient record over and over again, which caught Rita’s attention.“So,” Lisa explained, “this is one of those big Epsons, the kind that’s printer, copier, fax, and it’s got lots and lots of paper stored away in there, and it’s burning through that paper like it’s trying to destroy the rainforest.”“And it’s printing out a patient record?”“Benefits stuff for one of our customers, yeah. It’s been doing it for days now.”“Have you tried unplugging the phone cable?”Why would a printer/copier/fax machine be printing out a patient record non-stop? Interestingly, when Rita pinned Lisa down on the start of the problem, it turned out to be the same day Jack had left.Rita had a hunch it was the fax machine part that was the culprit, and after checking the activity on the IVR, she was certain. There was a job that was coming in with no origin phone number- it used a direct VoIP connection from inside their own network- from one of Jack’s test machines. Every three minutes, it connected to the IVRRita called operations. “Hey, there’s a job running on JCKRKS03 that’s causing some problems. Can I get you to kill any test scripts running on there?”“No can do,” the ops guy said. “We’re locked out of those boxes. Zero access.”Fine, she needed Jack to fix the mess. She called Initech Consulting.“Oh,” the rep said, “Jack isn’t with the company any more. He moved over to Initrode.”“Well, we still have a contract for IVR testing, right? Who’s taking over Jack’s role?”“Oh… I don’t really know…”The next three hours were a deep dive into a convoluted maze of bureaucracy. The rep roped in some Initech management. Rita roped in her company’s management. Initech claimed that the contract called for the test job to be set up and run- and it was clearly running. They could see the test results. Therefore the contract was completed. Rita’s management complained that they weren’t feeling like they were getting the support they had paid a large sum of money for. Fingers pointed, blame was shared around, and in the end, nobody knew what they could do short of wiping the test servers and starting from scratch, because Jack hadn’t told anyone the password.Annoyed, Rita decided to try remoting into the box. She connected to the box JCKRCKS01. If she were a highly paid consultant, what would her password be? “password”? No. “P@$$w0rd”? No. “j4ckR0cks”? Bingo.Rita poked around the test runner, and found that Jack had made two mistakes. The first mistake was that Jack didn’t use the correct test data. Specifically, when starting a job that would trigger a fax send, the destination number should always start with “555-”, which would never be a real number, and would cause the fax to be redirected to an email address. That mistake was a bit of a nuisance, but for the second. Under the contract, Jack was supposed to set up the tests and run them once, and then Rita or any of her peers could run them in the future on demand. Instead, Jack just put the tests on an infinite loop. The call script took about three minutes to run, so every three minutes it triggered a fax of a patient’s statement of benefits to print out from Lisa’s printer.Rita fixed it, and double checked his other scripts. The only piece of good news was that Jack had only used internal phone numbers in all of his scripts. They hadn’t spammed an outsider’s fax machine with thousands of pages of someone’s private health information.
CodeSOD: Tough Cookies
Back in 2007, Dimitry worked on a website that received millions of unique visitors.One day, a partnered ad agency provided a large PHP script that they wanted deployed as part of a new implementation. Given the popularity of the website, it was important that any code associated with it was either cached or light. This beast was neither. But Dimitry wasn't to ask questions, only test and deploy.Minutes after the code went live in production, Dimitry's manager barreled into his cube. "It's all frozen!""Wha?" Dimitry choked out around a celebratory sip of high-caffeine soda, which quickly went rancid in his mouth."The site is down! Roll back! Roll back!"Rolling back was the easy part. Now, Dimitry had to figure out what had gone wrong. That meant taking a closer look at the ad agency's code, and facing the nightmare within.Here was a representative function. Its purpose was to read server-side cookie information and track which ads a user had seen. No user would be presented the same ad twice in a row unless the config file specified otherwise.
Mercy the Mercenary in… The Cloud
The tale of Mercy the Mercenary Developer continues. Last week Mercy became the IT support for a political campaign because she knew how to stream from a cellphone, and thus knew more than anyone working at the campaign.Mercy ground her teeth. Her wifi connection in Rockwood’s campaign headquarters had dropped again.Around her, Rockwood’s “righteous” volunteers milled about. A few sat at phones, working through Florida’s constituency months before the general election would even take place. Since Rockwood’s town hall speech in Stoneford last week, the number of volunteers had swelled, with far more people below the age of 30 than any rally she had seen on TV, regardless of party.She checked her lock screen. The wifi network simply wasn’t accepting her connection.Mercy went to find Sullivan. The campaign manager for Rockwood for Governor sat in a corner, her face in a grimace as she stared at her laptop screen. “Barbie, I need to reset the router again.”“You see how slow our campaign site is?” Barbie said, ignoring Mercy’s request. “It’s been like this for days.”“Right, but right now the router needs a reboot.”Barbie nodded. Mercy went to find the router, which was hidden behind “Rover,” their single web server. Mercy thought it was a joke when she first saw it during her interview. Rover, Sullivan had explained, was Ellis’s beloved chocolate labrador retriever, passed two years ago. Behind Rover’s case was the router. Mercy retrieved a bent paperclip and pushed the reset button.“Fifteen volunteers today, can you believe it?” Sullivan said, as Mercy watched the router’s indicators blink back on. “We were lucky to have two or three on a given day not long ago.”“Fifteen?” Mercy counted the volunteers in headquarters: four on the phones, three folding shirts around a table, eight sealing letters in a corner. 15, plus Mercy’s phone and Sullivan’s laptop–Mercy went to one of the volunteers on the phone lines. “Hey, could you get off wifi for a few minutes?” she whispered. “I want to test a theory.”The man, who was speaking very loudly to someone on the other end about how Rockwood would save Tallahassee from itself, groaned. He pulled out his phone and switched off his wifi.Mercy waited another few seconds, then retried the connection on her phone. It connected to the campaign wifi network. “Okay, thanks.”“Great,” he muttered, “I can’t get on the network.”Mercy returned to Sullivan. “We need a new router. I think that model only allows 16 people on the wifi network at any given time.”“Why 16?”She shrugged. “It’s a power of 2.”“I’ll get some money from the petty cash,” she said. “Maybe it’ll speed up our website.”“I don’t know about that. It’s on an ethernet port, not wifi.” Mercy had thoroughly examined Rockwood’s campaign site. It was all static pages; the contact form led to his Facebook page, and a Donate button linked to his PayPal account. If anything, the site should be fairly speedy. “I’ll make sure something’s not bogging it down.”Mercy powered on Rover’s monitor. The first sign of trouble: Task Manager took ten seconds to launch. The CPU tab showed Rover’s old chip pegged at 96%, and its paltry memory hovered around 91%. Worse, she could hear its hard drive thrashing through the din of the volunteers around her.“Bad news,” Mercy said to Sullivan. “We need a new server.”Hosting the CampaignMercy was surprised at how long Rover had held out. Rockwood for Governor’s site ran on IIS 5.1, which was about as old as the OS on Rover, Windows XP. The pages, all static, had been generated with an obsolete version of FrontPage. That last bit Ellis had told her with pride.“Sure, I built the whole thing,” he said. “I made John’s first business page in 1998, back when no one knew what a web site even was.”“I’m sure a lot of companies did,” Mercy replied. “Amazon, eBay…”“Oh-kay,” Sullivan said, stepping between Mercy and Ellis. “We’re not here to criticize Ellis’s lovely site or Mercy’s skills. We just need to get the site on, what is it, a new server?”“More than one,” Mercy said. “I was able to check the server logs, although it took half an hour to get Rover to open them. It’s serving 500 requests a second, way more than it can handle. That little Pentium II in there is choking on all the threads spawned by IIS. After Rockwood’s speech last week, the site’s been linked to from Breitbart, Drudge Report, and Fox News. Another server won’t do. It needs to be hosted on the cloud.”“On a cloud?” Ellis asked.“Oh, you mean like, the servers over there—“ Sullivan waved her hands in a vague direction. “Not in the office, you mean.”Mercy’s throat tightened. Sullivan had probably heard it mentioned on the news, and Ellis was still stuck in 2001. “Right. Better hardware, better software. You can still use FrontPage, Ellis. The files will just be hosted somewhere else.”Mercy explained that Seashell Hosting, a Florida-based company, would be appropriate. They’d get access to robust, virtualized hardware, ample support (which she’d need, given that she specialized in web development and SEO, not IT), and she’d get the chance to rewrite it in a server-side language … if she could ever persuade Ellis.Sullivan frowned. “We need our site up and running as soon as possible, but given the expenses you outlined, I’ll have to take it up with John personally. He’ll be in the office soon.”Co-mingling DataAs soon as Rockwood reappeared in headquarters, Sullivan pulled him, Mercy, and Ellis into the conference space in the back. Rockwood sat, fingers steepled, as Mercy explained the situation.“You said it’s a Florida company?” Rockwood asked.“Absolutely. They host personal sites, small companies, even other campaigns.”“Other campaigns? Not my opponents, I hope. I don’t want Packard’s people anywhere near this.” Harold Packer was Rockwood’s Republican opponent. He and Rockwood were now neck-and-neck in the polls, while the Democratic challenger, Hewlett, was far behind. “Ellis, what do you think of all this? You built the thing.”“We definitely need some better hardware,” Ellis responded. “I don’t think the traffic will blow over, boss.” He glanced at Mercy, and she could see a slight curl to his lip. “I do believe Packard’s using Seashell Hosting, now that I think about it.”“I doubt it,“ Mercy said. She was pretty sure Packard was hosted on some ad-hoc solution. ”Even if that’s the case, the data’s all segregated. There’s no way someone from Packard’s campaign or anyone else could get access.”Rookwood’s eyes got a glassy look. “I don’t like this one bit,” he said, after a minute. “I don’t want our site in the ‘cloud’ or whatever. Some hacker could go in and change our page to show a drawing of me in some obscene position. Figure out something else.”Rockwood left the room, putting on his cheery game face for the volunteers as he did so.Ellis smirked.“I’ll show him that Packard’s not on Seashell,” Mercy said, pulling out her phone.“Let it go.” Sullivan put her hand over Mercy’s phone. “John doesn’t change his mind.” She turned to Ellis. “And you, bless your heart, what are you going to do about it?”“Wait for it to blow over,” he said.“Unacceptable.” Sullivan retrieved a platinum-colored credit card from her purse, the words “Rockwood for Governor” embossed on it. “Mercy, you have full rein on this. Get whatever hardware we need to keep our site up here in headquarters.”Attack of the DellsThe nearest big-box electronics store was a few miles away. When Mercy arrived, she went straight to a blue-shirted employee and asked him to grab a cart. “I need to see the most powerful desktop you’ve got that isn’t a gaming rig.”She left the store with nine consumer-grade desktop towers, a keyboard, a mouse, an input switch, a small flat-screen monitor, a sixteen-port gigabit ethernet switch, and a wifi router. The towers barely fit in her car: four in the trunk, four in the backseat, and one riding shotgun.Back at headquarters, a crowd watched as Mercy and two enlistees assembled the hardware near the T1 connection. She named them after the founding fathers, thinking it would humor the staff. washington Mercy designated as a firewall, which would run ipf; franklin was a load balancer, running Squid; jefferson became a mysql server; and the other six — hamilton, jay, hancock, adams, madison, and paine — would host Apache httpd.Meanwhile, Ellis stood in a corner, mouth agape.Mercy installed Ubuntu CLI, then the necessary software on each. Finally, Mercy copied the relatively tiny Rockwood for Governor campaign site onto each of the web servers. Everything set, she powered down Rover – which had been badly thrashing the whole time – and moved the ethernet cable from it to the firewall.Her consumer-grade hosting solution spun to life.Mercy checked her phone. Rockwood for Governor displayed in milliseconds, far less than the thirty seconds it was taking on Rover. Rover sat silent for the first time since she started working on the campaign.Covert CSS“We can scale it up as needed,” she said to Sullivan later that day. The servers soaked the hits from Breitbart and the other sites, none of their CPUs getting more than 30% usage. “That router has sixteen ethernet jacks. And that wifi router can handle up to 256 connections. Plus, with that firewall, Rockwood won’t have to worry about dirty pictures showing up on his website.”“That was almost $10,000 you spent today,” Sullivan said. "Seashell Hosting would have been cheaper.”Mercy nodded. “You can tell that to Ellis.”“Tell me what?” Ellis, who had been slack-jawed the entire afternoon, joined them. He had resumed his usual, smug appearance. “Let me get one thing straight,“ he said to Mercy. ”You are not Rockwood’s handler. You don’t get to tell him what to do. And you do not go behind my back.”Sullivan, who had rebuked Ellis earlier, was silent.“Hey, I’m just here for the job,” Mercy said. “Let me do it the best way that I know how.”Mercy turned back to Sullivan. “Another thing. With our new server software, we can build our own payment endpoint now. We could even build a blog into it, so Ellis doesn’t have to export it from FrontPage whenever Rockwood wants to issue a press release.”“Just don’t go changing the design,” he said. “That’s one thing the boss made clear. It looks fine the way it is.” He left them and went back to Rover, which he began to lovingly disassemble into a box.“About that.” Mercy showed Sullivan the website from her phone. “We need a mobile-friendly responsive design.”“But you just heard Ellis—““I won’t change the design at full resolution. I’ll just go in, pull out all those inline style declarations into a CSS file, change the markup from tables to divs, and add in some @media styles at mobile resolutions. It’ll be the same design. I’ll look just as ugly on a desktop, but less so on a phone or tablet.”“Fine,” Sullivan said. “But don’t cross Ellis. He and the boss are … well, bosom buddies, as they put it. That’s all I can say about that.”Sullivan left behind a blinking, confused Mercy, as her servers hummed behind her. Mercy knew one thing: Ellis was turning into the hardest thing about this job.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
Error'd: Please Ignore the Progress Bar
"Honesty like this should be rewarded - whole dialog box warning that the install progress bar is absolutely crap," wrote John A.
CodeSOD: isAlive
Why are we here? What is the purpose of life? What does it even mean to be alive?No, I haven’t been hanging out in coffee shops wearing a beret and discussing philosophy. I’ve instead been puzzling over this code, from Nikolai K.
Announcements: Tokyo TDWTF Meetup
UPDATE: April 22 will be the day!Tokyo readers, I'll be in your fine city this month -- and that means it's time for another Tokyo/TDWTF nomihoudai! It's always a fun time, and we've got a good group of regulars now. Here's a pic of a group of us from a past meetup:If you're unaware, nomihoudai is an easy way for a group of folks to get as much food and drink from the menu as they'd like for a set price over a set duration, without fussing over details like who ordered what and how many. While Japanese people often see this as a convenient offer, as an American I recognize it for the challenge it is -- and conquer it I shall!So, if you're up for getting together on Friday, April 22 in the Shinjuku or Shibuya area, please drop me a note via the contact form or direct, apapadimoulis/inedo.com. [Advertisement] Scale your release pipelines, creating secure, reliable, reusable deployments with one click. Download and learn more today!
The Pagemaster
Amanda supported and maintained a website through which clients managed their own data. Occasionally, she’d read through access logs in search of unwanted scrapers, rogue bots, and hack attempts.Her diligence paid off when she caught on to a particular IP that was making a huge amount of requests throughout the day. Page after page of results were being requested less than a second after another, as with a typical scraper bot:
CodeSOD: The Three Second Rule
The “Five Second Rule” is, of course, a myth. If you drop a food item on the ground, the bacteria living on the ground aren’t going to wait five seconds before moving in. Besides, everything you stuff in your face is already covered with all sorts of bacteria anyway. You have an immune system, you might as well use it.Adolphus Mannz recently gave his immune system a bit of a workout. In their SalesForce system, they needed a way to determine if a record was being added to the system or updated, and perform some slightly different logic in each case. His fellow developer came up with this rather ugly solution.This is in SalesForce’s APEX language:
Mercy the Mercenary in… Trouble at the Town Hall
Mercy Francis sat inside a drab, storefront office. The walls were covered in posters, captioned the words Rockwood for Governor, for a Righteous Florida! To her right was a map of Florida covered in multi-colored thumbtacks. Below the map sat an aging desktop machine. On its case was slapped a piece of masking tape marked Rover.Across from her sat Barbie Sullivan. She appeared to be in her fifties, just over five feet high, with a greying bob cut. She had introduced herself as the campaign manager.“For governor?” Mercy asked. “I thought primary season was over.”“Oh sure, but John Rockwood’s not affiliated with any party. He’s running as an independent.”“So the ad said you need someone to manage your online presence.”“Why yes,” Sullivan replied. “Most people who responded to our classified wanted $200 an hour just for consulting. Consultants don’t actually do work, and we really need someone who can get their hands dirty.”The consultants Mercy knew certainly did get their hands dirty, as Sullivan had put it, and $200 per hour was not unreasonable for their services. “I can do it for $50,” she said. “You can contact me 24 hours a day, and you’ll be my top priority above any other work I have.” Of course, she didn’t have any other work.Mercy showed her portfolio to Sullivan on her tablet. She had done SEO for several companies in Orlando, developed and designed web sites many others, but her portfolio site really showed off her design skills.“Oh wow, this is impressive,” Sullivan said. “I’ll bookmark this for later.” The campaign manager fired up her aging laptop, opened some ancient version of Internet Explorer, and laboriously typed in Mercy’s portfolio URL into the browser. Mercy gritted her teeth; her site downgraded gracefully through several versions of Internet Explorer, but anything below IE 11 made her subtle gradients and background images look like a magazine collage.“This is very impressive,” Sullivan continued, “but the boss really needs to sign off on this. I’ll talk to him after the event tonight and we’ll call you sometime Monday.”Mercy handed Sullivan her business card. Printed on one side was her email address and cell phone, and on the other were the words Mercy “The Mercenary Developer” Francis.As Mercy headed for the door, she heard Sullivan muttered something. “Why isn’t that live stream working?” Sullivan kept refreshing her browser window, staring at a black video player with an error message displayed in its center.Having freelanced since college, Mercy had developed a knack for knowing an opening when she saw one. “Anything I can help you with?” she asked the frustrated Sullivan.“Ellis was supposed to have this on an hour ago,” she said. “Harry Ellis, our media manager. He’s been bosom buddies with Rockwood almost as long as I have.” She eyed Mercy. “Do you know anything about ustream?”“Sure.”Sullivan offered Mercy her laptop. This version of Internet Explorer lacked a DOM inspector, so Mercy viewed the source instead. The ustream code was formed correctly, as far as Mercy could tell.“It’s not the code,” she said. “It looks like there’s no video data. I’ll make you a deal. I’ll go to this town hall or whatever and see if I can get that stream working. If I do, you pay me $30, otherwise I walk away with nothing.”“Oh, I’m sure Ellis will get it working before the boss is on,” Sullivan said. “In half an hour,” she muttered. “But why don’t you go lend a hand? If we offer you the position you’ll be working side-by-side with him. We’ll see about your $30 later.”Ellis InsistsMercy sped in her 10-year-old Honda to Stoneford High School, northwest of Orlando, where Rockwood was holding his town hall meeting. Sullivan had told her she’d find Harry Ellis, the campaign’s media manager, in the gym.The “town hall” held far short of a whole town, with maybe a few dozen people in attendance. The average age of the audience was around 50 or so. Most wore apparel blazoned with the flag.In the front row, staring into a laptop screen, was a man with a greying comb-over and a prominent chin. Beside him was some television station’s 80’s era camcorder on a tripod. Mercy made her way to him and introduced herself. “Sullivan sent me over to help with the live feed.”Ellis didn’t look up from his laptop screen. “You can help if you just shut up and let me do my job,” he said.Mercy would have left then and there, but she remembered how much beans and rice $30 could buy. Instead, she sat next to Ellis. He pulled his laptop screen close to his chest, squirming away from her.Around them came a smattering of applause. A tall man in his late 60s strode onto the platform that had been erected in the middle of the gym. Ellis started shaking his head, holding up a hand for the man to stop whatever he was about to do. Ignoring Ellis, the man turned on his microphone, waving down the elderly applause in the gym.“Ellis here says we’re not live, but I know you’ve been waiting a long time to see me, so let’s get this started.”Ellis closed his laptop. “So much for that.”Mercy yanked the laptop away from him before he had a chance to put it away. On the screen was a ustream profile page; in the corner, she could see he was logged in as JohnRockwoodCamp.“I’m so glad to be here, Stoneford,” Rockwood said. As Rockwood stumped in the gym, Mercy checked the stream settings while Ellis muttered next to her. Everything was set up correctly, as far as she could tell. It was set to record from a video feed coming through USB. Nothing wrong with ustream, then. Barring some issue with the laptop, the problem must be whatever camera he was using. It clearly wasn’t using the laptop’s webcam, so it had to be in the gym somewhere.She turned to hand the laptop back to Ellis, but he had left. She set the laptop on his empty seat.Mercy found a usb cable connected to the laptop. Unless Ellis was stupid enough to run usb halfway around the gym, the camera itself shouldn’t be more than a few yards away. She followed the cord.It led to the ancient camcorder on the tripod next to her.Out the corner of her eye, she spotted Ellis chatting with what looked like a police officer in the doorway.Meanwhile, Rockwood continued his speech, extolling the virtues of the native Floridian on stage.She examined the side of the camcorder, wondering how Ellis managed to connect a USB cable to something from the Reagan administration. Ellis had connected several dongles: USB to DVI, then to S-Video, then to the camcorder. The camcorder was on, the low-resolution video visible in the viewfinder. But the DVI-to-S-Video was paired incorrectly: the dongle down-converted from SVI to S-Video, not up-converted. Regardless, DVI was designed not to work with analog input. It would never have worked, regardless of what series of dongles Ellis had used to hook it up.The police office approached her, followed by Ellis.Mercy remembered that her smartphone had a ustream app, and she still had the charger in her purse. She lifted the heavy camcorder off the tripod, setting it gently in the seat nearby. She unplugged all the dongles, then plugged the end of the USB cable into her own, which went into her phone. She set the phone’s camera on record. There was no way to keep the phone on the tripod, though. So she took out her duct tape.“Time to go, miss,” the officer said.“I’m fixing your feed,” Mercy said to Ellis, ignoring the cop. She tore off a bit of duct tape, rolled it into a loop, and used it to stick her phone to one of the legs. “Why don’t you go check?” she said to Ellis.Ellis, fuming, went to his seat and opened his laptop. The ustream page showed Mercy’s phone camera footage in the player.Rockwood continued his speech. His eyes glanced back at the three of them around the tripod. After he finished his thoughts on the IRS and tax codes, he paused for nearly ten seconds, his eyes glazing over, trance-like. Then, he spoke. “You know, I just want to thank our volunteers for all they’re doing. I think they finally got us live. Could you give them a round of applause?”The audience did so. Ellis, caught in the act of throwing out the one person who was making Rockwood happy, faking a toothy, shark-like smile, and returned to his seat. The officer returned to the door, leaving Mercy with her duct-taped phone. She waved.“We have to make our state of Florida a better place for these young people. That’s why I have a proposal, one that none of my fellow candidates for the republican nomination would ever make. When I become the next governor of Florida, going to college at a state institution will be free. Not subsidized, not loaned out at high interest, free. Room, board, and everything else.”Before Ellis had another chance to toss her out of the gym, Mercy headed back to her apartment.Quite an ImpressionMercy drove to Rockwood campaign headquarters on Monday to pick up her check for $30. The storefront office was filled with volunteers, wearing “Righteous Rockwood” t-shirts. They were applauding as she entered.John Rockwood was making an impromptu speech in the back. “You young people are the reason why this campaign is going to change Florida,” he said. “The Democrats don’t own you, the Republicans don’t own you. You know Harold Packard, the Republican who’s foolish enough to run against me? He says you’re all a bunch of freeloaders. What he really means is that he’s scared of you. Well, I’m not scared!” More applause.The candidate finished his speech, and his volunteers dispersed. Meanwhile, Sullivan grabbed Mercy’s arm and led her to Rockwood himself. “You’re the one who helped Ellis get that video going,” the candidate said, shaking her hand. “What’s your name?”“Mercy Francis,” she said, wincing at his handshake.“Lord have Mercy,” he said, chuckling. “You know, I have never once used email, or used one of those smart-eye-phones, so I’m glad I have people like you and Ellis and Barbie over here to help me out.”As she spoke to Rockwood, Ellis spotted her and moved to intervene. Before he reached them, Sullivan moved between them with a graceful smile. “Ellis, this is Mercy Francis, our new online presence manager,” she said. “She’ll be working with you to get our online presence up to snuff.”“I don’t need her help,” Ellis said, pointing at Mercy.Barbie showed a sugary sweet smile. “Oh, yes we do. In fact, Rockwood asked for her personally, after she showed what an asset she was on Friday.”Ellis, fists clenched, spun on his heels and went back to his laptop.“That was quite an impression you left,” she said. “We’ll write a check, as we agreed. But I have a proposal.” She led Mercy to a windowless conference room in the back of the storefront. “Forget $30,” Sullivan said. “How does $3000 a month sound? Our donations have gone through the roof since his speech, and we have you to thank for that getting out there.”“Done,” Mercy said, shaking hands. [Advertisement] Onsite, remote, bare-metal or cloud – create, configure and orchestrate 1,000s of servers, all from the same dashboard while continually monitoring for drift and allowing for instantaneous remediation. Download Otter today!
Radio WTF: A Day of Mei
Radio WTF Presents!Jump to transcriptSoundcloud Links:Radio WTF: A Day of MeiDirect Download:ADayOfMei.mp3Starring (in order of appearance)Devin Sweeny... as Mei
Error'd: Saskatche-what's-it?
"I know we are special here in Saskatchewan but I don't think we need 10 different choices," wrote Mike.
A Meaty Problem
“The scales are down again, where the heck is Andre?”Roger had heard this cry often enough that he didn’t bother to poke his head out of his cubicle to see what the issue was. He worked for a meat-packing company. Sides of beef came in one side of the building, where they were sectioned and cut into smaller, grocery-store-friendly portions, and then shipped out the other side in refrigerated trucks. Along the way, the pieces of meat needed to be weighed multiple times. When the scales went down, production stopped.“I’ve got it,” Andre called out. “They’ll be back up in a second!”The scales weren’t Roger’s job. His job was making sure bills of lading and manifests and shipping instructions could be generated for every truck going out. That system was fragile and provided him more than enough work- he needed to integrate data from three different off-the-shelf ERPs and generate output suitable for each of their shipping partners (who all required different formats). Roger had enough problems without worrying about Andre’s scales.But damn, if those scales didn’t go down a lot.After a bad stretch of frequent outages, Pierre, the plant manager, had enough. Furious, he called the entire IT department into a conference room to give them a dressing down. He had a slide deck with charts and graphs documenting each of the IT failures that had impacted meat packing. “We pack and ship meat,” Pierre said as he paced in front of the projector screen. “This company’s been doing that since before you had this newfangled computer garbage, and we’ll keep doing it when computers get replaced by robots or whatever. All I want to know is, why are you screwing up my goddamn plant?”No one made it out of the meeting unscathed. Roger got called out because an outdated template file caused a shipping label misprint which left a truck sitting in the dock for two hours. There was one system, though, that represented the lion’s share of the issues on the graphs: Andre’s scale management system.After the meeting, Roger’s boss, Elene, pulled him aside. “Andre is really struggling,” she said. “And he says it’s an issue with communicating. Can you give him a hand?”Roger said “yes”, and sat down with Andre. “So,” he said, “you always seem to be able to fix the problem pretty quickly. What’s the underlying cause?”“Oh, well,” Andre said, “this cruddy scale system is like three hundred years old, and like anything built in the mainframe era, it only understands flat-file format instructions. To get data from our database and into the weighing system, I have to send it a file. Sometimes, there’s a locking issue, and I can fix it by just deleting the file.”“That would be annoying,” Roger said. “So you have to delete the file and resend it?”“Well, it’s not usually the file we send that gets locked. It’s usually the INI file.”“The… can I see your code?”Roger traced through the code, starting with the function that fetched data from the database. FindProductInfo was a pretty standard CRUD function, so he looked for places where it was called- like UpdateData.
CodeSOD: Scrubbed Inputs
In this age of JavaScript everywhere, developers have to come up with all sorts of ways to work around the uglier segments of JavaScript. For example, Aaron found this block, which promises to scrub “false-y” fields.
Tested Backups
The “Big Boss” of Initech’s Australian division ran the Sydney office as his own personal kingdom. Work- or workers- he didn’t care for was banished to the hinterlands of the Melbourne office. For example, IT services was a “useless sack of morons who only know how to spend money,” and thus the entire department was banished to Melbourne.Stewart C. lived in Melbourne, and was a new hire not long after the exile. The Melbourne office, with a 900km buffer zone protecting it from the whims of upper management, was actually a decent place to work. At least, until Brendan arrived.Brendan was an upwardly mobile middle manager based out of Sydney. One day, he did something to offend Tony. The scuttlebutt had a lot of rumors about what that was, ranging from “oh, he was late to a big meeting,” to “he took the last beer at the company party”. Rumors aside, the facts were clear: Brendan was in Melbourne with a long list of projects to manage, and he wasn’t going back to Sydney until he completed all of them.A few days into his exile, Brendan brought that list of tasks to Stewart’s cube. “Stewart. Stew. Stewie. I’m gonna need you to go ahead and test our backups, yeah? Make sure we can actually restore from them, right?”“That’s a great idea,” Stewart said. “So great, that we test them on a regular basis. I can send you a doc that covers our backup strategy-”“Right, yeah, but have you tested them in production?” Brendan asked.Stewart paused, making certain that he’d heard the question properly. “Well, no…”“Right then, yeah? They haven’t really been tested ’till we run them against production, yeah?”“We… really shouldn’t test things in production,” Stewart said. “I mean, what if the test fails?”Brendan shook his head and laughed. “Stewie, why would the test fail unless the backups are broken, right? Yeah, I’m gonna need a plan to cycle through every production server. Wipe it, restore from backup tape, and confirm it’s working, yeah? Right, so get on that. Orders from Tony, yeah, we need this by next week.”Stewart immediately got to work- on making sure this hare-brained idea didn’t go forward. He roped in his boss, who roped in her boss, and everyone was on the same page: this was a terrible idea that had no real benefit and carried with it too much risk and downtime. “Buuuuuuut,” his boss said, “it’s what Tony wants. We haven’t got the political clout to tell him ‘no’, so we’re going to have to do it.”Wind of Stewart’s attempts at killing the project got back to Brendan. This resulted in a rather nasty meeting invite demanding a “status update”. Stewart wasn’t the only invitee. When he took a seat next to Brendan, they were both staring at a speakerphone.The phone resonated with Tony’s booming voice and confident authority. “Well? What’s all this then?” he demanded.“I’ll tell you what this is,” Brendan said. “It’s just like you said, sir- everyone out here in Melbourne is lazy and obstructive, right? Yeah.”“You’re telling me crap I already know,” Tony said, his voice crackling on a bad connection. “Of course they’re useless, that’s why they’re out in Melbourne. Was there a point to this call?”“Well, yeah, right,” Brendan said. “I wanted you on the line for this because Stewart has been the worst, right? He’s been nothing but a trouble-maker disrupting my efforts and second-guessing me-”Stewart started to mount a defense, but he couldn’t get a word in before Tony’s laughter drowned him out. “Brendan, if you can’t handle the Melbourne office, how do you expect to cut it back here in Sydney? You just haven’t got the guts for this business, Brendan. Now, c’mon then, you’ve got your orders. Chop chop, and no excuses.”Tony ended the call, leaving Brendan and Stewart staring at each other in uncomfortable silence. Brendan was the first to break the silence. “Yeah, as you can see,” Brendan said, “this project has attention right from the top. So you’re going to give me a workable plan for testing all of the backups on the production servers by tomorrow- or else, right? Yeah.”Stewart nearly demanded, “Or else what?”, but decided against it. Instead, he wrote up his plan, noted the steps that involved downtime, and sent it to Brendan the following day. Brendan didn’t have any follow up questions, and nobody told Stewart to execute the plan, so he promptly forgot about it and got back to doing real work.Until all IT operations came screeching to a halt two weeks later. Brendan, as it turns out, decided he didn’t trust Stewart to run the tests. Instead, he strong-armed one of the junior technicians into doing it for him- but not until after making his own modifications to Stewart’s plan. Specifically, he wasn’t happy with the schedule- Stewart had very conservatively scheduled only one server to be tested a week, outside of regular business hours, so that any failures or issues would be minimized. That would have taken months, and Brendan wasn’t willing to wait that long, so he made the junior technician do them all at once. Without coordinating downtime.The result was every bit as catastrophic as one might expect, especially considering the junior technician didn’t think to order the backup tapes before starting the test, which meant they needed to be shipped from their offsite location. All in all, they lost two days of operations and a lot of reputation among their customers. Tony was furious, and he knew exactly who to blame: the “useless sack of morons who only know how to spend money.”Obviously, the folks in Melbourne couldn’t handle the complicated job of running IT services, so the IT department there was closed down at the end of the quarter and Initech hired on contractors to set up a new datacenter in Sydney. Stewart wasn’t particularly happy to lose his job, but he took some solace in the fact that he had prospects lined up- while Brendan didn’t.[Advertisement] Manage IT infrastructure as code across all environments with Puppet. Puppet Enterprise now offers more control and insight, with role-based access control, activity logging and all-new Puppet Apps. Start your free trial today!
CodeSOD: The Last of His Tribe
"The best thing about working here," Jaeson was told by his boss Renee on the walkthrough of the dev area on his first day, "is that we work closely with the customers, meaning you never EVER have to cash checks the salespeople wrote: you're only held to what your team promised." This sounded good to Jaeson, who was considerably more concerned about getting away from his previous company's open floor plan than the possibility of customer interaction, but hey, he'd take the icing on the cake. It sounded like he was in for a very productive time."Let's see, where to put you," mused Renee, glancing over the pods of cubicles. "Aha, I think Zebra Tribe will work." Zebra Tribe, it turned out, was the name of a scrum team; Jaeson would be working closely with the other members of that tribe, as they were called, in the coming months in order to accomplish tasks during sprints.Over the next three months of working in Zebra Tribe, Jaeson often thought back to that original introduction and laughed. True, there were no salespeople involved with the customers; however, in order to keep customer happy, engineers themselves were forced to promise things they knew wouldn't get done in the arbitrary time-box of a sprint. They were forbidden from explaining Scrum, as it "confused people", so instead had to speak in terms of releases, and nobody wanted to hear "It won't be in the next release, and we're not sure when it'll get done" as an answer. So they were forced to cram more and more work into sprints, leading to rushed work, mountains of technical debt, and no documentation. Even having a fifth man instead of a usual four-person tribe didn't help Zebra much."How are you settling in?" Renee asked, at the first so-called biweekly one-on-one three months in. She listened intently to his criticisms of the process before smiling and changing the subject entirely: "Well I've got good news for you. I'm moving you to Elephant Tribe after the current sprint."Elephant Tribe? thought Jaeson rapidly. I've never heard of Elephant Tribe. Hyena, Mongoose, and Snake, but Elephant? It wasn't a mystery for long; instead of a pod of cubicles like the other teams, Elephant Tribe had a single cube in the corner, where there was some space left over. In this lonely cube sat Bill, the Last of his Tribe, who was overjoyed to be given more resources to work with.Jaesan was given a second cube in a different corner; gone were the days of active collaboration and late-night nerf wars to keep morale up. He was also given a starter project to get up to speed on the ancient product that Elephant maintained. "We don't use scrum really," explained Bill. "Not much point with just me. Maybe it'll be different soon, though. I hear they're gearing up for a refresh project, keep the UI up to date. Good thing, too; I mostly do support these days. Hasn't been a real project on this thing in, oh... two years? Three?"Jaesan plunged into the task, getting familiar with the codebase. It was a brutal chore, but he managed to get the basic feature working with hardcoded parameters. Then he opened the configuration class.
Error'd: An Identity Crisis
Ari S. writes, "Not only was the poor computer running Windows XP, it also had to suffer through having the Apple keyboard and mouse attached to it.
CodeSOD: You Can't Always Count on Regular Expressions
After spending the most of the afternoon searching, trying to solve a rather vexing issue, Adam found exactly the solution he was looking for and wanted to squirrel it away for later reference.Sure - he could have added to "Favorites" in his browser like on every other website in the world, but there was something about the "bookmark" button on this particular site that called to him. It was more than a dumb link, it was a counter telling you how many people had bookmarked a resource, and you could bookmark it yourself.Also, it was the most calming shade of blue.Blame exhaustion, blame frustration, or even the fact that his remaining brain cells were delighted to see that 26 other souls had found this page bookmark-worthy - Adam threw caution to the wind, risked a stealth malware install and clicked on it.The thing was, instead of increasing by 1 as anyone would expect, it did so by 10."Shenanigans!" Adam shouted as he got to work, digging into the page's source and found the code responsible. (After all, who would be so sneaky that they'd increment a bookmark counter by an artificial amount just to make it seem like the page had been bookmarked more than it actually was?)As it turned out - the original coder, not knowing that you could extract the contents of an HTML node with the “text()” method, or similar ones, decided to give regular expressions a try.
A Signed Release
Brody and his team of contract developers were nervously awaiting a major update to TexOil's member website to go live. Between a complete overhaul of the site and massive database changes, it would be difficult to roll back if anything went awry. They were only responsible for developing the software, however. The task of the actual deployments fell to Lars' release team.The development and testing process had been rigorous, but Brody felt confident in his code after receiving UAT signoff the week before. There was even time for extensive load and stress testing this time around. Brody spent most of the weekend running builds and packaging up the code and database scripts so that Lars and Co. could prep the deployment first thing Monday. Lars strolled in an hour late Monday morning, seemingly unconcerned with the magnitude of the release before him. "Hey Lars," Brody greeted him. "It wasn't fun, but I got everything packaged for you guys to do your thing. So you should probably get started so we can hit the ground running tonight."Lars scoffed at Brody's urgency. "Chill out, BRO-dy. We got this. Since the last time we had a big nightmare release like this, my team created an automated deployment system. Things will go perfectly smooth, assuming you and your contractors did your jobs right."Brody brushed off Lars' snippiness as he recalled TexOil's last big release. Everyone involved pulled an all-nighter and worked 18 hours straight just to get the troublesome release stable. In the end, Lars' team had deployed the wrong code via human error. So the fact that they had automated deployments now was music to Brody's ears.TexOil's standard release window of midnight rolled around. Brody resisted the urging of his buddies to hit the bar earlier so he could be clear-headed for the release. Everyone signed in on time and joined the big conference call. "Ready when you are, Lars. Hit it!" Brody prepared to sit back and listen to the happenings and only get involved if things went sideways."Automated deployment - ENGAGE!" Lars shouted. In Brody's mind, Lars had just hit a button and a bunch of console windows were appearing then disappearing as their automated system updated everything. An hour went by without much chatter on the call. Brody assumed since the release was automated now, it would be quick. But he deduced there must be some kinks to work out.Getting impatient and tired, Brody broke the silence, "Hey Lars. How are things looking?""Well, the deployment worked just fine. I think there's something wrong with your code, though. All we are getting is ASP.NET errors when trying to bring up the websites. I thought you guys said this was signed off on?" Lars questioned in an accusatory tone."Um, it was. Everything worked fine in our UAT environment," Brody responded with concern. "What's the error you're seeing?""It's just some lame generic error. It says to turn custom errors off or something. If you guys are customizing stuff, I can't be expected to troubleshoot for you!" Lars shot back."Just send me the configuration file, Lars. I'll take a look," Brody said, expecting something to be amiss."Fine, but the way our automated deployments work, there's very little chance of a configuration error." Lars attached the web.config file to an email and shot it off to Brody.Brody popped open the XML configuration file in Visual Studio to check for the myriad changes that were required. One by one, he saw them. He started to think the configuration wasn't the problem and prepared to start debugging. But that's when he reached the bottom of the file and the distinct block of text that was Lars' e-mail signature sat there, looking horribly out of place. It was plastered with several squiggly underlines that were an obvious indicator that it wasn't valid XML."Lars..." Brody paused before asking a question he should never have to ask. "Why exactly is your e-mail signature in this config file?""WHAT?!" Lars shot back. "Give me a minute and I'll get this resolved." An awkward silence followed. Finally Lars spoke, "Ok Brody, the ASP error went away. We can have the testers hit this thing hard."Brody breathed a sigh of relief, but immediately began to wonder how that happened. "So Lars, how did that occur when you guys have the deployment automated now?""Well, you see Brody," Lars started, nervous. "What we have isn't FULLY automated yet. What you package up for us, I have an app that grabs that and throws it out on the server. Then I copy it by hand to the IIS directory. I also can't figure out how to make configuration changes with it yet, so I have a cohort do those, email the XML to me and I AUTOMATICALLY know to copy and paste it in to the web.config file. It's nearly a fool-proof system though!"Fortunately, Brody's phone was on mute so Lars and the rest of the conference call couldn't hear the stream of profanity he spewed at the sheer stupidity of this "automated" deployment. [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!
...42434445464748495051...