区块链version是什么意思,区块链vert.x
请查看相关英文文档
① What introductory knowledge should you learn to learn Python from scratch
1. Introduction to Python
Python’s characteristics, advantages, disadvantages, prospects and what python can do What?
2. Python environment installation
Install the Python compilation environment with one click and write the first Python code
3. Understand what is writing code and the basic types of Python
Python Basic types, including integers and floating point types; the meanings and conversion relationships of 10, 8, 2, and hexadecimal numbers; Boolean types; strings and common string operations
4. What represents "group" in Python Concepts and Definitions
Understand the concept of "group" and some types used to represent "groups" in Python, including: tuples, lists, sets and dictionaries.
5. Variables and operators
Understand the meaning of variables and the seven operators, and give a detailed explanation of the expansion of each operator
6. Branches, loops, conditions and Enumeration
The basic logical structure of the code, including conditional control (if else), loop control (for in, while), expression and operator priority. In addition, there are Python enumeration types and Python coding specifications.
7. Packages, modules, functions and variable scopes
Understand the core organizational structure of Python code: packages, modules and functions. You need to have a very clear understanding of the organizational structure of Python code. The focus is on functions. In addition to understanding the basic concepts of functions, you also need to understand Python's flexible function parameter mechanism (default parameters, keyword parameters, and list parameters).
8. Python functions
Functions are the basic code organization structure found in all languages. The importance of functions is self-evident. For Python, the usage of functions is extremely flexible and much more powerful than other languages. Understand the definition, calling, sequence unpacking, required parameters, keyword parameters, default parameters and many other contents of Python functions.
9. Advanced Part: Object-Oriented
Understand the concept of object-oriented. Including the three major characteristics of object-oriented (inheritance, encapsulation, polymorphism), the basic elements of classes, python's built-in class attributes, method overriding, operator overloading, static methods, etc.
10. Regular expressions and JSON< br />Regular expressions are also a very important knowledge point in text parsing. Learn how to write regular expressions and common regular expressions in Python. In addition, focus on understanding the conversion of JSON objects, JSON strings, Python types and JSON.
11. Advanced syntax and usage of Python
Understand the advanced parts of PythonLevel features, such as enumerations, closures
12. Functional programming: anonymous functions, higher-order functions, decorators
Learn more about lambda, mapece, filter and decorators of functional programming
13. Practical combat: native crawlers
Learn how to access network data, obtain and parse network data, and explain the basic principles of crawlers. And use the most basic syntax to create a native crawler project without using a crawler framework.
14. Pythonic and Python Miscellaneous Notes
Understand the excellent writing methods of extending Python, and learn how to write high-quality Pythonic style code. Including: how to keep the dictionary in order, the application of lmbda expressions and other advanced Python knowledge
② How to read effective c++
Reprinted I remember picking up "Effective C++" again some time ago At that time, I felt a sudden enlightenment, so I dug out the notes I took when I read it for the first time. For reference and reference purposes only. Please refer to the "Effective C++" book if necessary. by shenzi/2010.5.17
1. Get yourself used to C++
Article 01: Treat C++ as a language federation
In order to better understand C++, we break down C++ into four Main sub-language:
C. After all, C++ is still based on C. Blocks, statements, preprocessors, built-in data types, arrays, and pointers all come from C.
Object-Oreinted C++. This part is the most direct implementation of the classical principles of object-oriented design in C++. Classes, encapsulation, inheritance, polymorphism, virtual functions, etc...
Template C++. This is the C++ generic programming part.
STL. STL is a template library. Containers, iterators, algorithms and function objects...
Please remember:
These four sub-languages, when you start from Switching from one sublanguage to another causes the rules of efficient programming to require you to change your strategy. The rules for efficient programming in C++ vary depending on which part of C++ you use.
Item 02: Try to replace #define with const, enum, and inline
This item may be changed to "Prefer the compiler to replace the preprocessor." That is, use as little preprocessing as possible.
Compilation process: .c file--preprocessing-->.i file--compile-->.o file--link-->bin fileFile
The preprocessing process scans the source code, performs preliminary conversion on it, and generates new source code to provide to the compiler. Check statements and macro definitions containing preprocessing directives and transform the source code accordingly. The preprocessing process also removes comments and extra whitespace characters in the program. It can be seen that the preprocessing process processes the source code before the compiler. Shixu preprocessing instructions are lines of code starting with the # sign.
Example: #define ASPECT_RATIO 1.653
The token name ASPECT_RATIO may never be seen by the compiler, or it may be removed by the preprocessor before the compiler starts processing the source code. That is, ASPECT_RATIO has been replaced by 1.653 when compiling the source code. ASPECT_RATIO may not be entered into the symbol table.
Replacement: const double AspectRatio = 1.653;
The benefits should be: more type checking, because #define is just a simple replacement, and this replacement may appear in multiple copies of 1.653 in the target code; use constants instead The same situation will never happen again.
Constant replacement #define two points to note:
Define constant pointer:
const char *authorName = “Shenzi”;
cosnt std::string authorName("Shenzi");
Class-specific constants:
static const int NumTurns = 5; //static static constants have only one copy of all objects.
In case your compiler does not allow "static integer class constants" to complete "in calss initial value setting" (that is, setting the initial value of a static integer in the declaration of the class), we can do it through the enumeration type Compensation:
enum { NumTurns = 5 };
* Taking a const address is legal, but taking an enum address is not legal, and taking a #define address is usually not legal. If you don't want others to get a pointer or reference that points to an integer constant of yours, enum can help you implement this constraint.
Example: #define CALL_WITH_MAX(a,b) f((a) > (b)) ? (a) : (b))
The macro looks like a function, but does not incur function call errors comes with additional overhead, but is a simple replacement.
Replacement:
template
inline void callWithMax(cosnt T &a, cosnt T &b)
{
f(a > b ? a : b) ;
}
callWithMax is a real function, which follows the application and access rules.
Please remember:
For simple constants, it is best to replace #defines with const objects or enums;
For macros that look like functions, it is best to use inline functions to replace #defines. .
Item 03: Use const whenever possible
Const allows you to tell the compiler and other programmers that a value should remain unchanged, as long as "a value" really shouldn't be changed, then It should be said for sure.
The keyword const is versatile:
Example:
char greeting[] = "Hello";
char *p = greeting; // Both pointer p and the string pointed to can be used Change;
const char *p = greeting; //Pointer p itself can be changed, such as p = &Anyother; the string pointed to by p cannot be changed;
char * cosnt p = greeting; //Pointer p Unchangeable, the pointed object can be changed;
const char * const p = greeting; //Neither the pointer p nor the corresponding object can be changed;
Note:
If the keyword const appears to the left of the asterisk and indicates the constant of the object being referred to. The two ways of writing const char *p and char const *p have the same meaning, both indicating that the object is a constant;
If the keyword const appears to the right of the asterisk, it means that the pointer itself is a constant.
STL example:
const std::vector
std::vector
The following Note:
Having the function return a constant value can often reduce accidents caused by customer errors without giving up security and efficiency.
Example: const Rational operator* (const Rational &lhs, cosnt Rational &rhs);
Const member functions make the class interface easier to understand, and they make it possible to "operate const objects";
Note: Member functions declared as const cannot change non-static member variables. Adding mutable before the member variable declaration allows it to be changed in the const member function.
const_cast
//static_cast converts TextBlock & to const TextBlock &;
//const_cast will return Remove const constraints from values;
Remember:
Declaring something as const can help the compiler detect incorrect usage. const can be applied to objects, function parameters, function return types, and member function bodies in any scope;
The compiler enforces bitwise constness, but you should use "conceptual constness" when writing programs ;
When cosnt and non-const member functions have substantially equivalent implementations, having the non-const version call the const version can avoid code duplication.
Item 04: Make sure the object is initialized before using it
Always initialize an object before using it. For built-in types without any members, you must do this manually. As for anything other than built-in types, the initialization responsibility falls on the constructor, ensuring that each constructor initializes every member of the object.
Assignment and initialization:
C++ stipulates that the initialization of member variables of an object occurs before entering the constructor body.forward. Therefore, the initialization of member variables should be placed in the initialization list of the constructor.
ABEntry::ABEntry(const std::string& name, const std::string& address,
const std::list
{
theName = name ; //These are assignments, not initialization
theAddress = address; //These member variables have called the default constructor before entering the function body, and then called the assignment function,
thePhones = phones; / /That is, two function calls are required.
numTimesConsulted = 0;
}
ABEntry::ABEntry(const std::string& name, const std::string& address,
const std::list< PhoneNumber>& phones)
: theName(name), //These are initializations
theAddress(address), //These member variables only use the corresponding values for copy constructors, so they are usually more efficient .
thePhones(phones),
numTimesConsulted(0)
{ }
Therefore, the initialization of non-built-in type variables should be completed in the initialization list to improve efficiency. For built-in type objects, such as numTimesConsulted(int), the cost of initialization and assignment is the same, but for consistency, it is best to initialize through the member initialization table. If member variableWhen they are const or reference, they must require an initial value and cannot be assigned.
C++ has a very fixed "member initialization order". Base classes are always initialized before derived classes, and class member variables are always initialized in the order in which they are declared. So: When listing members in a member initialization list, it's best to always order them in the order they are declared.
Remember:
Manually initialize built-in objects, as C++ does not guarantee initialization of them;
It is best to use a member initialization list for constructors rather than within the constructor body Use assignment operations. The member variables listed in the initialization list should be arranged in the same order as their declaration in the class;
To avoid the problem of "cross-compilation unit initialization order", please replace non-local static objects with local static objects.
2. Construction/destruction/assignment operations
Almost every class you write will have one or more constructors, a destructor, and a copy assignment operator. If these functions make mistakes, the consequences can be profound and unpleasant, throughout the class. So making sure they behave correctly is a matter of life and death.
Item 05: Understand which functions C++ silently writes and calls
If you declare it yourself, the compiler will declare (the compiler version) a copy constructor and a copy assignment for the class operator and a destructor. In addition, if you do not declare any constructor, the compiler will declare a default constructor for you. All these functions are public and inline.
Only when these functions are needed (called) will they be created by the compiler. That is, the compiler will create them only if there is a need.
The default constructor and destructor mainly give the compiler a place to place "hidden behind the scenes" code, such as constructors and destructors that call base classes and non-static member variables (otherwise they should Where is it called??).
Note: The destructor generated by the compiler is non-virtual, unless the base class of this class itself declares a virtual destructor.
As for the copy constructor and copy assignment operator, the version created by the compiler simply copies every non-static member variable of the source object to the target object.
If a class declares a constructor (with or without parameters), the compiler will no longer create a default constructor for it.
Compiler-generated copy assignment operator: For member variables with pointers, references, and constant types, we should all consider establishing our own "appropriate" copy assignment operator. Because pointers pointing to the same block of memory are potentially dangerous, references cannotChange, constants cannot be changed.
Remember:
The compiler can secretly create default constructors, copy constructors, copy assignment operators, and destructors for classes.
Item 06: If you don’t want to use the functions automatically generated by the compiler, you should explicitly refuse
Usually if you don’t want a class to support a specific skill, just don’t specify the corresponding function. But this strategy does not work for copy constructors and copy assignment operators. Because the compiler declares them "self-consciously" and calls them when needed.
Since the functions generated by the compiler are all public types, the copy constructor or copy assignment operator can be declared as private. This little "trick" prevents people from calling it externally, but member functions and friend functions in the class can still call the private function. The solution might be in a base class specifically designed to prevent copying. (The class name provided by Boost is nonable).
Please remember:
To override functionality provided automatically (and implicitly) by the compiler, the corresponding member function can be declared private and not implemented. Using a base class like nonable is also a good idea.
Item 07: Declaring a virtual destructor for a polymorphic base class
When the pointer of the base class points to the object of the derived class, when we are finished using it and call delete on it, the result will be Undefined - Base class components are usually destroyed, while derived class components may remain on the heap. This can cause resource leaks, corrupt data structures, and consume a lot of time in the debugger.
The way to eliminate the above problems is simple: give the base class a virtual destructor. Afterwards deleting the derived class object will work just as you want.
Any class with a virtual function will almost certainly have a virtual destructor.
If a class does not contain a virtual function, it usually means that it is not intended to be used as a base class. When a class is not intended to be used as a base class, making its destructor virtual is often a bad idea. Because implementing virtual functions requires additional overhead (pointer vptr pointing to the virtual function table).
STL containers do not have virtual destructors, so it is best not to derive them.
Please remember:
Base classes with polymorphic properties should declare a virtual destructor. If a class has any virtual functions, it should have a virtual destructor.
A class is not designed to be used as a base class, or is not designed toWith polymorphism, virtual destructors should not be declared.
③ Does anyone know what VEC is?
VEC is a token issued by Gameflip, which is mainly used to transfer digital products in the gaming industry to the blockchain.
In 2018, GameFlip plans to launch VEC and launch a decentralized token trading system based on blockchain. Currently, relatively little information can be obtained from the official website and white paper. According to the official website information, GameFlip’s VEC mainly includes the following aspects: 1. Game players can own and safely store their game digital products on the blockchain; 2. The VEC token mechanism can be circulated; 3. Through the extension of the blockchain, Combining game transactions and token circulation.
In 2019, the Gameflip team also created a VEC cloud mining machine project worth $10 million, which helped them circulate VEC tokens more flexibly. On this basis, the team is confident in the flexible and secure solution it has built, allowing publishers to confidently place their digital products on the blockchain and flexibly control their presence in the decentralized ecosystem. Transactions using VEC tokens.
④ Text similarity calculation based on Gensim
Gensim is a Python natural language processing library, using algorithms such as TF-IDF (Term Frequency–Inverse Document Frequency), Latent Dirichlet Allocation (LDA), Latent Semantic Analysis (LSA) or Random Projections, etc., are performed by examining the statistical co-occurrence patterns of words in the same document in the training corpus. The semantic structure of the document is discovered and finally converted into vector patterns for further processing. In addition, Gensim also implements the word2vec function, which can convert words into word vectors.
Corpus is a collection of original texts used to unsupervisedly train the hidden layer structure of text topics. No additional information manually annotated is required in the corpus. In Gensim, a Corpus is usually an iterable object (such as a list). Each iteration returns a sparse vector that can be used to represent the text object.
A vector is a list consisting of a set of text features. is oneThe internal representation of segment text in Gensim.
Dictionary is a collection of all words in all documents, and records information such as the number of occurrences of each word.
Model is an abstract term. The transformation of two vector spaces is defined (that is, from one vector expression of text to another vector expression of ascending and descending filial piety).
Use an experiment to understand:
# -*- coding: UTF-8 -*-
from gensim import corpora,similarities,models
import jieba
classGensimExp(object):
def__init__(self,documents,test_document,Type,feature_num,best_num):
self.raw_documents = documents
self.test_document = test_document
self.SimCalType = Type
self.num_features = feature_num
/>
self.num_best = best_num
defCalSim(self):
corpora_documents = []
#Participle
foritem_textinself.raw_documents:
item_seg = list(jieba.cut(item_text))
corpora_documents.append(item_seg)
# Generate dictionary and corpus Yinsui
dictionary = corpora.Dictionary(corpora_documents)
# Calculate the bow vector corresponding to each news
corpus = [dictionary.doc2bow(text)fortextincorpora_documents]# Iterator
ifself.SimCalType =='Similarity-tfidf-index':
# Count the IDF value of each feature appearing in the corpus
tfidf_model = models.TfidfModel( corpus)
corpus_tfidf = tfidf_model[corpus]
self._similarity = similarities.Similarity(self.SimCalType, corpus_tfidf, \
num_features=self .num_features,num_best=self.num_best)
test_cut_raw = list(jieba.cut(self.test_document))
test_corpus = dictionary.doc2bow(test_cut_raw)
# Based on the trained model, generate IF-IDF values, and then calculate the similarity
self._test_corpus=tfidf_model[test_corpus]
elifself.SimCalType == 'Similarity-LSI-index':
lsi_model = models.LsiModel(corpus)
corpus_lsi = lsi_model[corpus]
self._similarity = similarities.Similarity(self.SimCalType, corpus_lsi,\
num_features=self.num_features,num_best=self.num_best)
test_cut_raw = list(jieba.cut(self.test_document))
test_corpus = dictionary.doc2bow(test_cut_raw)
self._test_corpus=lsi_model[test_corpus]
self.Print_Out()
defPrint_Out(self):
string ='The Most Similar material is '
fortplinrange(len(self._similarity[self._test_corpus])):
iftpl ! = len(self._similarity[self._test_corpus]) -1:
string = string + str(self._similarity[self._test_corpus][tpl][0]) \
< br /> +'('+ str(self._similarity[self._test_corpus][tpl][1]) +'),'
else:
string = string + str(self._similarity[self._test_corpus][tpl][0]) \
+'('+ str(self._similarity[self._test_corpus][tpl][1]) +')'
print(string)
if__name__=='__main__':
raw_documents =[
'0 On January 19, CITIC Group and Tencent signed a strategic framework agreement in Shenzhen, announcing that they would promote business cooperation in cloud and big data, blockchain, artificial intelligence and other technical fields, and actively explore The digital transformation and upgrading path of the real industry. ',
'1 Shanghai Pudong Development Bank announced that the company's Chengdu Branch was fined 462 million yuan by the China Banking Regulatory Commission for illegal handling of credit business and other violations. The penalty amount has been fully included in the company's profits and losses in 2017. The company's There is no significant adverse impact on business development and ongoing operations. ',
'2 [ Pudong Development Bank responds to Shanghai Pudong Development Bank Chengdu Branch's violation of regulations and fined 462 million: deeply guilty] Learned from the Shanghai Pudong Development Bank Head Office that Shanghai Pudong Development Bank is deeply guilty of the illegal loan issuance case that occurred in Chengdu Branch ; We firmly support and accept the investigation and punishment by the regulatory authorities. At the same time, we will use this as an incentive to strengthen our own management, insist on strict governance, and always regard operating in compliance with laws and regulations as the foundation of our future business development. (Yicai)',
'3 Su Shi Trial announced that the company's 13.32 million shares issued before the initial public offering will be lifted on January 24, accounting for 10.61% of the company's total share capital; the lifting date The actual tradable shares are 12.215 million shares, accounting for 9.73% of the total share capital. The shareholders who applied to lift the restriction on share sales this time include Suzhou Testing Instrument General Factory and four natural person shareholders including Zhong Qionghua, Chen Chen, Wu Yuanzhen, and Chen Ying. ',
'4 Boston Scientific and Sinopharm's subsidiaries are reported to be participating in the bid for XIO's Lumenis. ',
'5 Suning Cloud Business responded to the inquiry letter from the Shenzhen Stock Exchange: Suning Financial Research Institute officially established a blockchain laboratory in July 2017. The laboratory focuses on blockchain technology and its application in The application in the financial industry is studied, aiming to use blockchain technology to provide technical support for Suning Financial Services business and Suning Bank business. Suning Bank's blockchain domestic letter of credit information transmission system adopts the alliance chain method, which is only used for free among alliance banks and does not directly provide services to the outside world. The system generates no direct income. ',
'6 Longma Environmental Sanitation announced that the company's initial public offering of 160 million restricted shares will be listed and circulated on January 26, involving 17 shareholders including current directors, supervisors and senior executives Zhang Guifeng. ',
'7 Aerospace Engineering announced that the company's 324 million initial public offering of restricted shares will be listed and circulated on January 29. The shareholders involved are China Academy of Launch Vehicle Technology and Aerospace Investment Holdings Co., Ltd. , Beijing Aerospace Power Research Institute, Beijing Aerospace Industry Investment Fund (Limited Partnership) and the National Council of Social Security Fund transferred shares to two households. ',
'8 Daqian Ecological Announcement, the consortium formed by the company and Jiangsu Daqian Design Institute Co., Ltd. has won the preliminary bid for the EPC general contracting project of the characteristic pastoral rural construction project in Dongba Town, Gaochun District. The project investment is estimated to be approximately 140 million yuan. The smooth implementation of the project will have a positive impact on the company's operating performance this year. ',
'9 On February 19, 1954, the Presidium of the Supreme Soviet of the Soviet Union passed a resolution "on the occasion of the 300th anniversary of the alliance between brotherly Ukraine and Russia" to transfer the Crimea Oblast of the Russian Federation to Placed under the Union Republic of Ukraine',
'10 Chiyu Shares announced that the company expects that its net profit in 2017 will increase by approximately 42.5 million yuan to 53 million yuan compared with the same period last year, a year-on-year increase of approximately 80.49%-100.37%, achieving a profit of 52.8038 million yuan in the same period last year. The revenue of this period increased significantly compared with the previous period, and the operating profit increased compared with the previous period; the impact of non-recurring gains and losses such as government subsidies and financial management income on the company's net profit was approximately 32 million yuan. ',
'11 [Qianshan Yaoji: The stock pledged by the major shareholder fell below the liquidation line] Qianshan Yaoji announced that Liu Xianghua, the largest shareholder and one of the actual controllers, holds a total of 14.83% of the company's shares. . Currently, Liu Xianghua has pledged a total of 13.78% of the company’s equity. The 29.808 million shares pledged by Liu Xianghua to Guotai Junan Securities have fallen below the liquidation line. The company is currently under investigation by the China Securities Regulatory Commission. According to relevant regulations, major shareholders of the company are not allowed to reduce their holdings (including equity pledge closing) during the period of investigation. Therefore, this time the stocks pledged by Liu Xianghua fell below the liquidation line, which will not lead to a change in the actual control of the company. ',
'12 Tianma Fine Chemical: The subsidiary plans to control Zhongke Electronics for more than 100 million yuan, increasing its supply chain management development strategy. ',
'13 Chaohua Technology announced that it has recently received notification from employees of its joint-stock subsidiary Bellsun, reporting that Bellsun has been unable to contact its chairman Zheng Changchun recently. As of now, the company has not been able to get in touch with Zheng Changchun, chairman of Belxin. After discussion with the major shareholders of Belsine, and upon approval by the board of directors of Belsine, the existing management of Belsine will form a temporary working group to maintain the normal production and operation order of Belsine. The company conducts comprehensive verification of Bell Letter to safeguard the interests of listed companies and shareholders. ',
'14 Shenghong Technology announced that the company expects to achieve a profit of 280 million yuan-290 million yuan in 2017, a year-on-year increase of 20.65%-24.96%, and a profit of 232 million yuan in the same period last year. During the reporting period, the company estimates that the impact of non-recurring gains and losses on net profit will be approximately 10 million to 13 million yuan. ',
'15 Dongxu Optoelectronics announced that the controlling shareholder Dongxu Group's employee growth and win-win plan has completed the purchase of the company's shares. A total of 11.1901 million shares of the company's shares have been purchased, accounting for 0.2% of the total share capital. The total transaction amount is approximately 102 million yuan, with an average transaction price of approximately 9.12 yuan/share. '
]
Obj1 = GensimExp(raw_documents,'Digital transformation upgrade path','Similarity-tfidf-index',600,5).CalSim()
Obj2 = GensimExp(raw_documents,'Illegal handling of credit business','Similarity-tfidf-index',600,3).CalSim()
Obj3 = GensimExp(raw_documents,'This The income of this period has increased more than the previous period','Similarity-LSI-index',400,2).CalSim()
Experimental results:
Since there are not many corpora, we choose The number of similar texts returned is small, but it can be roughly seen that the judgment is correct. (PS: Stop words are not processed during the word segmentation process)
Reference:
https://radimrehurek.com/gensim/tutorial.html
Even non-computer majors or beginners with no basic knowledge can get started in minutes. Python's design philosophy is "elegant", "clear" and "simple", which determines that it is the most literary programming language. Therefore, I highly recommend girls to learn Python. The syntax is clear, clean, easy to read and maintain, with a small amount of code, short and highly readable. Reading other people's code will be very fast and more efficient during team collaboration and development. In layman's terms: "It's fast to write and understandable!"
The IT industry is an industry that requires constant self-challenge, which makes many people want to try and challenge themselves. Work in the IT industry is a type of mental work that requires constant overcoming of difficulties. During the work process, you need to constantly update your skills and knowledge to keep up with the times. In this industry,Practitioners can constantly break through themselves and achieve self-improvement step by step.
You must first learn Python's comments, identifiers, data types, functions and object-oriented programming. After learning these, you can learn more advanced ones: decorators, generators , iterator. The most important thing for novices is to lay a good foundation. This part requires more effort to lay a solid foundation.
Secondly, it is best to find relevant educational institutions where professional teachers will lead you to get started quickly. Choose a training institution that suits you. Different training institutions also have different Python training content
First of all, learn about the direction you want to pursue from online courses or materials, and then choose the direction after understanding it.
- 上一篇: 区块链莱茨狗官网,莱茨狗是什么币
- 下一篇: 区块链推广困难问题,区块链推广困难的原因