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

Comments

Science & Technology

Japan has developed an inflatable scooter that weighs practically nothing

The University of Tokyo engineers have developed the Poimo inflatable electric scooter, which is created individually for each owner. It is enough to send your photo to the manufacturers – and a personal optimized model will be assembled for you.

The scooter is designed with a special program for the body size of a particular user and his specific fit. Moreover, each owner is free to make any changes to this model. If he makes any changes to the drawing, the program will automatically redesign the electric bike to maintain its strength, stability and controllability. When the model is finished and approved, it is handed over to the manufacturer.

Scooter Poimo

The scooter consists of seven separate inflatable sections that are constructed from durable fabric and sewn with straight stitch. It remains to add electronic components – in particular, a brushless motor and a lithium-ion battery. 

The finished electric scooter weighs about 9 kg and can travel at speeds up to 6 km / h (that is, slightly faster than a pedestrian). It can work for an hour on one charge.

This is how the current version of Poimo looks like in action:

Continue Reading

Science & Technology

Excerpts from Elon Musk’s speech at the Martian Society convention

Elon Musk’s comments with questions relayed from the Mars Society Membership by Dr. Robert Zubrin, James L. Burk, and Carie Fay. Following Elon’s 30 min time, Dr. Zubrin took additional questions. This special event was part of the 2020 Mars Society Virtual Convention from October 14-18, 2020.

About Starship Test Schedule:

– entering orbit – with a probability of 80% -90% will take place in 2021

– the probability of the return of the ship and the 1st stage in this flight is 50%

– test of refueling in orbit – 2022

– Starship lunar version – 2022 or 2023

– Starship flight to Mars – around 2024

The goal of the Starship is to build a self-sufficient settlement on Mars as quickly as possible. Musk does not rule out the possibility that this will not be achieved during his lifetime. According to his rough estimates, to create a self-sufficient city, it will be necessary to deliver 1 million tons of cargo, which corresponds to 4-5 million tons in a low Earth orbit. Modern single-use launch vehicles are capable of removing less than 1% of this value.

“Disposable launch vehicles are completely stupid. They are a waste of time. I think people need to stop wasting time on this. If you try to sell a disposable plane, you will be thrown out of the office. If you try to sell a disposable car, you will also be thrown out of the office. “

A series of questions and answers followed:

What is the best landing site on Mars?

– I’m not sure about that. But I can name the criteria. The first of these is latitude: most likely it will be in the northern hemisphere, far enough to the north to have water ice, but to still have enough sunlight.It also needs to be low to get the most benefit from atmospheric braking.

How do you prioritize mission priorities: research, infrastructure construction, and science?

– The first will be the construction of a fuel plant.

A question from a teenager who wants to become an engineer and robot maker with a dream to work at SpaceX: what is the most important education in order to become an engineer?

– There are many varieties of this profession: you can be an aerospace engineer, in the field of electronics, software, or a chemical engineer involved in creating safe production of fuels. I think physics is a good foundation for critical thinking.

Boring Company was originally conceived as a tunnel manufacturing firm on Mars?

– No. It was originally something of a joke. I thought tunnels were a good solution to reduce the traffic problem in cities and improve the quality of life by turning parking lots into green parks. To do this, you need to go to 3d [get away from the “flat” infrastructure – approx. per.]. I think tunnels are good for Mars too. But there you need a lot lighter equipment: you don’t care about mass on Earth, but you will have to take care of it a lot when going to Mars.

At Boring Company, have you learned a lot of technology that might come in handy on Mars?

– I think, yes.

Do you have any tips for young people who love Mars but don’t know how to participate in its settlement?

– I think any strong advocate of the need to conquer Mars matters. People often don’t even think about it. I often talk to people who don’t even know about it. Therefore, I consider it important for humanity and consciousness in general to bring a discussion about this to society. Talking about it with friends and acquaintances – I think this is what we should do. In my estimate, we will spend less than 1% of our efforts on Mars exploration, exactly less than healthcare, perhaps even less than cosmetics – this will be enough to make life multi-planetary. But this requires people to start talking about it 100 times more often. I think this is what really matters. [the entire cosmonautics of the world is $ 424 billion a year, while cosmetics is $ 532 billion, and tobacco production is $ 849 billion – approx. per.]

What’s the coolest part about Starship development?

– I think the coolest detail is the ability to work with a great group of engineers and come up with interesting solutions. I think the best thing is the opportunity to work with smart and creative people who come up with solutions that were not available before. This is a great reward.

What do you focus on when hiring, especially with regard to engineers?

“We’re looking for signs of exceptional ability. Or at the very least, striving to do exceptional things at SpaceX.

Are you planning to make a Mars-Earth communication system like Starlink?

– Yes, I think we will use a laser, probably launched into orbit, to avoid atmospheric diffraction. Thus, it will be a laser beam going from the orbit of the Earth to the orbit of Mars. And also relay satellites in solar orbit, since the laser beam cannot be sent through the Sun [when it is between Mars and Earth – approx. per.].

Can Starship be used for other destinations like Venus and other planets?

– Starship will be able to travel to any target in the solar system that has a solid surface when fuel depots appear. It is not the kind of transport that will take us to other stars, but when we become a multi-planetary species, we will create a demand for innovation in space travel that will ultimately lead us to interstellar travel.

Continue Reading

Science & Technology

Cern Scientists Plan an Impressive Experiment – They Will Come Into A Parallel Universe

Cern scientists are once again preparing to impress the entire planet and become the focus of discussions with the new experiment they are planning.

An experiment that, if it brings the fascinating result that scientists have in mind,  will change the way we think about the world , will take place in the next few days at the Large Hadron Collider, the European nuclear center, Geneva CERN Research.

The astonishingly LHC complex, the largest, most energetic elemental accelerator in the world,  will be “fired” for the first time to its highest energy levels, in an effort to detect – or even create – tiny black holes. 

If it succeeds, then, a completely new universe will be revealed – rewriting not only the books of physics, but also the books of philosophy! 

It is possible, however,  that gravity from our universe will “leak” into this parallel universe, as LHC scientists say. 

From the Higgs boson to dark matter and the parallel universe

According to the British Express, the experiment is sure to “trigger” the critics, who are worried about the LHC, many of whom warn that the elementary particle accelerator will mark the end of our universe, creating a of the black hole.

Nevertheless,  Geneva has remained … intact since 2008, when the LHC began its spectacular “work”.

The first scientists at the Large Hadron Collider proved the existence of the Higgs boson – a key building block of the universe – and the LHC appears to be on track to locate “dark matter” – a previously undetectable force now considered that it constitutes the majority of matter in the universe, being, in fact, the reason why the latter is constantly expanding and moving away. 

So next week’s experiment is considered to change the game. 

The truth is out there

Mir Faizal, one of three heads of the three natural groups behind the experiment, said: 

“Like many parallel sheets, which are two-dimensional objects (width and length) can exist in a third dimension (height) , so parallel universes can also exist in higher dimensions. We anticipate that gravity can leak into extra dimensions, and if that happens, then tiny black holes can be produced in the LHC. 

Normally, when people think of the multiverse, they think of the interpretation of quantum mechanics by many worlds, where every possibility is realized. This cannot be tested and so it is a philosophy and not a science. We do not mean this with parallel universes. What we mean is real universes, in extra dimensions. The truth is out there.”

Continue Reading
Advertisement

DO NOT MISS

Trending