At the end of the 20th century, human society faced an unprecedented crisis that, if it came to pass, could have ended civilization.
Later, with the concerted efforts of the world’s elite, the crisis was finally resolved.
The crisis was neither an earthquake, nor a tsunami, nor a pandemic, but the “millennium Bug” of computers.
How did the y2K bug come about?
Speaking of this question, we have to mention the great programming girl sister, Grace Murray Hopper.
It’s amazing to talk about this little sister, a computer scientist and commodore of the United States Navy.
What are the achievements of Grace Murray Hopper?
She invented the first modern compiler: the A-0 system.
She created the first commercial programming language, COBOL.
She found a moth in a malfunctioning computer, making bugs and Debug popular words in the computer world.
In the 1960s, storage resources were so scarce that programmers had to budget for each line of code.
To save more memory, the Grace Murray Hopper uses a six-digit combination to store time information. For example, on July 23, 1965, the corresponding form of storage was 65/07/23, leaving out the “19”.
This form of storage quickly spread through the computer world. Although it saves some storage costs, it has two hidden dangers:
1. Since only the last two digits of the year are retained, when 2000 arrives, the year stores information as 00, and the computer cannot tell whether it is 1900 or 2000.
2. 1900 was not a leap year, but 2000 was. If the first two digits of the year were set to “19” by default, February 29 in 2000 would be treated as March 1 and stored as 00/03/03.
Both threats didn’t emerge until the year 2000, so the problem has been dubbed the “millennium Bug,” or Y2K.
1. Get to the point
Since it is impossible to change all the procedures, we should focus on those that play a central role, such as those in the medical, aviation, financial and military fields, so that the workload will be reduced a lot.
2. Modify the time window
For most of the less core programs, programmers have come up with a trick called windowing, which translates as “window of time.”
This method preserves the 6-bit time expression for the time being, but the time range of the expression is not the default 1900-1999, but 1920-2019.
For example, “10” in the program, which used to mean 1910 by default, now means 2010.
This greatly reduced the cost of fixing the problem, but rather than fixing it, it delayed its onset by 20 years.
In Gambia, Africa, some government agencies’ software systems temporarily crashed. The Gambian government declared Monday a non-working day to temporarily ease the pressure on the authorities.
When a business company in Guangzhou, China, asked its software supplier for help after a series of computer failures, it found that more than 100 companies’ databases were down.
Like this article friends, welcome to pay attention to the public number programmer xiao Grey, watch more exciting content