Introduction and practice of global unified exception handling
PS: This article is detailed, so it is long. Reading time: 30m~1h. Please read it carefully. I hope you can have a clear understanding of unified exception handling in an hour.
1. Background
In the process of software development, it is inevitable to deal with all kinds of exceptions. For myself, at least more than half of the time is dealing ...
Posted by cheechm on Thu, 04 Nov 2021 23:24:19 -0700
After using the cache object ConcurrentLruCache, the key value cannot be hit, resulting in the failure to improve the system performance
1. Problem Description:
Concurrent lrucache is used as the JVM cache pool object
public class UserManager {
private ConcurrentLruCache<UserCacheKey, UserInfo> cache = new ConcurrentLruCache<UserCacheKey, UserInfo>(100, new Function<UserCacheKey, UserInfo>() {
@Override
public UserInfo apply(UserCacheK ...
Posted by lisa3711 on Thu, 04 Nov 2021 22:15:27 -0700
EasyExcel third bullet + hutool POI are used together to export more complex Excel.xlsx + to calculate growth rate, year-on-year month on month ratio, proportion, etc
1, Review
Following the last "dynamic header easyExcel import and export"( https://blog.csdn.net/qq_37337660/article/details/114680512)", And the last dynamic header import( https://blog.csdn.net/qq_37337660/article/details/110288393 )”After that. We have a third wave easyExcel Torture, this time export complex Excel, by the w ...
Posted by Rithiur on Thu, 04 Nov 2021 19:59:56 -0700
Maven build project, how to build Java and Web projects in IDEA and how to run
3. Construction of Maven project
3.1 contents of Maven project
The structure of the project is as follows:
See the following figure for details:
3.2 commands for manually building projects
mvn compile #compile
mvn clean #eliminate
mvn test #test
mvn package #pack
mvn install #Install to local warehouse
Just be familiar ...
Posted by tina88 on Thu, 04 Nov 2021 18:47:40 -0700
Summary of JUC multithreaded programming
Summary of JUC multithreaded programming
JUC: use of java.util.concurrent multithreading Toolkit
Test demo:https://gitee.com/aqq/mytest.git
1. Daemon thread
There are two kinds of threads in java: user thread and daemon thread
Only if the user thread in the current JVM does not end, the daemon thread will work. Only when the last user thre ...
Posted by iimrii on Thu, 04 Nov 2021 18:07:21 -0700
[architect interview - JUC concurrent programming - 9] - thread pool
1: Introduction to thread pool
Using thread pool, you can reuse threads and control the total number of threads. If the thread pool is not used, a new thread should be opened for each task. The overhead of repeatedly creating threads is large, and too many threads will occupy too much memory.
This is too expensive. We want to have a fixed num ...
Posted by hairytea on Thu, 04 Nov 2021 16:05:52 -0700
Java -- detailed explanation of time complexity and space complexity
Algorithm efficiency
In use, the algorithm efficiency is divided into two types: one is time efficiency (time complexity) and the other is space efficiency (space complexity). Time complexity refers to the speed at which the program runs. Spatial complexity refers to the additional space required by an algorithm.
Time complexity
What is ...
Posted by ol4pr0 on Thu, 04 Nov 2021 15:35:04 -0700
Detailed explanation of RedisTemplate method
maven dependency
<!--redis-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<!--<version>2.1.4.RELEASE</version>-->
</dependency>
<dependency>
...
Posted by ITEagle03 on Thu, 04 Nov 2021 14:41:41 -0700
Talk about the Callback of collaborative process and write the model of collaborative process
The emergence of Coroutines has subverted the programming style of Java for many years. If you are the author of a third-party library, you may want to use Coroutines and Flow to make your Java callback based library more Kotlin and collaborative. On the other hand, if you are an API consumer, you may prefer to access the Coroutines style API t ...
Posted by jeff_papciak on Thu, 04 Nov 2021 14:41:06 -0700
Getting started with POI and easyExcel
Use scenarios and versions
Use scenarios
Export information to excelEnter information from excel table into website database (exercise upload.)
excel version
Version 03 xls rows Max 65535 rowsVersion 07 xlsx has no limit on the number of rows
One serious problem with POI is that it consumes a lot of memory
EasyExcel is an open source exce ...
Posted by kwilder on Thu, 04 Nov 2021 14:29:56 -0700