23 design patterns of Java, detailed explanation

1. Adapter Intent Convert one class interface to another user's interface.       Class Diagram       Implementation Duck and Turkey have different calls. Duck's call calls the quack() method, while Turkey calls the gobble() method. It is required that Turkey's gobble() method be adapted to Duck's quack() method to make Turkey ...

Posted on Thu, 17 Oct 2019 02:55:37 -0400 by QSDragon

elasticsearch Chinese word segmentation plug-in IK analyze

Elastic search version 7.3 Install Chinese word segmentation plug-in The corresponding version of plug-in should be the same as that of elastic search. Download address of plug-in versions https://github.com/medcl/elasticsearch-analysis-ik/releases Install using the elasticsearch native script ./bin/elasticsearch-plugin install https ...

Posted on Thu, 17 Oct 2019 02:05:15 -0400 by Ryaan

python learning 11: detailed explanation of Python tuple

Tuples are another important sequence structure in Python. Similar to lists, tuples are also composed of a series of elements sorted in a specific order. Unlike a list, a list can operate on any element and is a variable sequence, while a tuple is an immutable sequence, that is, the elements in the tuple cannot be modified separately. Tuples c ...

Posted on Thu, 17 Oct 2019 01:52:01 -0400 by manishdugar

Getting started with Python crawler [8]: the third picture of hummingbird Web

Hummingbird net picture The capacity of the previous tutorials is relatively large. Today I write a relatively simple one. It's a hummingbird. I still use aiohttp. I hope you like it.Crawl page` https://tu.fengniao.com The front process is still based on the purpose of learning. Why do I choose hummingbirds? I can't help it. I chose it blindly ...

Posted on Wed, 16 Oct 2019 19:27:06 -0400 by cedtech31

Springboot development, day 2

SpringBoot learning, the next day Directory: 1. Springboot integrates Listener 2. Springboot accesses static resources 3. Exception handling 4. Hot deployment I. SpringBoot integrated Listener Two ways to register components 1. Complete component registration through annotation scanning FirstListener package com.lee.listener; import javax.serv ...

Posted on Wed, 16 Oct 2019 18:23:22 -0400 by mediamind

Deep source code analysis event

Introduction In bare metal programming, you may often use the variable flag to mark the occurrence of an event, and then judge whether these flags occur in the loop. If you are waiting for multiple events, you may also judge if ((xxx_flag) & & (xxx_flag)). Of course, if you are A bit smarter, you will mark some bits of flag. For example ...

Posted on Wed, 16 Oct 2019 11:41:13 -0400 by Kazhultee

Talk about the server httpagent of nacos client

order This paper mainly studies the server httpagent of nacos client HttpAgent nacos-1.1.3/client/src/main/java/com/alibaba/nacos/client/config/http/HttpAgent.java public interface HttpAgent { /** * start to get nacos ip list * @return Nothing. * @throws NacosException on get ip list error. */ void start() throws Nac ...

Posted on Wed, 16 Oct 2019 11:02:26 -0400 by w4designs

One of the design modes: single instance mode [creation mode]

The creation mode is divided into the following types. Singleton mode: a class can only generate one instance. The class provides a global access point for external access to the instance. Its extension is the limited multiple instance mode. Prototype pattern: an object is used as a prototype, and multiple new instances similar to the proto ...

Posted on Wed, 16 Oct 2019 05:57:11 -0400 by suigion

Fast leader election in zk

Election involves concept Server status vote How do I choose to vote? Agreement Election How to conduct the election? epoch sender Recipient Sending queue Receiving queue Server status public enum ServerState { LOOKING for the Leader status. When the service is in this status, there is no Leader in the current cluster, so you ne ...

Posted on Tue, 15 Oct 2019 22:57:53 -0400 by webfandango

500 lines of code, teach you to write a wechat airplane battle with python

In recent days, I've been reviewing the airplane battle of wechat games, and I'm thinking about my life while playing. How can this airplane battle be done so well? It's easy to operate and get started. Help squatting toilet, YP and rice circle girls have one thing to cheer them up when they are bored! Let their left / right hand move rhythmic ...

Posted on Tue, 15 Oct 2019 17:57:19 -0400 by sickness01