Connect with us

Science & Technology

How a Programmer Nearly Broke The Internet by Deleting Just 11 Lines of Code –

How a Programmer Nearly Broke The Internet by Deleting Just 11 Lines of Code - 86

You might not be aware, but on 23 March 2016, the internet as we know it almost came crashing down.

A huge amount of the software the Internet is built upon crashed when an angry programmer decided to unpublish all his code from a popular Javascript registry called npm.

That doesn’t sound like a big deal – after all, code is deleted and re-uploaded all the time – but Oakland-based developer Azer Koçulu just happened to be the creator of a simple but frequently-used 11-line package that was relied upon by companies such as Facebook, Netflix, and Airbnb.

The problem was promptly fixed, and for the vast majority of us users, there was no down-time thanks to caching, and we wouldn’t have noticed anything out of the ordinary.

But for web developers, it was a temporary nightmare that resulted in thousands of builds failing each second. One developer wrote on the github forum at the time: “This kind of just broke the Internet”.

So how the hell does such deleting such a small chunk of code pull down the rest of the Internet like a house of cards? First, you need to understand that when it comes to building programs, there are a whole lot of modules and tools available to make the process quicker and simpler.

The biggest registry of these Javascript modules is an open-source platform called npm, which works sort of like an App store for developers. They look up the functionality they want, and hopefully fund a module that does it for them.

One of the most popular of these modules was Koçulu’s 11-line-long ‘left-pad’ module, which was a surprising simple, yet heavily relied upon, piece of code. In fact, the programming community didn’t even realise how relied-upon it was until Koçulu pulled it down.

Basically, left-pad is used as a shortcut by developers, so they didn’t have to write a whole bunch of basic code from scratch each time. “If a developer calls on an npm module, it’s basically shorthand for ‘put this code in later’, and a software compiler will just download the code when the time is right,” Matt Weinberger reports for Business Insider.

And it’s not just kids at home using those modules, we’re talking about high-profile Silicon Valley ventures here. Software that was reliant on left-pad included Babel, which helps Facebook, Netflix, and Spotify run code faster, and React, which helps developers build better interfaces, as Weinberger reports.

And most of the time that works just fine – unless of course the module in question disappears, which is what happened with left-pad after Koçulu unceremoniously unpublished it.

To give credit to the open source community, within 10 minutes, someone else had published a functionally identical version of left-pad, which fixed a few of the problems, but not all of them.

In the face of ongoing build fails, npm decided to take the unprecedented step of re-publishing the original ‘left-pad’ from a back up, which resolved the remaining problems.

But the move caused backlash and debate amongst the programming community, as well as discussions over why companies such as npm are allowing developers to build software on modules that can be unpublished at any time.

So why did Koçulu delete left-pad in the first place? As he explained in a post over on Medium, it all started because of a dispute with messaging company Kik, over a module Koçulu was working on, also called kik.

The company wanted him to change the name of his module so they could roll out their own product, but he declined, leading to some heated emails between the two parties (which you can see here).

Eventually, npm got pulled into the argument, and instead of siding with their long-time developer, they agreed that, for the sake of their users, having Kik the company use the package name kik would make more sense.

“It very quickly became obvious that they were not going to be able to resolve their dispute over the name,” npm CEO, Isaac Schlueter, told Ars Technica. “We made the decision based on what we thought would be in the best interest of the npm community. What it came down to is that a reasonably well-informed user who types ‘npm install kik’ would expect to get something related to Kik. So that’s why we turned (the name) over.”

Koçulu was understandably pretty annoyed by the decision, and sent them an email back saying:

“I know you for years and would never imagine you siding with corporate patent lawyers threatening open source contributors … I want all my modules to be deleted including my account, along with this package. I don’t wanna be a part of npm anymore. If you don’t do it, let me know how do it quickly. I think I have the right of deleting all my stuff from npm.”

A few hours later, npm gave him the command to do just that, and he deleted all 273 modules he’d registered on npm. But with all the focus on kik, no one considered the ramifications of deleting left-pad, and chaos ensued.

Koçulu has since apologised for the unexpected disruption, but stands by his decision. “Feeling very sorry for interrupting people’s work,” he wrote in an email to Ars Technica. “I did it for the benefit of the community in long term. Npm’s monopoly won’t be dictated to the free software community anymore.”

The bigger issue that remains is how to deal with these problems in future, and how to avoid them happening in the first place – and that’s something npm are now looking into.

“We dropped the ball in not protecting you from a disruption caused by unrestricted unpublishing. We’re addressing this with technical and policy changes,” wrote the company in a blog post last week. “We’ll continue to do everything we can to reduce friction in the lives of JavaScript developers.”

In the meantime, be careful with code out there, kids. You never know what could be relying on it.

A version of this article was originally published in March 2016.

Read More On This At ScienceAlert – Latest

Comments

Science & Technology

New Physics: Mysterious radiation pointed to the verge of discovering a “ghost” particle that makes up dark matter

New Physics: Mysterious radiation pointed to the verge of discovering a "ghost" particle that makes up dark matter 99
Photo: Daniel Molybdenum, NASA's Goddard Space Flight Center

Physicists at the Lawrence Berkeley National Laboratory in the United States have found that the mysterious high-energy radiation emitted from the vicinity of a group of neutron stars may indicate the existence of axions – not yet discovered particles within the framework of New Physics, the search for which has been going on since 1977. It is assumed that special types of axions form dark matter. This is reported in an article published in the journal Physical Review Letters. The research is summarized in a press release on Phys.org.

It is believed that axions can form in the core of neutron stars and transform into photons in the presence of a powerful magnetic field. To detect the electromagnetic radiation associated with axions, you need to find stars that do not emit radiation at different wavelengths that can mask the desired signal. 

These objects include the Magnificent Seven neutron stars that emit only X-ray and ultraviolet radiation. They are located at a distance of 200-500 parsecs from the Earth.

The researchers ruled out the scenario that the excess X-rays produced by the Magnificent Seven are actually emitted by other, more distant objects. These sources would be found in datasets from the XMM-Newton and Chandra X-ray space telescopes.

The extra X-rays likely originate from axions hitting an extremely strong electromagnetic field billions of times stronger than the magnetic fields that could be created on Earth, the scientists concluded. The axions themselves resemble neutrinos in their properties, since both have insignificant masses and rarely and weakly interact with matter.

The axion is currently viewed as the most promising candidate for dark matter particles, since another hypothetical candidate, the massive WIMP particle, has gone unnoticed in experiments aimed at detecting it. 

In addition, there may be a whole family of axion-like particles that form dark matter, as suggested by string theory. If axions are found, it will prove that there is a whole new area of ​​physics outside the Standard Model describing the properties of all known particles.

To find out, the next step will be to study white dwarfs, which are not expected to emit X-rays.

“If we see an abundance of X-rays there too, our arguments will be pretty compelling,” said lead author Benjamin Safdie.

Continue Reading

Science & Technology

The goal of human civilization is to create AI and disappear?

The goal of human civilization is to create AI and disappear? 100

Various sources often talk about civilizations that lived long before us. They all developed, prospered for a while, and then disappeared in an incomprehensible way. 

What is the reason for their decline, we probably will not know. All we can do is admire the remains of stone buildings, over which time has almost no power.

While looking for an answer, we somehow accidentally stumbled upon an interesting saying about the life of Japanese samurai: “A samurai has no goal, but a path.” In the end, the “path of the samurai” ended in what is known – death. The path of any civilization ended in the same way.

If you look at the issue through the prism of a samurai saying, then there is no point in looking for why and how civilization ended its existence. Probably, the process itself and its result are important here. But to whom is it important and what result does it expect?

Mysterious director

Apparently, behind the curtains of this “ancient theater” there is a mysterious “director” who periodically makes necessary adjustments to the history of civilization.

To figure out what’s what, you need to look at current trends in science. Where does a person strive with such an irresistible desire to “play God.” This attracts him and at the same time frightens him, but in no way turns him away from the intended path. Most likely, artificial intelligence (AI) is the purpose of our civilization’s existence.

About 50 years ago it would have seemed nonsense, but to someone, perhaps even now. However, if you trace the last 100 years of the life of our civilization, you get the feeling that most of the discoveries were given to mankind at the same time. A powerful leap has taken place in a hundred years. Why did it happen?

At the beginning of the last century, scientists recognized the existence of fields that have memory and the ability to store and transmit information. It is very likely that such or a similar field can be around the Earth and, more interesting, possess intelligence. Isn’t this the same “Director” hiding behind the screen of the “ancient theater”?

If this is so, then at a certain moment the “Director” gives the selected scientist “access” to certain knowledge (perhaps even in a dream, like Mendeleev), and another scientific breakthrough occurs in the world. Step by step, discovery after discovery, humanity is steadily moving towards the creation of AI. The trend is already well visible.

The goal of human civilization is to create AI and disappear? 101

AI is probably the next “Babylon”, which will combine all the knowledge, culture and accumulated experience of civilization. In the future, the neural network will enter into a connection with the general information field and leave humanity without knowledge, technology, and even a spoken language. This will be the next decline of civilization. And the “Director” will receive another array of new data (experience) in order to start creating a new civilization.

If someone believes that past civilizations ended in large-scale conflicts, then most likely this is already the consequences of “turning off” AI.

Co-founder of Skype talked about the threat of AI to humanity

One of the creators of the Skype internet call service, Jaan Ta

The goal of human civilization is to create AI and disappear? 102
Photo: 
© still from the movie “Terminator 2: Judgment Day”

llinn, said that the development of artificial intelligence (AI) threatens humanity. According to him, humans face three key threats, but it is AI that should be feared most of all, the expert said. 

Tallinn explained that at the moment, no one can predict what development AI will achieve in the next decades. In addition, the fact that scientists are creating artificial intelligence that can form a new AI without human intervention is also a cause for concern.

In addition, as the co-founder of the popular video calling service noted, the development of synthetic biology also causes concern. According to him, this direction in science allows the creation of artificial DNA sequences and biological systems that may not exist in nature.

Tallinn also drew attention to the fact that he fears we are entering an era of “unknown unknowns”, things that people are not even able to imagine right now.

Continue Reading

Science & Technology

Volkswagen robot will autonomously charge cars: a working prototype presented

Volkswagen robot will autonomously charge cars: a working prototype presented 103
Copyright: © VW

The renowned German car manufacturer announced a new development. This time, engineers have created a unique robot capable of autonomously charging electric vehicles. 

For more than a year, specialists have been developing this project, but only now the concern was ready to demonstrate the first working prototype. The robot is ready to charge electric vehicles and has shown the high efficiency of this process.

It is called the Mobile Charging Robot, and experts have already compared it to the R2-D2 droid from Star Wars, including squeaks and clangs. Indeed, there is a similarity. Before implementing this idea, the engineers decided that robots should be allowed to charge cars parked in large residential complexes.

This will save their owners from leaving in order to find a gas station. Another advantage is that large parking lots and garages do not have to contain several expensive charging points for electric cars. The car company said in a press release that the robot works exclusively autonomously.

It independently controls and interacts with the vehicle being charged. It opens the cover of the charging socket and independently connects the power plug, then disconnects it. The robot looks like a trailer, which is a mobile energy storage.

It is capable of charging multiple electric vehicles at the same time. Despite the fact that the manufacturer confidently praises its concept, experts saw inefficiency in the fact that first it is necessary to charge the robot’s battery, which is then used to recharge electric cars.

Volkswagen Group Components CEO Thomas Schmall noted that creating an efficient charging infrastructure for the cars of the future is an important step in the company’s development.

Its engineers focus on finding solutions to avoid costly do-it-yourself measures. The mobile robot is only part of the concept that will continue to be developed.

Continue Reading
Advertisement

DO NOT MISS

Trending