PHP magic method

Constructors and Destructors __construct constructor Class calls this method every time a new object is created, so it's a good place to do some initialization before using the object. __deconstruct Destructors execute when all references to an object are deleted or when the object is explicitly destroyed. <?php class MyDestructa ...

Posted by Caesar on Mon, 06 Apr 2020 01:57:18 -0700

The key implementation of HPA lateral expansion of kubernetes controller

HPA is the implementation of horizontal scaling in k8s. There are many ideas that can be used for reference, such as delay queue, time series window, change event mechanism, stability consideration and other key mechanisms. Let's learn the key implementation of the big guys together 1. Basic concepts As the implementation of general horizontal ...

Posted by insrtsnhere13 on Mon, 06 Apr 2020 01:18:40 -0700

concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 3

Today's project, because of the use of spring asynchronous concurrent execution, this error occurred. And occasionally, especially when the project is just started, such problems may occur java.util.concurrent.ExecutionException: java.lang.ArrayIndexOutOfBoundsException: 3 at java.util.concurrent.FutureTask.report(FutureTask.java:122) ...

Posted by blacklotus on Sun, 05 Apr 2020 19:58:19 -0700

Gradle this article is enough for 08 wrapper

Use of wrapper Gradle Wrapper is the recommended usage of gradle. This article will illustrate how to use it with specific examples. Gradle Wrapper The Gradle Wrapper is actually a script, which can be used to download and use the specified version of gradle. It can be downloaded before use as required, effectively avoiding environment consiste ...

Posted by jfontein on Sun, 05 Apr 2020 18:29:11 -0700

Spring boot using RabbitMQ code example

Example explanation In this example, slf4j-log4j12 is used to manage logs, and the logback classic dependency of spring boot start AMQP needs to be excluded to prevent conflicts. Key points of message queuing Producers: procedures for sending messages Consumer: a program that listens for and receives consumer messages Message: a stream of bin ...

Posted by darkvengance on Sun, 05 Apr 2020 18:23:16 -0700

Data Source Management | Master-Slave Library Dynamic Routing, AOP Mode Read-Write Separation

Source code for this article: GitHub. Click here || GitEE. Click here 1. Application of Multiple Data Sources 1. Basic Description In relatively complex application services, configuring multiple data sources is a common phenomenon, such as: configuring a master-slave database to write data, and configuring a slave database to read data. This ...

Posted by dey.souvik007 on Sun, 05 Apr 2020 17:38:43 -0700

007. Use of J.U.C locks

1. Lock API 1. Locks package class hierarchy 2. Lock interface Method Signature describe void lock(); Acquire locks (endless) boolean tryLock(); Acquire locks (just try it) boolean tryLock(long time, TimeUnit unit) throws InterruptedException; Acquire locks (out of date) void lockInterruptibly() throws InterruptedException; Acquire ...

Posted by Smasher on Sun, 05 Apr 2020 17:27:36 -0700

Build Flask web app with Translate ToolKit 2.5.0 API

The Translate ToolKit 2.5.0 API is a document conversion tool for the translation industry. For example, convert json or html to PO file for translation. Here, we use the Flask web framework to implement the basic functions of the Translate ToolKit api. This is a written test of the previous few days. It requires three days to implement a webAp ...

Posted by phpyoungdeveloper on Sun, 05 Apr 2020 14:43:37 -0700

Combination of structural patterns

1 Overview Composite Pattern refers to the grouping of a class of objects with common abstractions into a tree structure to represent the part-whole relationship. 2 Combination mode Often we encounter objects with the same behavior and hierarchical structure between them.In this case, the combination mode can make the system highly cohesive and ...

Posted by dpsd on Sun, 05 Apr 2020 11:38:25 -0700

Do you still need to learn JDBC? How much do you need to know?

Preface Only a bare head can make it stronger. The text has been included in my GitHub selected articles. Welcome to Star: https://github.com/ZhongFuCheng3y/3y I don't know if you have written JDBC in your work. I went to a small company as an intern in my junior year. JDBC is used in it, but it encapsulates several tool classes. When ...

Posted by gte806e on Sun, 05 Apr 2020 09:14:17 -0700