Introduction
As we all know, strings have a large proportion in OI and other computer fields. What we are talking about today is an algorithm for matching strings – “KMP algorithm”.
0x00
KMP The algorithm is used to solve such a problem: Given a text string T and a pattern string S, you are required to find the number and position of S appearing in T (we define the position as the position where the first character in S matches in T).
Of course, there are many other uses. Specific can be reflected through a topic HDU 3336
0x01
We all know the simple algorithm of matchi...
Some files are too large to read and write directly. They need to read one line by line, using a for loop.# f = open("log", mode="r+", encoding="utf-8")## for line in f:# print(line)## f.close()with open Open file operation can be automatically closed without adding f.close ().# with open("log", mode="r+", encoding="utf-8") as f:# print( f.read())with open("log", mode="r+", encoding="utf-8") as f1,open("123", mode="r+", encoding="utf-8"): f1.read()
Byte mode of file object/b Settings3 set any byte each time.
Chinese string
Returns a string that can be viewed
Write to find string
Useseek >
Pattern
File existence
file does not exist
operation
Document content
r
Establishopen default isr objects normally open normally.
Establishopen objects normally open normally.
Establishopen isutf-8 program, read this text file will be wrong, it will use.windows read mode (default).
w.
Mode plus‘b’ method returns an integer indicating the current pointer position.
f.seek(offset,from_what) sta...
1. While doing, change the model (Build-and-Fix Model).
2. The waterfall model (Waterfall Model);
3. Rapid Prototype Model (rapid prototyping);
4. Incremental Model;
5.The spiral model (Spiral Model);
6.Evolution model (evolution model);
7.The fountain model (fountain model);
8.Intelligent model (four generation technology (4GL));
9.Agile development model (agile development model);
10.RADRapid (Application Development);
Content-Type:
Used to define how a user’s browser or related device displays data to be loaded, or how to handle data to be loaded.
Content type, generally refers to the content-type that exists in a Web page, and the content-type attribute specifies the HTTP content type of request and response.
If no Content-Type is specified, the default is text/html.
1. text/html:
text/html:Set the Content-Type of the file to the form of text/html, and the browser automatically calls the HTML parser to process the file when it gets the file.
2. text/plain:
text/plain:Set the file to p...
Title Description
HZOccasionally, some professional problems are used to flicker those non computer majors. After today’s test group meeting, he spoke again: in ancient one-dimensional pattern recognition, it is often necessary to calculate the maximum sum of continuous subvectors, and when the vectors are all positive, the problem is solved. However, if the vector contains negative numbers, it isShould we include a negative number and expect the positive number to make up for it? For example, {6, -3, -2,7, -15,1,2,2}, the maximum sum of continuous subvectors is 8 (from zeroth to third...
httpDifference from HTTPS
Apple Developer Enterprise Program is a high-level developer account provided by Apple to iOs developers, which differs from personal developer accounts and corporate developer accounts, and should be noted because of AppleApple has stopped issuing corporate accounts because it has more authority to install non-jailbreak devices without uploading them to the Apple market. This is why we have applied for a long time business account and why there is no result. ~ios~ ~ ~ ~ ~ ~ ~ ~ ~ ~The industry is open to the 2989459.
There’s a lot of white here that’s easy to think of as a mix of...