Chen Anzhi of:
Rule One 3% of the world's people have a strong motivation for success .
In this world, the proportion of successful people is about 3%, the average person is 97%. In the end why someone will succeed, to become the 3% of people, some people will become ordinary people for a lifetime, become 97%? Where is the difference between the two?
In the past 17 years, I have visited 100 of the world's first, from the Olympic gold, the world's richest man, best-selling author, to the head
. replication of PythonAs seen from above, the assignment of an object is actually a reference to the object . When you create an object and then assign it to another variable, Python does not copy the object, but simply copies the object's reference.When you assign a value to an object (either as a parameter pass or as a return value), Python, like Java, always passes a reference to the original object, not a copy."" "passes a reference to the original object instead of a copy" "a = [1,2,3]b =
1. Common data typesName = "Jack" #字符串 stringage = 24# integer intheight =1.75# floating-point floatprint (Type (name), type (age), type (height))2. String and bytes type conversionmsg = "I love Beijing Tian ' an gate" print (Msg.encode (encoding= "Utf-8")) #字符串转bytes类型print (Msg.encode (encoding= "Utf-8"). Decode (encoding = "Utf-8")) #bytes类型转字符串3. DictionariesThe dictionary is another mutable container model and can store any type of object. Each k
+ this. age + "running... ";}; return obj;} var box1 = createObject (" lee ", 100); // instantiate; call the function and pass the parameter; var box2 = createObject (" jack ", 200); // instance 2; console. log (box1.run () + box2.run (); // The instance remains relatively independent; // disadvantage: the object and instance are identified; it is not clear whether they are the instance of that object; console. log (typeof box1); // Object;
3. creat
---------------------------------the slice schema diagram-------------------------------------------------------------------------------Slice 1 slice 2 slice 3| | |------------------|| | -----Configuration Server (Master)User----------> Routing-----------|-----configuration server (from 1)|-----configuration server (from 2)Note: After the MONGO 3.4 version, the configuration server must be a replica set, so you can see that the tutorial configuration server is an old version.---------------
, ' China ', 19.998]>>> print l[-1]19.998
4 of the words, apparently crossed the border.
>>> Print L[-4]traceback (most recent call last): File "
", line 1, in
print L[-4]index Error:list index
out of range>>>
The list is added to the trailer via the built-in append () method, which is added to the specified position by the Insert () method (subscript starting from 0):
>>> L = [n, ' China ', 19.998]>>> l.append (' J
OC-collection class
1. the OC collection classes include nsarray, nsset, and nsdictionary. They all operate arrays in an object-oriented manner. Unlike arrays in C, OC Arrays can only store the same data type. They can store any type of objects, however, non-OC object types such as basic data types int, struct, and enum cannot be stored.
2. The OC array exists as an object. Therefore, you must add *
3. Once an nsarray array is created, it determines whether it is variable or not.
4. Basic ns
: the pear db module and the PHP Data Objects (PDO) class. Both provide abstraction from the choice of a specific database. Therefore, your code can run on IBM DB2, MySQL, PostgreSQL, or any other database you want to connect to without too much adjustment.Another value of using the pear db module and the PDO abstraction layer is that you can use it in SQL statements? Operator. This makes SQL easier to maintain and protects your applications from SQL injection attacks.The alternative code for us
Foreach is often used in PHP, and arrays must be used to use foreach. Therefore, in this article, we talk about arrays and foreach. Foreach is often used in PHP, and arrays must be used to use foreach. Therefore, in this article, we talk about arrays and foreach.
Foreach has two syntaxes:
First, traverse the given array statement array_expression array. In each loop, the value of the current unit is assigned to $ value and the pointer inside the array moves forward (so the next unit will be obt
execute the gzip or gunzip command tar to process the directory without deleting the source file. for example: tar-cvf/home/jack/dest.tar/home/jack/source package/home/jack/source into/home/jack/dest.tar-zcvf/home/jack/dest.tar.gz/ home/
When we use the "who" or "w" command on a Linux terminal, we will always see a long list of users. At this time, do you really want to send a message to him/her. If she is a long-time-honored MM, and you see her, she is also shy. Do you want to send a message to her and say "hello, you are also there ".
Hey hey, are you looking forward to it? Let's introduce several commands to let you send them to her or him.
Write: send messages to other users in the system.
Usage:
Write + User Name
Write +
that in addition to the Comparable protocol, a protocol is defined _Comparable , and the former inherits from the latter. _Comparablethe agreement is defined as follows:protocol _Comparable { ... }func BoolWe found that just what we lost here was found. _Comparableis an example of the default protocol implementation mechanism provided in Swift. The _Comparable default implementations for several other operators are provided in the Protocol >=,>, .Since Comparable both the self _Comparable and
() function to create a set. Note: To create an empty set, you must use set () instead of {}, because {} is used to create an empty dictionary.
>>> Student = {'Tom ', 'Jim', 'Mary ', 'Tom', 'Jack ', 'Rose'} >>> print (student) # repeated elements are automatically removed {'Jim ', 'jack', 'Mary', 'Tom ', 'Rose '}>>> 'Rose' in student # membership testing (member test) True >># set can perform set operation
parenthesis) ends. Each "name" is followed by a ":" (colon); "' Name/value ' pair ' is separated by", "(comma).Example: var json = {"name": "Jack", "age": All, "Marray": true};2. Ordered list of values (an ordered list of values). In most languages, it is understood as an array (array or List).An array is an ordered collection of values (value). An array begins with "[" (the left square bracket), and "]" (the right square bracket) ends. Use "," (comm
When we use the command "who" or "W" in Linux terminal, we always see a long list of users, at this time, you do not want to send a message to him/her. If she is a you love for a long time mm, and you just see her also in, under the shy of you, is not at this time want to send a message to her, say "Hello, you are in AH" or "gee, so coincidence."Hey, you are not very looking forward to the following to introduce a few commands, let you send to her or him .1. Write: Send a message to other users
Dark Horse programmer------1 Nsset and NsmutablesetNsset, like Nsarray, is also a collection, but multiple objects in the collection are not in the obvious order. Nsset does not allow the inclusion of the same elements, and if an attempt is made to place two identical elements in the same Nsset collection, only one element is preserved. Nsmutablearray represents a variable set of Nsset collection elements, adding and removing methods based on Nsset.The basic use of set is void Test () { /
indexed and sliced, the same method.3. Note the special syntax rules for constructing tuples that contain 0 or 1 elements.4, the tuple can also use the + operator for stitching.
Five, Sets
A collection (set) is a set of unordered, distinct elements. The basic function is to conduct member relationship testing and eliminate duplicate elements. You can use curly braces or set () functions to create set collections, note: Creating an empty collection must be set () instead of {} because {} is us
)
# returns the smallest 5 values in the list
Redis 127.0.0.1:6379> SORT rank LIMIT 0 5 1) "1
" 2
) "2 "
3)" 3 "
4" "4"
5) "5"
You can use multiple modifiers in combination. The following example returns the first 5 objects sorted from large to small.
Redis 127.0.0.1:6379> SORT Rank LIMIT 0 5 DESC
1) "Ten"
2) "9" 3
) "8"
4) "7" 5
) "6"
Iv. use external key to sort
You can use the data of the external key as a weight instead of the default direct contrast key value to sort.
Suppose yo
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.