String Matching-KMP Algorithm
Finite AutomatonA finite automatic machine M is A quintuple (Q, q0, A, Σ, Delta), where:
Q is a set of States,Q0 and Q are in the initial state,A is the word set of Q and A set of acceptance states,Σ is a finite input alphabet,Delta is a function from Q x Σ to Q, called a transfer function.The following defines several related functions:
Phi (w) is the state in which M stops scanning string w. The function Phi has the following recursive relationship definitions: Ph
elements of the id attribute equal to footer
Like what:1 * {margin:0; padding:0;}23 p {font-size:2em;}45. Info {background: #ff0;}67 P.info {background: #ff0;}89 P.info.error {color: #900; font-weight:bold;}10P#info {background: #ff0;}Two, multi-element combination Selector
Selector Selector
Describe
CSS version
E,f
Multi-element selector that matches all E or F elements, separated by com
Basic Python and python tutorials
Python is a flexible language. You can see this by looking at the access mechanism of its class and instance attributes, but this is really hard to understand, after some tests, I understand that:
When an instance accesses the class attribute, it first retrieves its own names. If so, it will retrieve them directly. If not, it will find the names in the class. If not, it will be an error.
Class Pclass (object): "docstring for Pclass" num = 10 def _ init _ (s
/root/bin/links.sh shows the number of IPV4 addresses and connections for each remote host connecting to this host, sorted by number of connectionsNetstat-nt |tr-s ' |cut-d '-f5|tr-cs ' 0-9. ' ' \ n ' |egrep ' ([0-9]+.) {3} [0-9]+ ' |sort |uniq-c|sort-nr|tr-s ' \ t 'Write a script/root/bin/sumid.sh calculate the sum of the 10th and 20 user IDs in the/etc/passwd filedir=/etc/passwdn=10M=20Id_10= ' Cat $dir |head-$n |tail-1|cut-d:-f3 'Id_20= ' Cat $dir |head-$m |tail-1|cut-d:-f3 'NUM=$[ID_10+ID_20
/bashsed'10p;20p' /etc/passwdgawk' begin{ors= "+";p rintf "("}{print $3}end{printf "0)" \ n "}' | BC[Email protected] ~/bash_script $ bash sumid. SH 1010Three, pass two file path as parameters to the script, calculate the sum of all the blank lines in these two files [emailprotected] ~/bash_script $ cat sum_blanklines.sh # !/bin/bashread -P " " File1read -p Please enter a file path again: " file2printf " Total number of blank lines in
1.Tenth LineHow would you print just the 10th line of a file?For example, assume this file.txt has the following content:Line 1Line 2Line 3Line 4Line 5Line 6Line 7Line 8Line 9Line 10Your script should output the tenth line, which is:Line 10-------------------# Read from the file file.txt and output the tenth line to stdout. #Solution One: #head-n-file.txt | Tail-n +10#solution: #awk ' nr==10 ' file.txt#solution three:sed-n 10p file.txtKnowledge points
Big data analysis, how to make the data friendly display it? Of course, using charts, this article has Python's third-party library to complete the method of converting data to a chartNeed to use third-party libraries Pyecharts1. Pyecharts Installation Method:Pip Install PyechartsPyecharts Official website: http://pyecharts.org2. Python code is as follows:#!/usr/bin/env python#Coding:utf-8 fromPyechartsImportBar,line,bar3d fromPyecharts.engineImportCreate_default_environmentbar3d= Bar3d ("Exampl
number are 16the line number are 17the line number are 18the line number are 19the line Number is 20#当没有选项参数时, the last 10 rows are displayed by default
-F
Tail-f/var/log/messages#当文件内容有更新时, dynamic display of the latest content
-V, print the file name on the first line
[[email protected] scripts]# tail-v-N 3 TestFile.log ==> TestFile.log #在首行打印文件名称
[Email protected] scripts]# head-n TestFile.log |tail-n 5the line number was 11the line n
Original: Several commonly used CSS3 style codes and incompatible workaroundsBorder-radius achieve rounded corners effect1 CSS3 Code: 2 3 -webkit-border-radius:10px; 4 -moz-border-radius:10px; 5 border-radius:10px; 6 background-color: #666; 7 width:200px;height:100px;Firefox,chrome Google,safari and other browsers display the effect 0-0:Figure 0-0But IE this heterogeneous does not support CSS3 this attribute, the display effect under the IE9 0-1:Figure 0-1But don't let it go, or find a way to so
1. Get the K line (take k=10 as an example)Note that if the file contains less than 10 rows, it should not be output.# Read from thefile file. txt and output the tenth line to stdout.# solution one, using awkawk 'NR = = Ten' file. txt# solution Two, using sed (personal test Result: Sed method faster than awk)sed-N'10p' filetxt# Solution III, combined use of tail and headTail-n+Ten file. txt |Head-n1# In addition, the following methods do not meet the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.