Today I solve a problem about missing http header. I add some extra information in http headers when I request server. The code works well in my local environment. When I deploy it on the remote machine some http headers are missing. After google I solve the problem.
In this page I will show you when static inner class is initialized. I write a demo to help you to understand it. All static fields (include inner class) is initialized when the class is loaded.
The key words group by is used to divided records into several groups. Let's say you have a table like following. This table is the score of course for different students. Table name is score_info
For linux mint there are many service scripts in the directory /etc/init.d. Most of them will be executed when user login. Linux uses different directory (such as /etc/rc?.d/) to mark which service and when to run. If you don't want one service auto start you need to remove the link from the directory or to use update-rc.d command like following.
ReadWriteLock is used in the scenario that reading operation is more frequent than writing. It is more efficient than synchronized method. Multiple read threads do not block each other, only write thread blocks read thread. The sample code is here.
Dynamic proxy is commonly used in popular java frameworks, such as Spring, MyBatis and so on. There are other ways to implement proxy by using aspect or javassit and so on third part frameworks. In this page I will show you JDK dynamic proxy.
When I POST some xml data to server by using chrome I got the error message like following.
There are 6 states for Java Thread. From JDK comment it says that A thread can be in only one state at a given point in time. In this page I will show you different states in thread life cycle. Hope the sample code can help you understand the states better.
Template method pattern is commonly used in this scenario that main logic is stable but sub steps are not. Let's say you want to add export function in your system. For different data source there are different way to export data, but the main steps are the same: "getData", "processData" and "export". Let's try to use template method pattern in this example.
After downloading and unzipping the tar.gz file of IDEA I can start it by executing idea.sh. But I want to add it in Linux mint applications menu. For Linux mint the applications menu info is in / usr / share / applications /. Creating the file idea.desktop in this directory. The content is like following.
I have an old laptop with 4G memory and T6600 CPU. It installed Windows7 before and it runs slower and slower recently. I decide to install linux on it. Finally I choose Linux mint with xfce. It is not very beautiful but it's lightweight and use less memory. For the default Chinese fonts is not very clear. After google I use following command to make the fonts become clearer.
There are two ways to show remote repository in git.
Cache is very important for the project. Redis or MemoryCache are good choose for distribution project. If you want use local cache for your project guava is a good choose. I will show you how to use guava cache in this page.
Java provides several bitwise operators: &, |, ^ and ~. This page shows you how to use them.
State Pattern is for the scenario which contains different states. Let's consider the state of Amazon orders. When you want buy goods from Amazon the logic flow is: create order -> pay -> send goods -> receive goods -> evaluate. The status of order is changed after every operation and the action of order is changed correspondingly. The example code is like following.