Function nesting and closure in js

Today, let's talk about closures I understand. Before we talk about this, let's first understand the definition domain of variables.In js, the variable definition domain includes global scope and local scope. The new variable declaration keyword in es6 is introduced to solve the confusion of the scope of some variables. The global scope is not ...

Posted by totof06 on Wed, 10 Nov 2021 04:17:19 -0800

Talking about distributed unique IDs, this article is very real

Introduction to distributed unique IDThe globally unique id of a distributed system is a scenario encountered by all systems. It is often used in search and storage as a unique identification or sorting, such as the globally unique order number and coupon code of a coupon. If two identical order numbers appear, it will undoubtedly be a huge bug ...

Posted by bstruss on Wed, 10 Nov 2021 04:10:09 -0800

How the client communicates with the pod -- Service

pod communication and service discovery In a world without k8s, the system administrator needs to specify the exact ip address or host name of the service in the client configuration file to configure the client application, but it is not necessary in k8s. The application in k8s runs in pod, and the high availability design of pod makes it imp ...

Posted by aris1234 on Wed, 10 Nov 2021 03:46:51 -0800

[Spring] Spring integrates MyBatis

Integration ideas Spring can integrate many frameworks, which is an advantageous function of spring. Through the integration function, it is more convenient for developers to use other frameworks. The integration uses Spring IoC core technology. To use a framework, such as mybatis, how do I use mybatis? The purpose of Spring's integration w ...

Posted by auteejay on Wed, 10 Nov 2021 03:25:49 -0800

20 JavaScript single line code killer maces

Gets the value of the browser Cookie Retrieve the value of the cookie by using document.cookie access. const cookie = name => `; ${document.cookie}`.split(`; ${name}=`).pop().split(';').shift(); cookie('_ga'); // Result: "GA1.2.1929736587.1601974046" Convert RGB to hexadecimal const rgbToHex = (r, g, b) =>   "#" + ((1 << 24 ...

Posted by RP on Wed, 10 Nov 2021 03:18:40 -0800

cat ~/.bash_history | grep java view linux history command

Query the recently executed Java command cat ~/.bash_history | grep java 7. history command The history command is used to display the commands executed in history. The format is "history [-c]". The history command should be the author's favorite command. Executing the history command can display the last 1000 command records execu ...

Posted by Darrel on Wed, 10 Nov 2021 03:17:03 -0800

Use of Redis Stream type

1, Background Recently, after looking at the knowledge of redis, I found that a new data type Stream has been generated in redis5, which is somewhat similar to the design of kafka and can be used as a simple message queue. 2, Characteristics of Stream type in redis It is persistent and can ensure no data loss. Support message multica ...

Posted by devil_online on Wed, 10 Nov 2021 03:05:20 -0800

Detailed explanation of Spring AOP framework based on XML configuration

Learning AOP in Spring is to realize relevant interception and cut in functions through configuration (XML based configuration and annotation based configuration). Strengthen the original operation, but do not affect the original operation. catalogue Learning AOP in Spring is to realize relevant interception and cut in functions through confi ...

Posted by Rottingham on Wed, 10 Nov 2021 02:58:58 -0800

mybatis caching mechanism

mybatis cache mechanism I mybatis provides cache support, which is divided into L1 cache and L2 cache L1 cache The first level cache is enabled by default in mybatis. It is a cache form with hashMap as the data structure. How do I verify the L1 cache? The following example queries the same data twice (or multiple times, twice is ...

Posted by Wayniac on Wed, 10 Nov 2021 02:02:49 -0800

Why does MySQL limit affect performance?

1, Foreword First, explain the MySQL version: mysql> select version(); +-----------+ | version() | +-----------+ | 5.7.17 | +-----------+ 1 row in set (0.00 sec)Table structure:mysql> desc test; +--------+---------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra ...

Posted by marcnyc on Wed, 10 Nov 2021 01:49:19 -0800