polling implemented in Python. this didn't scale that well and scaling this short term meant implementing polling in a C server. see my post for more: Fast polling using C, memcached, nginx and libevent
after hitting limits with polling in C We calculated different comet solutions, but most of them were and still are very immature. so we implemented our own comet solution using Java and netty (a java. NIO network library ). see my post for more: plurk comet: handling of 100.000 + open connec
there are two numbers x and y, and their modulo n is the same remainder, then when you search for k + 1 decimal numbers composed of 0 and 1, X and Y are extended to four numbers: 10x, 10x + 1, 10y, 10y + 1. Because X and Y are the same (they can be considered equal), 10 X and 10 y are the same, and 10 x + 1 and 10 y + 1 are the same. That is to say, the subtree extended by Y and the subtree generated by X
while true7 break: jump out of the current loop (the loop that executes the break statement)8. Continue: jump out of this loop (the rest of the current loop is still executed)9. Command# Classic_set.sh
Version = classicPS1 = "classic>"
# Lastest_set.sh
Version = lastestPS1 = "lastest version>"
Execute Command$ ../Classic_set.shClassic>Classic>. lastest_set.shLastest version> echo $ versionLastestThrough this experiment, I think it seems that the command can be executed instead of/bin/sh.10. In
, ' A ', ' B ']l2=[' Abd ']Print (L1 > L2)Print (L2 > L1)Assignment Operationsx=10X=x+1X+=1Print (x)X/=3 X=X/3Print (x)x=10X%=3 #x =x%3Print (x)Logic andAge=input (' You Christina geometry >>: ')Age=int (age)Age=int (Input (' You Christina geometry >>: '))Sex=input (' Your gender is >>: ')Print (age > and sex = = ' female ')logical OR ORAge=int (Input (' You Christina geometry >>: '))Sex=input (' Your gende
loading)Umount [-l][partition] Unload mount-L is expressed as mandatoryworth knowing usage: Mount--bind/home//mnt/The/home/is attached to the/mnt/below, equivalent to the establishment of a soft link, delete/home/this "soft link" will expireThird, VIM editorWhen opening a file, vi +10 filename, move the cursor to line tenth of the fileLook at the line number, with Set Nu; cancel this, use set Nonu1. General modeCommon shortcut keys:Copy: "yy", "10yy"Paste: "P", "5p"Delete/Cut forward: "X", "
is to delete a character (equivalent to [backspace], which is the backspace) (common)
NxNx
N is a number that continuously deletes n characters backwards. For example, I want to continuously delete the 10 characters after the cursor, "10x".N is a number that continuously deletes the n characters preceding the cursor. For example, I want to delete the 10 characters before the cursor, "10X
' adult '...
If-else Statement :For example:Age=20If age>=18:print ' adult 'else: (Note the following else:)print ' teenager 'If-elif-else Statement :For example:If age>=18:print ' adult 'Elif age>=6:print ' teenager 'Elseprint ' Kid 'For Loop :For example:l=[' Adma ', ' Lisa ', ' Bart 'for name in L;Print NameNote: The name variable is defined in the For loop (this is a temporary variable name that can be customized), which means that each element in the list is taken out in turn, the ele
prompt character before the substitution to the user to confirm (confirm) whether need to replace! Common
Delete, copy and paste on
x, x in a line of words, X is the backward deletion of a character (equivalent to the [Del] key), X is to delete a character forward (equivalent to [backspace] is the backspace bar) (commonly used)
NX N is a number that continuously deletes n characters backwards. For example, I want to delete the 10 characters consecutively, "
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
1 repeating last commandIn normal mode . (decimal point) means the last command operation is repeatedNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitions, and the following is the practice:Do the following exercises:
Input 10
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitio
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
? Kaima means looking up Kaima this string
: n1,n2s/word1/word2/g
Find word1 between N1 and N2 rows and replace with Word2
10,20s/kaima/good/g find Kaima in the 10th to 20th row and replace it with good
: 1, $s/word1/word2/g
Find word1 from the first line to the last row and replace with Word2
: 1, $s/kaima/good/g
num + x
Continuous deletion of num characters
10x means delet
, it throws a Nameerror exception because it is not visible
Scope
Global scope
Visible throughout the program's running environment
Local scope
Visible inside functions, classes, and so on
Local variables cannot be used beyond the local scope in which they reside
Outer variable scope visible within scope of the inner layer
In the inner scope inner, if o=97 is defined, it is equivalent to redefining a new variable o in the
, delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitions, and the following is the practice:Open file file for editing$ vim protocolsBelow you can do the following exercises in turn:
Input 10x , delete 10 consecutive characters
Input 3dd
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
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.