form of synchronization that contains only the visibility, the volatile keyword, and in some cases we only need to focus on the visibility of the code, rather than the mutex, when using synchronizedIt does not seem necessary that we should consider using volatile, a volatile tagged property, when the thread accesses him without reading the cached variable's data, but instead reads it from main memory. It is also worth noting that the use of volatileWhen modifying a double and a long type, you s
list loaded into memory, accidentally checked 100w data, and check more frequently, the memory burst. There is this risk of changing the composition page query.Eight: Consider avoiding long connections or long transactions inside a transaction, which can affect performance if a large number of this situation takes up a data connection. Some unnecessary logic can be placed outside of the transaction execution.IX: A normal indexb Uniqueness index with unique parameter, primary key.C Single-colum
class does not lineThe order of the process to obtain the license to do any guarantee. In particular, intrusion is allowed, meaning that it can be in front of the waiting threadacquire()assigns a license to the calling thread, which logically means that the new thread puts itself in the waiting thread queue's head. When fair is set to true, the semaphore is guaranteed for any 获取 thread that invokes the method, asThe order in which they call these methods (i.e., FIFO) to select a thread and obta
of the busy cycleA looping statement designed to consume time22. The method that lets one thread wait for another thread to dieJoin ()23. The thread method that lets you sleepSleep ()24. Write an application called Intsleep, which creates a background thread, continuously prints out Hello, and then sleeps 100ms. After sleeping 2s, the default main thread should interrupt the background thread, which jumps out of the loop after printing out the interruptedpublic class Intsleep {public static voi
Atitit. Implementing best practices for extracting Zip files Java C #. NET PHP
1. JDK zip with Apache ant zip 1
2. Apache ant package for zip file compression, upzip approximate process. 1
3. Read the file name OK, but cant read to input said Npe. 2
4. Ant1.8.2.jar 2
5. #---Details Code 2
6. Reference 4
1. JDK zip with Apache ant zip
The following function is to extract the image files in th
the Observer class, the only way to implement the Observer Interface update
void Update (Observable o, Object Arg)
The parameter, object arg, corresponds to an argument passed by Notifyobservers (object Arg), and when the Notifyobservers () is executed, ARG is null. A simple example is given below: PackageDesignpattern_observer;Importjava.util.Observable; Public classMybuttonobserableextendsObservable {PrivateString Clickmode; PublicString Getclickmode () {returnClic
Reference fromHttp://www.cnblogs.com/tianzhijiexian/p/3906774.htmlHttps://github.com/tianzhijiexian/HttpAnnotation/blob/master/lib/src/main/java/kale/net/http/util/HttpReqAdapter.javaOriginal webpage address: http://www.codeceo.com/article/java-reflector.html ...Summary: The simplest and most elegant use of reflection.Examples of this article can be seen in the sample code and downloaded, if you like star,
of out-of-heap memory.Here are some practical experiences, in addition to the Java heap and the permanent generation of memory:Direct Memory: Can be resized by-xx:maxdirectmemorysize and thrown OutOfMemoryErroror Outofmemoryerror:direct buffer memory.Thread stacks: Can be resized by-XSS and thrown stackoverflowerror when out of memory (cannot be allocated vertically, i.e. new stack frames cannot be allocated)Socket buffers: Each socket connection is
will reveal the internal work and failure of the application, which can be used by attackers to further attack the application. Therefore, we need to treat the logs with care and keep them safe. Information that should not be logged is as follows:
Credit card number
Social Security Number
Password
However, the following types of information should not be written to the log:
Session identifiers
Authorizing tokens
Personal name
Phone number
Informati
[Java] itoo project practices: optimized collection of millions of data queries and itoo data queries
1. To optimize the query, you should consider creating an index on the columns involved in where and order.
2. Try to avoid null value determination on the field in the where clause, for example, select id from t wherenum is null.
You can set the default value 0 on num to make sure that the num column in t
String j = stringutils.join (new string[] {"A", "B", "C"}, ","); System.out.println (j); // A, B, C 8. Converting an array list to arrays String[] Stringarray = {"A", "B", "C", "D", "E" }; ArrayListNew arraylist(arrays.aslist (Stringarray)); New string[arraylist.size ()]; Arraylist.toarray (Stringarr); for (String S:stringarr) System.out.println (s); 9. Converting an array to set (set) New Hashset(Arrays.aslist (Stringarray)); SYSTEM.
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.