of the instance they are called, and Sleep () is available everywhere. The biggest difference between wait () and sleep () is that sleep () does not release object locks, and wait () is freed, so it is better to consider the wait () method in terms of efficiency.6. The basic principle of synchronous design: the smaller the code in the synchronization block (synchronized) the better!Do not write blocking code in the synchronization block (for example, Inputstream.read ())!Do not invoke methods o
Java 8 enhanced tool class Arrays notes, java8arrays
Make notes at willArrays tool categories are divided into two categories: Single-thread and multi-threadAll of the following statements with a subscript range are headers without tails.Single thread:1. binarySearch: The subscript of the key in the search array: binarySearch binary search. The array must be ordered and exist in this array. Otherwise, a negative subscript is returned.
Arrays. binarySe
, the number of bytes transferred is less than the number of bytes requested .Also note that in the Soketchannel implementation, Socketchannel only transmits the data that is prepared at this point (which may be less than count bytes). Therefore, Socketchannel may not transfer all of the requested data (count bytes) to FileChannel.(2) TransferTo ():The TransferTo () method transfers data from the FileChannel to other channel . The following is a simple example:1 Randomaccessfile FromFile =NewRan
accept () method is blocked until a new connection arrives.Typically, you will not just listen to one connection, but call the Accept () method in the while loop. As in the following example:1 while (true) {2 Socketchannel Socketchannel =3 serversocketchannel.accept (); 4 5 // Do something with Socketchannel ... 6 }Of course, you can also use exit criteria other than true in the while loop.3. Non-blocking modeServersocketchannel can be set to non-blocking mode. In nonblockin
connection is established. In order to determine whether a connection is established, you can call the Finishconnect () method. Like this:Socketchannel.configureblocking (false); Socketchannel.connect (new inetsocketaddress (" Http://jenkov.com ", ()); while (! Socketchannel.finishconnect ()) { //Wait, or do something else ...}(2) write ()In non-blocking mode, the write () method may return if nothing has been written. So you need to call write () in the loop. There are already examples, an
[Django] data export excel enhanced version (very powerful !), Django data export
Not to mention, the principle is to use xlwt to export excel files. The so-called forced version refers to the implementation of selecting certain conditions on the webpage to export the corresponding data.
I have published such articles in my blog post before, but I only want to export data. This time, I thought about it and added the online search to finally find out h
C # web crawler-multi-thread processing enhanced edition,
The last time I made a web crawler for my company's sister, it was not very delicate. I used it in this company project. So I made some changes and added the web site image collection and downloading functions, download images from the web page of the thread processing interface.
Let's talk about the train of thought: the Prime Minister obtains all the content of the initial website, collects i
Practical notes for learning using LinQ (2) C # enhanced features,
C # added many language features for the support of LINQ:
Implicit local variables
Object initializer
Lambda expressions
Extension Method
Anonymous type
Understanding these new features is an important prerequisite for a comprehensive understanding of LINQ, so do not ignore them.
(1) Implicit local variables
The highlight of processData is {get; set;}, which is a new feature.
Enhanced version of the system function that can return execution results
/********************************************************************* * Author : Samson * Date : 03/13/2015 * Test platform: * 3.13.0-24-generic * GNU bash, 4.3.11(1)-release * *******************************************************************/
In GNU Linux C programming, to execute system commands, only the system interface is provided, but t
Enhanced Java basics-reflection and Annotation
Basic enhancement 1 review generic and generic reflection 3 annotationsBasic enhancement I. review basic concepts of generic generics:
ArrayList
For example: ①
ArrayList
E In is called the type parameter variable
ArrayList
The Integer in is called the actual type parameter ② the whole
ArrayList
Called generic type whole
ArrayList
ParameterizedType defines a generic method ::
//
: Declaration o
The Use the Hints and NotesTip: If you need an unordered list, use the tip: use CSS to define list styles.
Properties
value
Description
Compact
Compact
Not supported in HTML5. Deprecated in HTML 4.01.Specifies that the list renders more compact than normal.
Reversed
Reversed
(HTML5) Specifies that the list order is descending. (9,8,7 ...)
Start
Number
Specifies the starting value of the ordere
1. Overview of propertiesProperties: Property Collection Class . is a collection class that can be used in conjunction with IO streams. Properties can be saved in a stream or loaded from a stream. each key and its corresponding value in the property list is a string .Properties is a subclass of Hashtable , and the description is a map collection .2. Properties as a map collection using1 Packagecn.itcast_08;2 3 Importjava.util.Properties;4 ImportJava.util.Set;5 6 /*7 * Properties: Property Colle
Java is not an enhanced HTML-general Linux technology-Linux programming and kernel information. The following is a detailed description. It is necessary to clarify a general misunderstanding before continuing the explanation. Because Java is used to create web pages, Beginners sometimes confuse Java with Hypertext Markup Language (HTML), or think that Java is only a few improvements to HTML. Fortunately, this is just a misunderstanding. In essence, HT
powerful ... But not for me.
Csscomb typesetting style
Zen (the predecessor of Emmet)
Basic Use
There are two default shortcut keys [You can also use the mouse to click the plugin call]
ctrl + alt + c[冲突]
ctrl + alt + shift + c[冲突]
Toggle typesetting style (ready-made configs), see description and look at the picture
Packages, Css Comb-settings
Default Shortcut key parameters
‘atom-text-editor‘: ‘ctrl-alt-c‘
1. Randomly get name cases in a text fileRequirements: I have a text file stored in a few names, please write a program implementation randomly get a person's name.Analysis:A: Storing the data in a text file in a collectionB: Randomly produce an indexC: Gets a value based on the index2. Code implementation:1 Packagecn.itcast_02;2 3 ImportJava.io.BufferedReader;4 ImportJava.io.FileReader;5 Importjava.io.IOException;6 Importjava.util.ArrayList;7 ImportJava.util.Random;8 9 /*Ten * Requirements: I
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.