: In Java development We will certainly use a lot of collections, here I will summarize the common collection classes, the advantages and disadvantages of each collection class, so that we can better use the collection. Now I'm going to use a
Transfer from http://blog.csdn.net/a9529lty/article/details/6454924The role of the Hibernate mapping file:Hibernate mapping file is a bridge for hibernate to persist with the databaseTwo, Hibernate mapping file main content:(1). Definition of the
An array is a collection of data, and an array is also a Java object, and an element in an array can be of any type (including basic and reference types).
To specify the length of the array declaration,
The new statement performs the following steps,
1. Sys_getloadavg ()
SYS_GETLOADAVT () can obtain the system load condition. The function returns an array of three elements, each representing the average load of the system in the past 1, 5, and 15 minutes, respectively. Rather than letting the
1 Find character position function:
Strpos ($str, Search,[int]): Find the first position of search in $str starting from int;
Stripos ($str, search,[int]): function returns the position where the string first appears in another string. This function
Collection
The collection class is stored in the Java.util package.
There are 3 main types of collections: Set (Set), list (lists include queue), and map (map).
Collection:collection is the basic interface of a set, the most basic interface of
Original link: http://www.jb51.net/article/83934.htm
The set interface in Java has the following characteristics:
duplicate elements are not allowed;The element position in the collection is not in order;There is only one element with a value of
Collection list: Click on the Open link
As with the list collection, the Set collection inherits the collection interface.
HashSet and TreeSet are two classes that we often use.
HashSet and TreeSet both inherited the Abstractset abstract class: But
$fruits =array (
"D" => "Lemon",
"A" => "orange",
"B" => "banana",
"C" => "Apple"); Define an array
Arsort ($fruits); Reverse-Sort the array
foreach ($fruits as $key => $val)//Cyclic output the key value pairs of the array after sorting
function Listfolders (){Set a path$dir = "./";
Set up an array of file pieces$aDir = Array ();
$oCurrentdir = Opendir ($dir); Open Directory
while ($sFile = Readdir ($oCurrentdir))//Read all subdirectories of the current directory{if ($sFile!= '.
The Array_multisort () function in PHP can be used to sort multiple arrays at once, or to sort multidimensional arrays based on one dimension or multidimensional. This article explains how to use the Array_multisort function.
The Array_multisort ()
Official Handbook (http://us.php.net/manual/en/function.natsort.php)
Copy Code code as follows:
BOOL Natsort (array & $array)
This function implements a sort algorithm so orders alphanumeric strings in the way a human being would
Searches for a specific value in the array and returns False if it finds return true
Boolean In_array (mixed Needle,array Haystack[,boolean Strict])
Finds a specified health in the array and returns False if found return True
Boolean
Top-n, sort by a rule, and then take the first N rows of data.
RowNum: Pseudo-columns, the data table itself does not have such a column, is the Oracle database for each data table plus columns, you can identify line number, by default, rownum by
1.strings (String)
A) If you use only the string type in Redis and do not use the persistence feature of Redis, then Redis is very much like memcache;
b) When a numeric operation is encountered, it is automatically converted to a string, such as
Fixed collection:
Property 1. Insert the fixed set very quickly
Attribute 2: Query output in the order of insertion is extremely fast
Attribute 3: Ability to retire the oldest data when inserting the latest data
Usage 1: Store log information
Usage
Introduction: TreeMap and TreeSet are two important members of the Java Collection Framework, where TreeMap is a common implementation class for the Map interface, and TreeSet is a common implementation class for Set interfaces. Although the
Objective:System unique ID is a problem we often encounter when designing a system, here are some common ID generation strategies.
Sequence ID
Uuid
Guid
Comb
Snowflake
The initial self-increment ID in order to achieve
A.MongoDB features, features, usage scenariosMongoDB Installation and ConfigurationMongoDB ArchitectureDatabase start, stop, connectJson/bson data formatMongodb1. FeaturesData is in memory, written to disk through a background threadNon-modal
"Suzhou needs to work to add me QQ, the introduction of fee-splitting" MongoDB advanced1. Database commandsA. How the command worksDrop command to delete a collection in the shell and Execute Db.refactor.drop (). Actually, this function actually
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.