Java Study Notes 45 (multithreading 2: security issues and solutions), java Study Notes
Thread security issues and solutions:
Security issues occur when multiple threads use one shared data.
A classic case:
Tickets are sold in cinemas, with a total of 100 seats and a maximum of 100 tickets. There are many ways to buy tickets, such as online purchase, self-owned ticket vending machine, and queuing purchase.
Java study notes 44 (multithreading 1) and java Study Notes
Concept of multithreading: omitted
Multi-threaded objective: to improve efficiency
Main thread:
Package demo; // main thread public class Demo {public static void main (String [] args) {function (); System. out. println (1);} public static void function () {for (int I = 0; I
With this simple code, we found that:
The number 1 in the second row can
Java learning notes 46 (multithreading 3: communication between threads) and java learning notes
Multiple Threads are processing the same resource, but the tasks of the threads are different. Through some means, each thread can effectively use the resources,
This means: waiting for the wake-up mechanism, also known as inter-thread Communication
Methods involved: wait (), Policy ()
Example:
Two threads have
Notes: International, notes International
Internationalization (I18N) indicates the first letter of the word, 18 indicates the length of the word, and N indicates the last letter of the word. Internationalization is also called Localization (L10N ).
Java internationalization is mainly achieved through the following three classes:
Java. util. ResourceBundle: used to load a resource package
Java. util. Loc
Java Study Notes day05 and Study Notes day05
1. Method overload
A method with the same name is allowed in the same class, as long as the parameter list of the method is different.
Different parameter lists: different parameter numbers, different parameter types, and different order.
Public class MethodOverLoadDemo {public static void main (String [] args) {} public static void method (int a, int B) {} p
Java learning notes-10. io stream, java learning notes-10.io
1. The input stream can only read data from it, but cannot write data to it. The output stream can only read bytes of data.
2. The InputStream types include:
ByteArrayInputStream contains a memory buffer, which is extracted from byte. FileInputStream obtains bytes from the file. ObjectInputStream is used to restore serialized objects. PipedInput
Mysql master-slave copy notes, mysql master-slave notes
I. Introduction to the test environment
The master-slave replication test environment is ubuntu + mysql5.7, the master server ip address is 192.168.71.135, the slave server ip address is 192.168.71.20., and the ubuntu environment is cloned from a server with a configured environment.
Ii. mysql Master/Slave Configuration
1 :) master Configuration
A. In
Struts2 framework study notes 7: struts2 tag, struts2 Study Notes
Three labels:
1. JSP: script. Expired to replace servlet
2. JSTL: Standard tag Library (core, format, SQL, xml). Only core libraries are eliminated.
3. Struts2 tag Library: Developed by the Struts2 Development Team, with more powerful functions
Struts2 labels include common labels and UI labels.
Common Tag: Control tag, data tag
UI Tag: Form
Spring Study Notes 01 and spring Study Notes 011. Spring Introduction
Spring is a lightweight solution for enterprises, including: dependency injection-based core mechanism, declarative Transaction Management Based on AOP,
A collection of persistence layer technologies and excellent web mvc frameworks.
Composition of the Spring framework:
2. Spring preparation
1) first download the Spring compressed file f
Struts2 Framework Study Notes 2: detailed configuration, struts2 Study Notes
Core configuration file:
Introduce other configuration files:
Relative Path under src
Constant Configuration:
There is a default properties configuration file under the struts2 core package. When we need to modify it,
Example 1:
Create a configuration file by yourself.
Struts. properties:
struts.i18n.encoding=UTF-8
Exampl
Java learning notes (entry) _ basic java syntax, learning notes _ javaPreface After learning the first java program, you will come to the system to learn java. Starting with the basic syntax, you can also understand this syntax in English or Chinese, but everyone has their own characteristics and differences. Learning programming is also a learning process of programming languages. When we are learning Engl
Java Study Notes-13. Create a window and program, and take notes-13
1. init () method: This method is called when a program is created for the first time and initialized for the first time.
Start () method: This method is called whenever a program piece enters the web browser and allows the program piece to start its general operations (the Special Program piece is stopped ); also called after init.
The p
360 plug-in solution RePlugin learning notes-the plug-in uses the classes in the host, replugin learning notes
Scenario 1: When the xml layout of the plug-in uses the full Class Name of the host as the node
When the application configures RePluginConfig, there is a line of code:
// Allow the "agent to use the host class ". The default value is "off" c. setUseHostClassIfNotFound (true );
When this line of c
Xampp configuration notes and xampp notes
--> Basic Environment
1: win7 64-bit System
2: Download xampp Installer (download link: Link: https://pan.baidu.com/s/1kVkX7Af password: czfm)
--> Installation Steps
1: you can create a new folder to store xampp, or use the default path specified during installation as the installation path.
(For example, create a folder on disk D: \ xampp)
2: If you do not need t
Learning notes TF009: logarithm probability regression, learning notes tf009
The logistic function, also known as the sigmoid function, is a probability distribution function. Given a specific input, calculate the probability of output "success" and the probability of "Yes" to the reply question. Accept a single input. Multi-dimensional data or training set sample features can be combined into a single valu
[Java learning notes] The Map interface sub-interface --- TreeMap, learning notes --- treemap
Similar to TreeSet, TreeMap can sort elements in a set and maintain the uniqueness of elements.
It should be noted that Comparable (The implementation interface should overwrite the comparaTo method) is used by Comparator.
1 import java. util. iterator; 2 import java. util. treeMap; 3 4 import cn. itcast. p2.bean.
Spring notes (1), Spring notes (
Spring framework:
Reference: http://www.cnblogs.com/cyjch/archive/2012/02/06/2340415.html
The Spring framework depends on two jar packages: spring. jar and commons-logging.jar.
Added Junit. jar to facilitate testing.
I. A simple example:
Interface Class:
1 package com.imooc.myinterface;2 3 public interface PersonInterface {4 void show();5 }
Implementation class:
1 packag
Spring notes (3) -- proxy mode, spring notes -- proxy
Static Proxy: Custom proxy class;
Dynamic Proxy: The program is generated at runtime.
I. Static Proxy:
Interface: UserManager: adds, deletes, modifies, and queries a user.
1 package com.dwr.spring.proxy;2 3 public interface UserManager {4 public void addUser(String username,String password);5 public void deleteUser(int userid);6 public void m
Java learning notes-Arrays, learning notes-arraysCommon Arrays Methods
Arrays. toString (int [] a) method -------> the return type is String, which can be used to generate printable representation of the array. This avoids reading array values cyclically for printing.
Arrays. sort (int [] a) method -------> used to sort Arrays
Arrays. fill (int [] a, int val) method -------> used to fill the array with t
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.