elements sorted by their length in this example, with the shortest entry in the front:
Listing I
This creates our own comparison function, which uses the strlen () function to compare the number of each string and then returns 1,0 or-1, respectively. This return value is the basis for determining the arrangement of elements. Here is the result of its output:
Array ([0] = jay@zoo.tw[1] = joe@host.com[2] = john.doe@gh.co.uk[3] = asmithsonian@us.info)
: This article mainly introduces the php- 文 tool. For more information about PHP tutorials, see.
Abc123 * Chinese string: return the first character of pinyin, eg. test string => CSZFC * English-Chinese mix string: returns the first character of pinyin and the English eg. I j => WIWJ * eg. * $ py = new str2PY (); ** $ result = $ py-> getInitials ('Jay Chou '); ** // get the first letter * $ result = $ py-> getFirstString ('ABC'); // A * $ resutl = $
/**
* Get hot words from Baidu
* @user Little Jay
* @from http://www.isharey.com/?p=354
* @return Array returns the hot Word data from Baidu (array return)
*/
Java code
/**
* Get hot words from Baidu
* @user Little Jay
* @from http://www.isharey.com/?p=354
* @return Array returns the hot Word data from Baidu (array return)
*/
function Getbaiduhotkeyword () { $templateRss = file_get_contents (' http:
Php/** * Chinese Pinyin First Letter tool class * Note: English strings: Unchanged returns (including numbers) eg. abc123 = abc123* Chinese string: Returns the phonetic first character eg. test string = cszfc* Chinese-English mixed string: Returns the pinyin first character and English eg. I i i j = wiwj* eg.* $py = new Str2py (); * * $result = $py->getinitials (' Jay Chou '); * *//Get first letter * $result = $py->GETF Irststring (' abc '); A * $res
This article is mainly to share with you PHP operation Redis Life, hope to help everyone.
To confirm that the server has the Redis service turned onThe Redis port number is 6379 by default
A small example code
Header ("Content-type:text/html;charset=utf8"); Declares the Redis object instance redis->connect ("localhost", 6379); If Redis turns on security authentication, then we need to use the Auth method in Redis to pass the secure authentication password $redis->auth ("123456");//Redis->hmset (
of the element in ascending order
Reverses the order of the elements inside the list:
List. Reverse ()//can be associated with list. Sort () to use to achieve the desired effect
To traverse the elements in a list:
The type of the foreach (t element in Mlist) T is the same as the Mlist declaration
{
Console.WriteLine (Element);
}
G.list empty: List. Clear ()
such as: Mlist.clear ();
H. Get the number of elements in list:
List. Count () returns an int value
I. Add array into list:string[] Te
, incluwei_product_ec156 )},
III. tools
Usb_switchmode-1.2.4
This is the latest version. This tool is used to convert the 3g usb modem identified as a storage device by default to multiple serial devices that can communicate with each other for ppp dial-up connections.
This tool depends on linusb, all of which are cross-compiled ,.
1. download and cross-compile libusb-0.1.12:
./Configure -- build = i686-linux -- host = arm-linux -- prefix = $ PWD/install
Make
Make-n install (confirm the in
value of that key cannot be NULL. it can be set to not null. As follows:
CREATE TABLE person_tbl( first_name CHAR(20) NOT NULL, last_name CHAR(20) NOT NULL, sex CHAR(10), PRIMARY KEY (last_name, first_name));
If we have set a unique index, the SQL statement cannot be executed successfully when repeated data is inserted, and an error is thrown.The difference between insert ignore into and insert into is that insert ignore ignores existing data in the database. if there is no data in the da
pattern is followed by a /, only directories and subdirectories match.
A shell script for testing and learning globstar is written as follows:
#! /Bin/bashfunction show(){ for i in ** do echo $i done} cd /root/jay/echo "------------------------"echo "disable globstar option:"# globstar is disabled by defaultshopt -u globstarshowecho "------------------------"echo "enable globstar option:"shopt -s glob
an unexpected dog poop!In addition to turn koi carp, online now also popular nostalgia, the following figure you all recognize a few?Another point of exposure to age ... It is said to know these goods to the legal age of marriage via: Figure DeanA little piece of lying gun, nothing to say, all in the wine, dry ...After the drink, let's go to the landlord and miss the college time.@ The fall of the Earth : Dog went to the yard to catch a cat, it bared teeth to the cat threatened: "Catch a mouse
Definitely improve the sense of humor.1. Q: "I am going to have a blind date. The girl smiled and my face was full of powder. What should I do ?"......
A: "You are welcome to deliver food when you first meet ."
2. Q: When you are taking the bus, people around you suddenly glance at you and then vomit. What do you do?
A: Sure enough! The average person sees me directly dizzy.
3. Q: What will happen if you have ten bottles of beer?
A: Let them come up again.
4. Q: Do you dare to say ho
There are many ways to sort arrays in, including sorting by value, sorting by keywords, natural language sorting, and so on. What we're going to teach you today is to implement a custom array ordering using PHP function Usort (). You can create your own comparison function and pass it to PHP function Usort (), if the first argument is smaller than the second argument, the comparison function must return a number smaller than 0, and if the first argument is "large" than the second argument, the c
conducive to user reading and crawling. Create your html and xml Sitemap. Generally, the search engine considers that the weight of the second-level domain name> The second-level Directory> the root directory document. When naming documents and directories, it is better to use pinyin, and the directory level should not be too deep.(2) the most appropriate combination of website content and corresponding keywords includes the article title, Meta Tag, Header Tag, Body Text, Alt Tag. In Baidu rank
everyone is attracted to you, this time others will ask you where to see, you can be generous ad, even if you do not have this content, but try to have, after all, do the station is to have the connotation. Can refer to this kind of ad way, or release very startling news, this can attract a lot of IP, such as false news, Jay Chou Taiwan by the dog Chase, leading to car accidents, such a topic is very attractive, in the group, a lot of people will ask
) = = strlen ($b)) {
return 0;
} else {
Return (strlen ($a) > strlen ($b))? 1:-1;
}
}
?>
This creates our own comparison function, which uses the strlen () function to compare the number of each string and then returns 1,0 or-1, respectively. This return value is the basis for determining the arrangement of elements. Here is the result of its output:
Copy CodeThe code is as follows:
Array ([0] = jay@zoo.tw
[1] = joe@host.com
[2] = john.doe@gh.co.uk
Share a php-made Chinese pinyin first letter tool class,
The code is very simple, here is not many BB, we read the comments, comments do not understand the small partner, beg to leave php!!!
Copy CodeThe code is as follows:/*** Chinese Pinyin first Letter tool class* Note: The English string: Unchanged returns (including numbers) eg. abc123 = abc123* Chinese string: Returns the pinyin first character eg. Test String = = CSZFC* Chinese-English mixed string: Returns the pinyin first character and
Code:
# Pragma mark-# pragma mark tableview // Note: Do not place tableview in scrollview, in this case, no rows will be suspended. // The number of rows in each group-(nsinteger) tableview :( uitableview *) tableview numberofrowsinsection :( nsinteger) Section {return 3 ;} // how many groups-(nsinteger) numberofsectionsintableview :( uitableview *) tableview {return 10;} // The number of displayed rows-(uitableviewcell *) tableview :( uitableview *) tableview cellforrowatindexpath :( nsinde
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.