been found for reference:Reference Address: http://blog.csdn.net/houyj1986/article/details/22966799#encoding =utf-8 print ' China ' #根据字符串中的数字排序, such as F10 should be in F2 after import re re_digits = Re.compile (R ' (\d+) ') def emb_numbers (s): Pieces=re_digits.split (s) Pieces[1::2]=map (Int,pieces[1::2]) return pieces def sort_strings_with_emb_numbers (alist): aux = [(Emb_numbers (s), s) for S in Alist] aux.sort () return [s for __,s in aux]
stability and complex sequencing
Starting from python2.2, the ordering is guaranteed to be stable. This means that if multiple elements have the same key, their order of precedence will be the same before and after ordering.Copy the Code code as follows:
>>> data = [(' Red ', 1), (' Blue ', 1), (' Red ', 2), (' Blue ', 2)]
>>> sorted (data, Key=itemgetter (0))
[(' Blue ', 1), (' Blue ', 2), (' Red ', 1), (' Red ', 2)]
Note that the order of the ' blue ' is maintained after sorting, that is, '
'), reverse = True)[('John', 'A', 15), ('Jane ',' B ', 12), ('Dave', 'B', 10)]
5) stable and complex sorting
From python2.2, the sorting is ensured to be stable. It means that if multiple elements have the same key, their order remains unchanged before and after sorting.
The code is as follows:
>>> Data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]>>> Sorted (data, key = itemgetter (0 ))[('Blue', 1), ('blue', 2), ('red', 1), ('red', 2)]
Note that the order of 'blue' after sorting is mai
-4.1
Sudo RM/usr/bin/GCC (delete GCC, it's just a soft connection file to the gcc-4.3.2)Sudo ln-S/usr/bin/gcc-4.1/usr/bin/GCC (build a soft connection from GCC to gcc-4.1)
2. The error is as follows:
Make [2]: *** [/home/zhoug/downloads/crosstool-0.43/build/ARM-Linux/gcc-4.1.0-glibc-2.3.2/build-glibc/CSU/version. O] Error 1Bash: Make [2]: The command cannot be found.Make [2]: Leaving directory '/home/zhoug/downloads/crosstool-0.43/build/ARM-Linux/gcc
'), Reverse=true) # now sort on primary key, descending
[(' Dave ', ' B ',], (' Jane ', ' B ', '), (' John ', ' A ', 15)]
6 The most old-fashioned sort method-dsu
We call it DSU (decorate-sort-undecorate), because the sequencing process requires the following three steps:First: The original list is decorated so that the value of the new list can be used to control the ordering;Second: After the
the number of times the Bnum breakpoint is ignored as ' COUNT ', that is, the breakpoint Bnum is executed to section count+1Program stops at timesTbreak ARGS or abbreviated to TBSet a breakpoint to be valid only once. Use of args in conjunction with the parameters in breakHbreak ARGSSets a breakpoint that is supported by the hardware. The main purpose of this command is to debug the Eprom/rom program.Because this command can set breakpoints without changing the code. This can be combined with t
connection file to the gcc-4.3.2)Sudo ln-S/usr/bin/gcc-4.1/usr/bin/GCC (build a soft connection from GCC to gcc-4.1)
2. The error is as follows:
Make [2]: *** [/home/zhoug/downloads/crosstool-0.43/build/ARM-Linux/gcc-4.1.0-glibc-2.3.2/build-glibc/CSU/version. O] Error 1Bash: Make [2]: The command cannot be found.Make [2]: Leaving directory '/home/zhoug/downloads/crosstool-0.43/build/ARM-Linux/gcc-4.1.0-glibc-2.3.2/CSU'Make [1]: *** [
crosstool cannot be installed as root, but must be installed as username. The installation process reads and writes the directory, so you need to modify the owner.3) log in with User username4) Create the/home/username/downloads directory to automatically download gcc, binutilty, and glibc from the Internet. If you have already downloaded these software packages, put them in this directory, so that you do not need to automatically download them from the Internet.5) slave6) cd/opt/crosstool tar
be stable. This means that if multiple elements have the same key, their order of precedence will be the same before and after ordering.Copy CodeThe code is as follows:>>> data = [(' Red ', 1), (' Blue ', 1), (' Red ', 2), (' Blue ', 2)]>>> sorted (data, Key=itemgetter (0))[(' Blue ', 1), (' Blue ', 2), (' Red ', 1), (' Red ', 2)]Note that the order of the ' blue ' is maintained after sorting, that is, ' blue ', 1 in front of ' Blue ', 2.More complex you can build multiple steps for more comple
./Configure error mv: cannot move './confsjjYiM/out' to 'cmake/makefile': Permission denied, confsjjyimcmake
Error due to insufficient permissions:
Mv: cannot move './confsjjYiM/out' to 'cmake/makefile': Permission deniedConfig. status: error: cocould not create cmake/Makefile
Hyc @ hyc-csu:/usr/local/proj-4.9.1 $ make
Making all in src
Make [1]: Entering directory '/usr/local/proj-4.9.1/src'
Make [1]: *** you can create the target "all" without
. Set_debuglevel (1)Server.login (from_addr, password)Server.sendmail (FROM_ADDR, [TO_ADDR,TO_ADDR2], msg.as_string ())Server.quit ()If __name__== ' __main__ ':With open (filename2, ' R ') as FO:For line in Fo.readlines ():If Line.split (') [0]!= ':Line=line.replace (' \ n ', ')Host=line.split (") [0]TrySsg_bak (host)Su.append (host+ ' \ n ')ExceptPrint (host+ "is failed")Fa.append (host+ ' \ n ')With open (filename1, ' R ') as FO:For line in Fo.readlines ():If Line.split (') [0]!= ':Line=line.r
dsdom; Double Y; do {x = averagerandom (Min, max); y = normal (dresult, Miu, SIGMA ); DSU = averagerandom (0, normal (Miu, Miu, SIGMA);} while (DSU> Y); Return X ;}
Parameter description: Double Miu: μ, mathematical expectation of a normal function
Double Sigma: σ, mean variance of Normal Functions
Double min, double Max, indicating the range of the generated Random Number
In the above method, take μ = 0,
personal Learning and collation, if there are deficiencies, please feel free. Reprint Please specify:@CSU-maxFile Descriptor Each UNIX process has a file descriptor range with a size of 0 to the maximum value of the N,N flag file descriptor, and the size of n depends on the UNIX version and System configuration. In fact, it is an index value that points to the record table in which the kernel opens a file for each process maintained by the process. W
/gcc/x86_64-linux-gnu/4.8/.. /.. /.. /x86_64-linux-gnu/crt1.o:/build/eglibc-mjixcm/eglibc-2.19/csu/.. /sysdeps/x86_64/start. s:118: For the first time in this definitionOBJ/FK.O: In the function ' _init ':(. init+0x0): ' _init ' is defined multiple times/usr/lib/gcc/x86_64-linux-gnu/4.8/.. /.. /.. /x86_64-linux-gnu/crti.o:/build/eglibc-mjixcm/eglibc-2.19/csu/.. /sysdeps/x86_64/crti. S:64: For the first time
cond.When a breakpoint occurs, Cond is calculated. When the value of Cond is non-zero, the program stops at the breakpoint. This meansWhen the value of Cond is true, the program stops .... Some parameters can be described below.
'Tbreak ARGs'Set the breakpoint to only valid once. The use of argS is the same as that of the parameter in 'Break.
'Hbreak args'Set a hardware-supported breakpoint. ARGs is the same as the 'Break' command.'Break' is the same. However, this breakpoint needs to be suppor
is the number of the city districts and roads correspondingly (2≤n≤50 000; N−1≤m≤50 000). The next m lines contain triples of integers a I, b i and c I, meaning that between the city districts a I and b i t Here are a road with the price c I (1≤a I, b i≤n; a i≠b i; 1≤c i≤10 9). There can several roads between, districts.OutputThe only line output the sequence of integers-numbers of the roads which should is kept open in the city. The roads is numbered as they appear in the input data. If There
with ref () or CREF ():For example:void incr(int i){ ++i;}int i =0;bind(incr, i)(); //仅仅一个拷贝ref//引用传递Calling member functionsThe following procedure demonstrates how bind () is used to invoke member functions#include #include #include #include #include using namespace STD;using namespace STD::p laceholders;classperson{Private:stringname_; Public: Person (Const string N): Name_ (n) {}voidPrint ()Const{coutvoidPrint2 (Const string prefix)Const{coutintMain () { vectorcoll = {person ("
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.