"Computer Algorithm Design and Analysis" - code specifications as well as "mathematical beauty" Book

A code specification

1, the variable naming requirements for "Hungarian law"

I.e., beginning with the letter variable type, with the remainder of the variables mean or abbreviation of the English meaning, try to avoid using Chinese pinyin, the first letter of the word required to be capitalized. Namely: variable name = + variable type variable meaning in English (or abbreviation) of the non-generic variables, explanatory notes added when defining, defined variable may be placed as far as possible at the beginning of the function.

 

2, the alignment (the Alignment) and the indentation (indent)

- ensure that the code clean, clear layer of the primary means
- "position two styles {
{} and its own line, and in the same column, with reference to their statement left-justified to facilitate pairing check
in the same layer within {} and {code left-justified in the number of cells at the right side, i.e. on the same level in the same code level indent level
- generally provided with four indented spaces Tab key, not indented spaces

 

 

 

 

Second, the "mathematical beauty" Book

Read 1.13 "mathematical beauty"    mathematical beauty Series 33 - Authoritative fingerprint information and its application

Speaking of fingerprints, we will think of each person's fingerprint is unique, then the input fingerprint information is really unique in it?

The answer is not necessarily.

Any piece of information text, can correspond to a too long random number,
As the difference between it and other fingerprint information (Fingerprint).
As long as a good algorithm design, no two fingerprints are difficult to duplicate information
, Just like human fingerprints. Fingerprint information has been widely used in encryption, compression and processing information.
 
The original text is difficult to say will be repeated, so we still have a chance of repeated fingerprints, but the probability is very small.
The next read on, we look at why it?
 
The key generation algorithm of the fingerprint information is a pseudorandom number generation algorithm (prng). most
Early prng father of the computer algorithm was developed by von Illinois Manti out. His way of non
Very simple, it is to break off both ends of the square of a number, several intermediate access. such as
A four-digit binary number 1001 (corresponding to decimal 9), which is the square of
01010001 (decimal 81) break off both ends of the remaining four intermediate 0100. of course
Digital generated by this method is not very random, that is to say two very different information can be
To have the same fingerprint.

 But even if there is likely to be repeated or likely to be hacked, we have no need to panic, because we and many encryption functions and systems. Look

Internet use encryption generator (CSPRNG) pseudo-random number based encryption. Common
The algorithm MD5 or SHA1 standards, they may be variable length information becomes
Into fixed length binary 128 or binary 160-bit random number. It is worth mentioning that matter,
SHA1 previously thought to be no loopholes, and now has been Professor Wang Xiaoyun of China
Loopholes proof. However, we do not panic, because this can really break through and hackers
Your registration information is also two different things. 

Well, you read it here first.

Although the fingerprint information of a long history, but the real has been widely used in the mutual
After networking, which a few years before getting hot up. 

 Third, after planning

I think we can use some of the games do their own programming, similar to the white pieces do not step on them, and can do some scripts or plug-ins, make some green plug-in, hands-free.

Guess you like

Origin www.cnblogs.com/jyf2018/p/11484753.html