Low cost timestamp acquisition
This article has been included https://github.com/lkxiaolou/lkxiaolou Welcome, star.
preface
In the previous article Design and implementation of Cobar SQL audit A question about the performance of timestamp acquisition is raised in
Get the operating system time, and directly call system in Java currentTimeMillis(); It's OK, but in Cob ...
Posted by bryan52803 on Wed, 09 Feb 2022 17:50:21 +0100
Design mode - singleton mode
Concept: ensure that there is only one instance of a class and provide a global access point to access this unique instance
ps: Singleton mode is an object creation mode. Singleton mode has three main points: first, a class can only have one singleton, second, it must create this instance by itself, and third, it must provide this instance ...
Posted by sinisake on Wed, 09 Feb 2022 17:20:09 +0100
Freemaker page static technology
I background
When accessing dynamic pages, users need to send a request to query the database through ajax to obtain dynamic data for display, but if the page has a large amount of visits and the data in the database changes frequently The rate is not high, which will cause great access pressure to the database. How to decompress the da ...
Posted by PrivatePile on Wed, 09 Feb 2022 16:11:10 +0100
The interviewer asked: how to interrupt a thread and how to implement it?
Interrupt threadThread of thread Interrupt () method is to interrupt a thread. It will set the interrupt status bit of the thread, that is, set it to true. Whether the thread dies as a result of the interrupt, waits for a new task, or continues to run to the next step depends on the program itself. The thread will detect this interrupt flag bit ...
Posted by Pino on Wed, 09 Feb 2022 15:58:02 +0100
Error handling mechanism in javase Java
Basic exception handling syntax and procedures
The error handling mechanism in Java refers to non compiled errors, that is, non syntax errors. Similar to the division by zero error, that is, you can't divide by 0 during division. Java will encounter the following errors: example: system out. println(16 / 0);
The ArithmeticException here is ...
Posted by nihal on Wed, 09 Feb 2022 14:36:26 +0100
Strategic mode of design mode
Strategy mode
1. Basic introduction
The strategy pattern defines the algorithm family and encapsulates them separately so that they can replace each other. This pattern makes the change of the algorithm independent of the customers using the algorithm.This model embodies several design principles:
Opening and closing principle: separat ...
Posted by pozer69 on Wed, 09 Feb 2022 14:33:58 +0100
Android bottom layer: familiar and easy to understand analysis binder: 1 Binder preparation
Originally written by binder
When it comes to binder, many people should say how old the technology of binder is, and there are a lot of articles analyzing binder. You don't need to write articles about binder at all! In fact, I don't agree with this view. Tell me my reasons:
You need to summarize the binder knowledge you have read and learne ...
Posted by rsilvs on Wed, 09 Feb 2022 14:31:53 +0100
Kotlin learning: 3.6 Classification of classes
Class modifier
Class modifiereffectfinalCannot be inherited from final classopenopen class that can be inheritedabstractabstract classenumEnumeration classdataData classsealedSealing classannotationAnnotation
abstract class
Use the abstract keyword to mark a class as abstract
abstract class Abstract class name[(primary constructor )][:I ...
Posted by Mew151 on Wed, 09 Feb 2022 14:18:33 +0100
A series of tough interviews -- what's the difference between redis distributed locks and zk distributed locks?
Tags: [advanced] [Redis] [ZooKeeper]
1. Ask
What is the difference between redis distributed locks and zk distributed locks?
2. Analysis
This question has high requirements for the interviewer. It should not only understand the implementation method, but also master the principle. So the answer to the question is divided into many levels ...
Posted by alvinchua on Wed, 09 Feb 2022 13:55:27 +0100
The way of basic learning of spring framework
1, IoC control reversal
IoC control inversion, fully known as Inverse of Control, is a design conceptThe agent creates and manages the object, and the consumer obtains the object through the agentThe purpose of IoC is to reduce the direct coupling between programsAdd IoC container to manage objects in a unified way and make object association ...
Posted by noginn on Wed, 09 Feb 2022 13:48:15 +0100