springBoot integrated redisson for distributed locks

scene The company has a piece of business that needs to run the timer business to process data. Background uses springBoot to develop, springBoot integration timer task is very simple, use Scheduled is configured to use cron, and a business is executed 45 minutes per hour, because the background is cluster deployed, and the front end is respon ...

Posted by shya on Fri, 15 May 2020 05:02:36 +0200

Python 3. X basic tutorial 3

Hello, I'm a little circle who loves to learn programming. Today I'll talk about the if/elif/else statement code import time as t a = 0 while a < 1: x = input('Please enter a number (1-9)\n') y = ['1', '2', '3', '4', '5', '6', '7', '8', '9'] if x in y: print('The input is correct!') t.sleep(5) a=a + 1 ...

Posted by opencombatclan on Wed, 13 May 2020 17:00:53 +0200

Java knowledge point Stream

overview There are two very famous improvements in java8, one is Lambda expression and the other is Stream. Stream is a stream. Its main function is to search and filter Collection data. It is similar to SQL database operation. The difference between stream and Collection is that Collection is only responsible for storing data, not for other ...

Posted by mushroom on Wed, 13 May 2020 16:35:23 +0200

On the problem that the sum of percentages in statistics is not equal to 100 (Java)

Questions In the process of calculating the percentage of statistical tables, because of the accuracy problem, 99.97% or 100.1% of the calculated results are not equal to 100%, the original scheme generally uses the last value equal to 1 minus the percentage to complete the calculation, but there are disadvantages in this way. Abnormal data of ...

Posted by lavender on Mon, 11 May 2020 18:48:54 +0200

Implement simple tomcat

Since our Web application is running in tomcat, the request must arrive at Tomcat first. Tomcat actually handles the request as follows. First, provide Socket service The start of Tomcat must be Socket service, but it only supports HTTP protocol! In fact, we can expand our thinking here. Since Tomcat is based on Socket, what about BIO or NIO ...

Posted by Sesquipedalian on Mon, 11 May 2020 16:41:20 +0200

How to produce a simple message using RabbitMQ

A recent scenario in business is that if a user has not paid for 30 minutes after placing an order in a store, the order needs to be disposed of, either deleted or marked as invalid. Why? 1. Inventory, the user will lock an inventory after placing an order. If the user does not pay, it will occupy the inventory and affect other users'purchase. ...

Posted by cuboidgraphix on Mon, 11 May 2020 04:11:56 +0200

A new feature of JDK 14: switch expression

brief introduction The new feature of switch has a long history. It was introduced as a preview function as early as JDK 12, and finally became an official version of the function in JDK 14: JEP 361: Switch Expressions (Standard). In fact, there are two new functions of switch, one is that case can be linked, the other is that switch can bring ...

Posted by DaRkZeAlOt on Sat, 09 May 2020 01:02:44 +0200

Some problems encountered in the installation of docker by rpm and their solutions

Today, I installed the docker environment for my colleagues in the R & D department on the domestic winning Kirin 7.4 operating system. Because of its special environment, I couldn't use the Internet repo source, so I only used the rpm package for the installation. Because it is the first time to use the rpm package for the installation of ...

Posted by EY on Fri, 08 May 2020 15:22:13 +0200

python Foundation: producer and consumer model under multiprocess

Introduction to producer consumer model 1. Why the producer consumer model is needed Producer refers to the task of production data, and consumer refers to the task of consumption data. When the producer's production capacity is far greater than the consumer's consumption capacity, the producer needs to wait for the consumer to consume before c ...

Posted by Spaceboy on Fri, 08 May 2020 12:27:28 +0200

Talk about maxwell's bootstrap controller

order This paper mainly studies the bootstrap controller of maxwell BootstrapController maxwell-1.25.1/src/main/java/com/zendesk/maxwell/bootstrap/BootstrapController.java public class BootstrapController extends RunLoopProcess { static final Logger LOGGER = LoggerFactory.getLogger(BootstrapController.class); private final long MAX_TX_ELEMEN ...

Posted by jerbecca on Thu, 07 May 2020 17:32:36 +0200