Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is big data's basic grammar?

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the basic grammars of big data". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the basic grammar of big data"?

1 introduction of computer theory

2 the basis of programming-- binary classification, binary conversion

Binary system

It's the carry system. It refers to the system in which we carry when we represent a number.

Binary classification

The following systems are commonly used in computers:

| | binary | description | example | remarks |

| |-- |-|

| | binary | use 0 and 1 to describe all natural numbers | 0,1,10,11,100,101 | start with `0b` |

| | Octal | use 0-7 to describe all natural numbers | 4, 5, 6, 7, 10, 11, 12 | start with `0` |

| | Decimal | use 0-9 to describe all natural numbers | 6, 7, 8, 9, 10, 11, 12 | |

| | hexadecimal | use 0-9, amurf to describe all natural numbers | 9, A, B, C, D, E, F, 10 | start with `0x` |

Binary conversion

-decimal to other decimal systems

-toss and turn division, divide by number, then divide by quotient, until the quotient is zero, and finally connect the remainder of each step backwards

Other decimal to decimal

-the number of digits in each digit multiplying to the power of-1, and then add up all the results

-conversion between binary and octal

-each octal bit can be equivalent to three binary bits

-each hexadecimal bit can be equivalent to four binary bits

Original code, inverse code, complement code

| | positive number | negative number |

| |-- |-- |

| | Source code | binary representation calculated directly from a number | the highest bit represents a symbol bit: 0 represents a positive number and 1 represents a negative number | |

| | inverse code | same as the original code | symbol bit remains unchanged, other bits are reversed by bit |

| | complement | same as original code and inverse code | Anti-code + 1 |

Note:

-data storage and operation are carried out in the form of complement

-the result of complement and complement operation is still complement.

-ask for the complement again, and you can get the original code

3 what is Java

Java is an object-oriented programming language, which can be used to write programs to achieve some of the functions we want. It is mainly divided into three parts:

J2SE: the standard version of Java for standard application development.

J2ME: a miniature version of Java, often used for mobile development.

J2EE: enterprise version of Java for enterprise-level application service development.

To run the Java program, it is necessary to compile the .java source files into .class bytecode files, and then the jvm virtual machine translates these bytecode files into machine language, and then performs the corresponding operations.

Interpretation of common nouns

JDK: Java Development Kit, Java development framework, various toolkits needed to develop Java programs.

JRE: Java Runtime Envrioment, Java runtime environment.

JVM: Java Virtual Mechine, Java virtual machine, able to run Java programs

1.2.4 Common DOS commands

-cd: switch to the specified path

-dir: enumerates all files and folders in the current directory

-mkdir: create a folder

-rmdir: delete a folder

1.2.5 installation of JDK and configuration of environment variables

-installation of JDK

-find the corresponding version number and install it directly.

-after installation, there are instructions for compiling and running Java programs in the bin directory of jdk.

-configuration of environment variables

-Why configure environment variables

-because we need to use the javac and java instructions under the bin directory to compile and run the program, and if we use these two programs, we need to use cd to cut to the specified path before execution, and the parameters need to write the directory where the java file is located, so it is very inconvenient to compile and run the program. So we need to add the bin directory to the environment variable so that we can use the javac and java instructions in any path to compile and run our program.

-how to configure environment variables

-my computer-> right-click-> Properties-> Advanced system Settings-> Environment variables

-Select system variable-> Path-> Edit

-win10: create a new variable, paste the bin directory under jdk, and move it up to the top

-win7/8: paste the path of the bin directory under jdk to the front of all paths, and then add a path separator

-how to verify that the environment variable is configured successfully

-create a new DOS window and enter the instruction javac. If there is no error prompt, it is a success.

1.2.6 comment

Comments are descriptions of the code that developers write to themselves or others to read, equivalent to some notes or memos we record. The content of the comments section is not compiled, so there is no grammatical requirement.

Comments can be divided into three categories:

-single-line comments: start with two / /, and the following line will be commented

-Multiline comments: start with a / * and end with a * /. Everything in the middle will be annotated.

-document comments: start with / * * and end with * /. Some tags can be added to the document comments to make it more convenient to record the information of the program.

1.2.7 data types

In the program, we need to manipulate a variety of data, all of which have different types.

In Java, all data can be divided into two categories: basic data types and reference data types.

Reference data types, also known as reference types. It is explained in detail later in the course.

Basic data types, also known as value types, are classified in Java as follows:

-Integer

-is an integer, divided into four categories according to the size of the space occupied.

-byte type: byte, 1byte, [- 128,127]

-short integer: short, 2byte, [- 2 ^ 15 ^, 2 ^ 15 ^-1]

-Integer: int, 4byte, [- 2 ^ 31 ^, 2 ^ 31 ^-1]

-long integer: long, 8byte, [- 2 ^ 63 ^, 2 ^ 63 ^-1]

-floating point

-decimals, which are divided into two categories according to the amount of space occupied.

-single precision floating point type: float, 4byte

-double precision floating point type: double, 8byte

-double-precision floating-point type can be more accurate than single-precision floating-point type.

-Boolean type

-used to describe data that is either right or wrong, true or false in the program

-boolean, 1byte

-there are only two values: true / false

-character type

-used to describe the smallest units that make up a text

-char, 2byte

-character data needs to be enclosed in single quotation marks. There can be only one character in single quotation marks, neither more nor less.

1.2.8 Identifier

An ordered sequence of characters used to describe a data in a program

Naming rules

-can only consist of letters, numbers, underscores, and $symbols

-cannot start with a number

-cannot have the same name as keywords and reserved words

Keyword: a sequence of characters occupied by the system that has been given a special meaning

Reserved word: a sequence of characters occupied by the system that has no special meaning for the time being, but may be used later

Naming convention

-look at the meaning of the text: you should be able to see the meaning of the data you want to express from the naming of the identifier

-follow hump nomenclature

Great hump nomenclature: all words are capitalized

Small hump nomenclature: except for the first word, starting from the second word, the first letter of each word is capitalized

1.2.9 variables and constants

Variable: data in which the value can be changed while the program is running

Constant: data whose values cannot be changed while the program is running

A declaration in the program

-variable

-data type identifier

-data type identifier = initial value

-data type identifier 1, identifier 2,.

-data type identifier 1 = initial value, identifier 2, identifier 3 = initial value,.

-constant

-final data type identifier = initial value

-final data type identifier; identifier = initial value

-Java allows no initial value to be assigned when a constant is declared, and the assignment can be delayed. But the assignment can only be done once.

1.2.10 escape character

A special character\ has two main functions

-some characters with special meaning can be converted into ordinary characters

-single quotation marks, used to match the beginning and end of a character, escape characters to make it a normal single quote

Double quotation marks, used to match the beginning and end of a string, escape characters to make it a normal double quotation mark

-can be used with some ordinary characters so that they have no special meaning

-n itself is an ordinary character, used with escape characters:\ n to indicate a line break

-t itself is an ordinary character, used with escape characters:\ t to denote tab

-r itself is an ordinary character, used with escape characters:\ r for return

1.2.11 data type conversion

After a variable declaration is completed, the space has been opened up in memory, and it is not allowed to resize the space at this time, that is, the data type of the variable is not allowed to be changed. The data type conversion here refers to declaring a new variable of the specified type and copying the value from the original variable to the new variable.

There are two types of data type conversions:

-automatic type conversion

-also known as * * implicit conversion * *. It is generally converted from a data type with a small range of values to a data type with a large range of values.

-the conversion process does not require any additional operation

-after conversion, there is no loss of precision.

-Force type conversion

-also known as * * explicit conversion * *. It is generally converted from a data type with a wide range of values to a data type with a small range of values.

-the conversion process needs to be enforced and cannot be completed automatically

-loss of precision may occur after conversion

Java

Byte a = 10

Int b = a; / / convert from byte type to int type, automatically without any additional operation

Int c = 128c

Byte d = (byte) c; / / change from int type to byte type, forced operation, there will be precision loss

Additional instructions

-data of byte, short and char types will be automatically converted to int types when performing operations.

Floating point conversion type, leaving out all the contents after the decimal point, leaving only the integer part

1.2.12 Common operators

Arithmetic operator

Used to do basic arithmetic calculations, +-* /% +-

Where:

There is no difference between -\% and mathematical calculation.

-divide the data of two integers, and the result is still an integer, which will strongly convert the calculated floating-point result into an integer.

The self-increasing operator + + is used in front of a variable to indicate that it is preceded by the value of the variable, followed by a + 1 operation on the variable.

-the self-increasing operator +, which is used after a variable to indicate that the variable is first operated on by + 1, and then the value of the variable is taken.

-self-subtraction and self-increase

> int a = 10

>

> int b = a minimum; / / the value of b is 10

>

> int c = + + b; / / c is 11

Assignment operator

=: assign the value to the right of the equal sign to the variable on the left

+ =,-=, * =, / =,% =: combine operators to operate on a variable

> a + = 10; equivalent to a = a + 10

Relational operator

\ >

< >

=

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report