• This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

Thank you very much for reading this article. Welcome [👍 like] [⭐ collect] [📝 comment] ~ Give up is not difficult, But insists it must be very cool ~ hope we all can be a little bit of progress every day ~ in this paper, from two headed white hat original ~ https://juejin.cn/user/2771185768884824/posts blog


I wish all program monkey/yuan happy holidays, a day for the program monkey/yuan will be lifelong learning, I hope we can progress a little bit every day ~


1024 Programmer Section

1024 programmers festival is the common festival of programmers. 1024 is two to the tenth, one of the basic units of binary counting. In view of the situation that programmers often work overtime on weekends and stay up late on weekdays, some Internet organizations have proposed to set October 24 as the 1024 Programmer Day every year, on which programmers are advised to refuse to work overtime.

Programmers are like 1024, building the technology world with the lowest tone, solid, core functional modules. 1G= 1,024m, and 1G is a homonym for grade 1, which also means grade 1.


Background the festival

Programmer (English Programmer) is a professional engaged in front-end and back-end program development, system operation and maintenance, testing, etc. Programmers are generally divided into programmers and programmers, but the line between the two is not very clear, especially in China. Software practitioners are divided into junior programmers, intermediate programmers, senior programmers, system architects, operation and maintenance test engineers, etc.

In 1834 Charles Babbage, a British mathematician, inventor and mechanical engineer and friend of Ada Lovelace, known as the “Queen of numbers”, developed an analytical engine; Ada worked on writing the algorithms for the analytical machine and, in 1842, wrote history’s first computer program. The world’s first algorithm was published in 1843. Babbage’s analytical machine was later considered the earliest prototype of a computer, while Ada’s algorithm was considered the earliest computer program and software. The hardware base for running the program is 1024. Example: 1 g = 1024 m; 1 m = 1024 KB.

import java.text.MessageFormat;

public class Test {

	public static void main(String[] args) {
		// I just want ¥, so I have to write it this way
		Integer $1024 = 1024;
		System.out.println(MessageFormat.format("The 2-base representation of {0} is: {1}", $1024.toString(), Integer.toBinaryString($1024))); }}Copy the code


Festival origin

In 2002, Valentin Balt, a Russian programmer, collected signatures to petition the Government of the Russian Federation to establish September 13 as Programmer’s Day.

On September 11, 2009, Russian President Dmitry Medvedev signed the plan for the festival, making it an official holiday in Russia. In addition to Russia, some programmer communities in other countries also celebrate the day. Why September 13th? Because it is the 256th day of the year (September 12 in leap years). The number 256 has special meaning for programmers. One byte (equal to 8 bits) can represent a maximum of 256 values, and 256 is the largest power of 2 less than 365 over the course of the year. In China, some people suggest that October 24 be designated as China’s Programmer’s Day, because 1024 is also a common number for programmers, and the date is very intuitive and does not change between ordinary years and leap years.

import java.text.MessageFormat;

public class Test {

	public static void main(String[] args) {
		// I just want ¥, so I have to write it this way
		Integer $powerOf2 = 2;
		final int maxDaysPerYear = 366;
		while ($powerOf2 * 2 < maxDaysPerYear) {
			$powerOf2 *= 2;
		}
		System.out.println(MessageFormat.format("The greatest power of 2 less than 365 is: {0}", $powerOf2.toString())); }}Copy the code


Why 1024

Programmers are extremely sensitive to 1024, which is more than an integer of 1000. If you happen to see or hear 1024, will be so excited, the reason 1024 is special, because computers commonly use base 2 (also have terimal computer oh 1), 1024 is exactly 2 to the tenth power, so computers commonly use 1024 as a base.

Chinese unit Chinese referred to as” English units English abbreviations Carry rate (Byte=1)
position The bit bit b 0.125
byte byte Byte B 1
kilobytes kilobytes KiloByte KB 2 ^ 10
megabytes mega MegaByte MB 2 ^ 20
gigabyte ji GigaByte GB 2 ^ 30
terabytes too TeraByte TB 2 ^ 40
petabytes pat PetaByte PB 2 ^ 50
exabytes Mr. ExaByte EB 2 ^ 60
Ze byte jersey ZettaByte ZB 2 ^ 70
Yao byte yao YottaByte YB 2 ^ 80
Quadrillion quadrillion bytes Quadrillion quadrillion bytes BrontoByte BB 2 ^ 90

The conversion relation between them is: 1B=8bit 1KB=1024B 1MB=1024KB 1GB=1024MB 1TB=1024GB 1PB=1024TB 1EB=1024PB 1ZB=1024EB 1YB=1024ZB 1BB=1024YB 1NB=1024BB 1DB=1024NB 1CB=1024DB 1XB=1024CB

Although we usually talk about the binary representation of some data at the bottom of the computer 1,0… But when you open up the hard disk, memory, CPU registers, you don’t have a string of 1’s, 0’s… . It may be magnetic and non-magnetic, with high voltage and ground voltage.

Range of each digit in decimal: 0-9 Range of each digit in binary: 0-1

Computer binary main reasons: 1, the computer is composed of logic circuit, logic circuit usually only two states, switch on and off (high voltage and low voltage, magnetic and no magnetic), these two states can just use “1” and “0”; 2, binary only use 0 and 1 two digits, transmission and processing is not easy to make mistakes, so it can ensure that the computer has a high reliability.

Two begets four, four begets eight, eight begets sixteen, and sixteen begets everything.


Make a joke. Give me my capacity back

Although the computer industry standard TB, GB, MB, KB between the relationship is 1024. But hardware manufacturers do not play so, such as the two master configuration is 1TB hard disk, however…

General hard disk manufacturers, the basis is 1000, that is, 1TB=1000GB, 1GB=1000MB, 1MB=1000KB, this is the standard of hard disk manufacturers, which is an open secret in the storage market, almost can be said to be the “industry standard”.

Yes, it was 1TB when you bought it and 931GB when you use it. Give me my capacity back.


Happy programmer’s day

Finally, I wish you a happy 1024 programmers’ day. Wish there are no more requirements and bugs that are difficult to do.

All right, husband of two is going to the convention.


  1. Ternary computer is a computer developed on the basis of the ternary number system. It has been used in computers by researchers at Moscow University, and has also been involved in photon computer research. Symmetric ternary can represent all integers more conveniently than binary. Ternary system is “every three into one, back one return three” base system. ↩