Column | chapter nine algorithm
Url | http://www.jiuzhang.com
It’s called “bug-free life”. From the moment you put up with the first line of code, bugs will follow you wherever you go.
In fact, it is good for bugs to be discovered by yourself or your testers; But if it is discovered by users, or leads to huge losses for customers and the company… These unknown consequences, like a knife hanging over the head, let people shiver down the spine…
But a small bug, may bring you a shock, may also bring a surprise. What are the unexpected effects of bugs?
1. A Christmas gift package from Amazon
In December 2014, Robert Quinn of The UK received more than 50 packages!
But this was not the result of his shopping the night before, it was Amazon’s computer that sent the returned warehouse package to his home by mistake! Robert contacted Amazon three times, worried that the return-buyers would not receive their money.
However, Amazon replied to him: “So many things have been sent to you by mistake. You can keep these. You can have them!
In fact, Amazon misdelivers packages from time to time, and FTC rules allow you to keep the item if it’s the retailer’s fault. You can return it if you don’t want it, and Amazon should pay for the return flight. If you keep it, you can give it to a friend, donate it to a charity, or even sell it online
2 be a millionaire for one night
On January 1, 1999, 19 European countries introduced the euro to replace their national currencies. In Portugal, one euro is worth 200 Escudos.
On New Year’s Eve, one Portuguese Internet user had 1.5m Escudo in his bank account. The next day’s account would have been 7,500 euros. At this point, however, he had ** 1.5 million euros in his bank account, 200 times more than before!! ** At this time, the bank suddenly, as if he was a member of the emperor.
So on Jan. 6, he received an email signed by the bank’s CEO inviting him to a private opera evening, tuxedo, on the weekend.
The netizen said he knew the huge fortune was nothing more than a dream, but the party was too exciting to refuse to go. So he wrote back and asked for extra tickets for colleagues and friends. Sure enough, he got a call from the CEO’s secretary, who said they’d be happy to offer more tickets.
“The opera wasn’t very good, but the caviar and champagne made the trip worthwhile,” the one-night spender said.
But soon after, his bank balance was corrected and he never heard from the CEO again
3 Psy forced YouTube to upgrade its counting system
Psy’s “Gangnam Style” hit Google in 2014.
YouTube capped the count at 32 bits, which meant that the maximum count that could be displayed was 2,147,483,647. Never before has a video exceeded YouTube’s preset limit. Until, at some point, the number of views for “Gangnam Style” went up to — 2142871897, and Google finally panicked.
YouTube said: “We never thought a video would surpass the high end of 32-bit integer numbers until we met Psy.”
In this way, YouTube is compelled to upgrade the counting system to 9223372036854775808, the nine Quintillion (more than ninety billion, 9 (1018).
4 The hilarious Bank of Canada affair
Canadian Trust ATM machines accept cards, but if you don’t have a card you can type in your account information and do your banking that way. The machine will ask you, “Do you have a bank card?” There will be a button for yes and another button for no.
Programmers spend months debugging the system, tracking down every bug, anticipating every bizarre decision a customer might make… All this is to ensure that the system will remain stable while running.
Finally, the day came when the machine went into service.
In the first hour of operation, a customer somewhere in southern Ontario, after choosing “No” to the question “Do you carry a card,” forced his card into the slot.
And then this whole system, the whole Ontario system, is… The avalanche.
50,000 deaths to blame! I should have updated the code…
Ariane rocket crashed because the software code was not tested and updated? !
On 4 June 1996, the Ariane 5 launch vehicle, which was supposed to carry four solar wind observation satellites into their intended orbit, deviated after launch due to a software problem and activated the self-destruct device. In an instant, the A-v rocket and other satellites burned to ashes.
The cause of the accident, however, is code reuse! In the case that the flight conditions of the two are completely different, the launch system code of a-5 is still directly reused the corresponding code of A-4. While the code worked perfectly on an Alpha 4, it was never tested on an Alpha 5.
It turned out that the Type 4 was inputting 16-bit integer data into older software (SRI), and the Type 5 was inputting 64-bit floating-point data into SRI, which overflowed when the data was converted.
The accident cost 370 million dollars.
6 A “/” key, blocking the entire Internet
On January 31, 2010, Google blocked the entire Internet.
Google has always protected us from malware and virus-infected sites; Working with StopBadware, it watches for dangerous malware/viruses/software and keeps the list of tagged sites up to date.
This time, the programmer who added the site to the tag list accidentally typed a “/” where he should have typed the URL.
Because of this omission, all sites on the Internet were flagged as dangerous.
The outage lasted 40 minutes and cost $3 billion.
7 One word difference, AWS service interruption
AWS (Amazon Web Services) is the backbone of the Internet because it provides cloud Services for many large websites and applications.
On February 28, 2017, the Amazon (S3) team was debugging an issue that was causing the S3 billing system to process slower than expected.
An authorized S3 team member uses a pre-written Playbook to execute a command designed to remove a small number of servers for one of the S3 subsystems used by the S3 billing process.
Unfortunately, when he typed the command… Typed a letter wrong!
It ended up deleting a whole bunch of servers that shouldn’t have been deleted. The server that was accidentally deleted supports two other S3 indexing and placement subsystems. Removing a significant portion of the capacity caused each system to require a complete reboot.
The outage lasted about four hours and affected thousands of online services, including Netflix, Airbnb, Slack, Spotify, Yahoo Webmail and others.
8 0.000000095 Patriot wounds
Feb. 25, 1991. During the Gulf War, U.S. Patriot systems fail to track and intercept an Iraqi Scud missile at Dhahran, Saudi Arabia.
The patriot missile defense system works in the following stages: exploration, verification, and tracking. In the tracking stage, it waits for the other side’s missiles to intercept it. But if the Patriot works for more than eight hours, its range will be 20% off its normal position. While this was a known bug, the U.S. military did not expect the Patriot to work for more than eight hours, but by then it had been operating for about 100 hours.
System every 1/10 of a second on a multiplied by 1/10 operation, and 1/10 of the binary is 0.00011001100110011001100… … , but only up to the 24th decimal place in aigo’s 24-digit fixed decimal register. Each calculation will give 0.0000000000000000000000011001100 about 0.000000095 (decimal).
Aigo working time is about 100 hours, 0.000000095 x 100 (hours) x 60 (minutes) x 60 (seconds) x 10 (division operation performed per second) =0.34 seconds; The speed of the Scud missile is about 1676 m/s. At 0.34 m/s by 1676 m/s, the range of the missile is already more than half a kilometer. That’s enough distance to get the missile out of range of the Patriots.
The missile struck an American military camp, killing 28 soldiers and wounding about 100 others.
Don’t kill all my system software!
On April 21, 2010, McAfee recognized Windows system files as quarantined infected files during an Enterprise edition software update.
McAfee wasn’t sure how many computers were affected, but online reaction suggested that at least hundreds of thousands of computers were affected by the McAfee update failure at hospitals, businesses and schools around the world. Intel’s internal computers and Dish Network’s call centres are also said to have been affected.
McAfee has since fixed the software issue and is again offering software updates for download.
In May 2007, Symantec’s NORTON antivirus software had a similar problem. After the virus database was upgraded, the key system files of the Simplified Chinese version of Windows XP were removed as viruses, causing the system to crash.
In July 2016, the CA Internet security suite after McAfee mistakenly identified certain Windows XP system files as viruses, leaving users unable to find them. CA has confirmed this, but also stressed that these files are only quarantined and users can manually restore files.
But frequent victimized customers can only take backup as they see what remains of the world
Welcome to follow my wechat official account: Ninechapter.
Elite programmer exchange community, regular release of interview questions, interview skills, job information, etc