Understanding and use of ThreadLocal

Understanding and use of ThreadLocal ​ When multiple threads access the same shared variable, they are particularly prone to concurrency problems, especially when multiple threads need to write to a shared variable. In order to ensure thread safety, general users need to synchronize appropriately when accessing shared variables. ​ The syn ...

Posted by carlmty on Tue, 24 May 2022 17:07:06 +0300

Leetcode Best Time to Buy and Sell Stock series topic analysis and java implementation

Leetcode Best Time to Buy and Sell Stock series topic analysis and java implementation The title of this series is to allow us to trade according to restrictions in a continuous period of stock prices to maximize profits. Each derivative title will set some restrictions Best Time to Buy and Sell Stock I Best Time to Buy and Sell Stock II Best ...

Posted by Karlos2394 on Sun, 22 May 2022 21:32:50 +0300

How to Realize Breakpoint Continuation of Large Files Similar to Baidu Disk

Catalog background Implement small file upload as a whole Build Front End Environment Setting up a service-side environment How to Upload Large Files in Pieces Client implementation slicing Client computing hash Client Upload Slices Server Implements Check Interface Server Implements Piecewise Upload Interface Service side implements me ...

Posted by doforumda on Sun, 22 May 2022 20:42:59 +0300

Invest in a milk tea shop and coffee shop (code implementation) [the web page can be modified by yourself]

catalogue 1 investment 2 coffee shop code display 2.1 ideological source 2.2? Pictures and videos 2.3 code 2.4 write at the end? 1 investment **There is only one criterion for real investment, that is, whether it is creating real value and whether this value is beneficial to the overall prosperity of society** Adhering to this standar ...

Posted by solar_ninja on Fri, 20 May 2022 23:52:30 +0300

JavaSE-No.8 - Polymorphism of the Three Features of Java

JavaSE Portal JavaSE_Start JavaSE-No.7.1 - Java's inheritance (super keyword) JavaSE-No.7.2 - Java's Inheritance (and Composition) content 1. The concept of polymorphism2. The realization conditions of polymorphism rewrite 3. Up and down transitions 3.1 Upward Transformation3.2 Downcasting instanceof 4. Rewritten design rules ...

Posted by Big X on Fri, 20 May 2022 00:12:51 +0300

0827 early test XXS attack. Reflow and redraw, sql injection, csrf attack, cookie and session

What is XSS attack and how to defend it XSS (Cross Site Scripting) is a common computer security vulnerability in web applications XSS injects malicious runnable scripts into the client. If the server does not process the user input, it directly outputs the user input to the browser, and then the browser will execute the user injected script ...

Posted by scm24 on Thu, 19 May 2022 17:59:27 +0300

Fundamentals: in depth analysis of JAVA exceptions

When an exception occurs in the method, an exception object will be created and handed over to the JVM for processing. The exception object contains the exception name, exception description and the state of the application when the exception occurs. The process of creating an exception object and handing it to the JVM is called throwing an ex ...

Posted by slindstr on Thu, 19 May 2022 10:38:24 +0300

A concise tutorial on elasticsearch

Installation configuration Install Download from the official website www.elastic.co/downloads to install, download elasticsearch-6.8.1.deb here. Also download ik tokenizer (elasticsearch-analysis-ik-6.8.1.zip) and kibana-6.8.1-amd64.deb. Pay attention to the version of the tokenizer, the version of kibana is the same as the version of e ...

Posted by GESmithPhoto on Tue, 17 May 2022 17:33:38 +0300

Design mode - eight different implementations of single case mode [JAVA] and single case question sorting - interview necessary - super detailed

Design mode - single case mode - eight different implementations [JAVA] and single case problem sorting - necessary for interview - super detailed Introduction to singleton mode the singleton pattern is a software design pattern that restricts the instantiation of a class to one "single" instance. It can be simply understood as: a class ca ...

Posted by SalokinX on Mon, 16 May 2022 21:13:29 +0300

Implementation principle of Java thread pool -- thread pool blocking queue, rejection policy and Executors

1.BlockingQueue thread pool blocking queue Blocking queue method public interface BlockingQueue<E> extends Queue<E> { boolean add(E e); boolean offer(E e); void put(E e) throws InterruptedException; boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException; E take() ...

Posted by siobhan on Sun, 15 May 2022 04:46:08 +0300