📜 ⬆️ ⬇️

Curious perversions from the IT world - 3

The Daily WTF website has been collecting funny, wild and / or sad stories from the IT world for 14 years. I translated several stories that seemed interesting to me. All company names have been changed. Previous issues can be found under the label " curious perversions ."

image

The first story: "Not just brilliant"


[ Original ]

We all had colleagues unable to do their job. Jarad was lucky with that too.
')
He worked at Initech in a small group of developers who created a Windows client for customers who used it to interact with their server. The company decided to port the application from .NET to Java. The most important guideline recommended highly respected lead Java developer Kishu from Intelligenuity to the role of project manager. “Do not worry,” the management said. "Intelligenuity only hires the most brilliant programmers."

At the first project meeting, the manager announced that they would use Eclipse for the Java project. Kish said: “I don't have Eclipse. Can someone send in? ”Jarad sent her a link. At the next meeting, he asked her if she installed Eclipse. She replied that she could not download the environment, so she waited for the next meeting to ask for help. The manager ran to her car and solved the problem by clicking on the download link.

Fast forward to the next meeting: Kisha said that she couldn’t continue working because “Eclipse has some problems with the JDK, can someone send it to me?” Jarad sent her the link again. A few days later, at the next meeting, she said: “Eclipse is not working, because it needs a jar file, can someone send it?” And after that, “Can someone send me the code for the example class creation, because Eclipse constantly reports about NullPointerException ? "

Finally, the manager has changed the structure of the meetings. They continued their regular Windows client meetings, but added a separate ad hoc meeting only for Kishi. Over time, it turned out that she and her husband were friends of a very senior manager and his wife. A separate meeting was held to “ensure its success”; This meant that the team manager wrote code for it.

Once, Kisha told the manager that the client had a critical problem with the web portal, and that a meeting with the client should be held as soon as possible to solve his problem.

The manager organized a meeting with the client, himself, Kishi, Jarad and the project manager to solve the problem once and for all. On the day of the meeting, the client was surprised at the number of technical support staff and managers. He explained: “Um ...„ the problem with the portal “was that I asked Kishi for the URL of the web portal. It was enough to send him a letter. ”

Sometimes justice happens in this world, and Kisha lost her job as a result.

The second story: "Three-month itch"


[ Original ]


In March 2016, Ian needed a job. Almost immediately after the start of the search, he was lucky: he found a tiny startup that needed a worker with knowledge of Python architecture and design skills. “Tiny” because, apart from Ian, there were only three developers in the company under the leadership of its founder Jack.

Interview with Ian was conducted by Jack himself. After the technical test, he learned more about the company's project: an almost complete prototype of an iOS application. The user synchronizes his phone with a wrist pulse meter, after which the phone had to play music that corresponds to the user's current activities. The main objective of the application was to help achieve the necessary heart rate during training. The app also used the phone’s accelerometers to track the user's pace while driving. These data, according to Jack, should have been useful for studies of Parkinson's disease. He supported his statement with scientific articles from the best universities. Jack wanted Ian to develop a new backend system for storing data and processing requests.

Jack was friendly and charismatic, and his enthusiasm infected others. Ian immediately accepted the offer, and began work the next day. His office was cramped, but still belonged to him alone. His task was to create the necessary backend for the application.

Two weeks passed. One early sleepy Monday morning, Jack invited his development team to the meeting room. The bright light that hit his Powerpoint presentation burned the retina.

“I thought it over carefully. We are a completely new startup. Nobody knows about us, right? We need to do something to increase brand awareness. So, I decided: we will get rid of the musical part of the application and focus exclusively on data collection. ”

Ian instinctively almost uttered "What ?!" They will have to throw away the results of two weeks of work. Moreover, in the past the part responsible for data collection was completely optional.

Jack switched to another slide, where the metrics that he now wanted to track for each user were shown. There were so many of them that I had to use the smallest font. To read, Ian had to squint.

“If you collect a large enough haystack, a needle will definitely appear in it!” Said Jack. “We will make the application free, and working with it will imply mandatory registration. The real income for us will be the collected data. ”

Investors' capital was spent on a luxurious office in the business center of the city; free app developers deserve only the best. Jack hired a second iOS developer, data science specialist and intern.

“But do not give the intern any important work,” Jack told the staff at full time.

Having mastered the new situation, Ian began to develop the architecture of the new system, which will register all the necessary data.

Three months later, Jack threw everything in the trash. “No apps! We need a new direction of development! ”

New vision of Jack was to create a web site where people would have to indicate the songs they listen to in their sleep, while training and doing other things.

“People like to talk about themselves,” said Jack. “We don’t have to pay them for giving us their data!”

A front-end developer was hired to create the website. Shortly after the launch of the site, Jack boasted to investors that he had reached a million unique visitors. In fact, there were only about 300 registrations, half of which were created by one person.

You can already guess what happened after another three months. Jack abandoned the slowly developing website in favor of the Slackbot, which was supposed to respond to the "Play ${song} by ${artist}" command, finding the song in Spotify and giving it a link. The Spotify widget would lose a 30-second preview or, if the user has a Spotify Premium account, the entire song.

"And it's all? How are we going to make money? ”, - by this time, the developers were no longer holding back their complaints.

"The subscription will be paid," Jack answered boldly.

“For the chat bot? ", - objected Ian. “In order for it to work completely, the user needs Spotify Premium anyway. If we want people to pay beyond this, we need to give them more opportunities! ”

"We will deal with this later," Jack answered.

Jack commissioned the development of a new core product to the intern, violating the demands of Jack, who was six months ago. The intern put maximum effort, but was soon forced to return to school; the unfinished code without ceremony was thrown for revision to the front-end developer. With the help of one of the iOS developers, he finished it. And what did Ian do? He created a dashboard and logging, because Jack insisted that they would attract enough users to justify the effort.

Three more months passed. Many "functions" were added, for example, the bot intrusively asked users on the Slack channel to use it. This behavior violated the terms of using Slack, so the application was not allowed into the store; Jack himself had to send the links to interested people so that they would install it manually. First, the product was transferred to 50 "very friendly" companies that Jack knew personally; of these, only a few installed it, and even less continued to use the next day. Jack then expanded the advertising to 300 “friendly” companies, but with the same result.

The turning point came for Ian when Jack began to insist on additional working time, despite the fact that Ian could not help other developers in their tasks. However, Jack made him stay up late to "demonstrate solidarity." This was the last straw: Ian wrote a letter of resignation two weeks later. His last day at work coincided with the release of the Slackbot, during which he observed very straight lines on the dashboard. When he finally left the luxurious office, the startup has still not earned its first cent.

Luckily, Jack had a plan. After Ian left, he started everything from scratch and was going to create a new product. No, he will not make any money, but they need first to get to know about the brand.

The third story: "Conveyor backups"


[ Original ]

"Um ... can you look at something for me?"

Pat broke away from programming new features, and saw Milton standing near her cubic.

“I think I have a problem,” added Milton.

One of the company's main internal systems was the data processing pipeline. Perhaps the word "pipeline" can be considered an exaggeration, because in practice it is just a few shell scripts and Python programs that take data from files, perform operations on this data and dump the results into other files, then read by other scripts. In the process, people usually took the latest version of the scripts from the version control system, modified and set them up so that they answered the specific question related to the data. If it seemed that this particular process could have value, then they cleaned up the code and added it to the version control system again. If they thought they wouldn’t need the code anymore, they simply performed a reset on HEAD.

However, some, such as Milton, basically kept their own copy of all the scripts. Or, as with Milton, several copies. Milton knew the data processing pipeline best of all, but the bulk of this knowledge was contained in his personal library of scripts.

“I thought it was worth making my changes to the version control system,” Milton said. "I had a script called by a script that was called by a script, and it all depended on a bunch of shell variables created, like $SETUP_DIR ."

Pat nodded.

“So I wanted to reorganize all this into an argument so that other people could use the code. I did just that ... but before testing I forgot to change the calling scripts so that they pass the argument. ”

In particular, the Milton script contained the following line:

#!/bin/sh

rm -rf $SETUP_DIR/*/


He performed its refactoring on this line:

#!/bin/sh

rm -rf $1/*/


Shell scripts do not care about the existence of these variables. Milton had a medium that ensured the constant existence of $SETUP_DIR . But $1 is the first argument, and if you do not pass the argument, it will be empty. Therefore, when Milton launched the new script without arguments, it was deployed to rm -rf /*/ , deleting everything that his account had access to.

Basically, this led to numerous attempts to delete files for which he did not have rights. In addition, it meant the disappearance of his home directory with a whole bunch of spaghetti scripts that could not be recreated at all, because they never got into the version control system.

“Can this be somehow corrected?” Asked Milton.

"Yes of course. Everything can be recovered from your last backup, ”Pat replied.

Although an automated backup tool was launched on all Windows systems, it was not configured on any Linux system. The support department decided that if you are technically competent enough to work with Linux and write shell scripts, then you will have enough knowledge to set up your own backup system. Especially for this purpose there was an SAN accessible to all.

"Oh, and I ... never set up a backup," Milton whispered. “Well ... at least I didn't push it, did I?”

Pat hoped that Milton would learn the right lesson from this mistake.

Fourth story: "What is a floating point?"


[ Original ]

image

Newbie programmers face a lot of pitfalls: the difference between declaring a variable and its initialization, the need to sometimes use semicolons to complete the lines, offset errors by one ... We all have encountered brilliant self-taught programmers in our industry who are able to create large-scale applications with the right architecture a dream, but we also saw self-taught juniors who barely mastered the basics and believed that this was all they needed. In the end, diplomas and formal education are needed for a reason.

This story began when Olaf just graduated from the university and worked on his first real job as a programmer-trainee. The company has set itself a goal to improve management in the public health system: everyone who has the dubious pleasure of communicating with health systems will say that this is a noble task. However, the company was founded by a doctor who had only superficial knowledge in PHP, which he studied on his own when time was given.

Olaf got down to business, intending to apply his knowledge of design patterns. PHP is easy to learn, but it’s hard to master; In many examples of software written in PHP, omnipotent objects (god objects) are used, and the code is mixed with the presentation - two serious errors, which, however, are not mentioned in most online tutorials. Olaf began to separate the function from the form, create objects that can be used repeatedly to minimize copy-pasting, and dealt with other similar tasks, happily turning the chaos of the code passed to him into order.

And so he found himself in the office of the chief, who arranged for him to wash himself.

"Other programmers will not understand this!" Shouted the boss. “The code is too complicated. Why are you changing it? It works, you had to leave it! ”

Discouraged, Olaf went back to work and uploaded a clean version to the main branch without any changes. Trying to avoid colliding with bad practitioners, he began working on a bug in the accounting system that has high priority and urgency, because it was about billing. Users could upload CSV files to the server with information about their spending, and the system summarized the values ​​into categories and created billing reports. However, somewhere inside a rounding error crept in, resulting in incorrect amounts in some important boundary cases.

Olaf studied more than his colleagues, but no training is comprehensive. He quickly managed to determine that it was a floating point mathematical error. Since decimal numbers cannot be represented in binary form with full accuracy, in the boundary cases, computation errors occurred. He began to look for the right ways to handle decimal values ​​in PHP. Unlike Node or C #, external libraries in PHP are quite difficult to connect because there is no built-in support for package management in this language. He could not figure out how to add a library capable of correctly performing mathematical operations. Since the software calculated only the amounts, Olaf decided to use integer mathematics: read the value, get rid of the decimal point (so that the value of $ 10.50 was represented as 1050), perform calculations, and add a decimal point again when displayed.

Another junior liked this idea. Senior developer approved it, but the head flatly refused the offer. How did he argue? “This is not a floating point error. It arises due to the weak typing of PHP, the program tries to summarize values ​​as strings, not as numbers. ”

(For those who are curious: for concatenating strings, PHP does not use the "+" operator. Instead, it uses ".". The result of "hello " . "world" will become "hello world" .)

As a result, the senior developer realized this solution: to separate the whole part from the fractional part so that $ 10.50 turned into $ 10.00 and $ 0.50, and then sum each part separately.

Olaf did not linger, waiting for them to find out that the bug is still in place, because the program still processed the fractional part with cents as a floating point number. He found a better job with a better language, and left the company.

image

Story Five: “Calculated Security”


[ Original ]

In the late 80s, Karl worked for some time in a software development firm that was involved in avionics and global positioning systems for military and civilian customers. On working cases, he often visited Schlockdeed Corp., a customer with a contract to develop a new generation of jet fighters for the American army. Due to the strict secrecy of their work, it was very important to ensure safety.

Every time Karl entered or left the company, he had to go through the security department. They carefully checked his briefcase, jacket, box for lunch and almost everything, except for a complete study of body cavities. Despite the pedantry of the daily checks at Schlockdeed, some of their “security measures” bordered on the absurd.

In this era of information transfer through floppet , programmers often took with them to work and carried away with it boxes with flexible disks.Schlockdeed had a rather relaxed policy of moving disks, despite the fact that it was the easiest way to steal their secrets. After verification of biographical data, contractors like Karl were given a “pass to carriers”. It was a card that allowed them to carry out and bring into the building any number of floppy disks without any questions.

Karl's work did not darken until he decided to bring his favorite calculator HP-41CX to the office. They worked on complex algorithms, and writing the equations on the board took too much time, so Carl hoped to speed up the process. During the morning inspection, security guard Bill pulled out the HP-41CX and a worried expression immediately appeared on his face.

Bill reached for his walkie-talkie: “Paulie, we need you. We have a difficult situation here. ” Karl is very confused. Has the 41CX ever been used in bombs? Or maybe this is a rally for the first of April? “Sir, we need to send you to our CIO. Come here, ”said Bill.

Karl’s face flared, he tried to understand what problems he had, because these “problems” could easily turn into handcuffs and imprisonment. He also did not understand why the Chief Information Officer should conduct an additional inspection. Bill brought him to Pauli's office, in which there was a portly man with a mustache in the style of the 80s. A sign on his desk said that it was Calculator Inspection Officer.

“Buddy, I will need to look at your typewriter to add,” said Pauli, holding out his hand. Bill gave him the HP-41CX. Pauli carefully examined him and said: “I will have to confiscate him. You see, it has an internal memory, so it can potentially be used to steal secrets. At the end of the day, I’ll return him to you, but don’t even think of coming across me with this! ”Bill took Karl back to the main security department, without a calculator.

Along the way, Bill explained that programmable calculators are strictly prohibited in the building. Paulie was supposed to follow the execution of this policy and took his work very seriously. If Carl needed to bring a calculator, the simplest models were allowed. After Poli’s approval, the AC (Approved Calculator) label was attached to it, which allowed the calculator to be entered. Discouraged by the loss of his HP-41CX, he resigned to the fact that he would have to breathe chalk dust during his entire period of working with Schlockdeed. But, at least, he has a “media pass” for free insertion and removal of floppy disks.

Source: https://habr.com/ru/post/442222/


All Articles