Connect with us

Science & Technology

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

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

Advertisement
Comments

Aliens & UFO's

Ecto-1 Returns in Teaser for Secret Ghostbusters Movie

Trailer teases the return of the Ghostbusters with a malfunctioning proton pack and a rusting Ecto-1.

A new Ghostbusters is coming in 2020! It was announced this week with the arrival of this short but effective teaser trailer. It’s an eerie night and spine-tingling music from the original Ghostbusters score is playing as the camera moves past a fence dripping with ectoplasm into an creepy barn where we hear the sound of proton pack that won’t start. And then the wind blows up a tarp to reveal a rusting Ecto-1.

The new film is being directed and co-written by Jason Reitman, the son of Ivan Reitman who directed the original Ghostbusters.

“I’ve always thought of myself as the first Ghostbusters fan, when I was a 6-year-old visiting the set. I wanted to make a movie for all the other fans,” Reitman told Entertainment Weekly. “This is the next chapter in the original franchise. It is not a reboot. What happened in the ’80s happened in the ’80s, and this is set in the present day.”

A rusting Ecto-1 from the Ghostbusters teaser trailer

For those of us who grew up in the 80s, the 1984 Ghostbusters film was probably one of our earliest introductions to the occult, inspiring a lifetime of obsession. Sure, I was disappointed when I learned Tobin’s Spirit Guide wasn’t real, but my hope was renewed when I discovered real occult texts. And of course Ecto-1, a 1959 Cadillac built by the Miller-Meteor company, kick-started a love for hearses.

Do you believe in UFOs, astral projections, mental telepathy, ESP, clairvoyance, spirit photography, telekinetic movement, full trance mediums, the Loch Ness monster and the theory of Atlantis?

I probably had not even heard of these things before Ghostbusters.

The new Ghostbusters is set for a 2020 release.

Source link

Continue Reading

Science & Technology

A New Class of Drugs Could Make Safer Sleeping Pills

ZZZ

If your house caught fire in the middle of the night, you’d want to wake up to deal with that emergency, right?

In a new prescription sleeping pill study published this week in Frontiers in Behavioral Neuroscience, half of the study participants slept through a fire alarm as loud as someone vacuuming next to their bed. Researchers from Kagoshima University, Japan estimated that millions of people taking prescription sleeping pills like Ambien and Halcion would sleep through a fire alarm. They propose that a new class of hypnotic drug might be used as an alternative which would function like a sleeping pill while still allowing the brain to wake up during an emergency.

DORA The Hypnotic Drug

The most widely prescribed type of sleeping pills, benzodiazepines, are really effective at getting the brain into “sleep mode”. Unfortunately, they act as a sort of blanket, suppressing areas of the brain that they don’t need to. That includes the area of the brain that decides which external information, such as noises in the night, to pay attention to.

Over the past decade scientists have been developing a new class of hypnotic drugs called dual orexin receptor antagonists (DORAs). DORAs more selectively target the brain’s sleep/wake pathways making them a safer alternative to benzodiazepines while also leaving the user with a reduced hangover-like affect these drugs can cause.

Wake-up Call

When tested in lab mice, those that had been given the benzodiazepine triazolam were slower to rouse than those given DORA-22 when presented with the sounds of a fox, a serious threat to a mouse. Better still, once the danger had passed the mice given DORA-22 fell back asleep as fast as the mice that had been given a sleeping pill, and significantly faster than mice that hadn’t been given anything at all.

More human testing is needed in order to show DORAs have potential applications as sleep aids. Since 2014, a DORA called surovexant has gained regulatory approval in Japan, the USA and Australia. High costs and limited clinical testing of surovexant have stymied its use but new types of DORAs currently in development could some day offer better results at a lower cost.

READ MORE: Millions on prescription sleeping pills would sleep through a fire alarm [EurekAlert]

Source link

Continue Reading

Science & Technology

A new theory suggests that a mirror universe existed before the Big Bang

Since the 1950s, scientists have discovered that certain phenomena have the ability to violate some established symmetries of the universe. This is how it has now been proposed that our universe could be the reflected image of a universe of antimatter that extends backward in time before the Big Bang.

This has been suggested by a group of scientists from Canada. They have designed a cosmological model that raises the existence of an “anti-universe” that, like ours, has a fundamental rule of physics called “CPT symmetry”.

A fairly similar study was reported 3 years ago and suggested the existence of a mirror universe where time could be moved upside down.

What is the “science” here?

The phenomena that we mentioned in the first paragraph and that could violate some established symmetries of the universe are called parity (P), which is the idea that if you change all your spatial coordinates (up, down, inside, outside, right), physics will continue to behave in the same way. Another is called charge (C), which states that the change of matter to antimatter should lead to the same physics. But that is not always the case. At first, many of these violations were resolved using the combined CP symmetry, but then the researchers found violations in this as well, so they added time (T) to the equation. The principle says that something may be able to break one (or two) of the symmetries of physics, but nothing should be able to break the combined CPT symmetry.

Unlike the previous study, this new research uses this approach for the entire universe. They argue that the universe does not violate the CPT since our universe dominated by matter, expanding in a certain direction in the time since the Big Bang, is the mirror image of a universe dominated by antimatter that existed before the Big Bang.

This theory has some interesting advantages. It does not require us to build new physics to explain several complicated events in the evolution of the universe, such as ” Cosmic Inflation,” the extremely rapid expansion of the universe in the fraction of seconds after the Big Bang. It also presents a possible candidate for dark matter, since this configuration would produce an excess of hypothetical massive particles known as sterile neutrinos.

A new theory suggests that a mirror universe existed before the Big Bang

However, it is far from being a perfect theory. It does not explain, for example, the fluctuations of temperature in the cosmic microwave background: the universe must be full of radiation, which is the remnant of heat that remains of the Big Bang after the cooling of the gas, which has been a cornerstone of the cosmological models since its discovery.

Now, the team is working to solve these problems; and if they do, they may be able to respond if there is a mirror universe populated by “evil versions” of ourselves.

The scientific study has been published in  Physical Review Letters.

Continue Reading

Trending