Feed the-daily-wtf The Daily WTF

Favorite IconThe Daily WTF

Link http://thedailywtf.com/
Feed http://syndication.thedailywtf.com/TheDailyWtf
Updated 2024-11-23 03:31
Error'd: The Reason is False
"Thanks for the explanation because thanks for the explanation because false!" writes Paul N.
The Second Factor
Famed placeholder company Initech is named for its hometown, Initown. Initech recruits heavily from their hometown school, the University of Initown. UoI, like most universities, is a hidebound and bureaucratic institution, but in Initown, that’s creating a problem. Initown has recently seen a minor boom in the tech sector, and now the School of Sciences is setting IT policy for the entire university.Derek manages the Business School’s IT support team, and thus his days are spent hand-holding MBA students through how to copy files over to a thumb drive, and babysitting professors who want to fax an email to the department chair. He’s allowed to hire student workers, but cannot fire them. He’s allowed to purchase consumables like paper and toner, but has to beg permission for capital assets like mice and keyboards. He can set direction and provide input to software purchase decisions, but he also has to continue to support the DOS version of WordPerfect because one professor writes all their papers using it.One day, to his surprise, he received a notification from the Technology Council, the administrative board that set IT policy across the entire University. “We now support Two-Factor Authentication”. Derek, being both technologically savvy and security conscious, was one of the first people to sign up, and he pulled his entire staff along with him. It made sense: they were all young, technologically competent, and had smartphones that could run the school’s 2FA app. He encouraged their other customers to join them, but given that at least three professors didn’t use email and instead had the department secretary print out emails, there were some battles that simply weren’t worth fighting.Three months went by, which is an eyeblink in University Time™. There was no further direction from the Technology Council. Within the Business School, very little happened with 2FA. A few faculty members, especially the ones fresh from the private sector, signed up. Very few tenured professors did.And then Derek received this email:
CodeSOD: Clean Up Your Act
Artie S. writes:
Table Driven Software
We've all built table driven software. In your engine, you put a bunch of potential callbacks into some data structure, perhaps a map, and call the relevant one based upon some key value. Then the calling logic that uses the engine has some structure that holds the key(s) of the method(s) to be called for some context. If you change the key(s) for a given context, then the corresponding method(s) that get called change accordingly. It's neat, clean, efficient and fairly simple to implement.At least you'd think so.Unless you run into one of those folks who believes that everything, and I mean everything belongs in the database.About 15 years ago, a mid level developer was tasked with creating a table-driven mechanism to call methods based upon values returned from a query to a remote system in real time. He took the phrase "table driven" literally. After I was hired, I was tasked with diagnosing and fixing the performance problems that were weighing down the application. This developer spent a little time explaining his table driven software to me (minus the fact that it was actual DB tables) and that this was highly efficient and couldn't be the source of the performance issues.There was a single stored procedure call named Engine which took as a hard wired argument the name of the method to call, and an arbitrary list of up to 100 pairs of parameter type and value strings. It would then look up the specified method name to see if it existed, and grab the user id from the environment and look up whether the user had permission to call said method. If so, it would parse the arguments until it hit a null, and based upon the specified types, verify that those types matched the ones configured for the specified method, build up a string representing the method call, exec it, grab the results, and spit them back as a delimited string in a single output parameter.It looked something like this:
CodeSOD: Strung Out Properties
Microsoft recently announced that they’re changing how they handle .NET languages. Up to this point, the focus has been on keeping them all feature compatible, but going forward, they’ll be tuning VB.Net towards beginners, C# towards professionals, and F# towards people who have to use .NET but want to “be functional”.VB.Net’s biggest flaw is that it’s inherited all of the Visual Basic programmers. You may be able to write bad code in any language, but I’m not convinced you can write good code in VB6 or earlier. Those bad habits, like Hungarian notation, can mark out “modern” code written with a distinctly “non-modern” mindset.Like this:
Error'd: Garfield Only Wants the Best for You
"I have two questions: First - Why make the dropdown go all the way down to 1908 if you don't want people selecting it? Second - Why can't I view garfield.com if I'm 101 years old?" wrote Tom.
Software on the Rocks: Episode 1: Traveling Angular
Welcome to Software on the Rocks, the Daily WTF podcast. This is a new feature we’ll be running on a bi-weekly basis for a first season of a few short episodes. If folks like it, or more important, if we really like doing it, this may continue, but for now, we’re committed to season of 6 episodes.In this episode, Alex and Remy discuss ruining the site, the dangers of booking airline tickets, and why Angular 2 is absolutely the best possible framework for those who love lots of boilerplate.This episode of Software on the Rocks is brought to you by Atalasoft.Tune in two weeks, when we’ll have special guest, Justin Reese of Code & Supply, to discuss software communities and the value of a good bar. Follow future episodes here on the site, or subscribe to our podcast.Direct MP3 DownloadTranscript Welcome to software on the rocks, a daily WTF podcast brought to you by Atalsoft.Remy ® So, I guess we are going to do a podcast thing. This is one of our new things and I guess I probably should take it lame. Hello everyone, welcome to software on the rocks, I’m Remy Porter, chief editor of the daily WTF and responsible for single heading, ruining the site, if I judge by the comment section.Alex (A): Hi everyone, this is Alex and I started daily WTF and still tried to take all the good credits for it. And any times someone complain, just really blame on Remy. I remember starting WTF in 2004 or something like that and literally in the 2 months it had been going downhill. I don’t know…R: The high of the first day. Let’s talk about why we are doing a podcast: we have been doing periodical sponsor posts and this is really not a site that makes a lot of money by driving traffic.A: WTF it could be probably be a full time job, if we were able to turn it into a proper media publication, but it is a hobby site. It’s not free, there are server bills and other expenses and in order to pay for that you could just get google ads, but we wanted to do something different and that is why we have a handful of sponsors. By enlarge they are taking care of the website costs. One things that we wanted to do by giving sponsors, was starting a podcast, so thanks to them we are doing it.R: Atellasoft is a vendor that makes SDK for doing document imaging: scanning documents, storing and processing them. It seems like a relatively good idea to solve the problem and I don’t see other good solutions.A: well, they have been around forever and have a solid community and product and I would recommend to just check them out.R: one of the bullet thing that they do: web scanning for dot net. So they do scanning from a Java script API, which is a funny possibility. It brings back one of the projects I worked on. This was for a company called TPG industry. They almost certainly made the paint on your car. They care about colour, that means a lot. This is something that as a developer I really simpatize with: they make the paint. They take it to GMs factory and than GM applies the paint to the cars. The application process has to be extremely tightly controlled, because if the pressure used is wrong, the colour will come out different and when you will put the bumper on the car, the colour will be different of the one of the fender. And so they will get in fight with their customers: GM will say “the paint you gave us is bad, because we sprayed them to the fender and it doesn’t match the bumper. But then TPG says “no, the paint we gave you was good, we fulfilled your requirements, you are using it wrong”.A: I’ve never heard that before in any other industry, that’s amazing.R: They have a device, that behind the scenes launches a windows executable. What we deploy just launching the webserver on the user’s machine and from the browser we can do cross-orange requests to the webserver running locally on their machine.A: So he built a website that downloaded a thick client, then installed the webserver, than used it to do all the hard work stuff.R: YepA: It seems like not the easiest way. Why don’t just have the desktop UI than?R: They didn’t want it, they wanted a web browser based UI. What is your hobby outside this?A: That’s a funny way to drive that requirement I guess. So, what are you doing now?R: The hobby that pays the bills is that I am consultant, I’m good at training and this weekend I’m teaching a group of people to use Angular 2-A: Wow, I’ve heard a lot of wonderful things about it, mostly from you, even if I don’t do a lot of web developing.R: Yes, I really love it. What I appreciate the most about Angular 2 is the big quality of sheer boiler plate. I want to have a series of project files that have nothing to do with my business that simply need to exist, so the application needs to find its own hustles.A: Yes, you right. The advantage of having a giant number of files is that it gives the developer a sense of responsibility, it makes you really feel like you are building a web application. I see angular 2 more like the shitty sequel of regular 1R: Yes. If you write code that works with angular 2, it might not work tomorrow. Angular 2 didn’t care to make angular perfect: which each single release changes completely the program. That is the framework that they are giving you a product, that is goodish.A: Some might say it’s bad product management, but I say it’s brave. If you just needed to upload angular and your code works, where is the fun in that? More applications should be doing that.R: Sure! Furthermore, angular is creating new jobs, because of its complexity. But, putting the sarcasm down, I will definitely admit that there are actual benefits from Angular’s approach. A while back I took a course about leading business improvement and me and the teacher had the same approach: we look at a process and model it. IT people when they see a complex process try to automate it. My solution is to delete the process, so it’s not a problem anymore. I think that is a big cultural problem.A: Yes, they are engineering a poor solution to an irrelevant or misunderstood problem. What have I been working on lately… oh booking airplanes tickets. What is fascinating to me about the airline industry is that it existed before information systems were a thing. All their fair rules are so deeply ingrained in the process that it is incomprehensible. Why not just simplify the way airlines work? If you start from scratch you will easily find a solution for that business problem than implementing the absurd business requirements.R: But then you see something like South West Airline. What they did when they entered the industry, they did throw away lot of the legacy craft: they standardize their process and that is why circa 2002 every management magazine was “what is South West Airline doing now?”. But it’s the same idea: can we simplify the process?A: They did it rapidly, we are talking about years not decades. They adapted to very fast changes in the market. That is all what this agile thing is all about.R: It seems that might be one of your problems now.A: Yeah, here at DevOps my job is to take ideas into reality quicker and to collaborate with different teams. It’s easy, but sometimes anyone is in a different trench and is thinking about a small problem, without collaborating.R: Sometimes they want to do something different, but as you said, organizationally they can’t.A: They recognize that the 6 months process sucks. The devup’s software will give you the possibility to release in less than 6 months, which is amazing for them.R: developers have fund a new solution, even better than devup that gives you feedback and doesn’t require automation.A: we call that develop misconstruction’s Basically you take a bad software and you run it to the customers, waiting for bug feedbacks and when they come you make the adjustments. They are accepting a low quality process and product. Having a half working product is totally acceptable for this companies, which is very sad to me.R: the idea of risk management is something that IT doesn’t take really into consideration. All this things are rooted in risk management and risk tolerance.A: this is an important topic, but nobody is going to care if we call out this things.R: we believe that risk management is something important to talk about. We need a buzz-word and would love to see some ideas in the commentsA: furthermore, for future episodes we would love to bring up a guest, somebody outside usR: yes, there are already some people aligned up.A: this is going to be fun, I’m exited and hope we can keep it up.Machine Generated Transcript [BREATH] and.
Representative Line: Someone Hates These Interfaces
Let’s start with a brief lesson on .NET. .NET, like most OO languages, needs the ability to perform “cleanup” when an object finally dies. One option for this is the Finalize method, which is called when the memory is freed, but since it’s the garbage collector’s job to do that freeing, you have no idea when (or even if) that will happen.To solve that problem, .NET has an interface, IDisposable. The I, of course, is one of the lonely last relics of the tyranny that was “Hungarian Notation”. Classes which implement this interface have a Dispose method, which should be called by an instance’s owner to trigger cleanup (or can be auto-invoked through some nice syntactic sugar).As an interesting, and odd quirk, classes may implement interfaces privately, so a disposable object might have a private Dispose method, that can only be invoked if you first cast to IDisposable.There was a different problem .NET had, specifically, “wouldn’t it be nice to have a way to safely extend objects without inheriting?” Thus came “extension methods”. These are essentially static methods that simply take an object as its input and perform some operation on the object, but can be invoked as if they were class members.For example:
freE-Commerce
Douglas had just joined a large eCommerce company that was constructing its own in-house PHP development team. It was a big step for them, as they only relied on cheap freelance c0derz to get things done before. Because of this, Douglas and his cohorts had to maintain a glut of legacy applications made by people who were long gone.A vast majority of the horrid legacy apps were created by a man simply known as Shayne. The sight of his name in the code comments would send icy chills down Douglas' spine. Shayne was freelance down to the very definition of it. His signature philosophy to coding seemed to be "roll your own" and his framework weapon of choice was a version of CodeIgniter that was two years out of date at the time he utilized it.One of the more egregious examples of Shayne's hand-rolled disasters was the authentication script he reused on every site he built. Because of his custom session-generation code, a user could log in to one of his websites and copy the 'session' cookie (which contained hashed user details, rather than a unique session ID) to another Shaynesite. From there, they could instantly log in to it, regardless of whether they had the authority to do so.The authentication script, however, had nothing on the poison marsh that was Shayne's eCommerce platform. The platform was developed a few years prior and used to build up the rest of what was supposed to be the company's triumphant new version. Douglas was brought in at the 11th hour to give it a once-over before it got deployed. It didn't take long for him to find an entire mast's worth of red flags.Within half an hour, he found five separate ways to get a free order out of the system. Simple methods involved changing the cart value to '0' in a hidden input since the back end didn't validate the cart total, and more complex methods like spoofing a 'success' callback from card processor WorldPay. Since the application only checked the order ID (which was available prior to the payment stage) but neither the server origin of the payment callback nor the shared secret; the system would be fooled into thinking that an order had been successfully paid for.Douglas immediately brought his findings to his supervisor and informed him that under no circumstance should it be released as-is. He was convincing enough that the brakes were pressed on the release, but the resolution option his boss presented was less favorable, "I'll see if we can dig up this Shayne's phone number and try to get him back in here to fix this mess!"The colorful, four-letter language Douglas used in reply to that suggestion probably should have been enough to get him fired. Fortunately, his boss used more colorful vocabulary daily. Douglas again swayed him to under no circumstance let Shayne in the door ever again. Wanting to make a good impression, Douglas committed his nights and weekends for the foreseeable future to cleaning up the disaster. But before he did that, he began drafting a letter of recommendation to Amazon to hire a great talent like Shayne. Because who wouldn't love to be able to get a bunch of free stuff from Amazon? [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
CodeSOD: Overloaded Loop
Brian found himself digging through some C++ code, trying to figure out a cross-thread synchronization bug. It had something to do with the NetLockWait function, based on his debugging, so he dug into the code.
Error'd: Not so Smart on Sundays
"Every Sunday my 'smart' watch does this. Other days, it displays an abbreviation of the day," wrote Lawrence W.
Who Backs Up The Backup?
A lot of the things we do in IT aren't particularly important. If this or that company doesn't sell enough product and goes under, it sucks for the employees, but life goes on. Sometimes, however, we're faced with building systems that need to be truly resilient: aviation systems, for example, cannot go down for a reboot midflight. Government services also fall toward the "important" end of the scale. The local mayor's homepage might not be important, but services like Fire and Rescue or 911 are mission-critical.The control room Kit was installing needed to be up 24/7/365, presumably only allowing a maintenance window every four years. The building was designed to be fireproof, terrorist-proof, electronic-evesdropping-proof, you name it. This was going to be one of the most secure, resilient rooms in the entire city, and we're not talking about a small city, either.Kit hooked up the servers to power. The power had been designed with two independent feeds from two separate substations, with a huge UPS in the loft (to keep it safe from potential floods) with a twelve-hour capacity. The basement housed two diesel generators, and if all else failed, there was a huge socket on the garage wall to allow a transport container generator to be plugged in.It was an excellent design—but you know what site you're on, so you can guess how it all worked out.Kit was in the middle of commissioning and testing the systems they'd installed. Everything was looking good in the control room, and the customer was running some training exercises.Then, it happened: the servers stopped responding.The terminals remained on, but there was clearly nothing for them to connect to. This was around 1990, so it was still very much a mainframe setup. Kit's team headed to the equipment room, only to find the gut-wrenching sight of dead machines: no lights, no fans, nothing.It has to be the power, Kit thought. The system was working five minutes ago, and they're redundant servers. They wouldn't all just break down.He was sweating, but tried not to let his team see. "All right, let's check the UPS," he declared, trying to sound casual."This way," replied one of the techs, leading him to the stairwell ... and down the stairs."Isn't the UPS in the loft?" Kit asked, frowning."No, sir," the tech replied with a grin. "Turns out the floor up there isn't rated for the weight of the lead acid batteries."The best laid plans of mice and men ... Kit thought, then shook his head.Twenty minutes later, the UPS checked out fine. It wasn't flood-proofed anymore, but there wasn't any water, so it ought to have been working. The diesel generators had kicked in, which was why the overhead lights were still on. There had to be some kind of wiring mistake for the servers.Kit traced the wires, mentally correcting the specification to account for the relocated UPS. That led him back to the equipment room without any obvious sign of fault other than "equipment not working." After pulling open a wall panel, he were able to figure out the mistake pretty quickly: the servers were powered by the UPS, but the switch was hooked to the raw mains, and everything was designed to shut off if the switch went down.Kit rubbed his forehead, sent a tech to check all the outlets, and kept looking for any other bonehead moves.The control room power didn't route through the equipment room. When Kit ran a check, half the gear in that room didn't seem to work, either. It had power, but the communication was down.This was all fine before the power went, he reminded himself. Now where's that intercom switch?Then he remembered: the training room. You see, due to the massive amounts of equipment needed to run the control room, there wasn't any space for the communication switches. The nearby training room, however, had much less equipment in it, so they'd moved the switches there.Sure enough, as Kit poked his head into the training room, he found the whole place dark. Who'd want to train during an emergency? Nobody, that's who. So why bother with redundant power? Save the juice for the important rooms—which now couldn't function because they were missing key components.Only one question remained: why did the power go out in the first place? It wasn't a scheduled disaster drill. There were two redundant power lines coming in, so it would've taken something massive to knock them both out. Was one of them disconnected? No; Kit had been there when the electrician went over the wiring, and had seen him sign off on it. Concerned, he wandered out back ... and immediately facepalmed.Both cables came into the building at the same point, so they could both be fed into the same grid. That point was currently occupied by a small backhoe and some frazzled looking contractors.Mystery solved. [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
CodeSOD: Checked Numbers
Dealing with types in dynamically-typed languages is always a challenge. Given a variable, does it hold a string? A number? An object? Without inspecting it, you have no idea!Thus, most of these languages have methods for inspecting variables, where you can ask questions like, “is this a number?” and then decide where to go from there. This can make validating your inputs a bit more difficult.Of course, this code Joe found might make it more difficult than it needs to be:
Predict Correct
Steven was an engineer at a US-based company whose leadership had decided to take some dramatic cost-saving measures. A mandatory company meeting convened at 12:00PM, with nary a crumb of food in sight, to allow management to make their big announcement:"We're opening an office offshore, and one of the first things we'll be transitioning there is product documentation."Ah, transitioning: a nice way to say they were firing every US-based tech writer immediately. From that point forward, the engineers would have to send notes on product features to the offshore team, who would then compile the documentation.Steven was nervous about the prospect. He'd had a good working relationship with the tech writers. They could take his notes, add their personal experiences with the products, and compile it all into something useful (for the rare user who actually bothered to look at the manuals). Hesitantly, he raised his hand. "Will the offshore team be trained on our products?""Don't worry. We're working with a consulting company that's helping us hire the best talent available," the meeting presenter assured him with a saccharine smile. In other words, No way in hell. Steven saw through the ruse, but didn't have the guts to call it out. No one else did, either. After all, no one wanted to give management the idea that perhaps engineers were just as replaceable as tech writers.They had no choice but to wait and see. With any luck, the hiring firm would find some good writers, at least.A few weeks later, Steven sent off his first round of notes and crossed his fingers. Unfortunately, what he got back was his own notes copied and pasted into the standard manual template, surrounded with typos and broken English.No, wait, they hadn't just copied his notes. They'd tried to "improve" upon them. In one case where Steven explained the behavior of a quirky installer, he'd written:
Best of Email: The Mailing List
The Best of Email feature is not one that gets a lot of traffic these days, but this particular submission couldn’t fit anywhere else. It started when Justus got a ticket: “customer spam filters are blocking our emails”. How on earth was he going to fix customer spam filters? He almost replied as much to the ticket, when he noticed that the end user had helpfully attached a sample email.This was the “to” line… and I present it here in its entirety, exactly as supplied by Justus. I apologize to mobile users in advance:
Error'd: Nicht Gesprochen
"I can't read German, but that doesn't look like glowing praise," writes Bruno G.
Unstructured Data
Alex T had hit the ceiling with his current team, in terms of career advancement. He was ready to be promoted to a senior position, but there simply wasn’t room where he was- they were top-heavy as it was, and there were whispers among management of needing to make some cuts from that team. So Alex started looking for other openings.There was another team at his company which had just lost all of its senior developers to other teams. Alex knew that was a bad sign, but in general, climbing the career ladder was a one-way street. Once he had a senior position, even if it was terrible, he could transfer to another team in a few months, keeping his senior title and salary.Perry was the team’s technical director. “I’ve been laying out the TPM architecture for years,” Perry explained, “and you are going to be part of implementing my vision.” That vision was an Internal Framework called “Total Process Management”, which, as the name implied, was a flexible business rules engine that would manage all of their business processes, from HR, to supply chain, to marketing, it would do everything. “We’re bringing the latest technologies to bear, it’ll be based on RESTful microservices with a distributed backend. But we need to staff up to achieve this, so we’re going to be doing a lot of interviews over the next few months, you and me.”Alex knew he could apply for another internal transfer after six months. He already saw this was a disaster, the only question was how disastrous would it be?While the code Perry had him writing was an overcomplicated mess of trendy ideas badly implemented, the worst part was doing the interviews. Perry sat in on every phase of the interview, and had Opinions™ about everything the candidate had on their resume.“You used Angular for that?” he demanded from one candidate, sneering, and drawing a bright red “X” on their resume. He criticized another for using a relational database when they could have used MongoDB. One interview ended early when the candidate admitted that they didn’t spend their nights and weekends hacking at personal projects.The worst part, for Alex, was his role in the technical screens. He’d read about the failures of white-board programming, the uselessness of asking trivia questions: “How do you reverse a linked-list?” wasn’t exactly a great interview question. He’d planned out a set of questions he thought would be better, and even some hands-on coding, but Perry nixed that.“I want you to build a test with an answer key,” Perry said. “Because at some point, we may want to have non-technical people doing a first-pass screening as our team grows and more people want to join it. Use that in the technical portion of the interview.”Interviews turned into days, days turned into weeks, weeks into months, and eventually Perry brought in Jack. Jack had worked at Google (as an intern), and Perry loved that. In fact, through the whole interview, Perry and Jack got on like a house on fire, smiling, laughing, happily bashing the same technologies and waxing rhapsodic over the joys of using Riak (Mongo was so last year, they were junking all of their database access to use Riak now).Eventually, Perry left and it was Alex’s turn to recite his test, and compare the results against his answer key. “What’s a linked-list?” he asked, dying on the inside.“It’s a navigation widget on websites.”Alex blinked, but continued. “How does a linked-list differ from a doubly-linked-list?”“A doubly-linked list has a pop-up menu so you can have more links in the list,” Jack said.For the first time since he’d written his test, Alex was actually excited to see the results. Jack wasn’t just wrong, he was finding incredibly new ways to be wrong. He claimed a binary-tree was a kind of legacy hard-drive. Or RAM, perhaps, it wasn’t really clear from his answer. Design Patterns were templates you could use… in Photoshop.Alex thanked Jack for his time, sent him on his way, and then went to compare notes with Perry.Perry was positively beaming. “I think we found a really great candidate,” he said. “Jack’s sharp as a tack, and is definitely a culture fit. What did you think?”“Well,” Alex started, and then stopped. Perry was difficult to handle, so Alex decided that he should be as diplomatic as possible. “It started pretty well, but when we started talking about data-structures- he was really weak. It’s a bad sign. We should pass.”“That’s probably not a big deal,” Perry said, “I don’t care if he knows Oracle or not. We use unstructured data.” [Advertisement] Atalasoft’s imaging SDKs come with APIs & pre-built controls for web viewing, browser scanning, annotating, & OCR/barcode capture. Try it for 30 days with included support.
CodeSOD: Popping a Plister
We live in a brave new world. Microsoft, over the past few years has emphasized, more and more, a cross-platform, open-source approach. So, for example, if you were developing something in .NET today, it’s not unreasonable that you might want to parse a PList file- the OSX/NextStep/GNUStep configuration file format.But let’s rewind, oh, say, five years. An Anonymous reader found a third-party library in their .NET application. It never passed through any review or acquisition process- it was simply dropped in by another developer. Despite being a .NET library, it uses PLists as its configuration format- despite .NET offering a perfectly good in-built format. Of course, this C# code isn’t what we’d call good code, and thus one is left with an impression that someone hastily ported an Objective-C library without really thinking about what they were doing.For example, perhaps you have an object that you want to convert to a binary PList file. Do you, perhaps, use overriding and polymorphism to create methods which can handle this? Do you perhaps use generics? Or do you ignore all of the benefits of a type system and use a case statement and compare against the type of an object as a string?
Announcements: Sponsor Announcement: Hired
There are certain tropes that show up in our articles, and judging from our comments section, our readers are well aware of them. For example, if a manager in a story says, “You’re going to love working with $X, they’re very smart,” it’s a pretty clear sign that the character in question is not very smart, and is almost certainly sure to be TRWTF in the story.Part of this is narrative convenience- we try and keep our articles “coffee-break length”, and dropping a few obvious signals in there helps keep it concise. Most of it, however, really boils down to the fact that reality is full of certain patterns. The world is full of people who aren’t half as smart as they think they are. There are legions of PHBs ready to micromanage even if they haven’t a clue what they’re doing. And there are a lot of employers that can make a terrible job sound really great for the duration of the interview process.Let’s focus on that last bit: finding a new job is hard. Finding a good job is even harder. At its worst, you end up suffering your way through a horror story that ends up on this site (so hey, Internet “fame”, it’s not all bad, right?). Maybe you just end up trading hours of your life for a paycheck, doing work that you don’t hate but you don’t love. If you’re really lucky, you land something that you really care about doing, and you get paid exactly what you’re worth.And let’s not even get into the job search process- it’s stressful and eats enough time to be a job in itself. You have to dance around recruiters who just want the commission and don’t care if the job’s a fit for anyone involved. You chuck your resume on job sites, which might as well be a black hole. You can end up investing countless hours into a company’s interview process only to get an offer that isn’t sufficient, or to discover that the company culture isn’t what you were looking for.Which brings us to our newest sponsor, Hired. Hired flips the script on the traditional job site. Once you fill out a simple application, employers start applying to interview you, instead of you applying for an interview. Whether you’re looking for a full-time or a contract gig, whether you’re looking for engineering, development, design, product management or data-science- Hired will match you up with top employers.And “top” doesn’t mean “gigantic” or “corporate”. Sure, there’s companies like Facebook on there. But in their pool of over 6,000 employers, they have everything from titans of industry to small startups, spread across 17 major cities in North America, Europe, Asia, & Australia.Okay, sure, there are lots of companies you might work for there, but what does this “apply to interview you” stuff mean? It sounds like marketing copy that Remy just pasted into this article to make the sponsor happy, and you’re right- but it’s also so much more.Once you have filled out Hired’s application, employers who are interested in your profile will send you a personalized interview request which includes salary information up front. Hired’s going to provide a “talent advocate” who can provide unbiased career advice to help you put the best foot forward. And Hired solves one of the worst problems of the job search: they hide your profile from current and past employers, so your boss will never find out you’re searching for a new job until you’re ready to tell them.And most important: you’ll never pay a dime for this service. So try it out and plan your next career change. [Advertisement] Otter, ProGet, BuildMaster – robust, powerful, scalable, and reliable additions to your existing DevOps toolchain.
The 3,000 Mile Commute
A true story, recounted from personal experience by our own Snoofle.Many decades ago, DefCon Inc, a defense contractor working for the US military was attempting to get awarded a new contract to build some widget needed for combat. As part of their proposal, they wished to demonstrate that they had the available staff to dedicate to the project. Toward this end, they hired more than 1,000 assorted programmers, project leads, managers and so forth. The military folks that were evaluating the various proposals saw a slew of new employees that were completely unfamiliar with the relevant processes, procedures and requirements, and awarded the contract to another firm. In response, the contractor laid off all 1,000 folks.A few months later, another such contract came up for grabs. Again, they hired 1,000 folks to show that they had the staff. A few months later, that contract was also awarded to another contractor, and again, all 1,000 folks were laid off.This repeated a few times over two years.After all of this, the base of available employees was wise to the very short repeating hire/fire cycle, and the contractor was unable to attract anyone beyond folks fresh out of school. Finally, some C-level executive realized that all of these people just out of school were far cheaper than the experienced developers that were on staff and those that they had previously hired and fired for the potential projects, and so issued an edict that all in-house senior staff was to be cycled into cheap young employees. It took two years, but it happened.Now that their payroll was drastically reduced, and they had royally pissed off the potential pool of experienced developers, they could increase their permanent headcount without increasing their long term payroll costs - by hiring only young, inexperienced developers - which enabled them to finally get awarded a contract.Unfortunately, all those junior developers had very little experience, and there was nobody at the firm who had been through the war to guide them. As a result, their two year contract yielded a flaky project that frequently crashed, acted unpredictably and could not be modified. When you're dealing with a system that can shoot at and blow things up, these are not desirable or tolerable attributes.At some point, some high level exec realized what had happened, and forced the company to stick a crowbar into its pocket and hire some highly paid consultants. Unfortunately, the HPCs remembered the hire/fire cycle and wanted nothing to do with the place. After some time, this led to substantial sweetening of the pot until a few experienced folks finally agreed to come on board as full time employees. This happened in New Jersey.After management got the new folks up to speed on the project, the new folks said Hold on; there's a gaping hole in the middle of this project! Management replied that this part of the project was classified and could only be viewed by folks with secret clearances, and from the facility in California. OK, so relevant clearances were applied for and granted, and the senior folks were assigned to go to the CA facility for two weeks.Before agreeing to go, the developers wanted some information as to how they'd be able to access this stuff after being familiarized with it since it could only be accessed from CA, and they all lived and worked in NJ. They were told that they'd be advised of the details when they got to CA.OK, they all fly to the Left Coast, get settled in their hotels and go to the office.At this point, they were informed about all of the problems that had to be fixed. On Thursday of the second week, it was determined that there was about two years of work to do all of the retrofitting that needed to be done. Again, the developers all asked How will we access this stuff from NJ? The managers replied that it had to be done locally, and that they would all be located locally for the next two years. Starting Monday.Wait; they don't get the opportunity to discuss it with their spouses? How it might affect the kids to have one parent away 90+% of the time? Would they be willing to live in hotels and airports for two years? Why the F*** didn't they just hire talent at the CA location instead of NJ?It turns out that because the contractor is based in NJ, the personnel they hired needed to be based there as well. Of course, had any of this been mentioned before people were hired, most (if not all) of the folks they hired wouldn't have accepted the jobs. If they had known, none of the folks would have even gotten on the plane to go for the briefing and ramp-up required to familiarize themselves with the project.Needless to say, Thursday afternoon was spent with managers barking demands about sacrificing for the company, and developers saying WTF?! Thursday evening was spent with countless phone calls home. Friday morning was spent with everyone resigning and heading for the airport to go home.The representatives of the military acted as decent folks and were very understanding as to why people wouldn't just leave their homes and families for two years. They were far less sensitive when it came to holding the contractor to their promise of an on-site experienced staff to do the work.In the end, the contractor was fired and a new one was hired to clean up the mess. [Advertisement] Atalasoft’s imaging SDKs come with APIs & pre-built controls for web viewing, browser scanning, annotating, & OCR/barcode capture. Try it for 30 days with included support.
CodeSOD: Eventful Timing
I once built a system with the job of tracking various laboratory instruments, and sending out notifications when they needed to be calibrated. The rules for when different instruments triggered notifications, and when notifications should be sent, and so on, were very complicated.An Anonymous reader has a similar problem. They’re tracking “Events”- like seminars and conferences. These multi-day events often have an end date, but some of them are actually open ended events. They need to, given an event, be able to tell you how much it costs. And our Anonymous reader’s co-worker came up with this solution to that problem:
Error'd: Banking on the Information Super Highway
"Good to see Santander finally embracing modern technology!" writes Sam B.
CodeSOD: Extended Conditions
Every programming language embodies in it a philosophy about how problems should be solved. C reduces all problems to manipulations of memory addresses. Java turns every problem into a set of interacting objects. JavaScript summons Shub-Niggurath, the black goat of the woods with a thousand young, to eat the eyes of developers.Just following the logic of a language can send you a long way to getting good results. Popular languages were designed by smart people, who work through many of the problems you might encounter when building a program with their tools. That doesn’t mean that you can’t take things a bit too far and misapply that philosophy, though.Take this code, sent to us by “Kogad”. Their co-worker understood that objects and interfaces were fundamental to Java programming, so when presented with the challenge of three conditional statements, they created this:
A Case of Denial
On his first day at his new job, Sebastian wasn't particularly excited. He'd been around the block enough times to have grown a thick skin of indifference and pessimism. This job was destined to be like any other, full of annoying coworkers, poorly thought out requirements, legacy codebases full of spaghetti. But it paid well, and he was tired of his old group, weary in his soul of the same faces he'd grown accustomed to. So he prepared himself for a new flavor of the same office politics and menial tasks.It didn't faze him much when he walked into the IT office to pick up his credentials and heard the telltale buzzing and clicking of old Packard Bell servers. He simply adjusted his expectations for his own developer machine downward a few notches and walked back to his new office. Yes, this job came with a private office, and pay to match. For that, he could put up with a lot of BS.His login worked on the first try, which was pleasantly surprising. He expected Windows XP; when Vista loaded, he wasn't sure if he should be pleased that the OS was newer, or horrified that it was Vista. He could pretend it was 7 for a while at least, once he finished getting admin privileges and nerfing UAC. It'll take more than that to scare me off, he thought to himself as he fired up Outlook.Already, he had mail: a few welcome messages with new employee information, as well as his first assignment from his manager. Impressed with the efficiency in assigning work, if nothing else, he opened the message from his new boss.That first email went a little something like this:
CodeSOD: Mapping Every Possibility
Today, Aaron L. shares the tale of an innocent little network mapping program that killed itself with its own thoroughness:
Healthcare Can Make You Sick
Every industry has information that needs to be moved back and forth between disparate systems. If you've lived a wholesome life, those systems are just different applications on the same platform. If you've strayed from the Holy Path, those systems are written using different languages on different platforms running different operating systems on different hardware with different endian-ness. Imagine some Java app on Safari under some version of Mac OS needing to talk to some version of .NET under some version of Windows needing to talk to some EBCIDIC-speaking version of COBOL running on some mainframe.Long before anyone envisioned the above nightmare, we used to work with SGML, which devolved into XML, which was supposed to be a trivial tolerable way to define the format and fields contained in a document, with parsers on every platform, so that information could be exchanged without either end needing to know anything more than the DTD and/or schema for purposes of validation and parsing.In a hopelessful attempt at making this somewhat easier, wrapper libraries were written on top of XML.Sadly, they failed.In the health care industry, some open-source folks created the (H)ealthcare (API), or HAPI project, which is basically an object oriented parser for text-based healthcare industry messages. Unfortunately, it appears they suffered from Don't-Know-When-To-Stop-Syndromeâ„¢.Rather than implementing a generic parser that simply splits a delimited or fixed-format string into a list of text-field-values, the latest version implements 1205 different parsers, each for its own top-level data structure. Most top level structures have dozens of sub-structures. Each parser has one or more accessor methods for each field. Sometimes, a field can be a single instance, or a list of instances, in which case you must programmatically figure out which accessor to use.That's an API with approximately 15,000 method calls! WTF were these developers thinking?For example, the class: EHC_E15_PAYMENT_REMITTANCE_DETAIL_INFO can have zero or more product service sections. So right away, I'm thinking some sort of array or list. Thus, instead of something like:
Error'd: Errors for Everyone!
"All I wanted to do was to unsubscribe from Credit Sesame emails, but instead I got more than I bargained for," writes Shawn A.
A Font of Misery
After his chilling encounter in the company’s IT Cave, new hire George spent some time getting his development workstation set up. Sadly, his earlier hope that the PC in his office was a short-term placeholder until something better comes in was dashed to pieces. This PC was a small-form-factor budget system, relying on an old dual-core processor, 2 GB RAM, a 5400 RPM “green” disk drive, and integrated graphics with a single output port, to which was connected an aging 17" LCD monitor with a failing backlight.George got to work installing software packages from a network drive, presumably clicking itself to death in the dark IT office. With a PC nearly ten years behind the curve, George had plenty of time, several days, in fact, to drink coffee while exploring the building. His unease from the encounter with the IT guy eventually faded as he met other employees who seemed as normal as he, discovering conference rooms with normal-looking Scrum boards, and offices and cubicles that would not appear out-of-place in any modern, successful software company. A friendly member of the Marketing Department even gave him some swag: logo’d pens and stress balls and notepads. Perhaps the unusual IT guy and his dark, precarious office was just an anomaly to an otherwise excellent organization.A week into his new job, George finally had his system set up enough to look around at the software products he’d be working on. During his interview, he’d been told everything was “superbly” documented.A coworker emailed him links to their developer documentation which was hosted on an internal server somewhere. George followed the link, and his web browser sat on a loading page for way too long. As he waited, and waited, and waited for the page to load, he almost thought he could hear the clicking and clunking of failing disk drives from whichever ancient pile of failing hardware served as the company’s documentation server, but eventually a SharePoint page presented itself on his screen.The “Developer Documentation” was unexpectedly short. In fact, George read through it faster than it took to load, feeling a sense of dread once he realized what it actually was: three pages of buzzword-laden marketing material! He read about how “superb” the application is and how it has helped millions of companies “leverage new synergies for key wins”. Nowhere could he find a simple, developer-centric description of the application. When he pressed for more documentation, his coworkers shrugged. “That is the documentation,” they explained. “The bosses say it’s good enough and it’s a waste of time to write more.”George’s sense of dread continued to increase.And so he did all he could. He checked out the application from source control and went spelunking.On his first run, he noticed the application’s text did not look right. Characters were glitched in various ways, with bad kerning, inconsistent alignment, and missing/extra pixels, though it was still generally readable with some effort.Thinking he was missing a dependency, he asked his coworkers for their opinion. “No, it normally does that,” they explained with a shrug. “Most of the time.”“Do we have unit tests for this?” he asked, but deep down in his gut he knew he wouldn’t like the answer.“Testing programs are in the design and planning stage,” they responded, even though the application had been on the market for eight years now. “The bosses don’t like to spend too much time on testing.”He still had no direction on what tasks to perform, so George took it upon himself to dig into the font issue, if nothing else to learn more about the codebase. He downloaded a few third-party font test programs from some prominent tech companies and they all agreed that the application had nearly 1,300 basic font rendering errors.His sense of dread was starting to overwhelm him as he considered his future. How could an application possibly have millions of sales and installs with nearly-unreadable fonts? And how could it possibly be maintained with no testing and no documentation?He wrote a memo explaining some of his findings and forwarded it to several coworkers, and asking various questions about it before putting too much effort into fixes that could cause issues unforseeable by a newbie who was not familiar with the history behind the application’s overly-complex font-handling codebase.Later that day, he received a long email directly from the company president. In tirade form, it explained that George was wasting time, there can’t possibly be that many bugs, and if anything like this happens again the time would be deducted from his paycheck. It ended with the president explaining that George was obviously a f***up who would never amount to anything at the company, but he was willing to give him another chance.George didn’t want another chance. As he walked past the IT Office on his way to the HR Office to announce his resignation, he briefly wondered how much damage his foam stress ball could do to already-failing disk drives if he were to chuck it through the door into the darkness within.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: Sche-ma
In the early 2000s, it was a time of darkness, a world of fear, it was the age of XML. As someone who was just entering the industry at the time, you couldn’t type three lines of code without a PHB asking, “Have you considered using XML for this?” Since this was 2002, “this” was likely trying to find a way to emulate the marquee tag in JavaScript, the answer was usually, “No,” at which point you’d be reminded that we should be using XML for everything, so throw it out and start over in XML.One of the key selling points of the grand power of XML was the idea of schemas. These magical little files allowed you to use XML to specify the structure of some other XML, and then validate various XML documents against that schema. Combined with the ability to use namespaces, this was truly the One Format to Rule Them All™.The real magic, of course, was that since XML was a text based format with a clear (if complicated) parsing mechanism, it could be produced and consumed by any system, including those pesky legacy mainframes that were sure to be replaced any year now. Vendor after vendor came up with new and interesting ways to bolt XML onto your mainframe, so that you could wire modern applications up to those legacy back ends, and when you wanted to replace that legacy backend (they’re going away, any year now! Really!), you could slap a modern backend behind the same XML interface.I bring up this history lesson because John B works for a “very large, government-type” organization. He maintains an XML data-feed that passes around location data. I strongly suspect that the schema for that XML data-feed was generated based off of an older flat-file dataset from a legacy system. Why? Well, let’s look at a sample file.
The Helpful Manager
Git is a divisive piece of technology. There's a number of people who insist that it's the best of all possible version controls, often citing the fact that a complete repo copy is on everyone's computers in case of emergency. There are also a lot of horror stories of people screwing up commands and ending up neck-deep in tutorials, desperately trying to undo what they did. Recently, I was involved in a discussion about the merits of Mercurial. The usual git fans stopped by to ridicule the lack of history-rewriting in Mercurial, insisting that it's a necessary part of any version control. Which reminded me of this reader submission ...Toni worked at a certain company that worked on inventory systems, and was also a defense contractor. Her manager quit out of protest; the new boss—whose name was Alexander, but he insisted on being called "Lex"—was assigned to the team from upon high. Lex was a dopey corporate puppet who liked to talk about Bob Dole a lot. The best the team could hope for was that he'd stay out of their way, making vague promises about the future but not actually accomplishing anything. After all, they had done just fine without a boss for eight months.What they didn't know? Lex had been given the keys to the kingdom: their server git repository, and everything in it.One fateful morning, Toni woke up at 4:00 AM to an SMS saying that the code repository at work had been accessed by "a new member of the compliance team."... What? she wondered, groggily. There was no new member on the "compliance team." That wasn't even a real department name! Damn it, we've been hacked.She rushed to the office, wide awake at this point, praying for no cops with speed guns on the way there.Did someone break in? she wondered. Or worse, hack into the local code repository from one of the ports the IT guys kept forgetting to close? Surely a randomly generated password longer than a bible couldn't have been cracked, right?By 8:00 AM, she hadn't found any sign of intrusion. She was asleep at her desk from exhaustion when her co-worker, Clarissa, came in. Clarissa had just wiped her MacBook Pro clean the night before due to a botched OS X update. She had also gotten a text message, but had assumed it was Toni, as she'd been working late the night before.Clarissa was able to discover what Toni had overlooked: to their horror, two new people, with names 20 characters long, had been "invited" into the team, and the team had been "renamed" to Compliance.That was when they both got an email from Lex. I thought you could use some help! :)That "help" came in the form of two dimwits from the Chennai, India branch, recently acquired by merger a year before. Through Slack, they admitted to the existing team members that they had never used a version control system before.Toni was already seeing red at this point, but the day was just beginning to reveal the depths of insanity that were in store for them.The two new team members had decided that the color of the web-based inventory front-end wasn't "good enough." Now, this had just gone through a redesign; the colors matched the official design guideline, and had been agreed on by numerous stakeholders. Not only did the newbies change the colors, they decided to deploy those changes to the main Internet-facing servers without going through QA.Toni was still processing that little gem when she heard the fires of hell erupt from Clarissa's cubicle.Clarissa told Toni that their "friends" had pushed code to master, bypassing QA, while also tinkering with her custom branches. As if that wasn't bad enough, they'd used an editor that had converted all the source code files on her branch to Windows format, which screwed up all the line endings. Immediately, this caused conflicts with the existing frameworks, and one of their parsers no longer worked.In a fit of brillance, the two new helpers had decided a force push would do the trick. Surely it couldn't be their color tweak breaking things, right? Apparently, they'd figured out that it was. Shortly after, they'd copied over the files from master, pasted them in the working folder, and force pushed with a fake name, erasing all history on said branch in a terrible attempt to cover their tracks.Remember how Clarissa had wiped her MacBook the night before? If Toni hadn't cloned the entire repository to her ThinkPad for Thanksgiving tinkering, Clarissa would've lost four to eight months of work.They received word that the interim manager, on vacation in Tampa, had hopped on a plane after getting the same SMS they did. He could've flown in with his own two arms given the level of pissed-off he was when he slammed open the office door. Lex walked in with coffee to see the door nearly fly off the hinges.It turned out that the website had been inoperable for eight hours. With worldwide clients, this was a bad, bad thing. After the interim manager finished steamrolling Lex with expletives, he told the team that, due to US regulations, using foreign workers without security clearances could bring up to $10K of fines per infraction.Salespeople barged in behind him with questions about why the interface had changed without any notification. The QA team followed the salespeople, also demanding answers.Lex turned the color of wax paper. "Well, I guess I should remove the other twenty guys I just added to the repository, then."Lex is no longer with the company. [Advertisement] Universal Package Manager - ProGet easily integrates with your favorite Continuous Integration and Build Tools, acting as the central hub to all your essential components. Learn more today!
CodeSOD: Do You Think This is a Game?
We’ve passed Christmas and made our way through a Steam sale with our wallets mostly intact, and now most of us have a pile of games that we’ll probably never actually play.Game programming is hard. Setting aside the “cultural” problems in the industry- endless crunches, compensation tied to review scores, conflicts between publishers and studios, and a veneer of glamour over unglamorous work- the actual work of developing a game is a hard job.Building a game engine is even harder. Not only do you have to build highly performant code, you have to build a system flexible enough so that game developers can build a game on top of it. You need to provide a set of high-level abstractions that make it easy for them to build a game, and this is where the problems come in.For example, I went through a brief period of playing Frozen Cortex, an interesting approach at a turn-based sports game. I was stunned at how badly it performs, though. Weirdly, it’s not during gameplay that performance stinks, but when staring at the menus. I was puzzling over this for some time, when Anonymous sent us a message.You see, Frozen Cortex is build on the Torque engine, and our anonymous submitter is working on a different game that also uses the Torque engine. And they’ve encountered a few… special warts.First, take a look at this code:
Best of…: Best of 2016: Tern Around…
While looking at our most popular CodeSODs this year, I noticed we had two popular ones that both involved the ternary operator. So, what the heck, this one's a twofer. Originally, "As the World Ternaries" and, "Returnary". -- Remy As the World TernariesAh, the ternary operator. At their worst they’re a way to obfuscate your code. At their best, they’re a lovely short-hand.For example, you might use the ternary operator to validate the inputs of a function or handle a flag. Adam Spofford found this creative use of the ternary operator in a game he’s developing for:
Best of…: Best of 2016: Dude, Where's My Hard Drive
Instead of our standard workplace fare, this story is a bit different, because TRWTF is the Windows Registry. --RemyWhat, again? Michael stared at the Explorer window in disbelief. The free disk space bar was glowing red, and the text underneath reported that his half-terabyte system partition had a measly few gigs left before filling up.When it had first happened, he hadn't thought twice about it. In fact, he'd been rather glad; at least he'd had the motivation to finally discard all the games and software he would never use again. But when the disk space ran out again the next month, and again the month after, he started getting more and more worried. Was he really using that much space, or was something else going on?Curious, he decided to finally investigate the issue. A cursory look at his hard drive with WinDirStat confirmed his suspicions. With over 80 percent of his hard drive space labelled as "unknown", something was definitely amiss. He kept searching, manually scouring through his folders and files, until finally he managed to pinpoint the culprit: an innocuously named "C:\Windows\System32\Config" folder filled with hundreds of thousands of files, taking up 420 gigabytes in size.A quick trip to Google and a bit of playing with Process Monitor revealed the answer to the mystery. As it turned out, every modification to Windows Registry—the oft-derided database of all the Windows and Windows application settings—generated a transaction log file to ensure the data integrity, prevent corruption, and allow rollback of changes. Usually those small 512KB files weren't much of an issue. They got deleted after a clean reboot, and most software only modified the registry during installation or after a configuration change.However, some applications and drivers—among them, Nvidia's 3D service—didn't play nice with the registry, shuffling the values around every few seconds or minutes. That, together with Michael's habit of not turning the computer off too often, resulted in cluttering the disk with more and more files until it filled up completely.The solution, luckily, was rather simple. Michael purged the folder of all but the most recent log files, then uninstalled all the unnecessary bloatware from Nvidia, hoping it was the last thing he'd be deleting for a long while.[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!
Best of…: Best of 2016: The Website Hacker
This week, we're reviewing the best WTFs of the year. In this installment, overreactions from management are their own WTF. --RemyAn investment bank had just completed development on a new digital retailing platform. Daniel was assigned to a cross-functional automated test team, gearing up to test the platform's web application—or at least trying to. Charlie, a veteran manual tester from QA, had been vocal in his opposition."Automated tests need to be tested themselves, which means the testers need to test the tests, so automation doesn't save anything. If anything, it creates more work! Besides, we should always be striving to recreate the user experience as closely as possible!"Daniel and the other developers insisted that manual testing was valuable, but automation needed to happen too. The conflict marched up the org chart, culminating in a meeting with Charlie's boss, Daniel's boss, their bosses, their bosses' bosses, all the way up to where these branches of the organization finally joined.The verdict was handed down. Charlie was appointed the leader on testing the web application, running through the same test cases in a manual fashion to catch any problems that fell through the cracks.The team—developers, QA, and a tech lead—all abandoned their cubes to huddle together in a large conference room. Everything went smoothly until one afternoon, when Charlie piped up with the nervousness of one staring down a cobra poised to lash out."Fellas? I don't know how I did it, but I hacked into the website somehow. I see all of the code."The people seated closest to him glanced up from their work to trade frowns."What do you mean?" Daniel asked, glancing across the table at Charlie."I'm in the browser, and I can see all of the code!" Charlie explained. "I've hacked into the website. I see stuff like, 'div class equal sign—'"In other words, the HTML source. Those who were listening in burst into relieved laughter, prompting everyone else in the room to quit their work and pay attention to the faux emergency.The far more patient tech lead bit her bottom lip to hide her grin. "Charlie, it sounds like you opened the developer tools in Chrome by accident. Press F12, it'll go away."Charlie hunted down the key and pecked it with a single loud stroke. "OK, it's gone," he said as though he’d just diverted a nuclear strike. His gaze swept over the room with a mix of urgency and confusion. "I'm still really concerned. That shouldn't happen!""It's supposed to do that," Daniel explained. "Go to any website you want, you can do that on any of them.""What?!" Charlie flipped to a different browser tab, then pressed F12 again. "What?! No!"Another burst of laughter drowned out his concern."Check out the leet haxxor here," one of the developers cracked."Step away from the computer, Charlie, before you hack the whole Internet!" another developer commanded, pointing a finger-gun at the hapless tester."Charlie, it's just—" Daniel tried to say."We can't keep using this browser!" Charlie declared. "I'm raising a defect for this!""All browsers have something like that for debugging purposes," Daniel explained. "It's not just Chrome."But as the giggles continued around him, Daniel's plea seemed to fall on deaf ears. Charlie tabbed over to their bug tracker and took to some furious hunting and pecking.Daniel shook his head. Let Charlie log his defect if it made him feel better. Surely no one would take it seriously.Unfortunately, QA heads and project leads took "security threats" very seriously. The conflict escalated up through bosses, bosses' bosses, and eventually, the verdict was handed down. To avoid exposing code to users, further web development and testing involving Chrome was suspended company-wide. [Advertisement] Application Release Automation – build complex release pipelines all managed from one central dashboard, accessibility for the whole team. Download and learn more today!
Best of…: Best of 2016: The Inner JSON Effect
As we review this year's greatest hits, let's revisit the latest incarnation of the dreaded "Inner Platform Effect". --RemyJake eagerly stepped into his new job, grateful for more experience and new challenges, craving to learn new software stacks and see what his new company had to teach him about the world of software.They told him he’d be working on some websites, dealing with JavaScript, Node.js, JSON, and the like. It sounded pretty reasonable for web development, except for the non-technical interviewer’s comment that it was all “built on top of Subversion” which he assumed was a simple misunderstanding.Then he was thrust into a project using the company’s custom “JSON-based Domain Specific Language”, or JDSL. His boss told him to check out a copy of the project he’d be assigned to, and spend a week or two getting familiar with it. “Just ask anyone for help if you have questions, but you shouldn’t have any trouble judging from your experience.”So Jake began an SVN checkout…and long story short it took two days to complete. When he asked about it, his coworker Scott told him, “Oh that’s normal. Just play Solitaire or something until it finishes.”Two days later he started poking around. He started with a seemingly-innocuous file called “customers.json” and stared in confusion at its contents:
Best of…: Best of 2016: Overpowered
Merry Holidays, and as we coast into the new year, it's time for us to reflect on some of the best/worst moments of the past one. Today, we start things off with a BANG, and a reminder that electricity is a complicated beast. --RemyMike had a different perspective on wiring and cable management- because he worked at a factory which made wires and cables. It was the early–90s, and he was in charge of babysitting a couple of VAXes and their massive, 85lb hard drives. It was an easy job: the users knew the system and needed very little support, the VAXes were practically unstoppable, and the backup battery system could keep the entire thing running for over an hour.The computers supported HR and accounting, which meant as the year ticked towards its end, Mike had to prep the system for its heaviest period of use- the year end closing processes. Through the last weeks of December, his users would be rushing to get their reports done and filed so they could take off early and enjoy the holidays.Mike had been through this rodeo before, but Reginald, the plant manager, called him up to his office. There was going to be a wrench in the works this year. Mike sat down in Reginald’s cramped and stuffy office next to Barry, the chief electrician for the plant.“Our factory draws enough power from the main grid that the power company has a substation that’s essentially dedicated to us,” Reginald explained. “But they’ve got a problem with some transformers loaded with PCBs that they want to replace, so they need to shut down that substation for a week while they do the work.”The factory portion was easy to deal with- mid-December was a period when the assembly line was usually quiet anyway, so the company could just shift production to another facility that had some capacity. But there was no way their front-office could delay their year-end closing processes.“So, to keep the office running, we’ll be bringing in a generator truck,” Reginald said. “And that means we’re going to need to set up a cut-over from the main grid to the generator.”From the computer-room side, the process was easy, but that didn’t stop Mike from writing up a checklist, taping it to the wall beside his desk and sharing a copy with Barry. Before the generator truck arrived, he’d already tested the process several times, ensuring that he could go from mains power to battery and back to mains power without any problem.The generator truck arrived a week before the changeover. The electricians ignored it for a few days. Just as Mike was starting to get worried about deadlines, he looked out a window and saw a trio of electricians, lead by Barry, starting to connect cables to it. Later that day, when Mike left to go to lunch, he walked past the generator truck, and noticed something odd about the cables- they were clearly single phase power cables.Typical residential power systems are single-phase alternating current- one peak, one trough. This creates “dead” moments in the cycle, where no work is being done. That’s fine for residential use- but industrial systems need three-phase power- three offset AC cycles that, when added together, guarantee current is always flowing.“Hey,” Mike said to one of the electricians loitering near the truck, “you’re planning to run some three-phase cabling, right?”“Nope. The factory’s shut down- this thing is just gonna run lights and heating.”“And computers,” Mike said. “The hard drives need three-phase power.”“We’ll have to order some parts,” the electrician said.A few more days ticked by with no three-phase connections, and Mike checked in with the electricians again.“The parts are coming.”At this point, Reginald came down from his office to the computer room. “Mike, Barry’s telling me you’re being a disruption.”“What?”“Look, there’s a chain of command,” Reginald said. “And you can’t tell the electricians how to do their job.”“I’m no-”“From now on, if you have any concerns, bring them to me.”The day of the cut-over, the three-phase cabling finally arrived. Barry and his electricians quickly strung those cables from the generator. Mike wasn’t exactly watching them like a hawk, but he was worried- there was no way they could test the configuration while they were working so hastily. Unlike single-phase power, three-phase power could be out-of-sync, which would wreak havoc on the hard drives. He thought about bringing this up to the electricians, but recalled Reginald’s comments on the chain of command. He went to Reginald instead.“Mike,” Reginald said, shaking his head. “I know you computer guys think you know everything, but you’re not an electrician. This is a factory, Mike, and you’ve got to learn a little about what it’s like to work for a living.”Now, the electricians and Mike needed to coordinate their efforts, but Reginald strictly enforced the idea of the chain of command. One electrician would power on the generator and announce it, “Generator’s running.” Another electrician would relay this to Barry: “Generator’s running.” Barry would relay that to Reginald. “Generator’s on.” Reginald, finally, would tell Mike.
Error'd: What's my Age Again?
"For your information, Walmart, no, I'm not too old to buy this game, no matter how many years old you think I should be," wrote Ryan F.
'Twas the Night Before Go-Live
Once again, we're hitting the holiday season. I had fun doing The PM Who Stole Christmas last year, so I decided to try my hand at another holiday classic. Expect your regularly scheduled Error'd tomorrow, but next week, we'll be revisiting our classic and best articles of the year. Happy Holidays! -- Remy’Twas the night before go-live, and all throughout git,
CodeSOD: 1 Moment in Time
On occasion, we've all faced a situation where we need to check to see if some internal application process has succeeded, or gotten stuck. There are many ways to accomplish this; some better than others. In the old days, folks used loops to count CPU cycles. Of course, as CPUs got faster, this didn't scale all that well. Now you can use myriad combinations of event handlers, semaphores, thread safe flags and threads. Or you can just use the time tested method of hard coding a sleep.Of course, this requires that you have a decent idea of how long something will take to complete. It also assumes that you know something about the delays that can reasonably be expected in the execution environment.If it's on your hardware, that may be reasonable. When it's on the customer's hardware in their environment, your ability to accurately guess how long stuff will take decreases exponentially (think solid state disks vs. local physical disks vs. network storage vs. anything in the cloud).Jerry inherited some installer software written by a former cow-orking cowboy coder named Mike. This software would perform several installation/setup tasks. Each used the same mechanism to see whether or not it had completed.Specifically, It would spawn a thread that did a sleep for a hard-wired period, and then check to see if the step that was running had completed or not. If not, it reported an error.Except that it frequently (e.g.: most of the time) reported that the task had hung or failed, when it was simply still (legitimately) running. Mike had made several fixes to this end, but never solved the problem. This annoyed the operations team to no end. Jerry was tasked with figuring out why it would incorrectly flag failures so often.After some spelunking, Jerry had a headdesk moment when he found Mike's fixes in source control. See if you can spot the problem:
Announcements: Submit WTF Code Directly From Visual Studio
A little more than five years ago, we published a plug-in that allowed you to submit code directly from Visual Studio to The Daily WTF. However, in the years since, that style of extension was deprecated in Visual Studio, and the SubmitToWTF API was lost in the latest site redesign.The loss was felt by many users. Without the plug-in, submitting bad code requires first printing it out, putting it on a wooden table, taking a picture of it... then printing out the picture, scanning it, then uploading as a PDF to the Submit Your WTF form.With Christmas right around the corner, we thought it would be the perfect time to restore this much-needed plug-in. Thanks to Ben Lubar, the SubmitToWTF extension has been rewritten and is available directly from the Visual Studio Marketplace.
The Call of the 90s
The 90s were a weird decade, and not just because of a strange obsession with flannel. Computers were just becoming a mass-market phenomenon, and nobody really quite grasped what that was going to mean. When I entered college in the late 90s, the campus was still littered with dumb terminals wired up to the VAX. Just a few years before, they’d installed the latest thing in networking- 100Base-TX Ethernet- to all of the dorm rooms and most of the classrooms. They loved their brand new network, and didn’t want punk kids messing it up, so you couldn’t just connect your computer to the network (you probably didn’t have a network card anyway). Instead, they had an outside vendor set up an office in a storage room on campus. You had to lug your tower over there, they’d take your computer for a week or two, and then give it back to you with a new NIC, a bunch of crapware, and a note which said your computer was cleared to use the network. You could then take that note over to the IT offices, and they’d put in a work order to activate the network port in your dorm room, and give you an Ethernet cable. Oh, and this entire process cost $200.The 90s were a dark, dark time.Eventually, they wised up, kicked the outside vendor off campus, and CS majors like myself got to make a couple of bucks installing NICs into freshmen’s computers. I think many of us might have had that sort of experience. Sabrina did a similar turn in her teens, helping a small ISP get people connected via modem or ADSL, but encountered a few… special edge cases.One call was a pretty standard example: a family had just gotten a new modem, and wanted to connect their computer to the information superhighway… but couldn’t. Yes, they had a dialtone. Yes, the modem dialed. No, it couldn’t connect. Remote diagnostic options exhausted, Sabrina went on site. This small ISP primarily served a small city, but that city was surrounded by a large stretch of rural farmland that stretched into mountains. Before long, Sabrina found herself on gravel roads, driving past signs that warned, “No Trespassing” (and had been peppered with shotgun pellets to drive home the point). Eventually, she found the house- a quiet little place nestled well back into the woods. She greeted the family, waded through a handful of screaming kids, and went straight to the phone first. She picked up the handset.There were voices talking on the phone.“Do you have another handset?” Sabrina asked. “I’ll need everybody to hang up so I can debug things.”“What?” the mother said, “Oh, no. We’ve just got the one. But it is a party line.”“A what?” Sabrina asked.“A party line. We share a loop with the whole neighborhood.”Sabrina was a little flummoxed, since this hardly seemed like a neighborhood- their nearest neighbor was miles away- but as someone who grew up in the city, she’d never even heard of a “party-line”, as they were mostly extinct everywhere in the country. Instead of giving each subscriber their own phone line, sometime in the past century, the phone company had installed a loop of cable all around the region. Each handset was attached to the entire loop, which meant everyone in the service area shared a single phone line. There was no call privacy, and there was certainly no way to use a modem under those conditions. Sabrina explained the problem to the family.“Well, the phone company has been after us to get a single line, but it just seems so silly when what we have works just fine. But, I guess if we need it to use the Internet…”After leaving that strange intersection of the 19th and 20th centuries, Sabrina’s next call took her back into the city. There was a customer complaining that they’d just installed the software that came with their ADSL modem, but couldn’t connect to the Internet. This brought her into her town’s business district, where she found a the law offices of Duey, Cheatum & Howe. Mr. Duey brought her to his shiny new computer, a Pentium with a Yamaha CDR100- the $5,000 CD-R that Sabrina never thought she’d see in person.“Now,” he said, “let me show you what I did.” He put a CD into the regular optical drive. This CD was not one of the ISP’s discs, but instead, was a duplicated disk simply labeled with black marker as “Internet”. Once he brought up the installer, however, it was clear that it was their software. He went through the installer, completely ignoring Sabrina until he had finished demonstrating exactly what he had done to set up the Internet. Once the he failed to connect, he turned to her and said, “Well?”“Well… I’ll need to look at your modem.”“My what?”“Your modem? The thing you hooked up to the ADSL line?” Sabrina asked. “It’s a little box…”“I don’t have one of those. I just have the CD.”“Right…” Sabrina said. “But… you need one. A modem, I mean.”“What? That’s nonsense. My neighbors bought Internet from your company. I borrowed the disc, made a copy, and now I want Internet at my office. I copy all sorts of programs from my neighbor,” the lawyer explained. “I paid all that money for a CD burner, and I want to get my money’s worth out of it.”“You… you’re a lawyer,” Sabrina said, scandalized. “That’s illegal. And… you copied our software, installed it without a subscription, and then called us for technical support?”“Honey, I think I know just a little bit more about what’s illegal or not. And you know what is illegal, offering a service that doesn’t actually work! I want the Internet on this computer, and I want it now missy.”Sabrina confessed that she couldn’t get it to work, and left him with the number to the ISP’s sales department. She then beat a hasty retreat and went out on the next service call.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: Recycled Code
Hannes has inherited a legacy project. Like most legacy projects, it has no real documentation, the code is a disorganized mess, and making any change runs a non-zero risk of completely knocking over the house of cards.What few comments the code has tells us things like this:
Error'd: Now Playing - Exception, The Movie
"While browsing the IMDB Android app, I finally found a hacking movie that gets the details right!" writes Jamie.
Pulling Teeth
"Jackie, Brian is leaving the company in two weeks," the boss revealed behind his closed office door. "You'll be taking over maintenance for CONLAB."Jackie's eyes went wide. Brian was a guru within their IT department; his departure would surely cause a stir. CONLAB was just one of his holdings, a real database-maintenance workhorse that several large internal business units relied upon."To get you familiar with it, I'm gonna have you take over some of Brian's open feature requests," the boss continued. "I'll email you the details.""Sure!" This was good. Jackie could learn the ins and outs of the code while Brian was still around."Great! Make sure to arrange some one-on-one time with Brian as soon as possible," the boss said.Jackie was optimistic about his increased responsibility at first. He already maintained a few smaller apps, and was sure he could make CONLAB "his" fairly quickly.Unfortunately, getting his feet wet was hard when the pool turned out to be a desert mirage. Brian's calendar in Outlook was unpopulated. His cube was always empty. He never answered emails, never signed into Lync, and let every phone call dump to voicemail. Wall-to-wall meetings? Flaking out? Either was possible."Don't worry," the boss told Jackie. "I'll tell Brian to give you some time on his schedule."Nothing came of this confident offer. As the days slipped by, Jackie had to get creative. He pounced on Brian in the one place everyone wound up at one time or another: the restroom.Jackie explained how he'd be taking over CONLAB once Brian was gone. "I wanna start working on feature requests right away, but I'll need access to the code first. Can you help me with that?" Granting the proper permissions would be a single mouse-click operation in their project management tool."Well, it's complicated," Brian said. "The project lives in two git repos: one with the supporting library, one with the app itself."Jackie frowned. "Really? Why?""It'll make sense when you see it," Brian promised. "Let me finish some refactoring first, then I'll grant you access."Three days passed with no further progress. Jackie managed to corner Brian in the bathroom and ask again."Give me two more days," Brian said.The extended deadline didn't help. Desperate, Jackie sought help from Alisa, the system administrator, and her incredible sudo-powers."Based on file names, I think this is the library he was talking about." Alisa pointed to her laptop screen. "But there are two git repos holding different versions of it.""Oh, geez." Jackie nursed his temple. "OK, let me try out the one that's been worked on more recently."Once Alisa granted the proper permissions, Jackie returned to his desk to examine the library. Its codebase lacked comments. It contained an if-statement body that failed to fit vertically on his 23" monitor. But worst of all, there were no test cases to be found."There are test cases for the application that also cover the library," Brian revealed in the bathroom some time later. But access to CONLAB's application code remained out of reach.Alisa and Jackie went through the entire list of projects in the project management system, opening any git repo whose name hinted at having something to do with CONLAB. In the process, they learned their boss kept sales figures and presentations in git, along with more personal items."Oh my God, is this a diary?" Alisa asked."Close it, close it! I don't wanna know," Jackie said, averting his gaze.Alisa grepped through the file system. Nothing looked remotely like code for CONLAB. She checked every file server that Brian may have had access to. She checked file servers that Brian shouldn't have had access to. She checked local production servers and even remotely based client production servers. No sign of CONLAB's code."Maybe he's bypassing company policy and using some other version control system," Alisa suggested.She searched for signs of Mercurial, Subversion, CVS, Bazaar, Fossil—all to no avail."Seriously, what the hell?" Alisa muttered.Jackie shook his head, sullen. "Right now, I have two theories. Brian's either storing the code directly on his dev machine, or, CONLAB isn't actually an application at all.""Not an application?" Alisa repeated."CONLAB has no UI. It just processes database entries. So it could just be a batch file running in the background all the time," Jackie explained, then straightened as a third possibility occurred to him. "Heck, that might even be giving Brian too much credit. Maybe he's been handling the database updates manually, every 12 hours, for years now."Alisa's eyes went wide before she sobered again. "Today's Brian's last day. What'll you do?"Jackie stood up and scouted past the cubicle walls. He saw the familiar flicker of bad flourescent bulbs, heard the laughter of coworkers talking about anything but work ... and spotted Brian heading toward the men's room for what might be the last time."I'm going in," Jackie replied.[Advertisement] Release!is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!
CodeSOD: Not Getting the Getters
The number of customers that might purchase your software has a detectable impact on how you develop that software. If you’re making a smartphone time-killing game, for example, there are potentially hundreds of millions of customers for that game. This drives software in two directions- you have your mounds of shovelware crap that just hope to make a few bucks fleecing suckers, and then you have the tight competition that optimizes the design of the software.Contrast that to “enterprise” software. If you’re making an ERP, how many potential customers do you have? Thousands? Tens of thousands? And each one of them is going to want something different from your product, so you’ll need to either pile on features or build an Internal Platform that lets them customize it. It doesn’t matter how much money is in this market, or even how many users there are going to be- it’s all about the number of customers that might pay for your product. This, I suspect, is a large part of why enterprise software is terrible, and I think it lays out a corrolary to Remy’s Law of Enterprise Software: the narrower the audience, the worse the software is going to be.Which brings us to the code sent in by Jason F. Jason recently finished a contract to “modernize a PHP web app for agricultural consultants.” About twenty or so developers have touched this application at one point or another, and Jason is simply the latest one through the revolving door. A niche market, a series of developers who have never talked to each other, and as the topper, it’s built in PHP.One of the preceeding developers left behind this unusual approach to object-oriented programming in PHP…
Easter Eggs
Ada worked in QA in the Netherlands, testing a desktop application for a German bank. The app was simple: a C/C++ app that scanned in paper forms, read them with OCR, and processed their contents. It was constructed, as was the fashion at the time, from a number of separate DLLs, each serving one and only one purpose. It was usually fairly boring work, but it was paying for her education, so it was worth putting up with.One day, however, it stopped being boring. The error message she was looking for was meant to say something along the lines of Name field is not filled out, indicating that—surprisingly enough—the name field was blank. Pretty routine test. The message that appeared, however, was ... different. It read, You stupid woman.Ada stared at the message for a moment, then looked around, trying to see if anyone was snickering. Was this a prank? Was someone mad at her? Did they deliver her a dud build just to insult her? Or had her computer been hacked? Was she seeing things? Going insane? What the heck was going on here?!"Nobody's going to believe this," she muttered to herself as she took a screenshot. Then she printed it and carried it to her coworker's cube. "Bernd, I know this is weird, but ..."No sooner had Bernd seen the screenshot than he pinched the bridge of his nose, looking tired. "Thanks. I'll take care of it.""You believe me?" she blurted before she'd even realized it."Yeah. I know exactly what happened here."Slowly, she managed to coax the story out of him. You see, in the Netherlands, you're forced to work your notice period, with no option to leave earlier; you're expected to be professional enough to keep doing your job the whole time. At this company, the notice period was two months ... and Edwin, one of their colleagues, hadn't been very pleased with the company when he'd resigned."I'm still trying to find all the blasted things," Bernd confessed to Ada."It can't be that hard," she protested. "We've been over this thing a dozen times in the last two months.""He only left last week," said Bernd. "And a lot of them are on random timers. They don't show up every time, only one in three, or after it's been open for ten minutes, or an hour, or a day."Ada whistled. "Are they all this bad?""This one's my favorite," he said, pulling a screenshot off his cube wall. It was a message box just like the one she'd found, only this one read Give me back my bike!—a reference to WWII, when Germany had impounded bicycles in Holland to pay for the war effort."If the bank had seen this ..." whispered Ada, horrified.Bernd nodded. "That one only showed up on Tuesdays."With Ada's help, Bernd managed to remove another dozen message boxes before they shipped live—and three more after, under the guise of security patches. Starting with the next hire, the company shortened their standard leave back to the typical one month, and started a new policy: developers who were leaving the company would be moved to the testing department for the duration of their notice period, just in case.[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: This is the Endian
Anyone who’s ever needed to write cross-platform code in C or C++ knows that TRWTF is endianness. Your options are either to use a lot of platform specific preprocessor macros, or to coerce all of your data into your own specific format, for portability.Adam H’s company took the latter approach, implementing a ByteWriter class. It was relatively easy to use, with code that looked something like this:
Error'd: Null and Vague
"UPS has sent my parcel to the corporeal equivalent of /dev/null," wrote Steve J.
CodeSOD: Un-Encoding
Felix caught a ticket about their OpenId authentication. For some mysterious reason, it had started failing around 30% of the time, specifically because the access token returned by the service was invalid.Felix had originally written the code, but there was one problem: he wasn’t the last one to touch it. Another development team needed their own versions of the code, organized a bit differently, for infrastructure reasons. Eventually, the whole thing was turned into a drop-in library component that was used by all applications which depended on OpenId. The failures started after they made their changes, so obviously their changes caused the failures.Since the errors were intermittent, their first guess was that the bug was something intermittent- perhaps an infrastructure problem, or a race condition between interacting services? They couldn’t reliably reproduce the error, so Felix spent a lot of time eliminating possibilities. Trawling through the code wasn’t very helpful. The other team had been operating under unrealistic deadlines and hacked together something that worked and wasn’t too worried about how or why it worked. The result included lots of un-patterns (like anti-patterns, but without having a pattern to them), inheritance trees that desperately needed pruning, and old-fashioned SQL injection vulnerabilities copy-pasted everywhere.Eventually, buried deep in a common service adapter base class, no where near the code that was supposed to be responsible for managing authentication, he found this code for fetching the OpenId token:
Frozen Out
Lex was an employee at GreyBox in the late 90s, a PC-repair shop inside of a large electronics chain. He had spent the entire morning handling phone calls from customer after customer. Each of the calls was supposed to go to his co-worker Gerald, but Gerald hadn’t been picking up his phone. Each caller complained that Gerald had taken in their computer for repairs and not actually done the repairs.“I brought my laptop in yesterday,” one caller, a wheezy old man, said, “and the young man behind the counter just took the laptop and said, ‘come back in an hour’. He went into the back room, and when I came back, he looked like he had been drinking. You know, red faced and sweaty. And the laptop smelled funny- like corn chips. And it wasn’t fixed!”Lex, along with their boss Kyle, had long suspected Gerald’s… habits were interfering with his work performance. To wit, every time he was alone in the back room, he came out red-faced and sweaty. The accounting computer, also in the back room, frequently got infected with malware, despite only officially being used for running Excel. Gerald always covered his tracks, clearing history after he went about his ‘business’, and liberally spraying Febreeze in the back room afterwards, but they knew what he was getting up to.Unfortunately, Gerald was the son of the owner. It would take something like the Pentagon Papers to get him fired.“I’ll see to your laptop personally,” Lex told the old man on the phone. “I’ll also give it a thorough cleaning for the trouble you’ve been through.”The StingIf Gerald couldn’t be fired, then he had to be convinced to quit. He approached Kyle with an idea.“So, Gerald basically comes to work to… play on the computers, right?,” Lex said. “Well, I could write an application in Visual Basic that could freeze and un-freeze a computer screen.” At some point, a copy of Visual Basic had ended up on one of their diagnostic machines, and Lex had spent some time learning to use it. “It can disable the mouse and keyboard input, take a screen shot, then place the image over the entire screen. The entire process is reversible, too.”Kyle nodded, liking the general idea. “How do you trigger it on his machine without him noticing?” Kyle asked.“You can use another machine running the same process. It sends out a CmdPacket with the computer ID of the machine we want to target, along with a flag to either freeze or unfreeze the computer. When I notice Gerald’s not doing his job, I’ll freeze his computer from my own. Oh, and we’ll hide the process from the Task Manager, so he won’t be able to kill it.”“I don’t think Gerald’s ashamed of what he’s doing,” Kyle replied. “You could freeze… that stuff on his monitor, but he’d just turn it off if somebody walked in.”“I’m not talking about catching him red-handed. We just freeze his screen when he’s not doing work, and then unfreeze it when he decides to be useful again.”Kyle shrugged. “Well, it’s worth a shot.”The Happy EndingIt was all Lex could do to hide his glee that week. Each day, when Gerald came in to work, he and Kyle would keep tabs on him. When Gerald blew off the cashier station for the back room, Lex would press a key combo and enter the computer ID Gerald was at. Gerald would moan and shout expletives, then mumble something about a “lunch break” before vanishing for an hour.Gerald never got interested in doing work. Instead, after about a month of this treatment, he just stopped coming in. The owner called Kyle, asking if there was a problem with “malware”.“Well,” Kyle replied, “Lex and I haven’t seen any problems, but maybe Gerald should come in and remove the malware. It is part of his job, after all.” Gerald’s dad never mentioned it again.The little VB application that Lex installed remained on the computers at GreyBox for years afterwards. While they never had to punish any future employees for viewing NSFW content on company time, it did make for a fun gag during an after-hours LAN-party. [Advertisement] Infrastructure as Code built from the start with first-class Windows functionality and an intuitive, visual user interface. Download Otter today!
...38394041424344454647...