Project Records - Enterprise Requirement
Here will record some of my project requirements in enterprise development.
—————-For quick search and page turning, please see the table of contents on the right———————->
—————For quick search and page turning, please see the table of contents on the right———————–>
————–For quick search and page turning, please see the table of contents on the right————————>
Redisson Distributed Lock
Requirement DescriptionRecently, while working on my project, I found the need to implement caching lo ...
Hexo switch language, suitable for any theme
This article mainly discusses how Hexo achieves internationalization in the simplest way, and this method is highly applicable. I personally think that there is no requirement for which theme to use.
Ideal SolutionThere is a button on the home page, by clicking this button, you can switch the language page with one click (the example of this blog will be Chinese and English). At the same time, the realization of this method does not need to buy a new domain name.
It is worth noting that this met ...
Project Records — Troubleshooting
Here I will record some insightful bugs I encountered in enterprise development, as well as troubleshooting for code
SQL DML Blocking Issue (Oracle)Bug DescriptionRecently, our project needs to receive data from the Big Data department’s interface and perform some update operations on the data before inserting it into a table, which we will refer to as the “Business table” in the following text. During the execution of this operation, it was unexpectedly observed that the execution time exceeded ...
Considerations for Using Collections
Collection Empty Check
To check whether all elements inside a collection are empty, use the isEmpty() method instead of size()==0 method.
This is because the isEmpty() method provides better readability and has a time complexity of O(1).
While the time complexity of the size() method for most collections we use is also O(1), there are many collections, particularly those in the java.util.concurrent package (such as ConcurrentLinkedQueue, ConcurrentHashMap, etc.), whose complexity is not O(1).
B ...
MySQL Data Backup
“This blog post is intended to document the new knowledge I’ve acquired during the learning process, specifically about how to perform data backup in MySQL. If needed in the future, it can serve as a reference.”
Take a look at the code directly.
123456789101112Q1:SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;Q2:START TRANSACTION WITH CONSISTENT SNAPSHOT;/* other tables */Q3:SAVEPOINT sp;/* Time 1 */Q4:show create table `t1`;/* Time 2 */Q5:SELECT * FROM `t1`;/* Time 3 */Q6:ROLLBACK TO ...
Method Static Dispatch
This example is referencing the book “Understanding the Java Virtual Machine”.
Firstly, contemplate the expected output of the following code:
1234567891011121314151617181920212223242526272829public class StaticDisptach{ static abstract class Human{} static class Man extends Human{} static class Woman extends Human{} public void sayHello(Human people){ System.out.println("hello,people"); } public ...
Oracle SQL optimization
ProblemRecently, I encountered a problem when writing a SQL, and the execution time of SQL was too long:
1234567891011121314151617select'A' as type,count(adl.is_attend) as count,round(sum(case when adl.is_attend = 1 then 1 else 0 end)/ count(adl.is_attend),2) * 100 as ratefromattendance adlinner join (select deptId from department start with deptId = '...' connect by up_daptId = prior deptId) as nbd on adl.deptId = nbd.deptIdwhere to_date(adl.date,'yyyy-MM-dd& ...
Intranet projects avoid pitfall
As we all know, some projects are completely established in the offline mode of the intranet. The first time I came into contact with this offline mode project recently, record the problems encountered:
Maven offline modelDue to the requirements of the intranet, the project is running on a virtual machine, and the development environment cannot be connected to the Internet on the virtual machine, so all projects need to be downloaded again. There was a problem when configuring pom.xml, and idea ...
How to debug spring boot scheduling tasks
When I was doing enterprise development recently, there was a requirement for me to adjust and optimize the scheduled tasks for sending emails.
@Scheduled tasksThe scheduled task of sending emails that has been completed looks like this:
12345678910@Componentpublic class EmailScheduled{ @Scheduled(cron = "0 0 23 * * * ?") public void emailSend(){ ... } }
The difficulty of optimization and adjustment lies in the trouble of ...
IDEA quickly adds JavaDoc comments
As a programmer, adding Javadoc comments can be considered an essential step. However, manually adding extensive content each time can undoubtedly become a cumbersome task.
This article serves as a record, aiming to facilitate the process of reconfiguration when changing environments in the future:
(The method described here is auto-generated by IntelliJ IDEA and does not require installing additional plugins.)
Class、Interface Comments
File–>settings–>Editor–>File and Code Templates–> ...