What does countdown latch do?
The article is short. I haven't explained some top-level methods of AQS, such as releaseShared, because these are the categories of AQS. You can see another article about AQS—— AQS.
CountDownLatch is generally referred to as a "counter". Its function is to count until the number reaches a certain point. It can be used ...
Posted on Fri, 03 Dec 2021 13:37:48 -0500 by NJordan72
A set of solutions for Spring Security OAuth2 authorization mode extension and application practice
1, Foreword
[APP mobile terminal] Spring Security OAuth2 SMS verification code mode [wechat applet] Spring Security OAuth2 wechat authorization mode [management system] Spring Security OAuth2 password mode [management system] Spring Security OAuth2 verification code mode
The four authorization modes implemented by Spring Secur ...
Posted on Fri, 03 Dec 2021 11:18:27 -0500 by MasterACE14
Sword finger offer: search algorithm
Sword finger offer (V): search algorithm
Topic 1: repeated numbers in the array
Method 1: hash table / Set. It's the same way, but there's no easy answer
class Solution {
public int findRepeatNumber(int[] nums) {
Set<Integer> dic = new HashSet<>();
for(int num : nums) {
if(dic.contains(num)) return ...
Posted on Fri, 03 Dec 2021 10:55:17 -0500 by baffled_in_UK
Introduction to practical classes
1, Enumeration
Enumeration refers to a type consisting of a fixed set of constants
Features: safe type, easy to input, clear code Common ways of enumerating a) Define enumeration values directly
public enum Week{
//Enumeration values are all capitalized and separated by commas. enum keyword is added before class name to distinguish enumerat ...
Posted on Fri, 03 Dec 2021 10:47:08 -0500 by shaunno2007
Introduction and use of MyBatis framework (the children next door will talk about it) -- Basic
1: Overview
MyBatis is an excellent persistence layer framework that supports common SQL queries, stored procedures and advanced mapping. MyBatis eliminates almost all the manual setting of JDBC code and parameters and the retrieval of result sets. MyBatis uses simple XML or annotations for con ...
Posted on Fri, 03 Dec 2021 10:11:03 -0500 by gasxtreme
Learn more about Spring cache of SpringBoot series
Why cache
Using cache is a "cost-effective" performance optimization method, especially for programs with a large number of repeated queries. Generally speaking, for WEB back-end applications, there are two places that take a lot of time: one is to query the database, and the other is to call the API of other services (because ...
Posted on Fri, 03 Dec 2021 09:56:12 -0500 by thinkaboutit
SpringBoot+Vue enables third-party microblog login
one preparation
The purpose of this step:
Before logging in to the microblog, the website needs to apply and obtain the corresponding appid and appkey to ensure that the website and users can be verified and authorized correctly in the subsequent process.
1.1 save appid and appkey
Appid: the unique ID of the application. During OAuth 2.0 ...
Posted on Fri, 03 Dec 2021 09:55:24 -0500 by PhantomCube
012Java virtual machine 003 data storage
Some of the content comes from the following Blogs:
https://www.cnblogs.com/xrq730/p/4827590.html
https://www.cnblogs.com/gw811/p/2730117.html
https://www.cnblogs.com/jhxxb/p/11001238.html
1 memory area model
The Java virtual machine defines the memory area that the program needs to use when running. The model is as follows:
The reason why so ...
Posted on Fri, 03 Dec 2021 07:43:20 -0500 by jagdpenta
Common JAVA postures and methods collected by programmers who have worked for three years
Serialization and deserialization of objects
<dependency>
<groupId>org.javatuples</groupId>
<artifactId>javatuples</artifactId>
<version>1.2</version>
</dependency>
package com.cqcdi.securitybrain.vulnerability_scanner.utils;
import com.fasterxml.jackson.core.JsonGenerator;
import ...
Posted on Fri, 03 Dec 2021 06:54:22 -0500 by jbdphp
RocketMQ - send transaction message
1. Principle of transaction message
The implementation principle of RocketMQ transaction message is based on two-stage commit and scheduled transaction status check to determine whether the message is finally committed or rolled back.
2. Transaction message start
TransactionListener transactionListener = new TransactionListenerImpl();
Transa ...
Posted on Fri, 03 Dec 2021 05:12:45 -0500 by dey.souvik007