Design Mode Architecture - Agent Mode

1. Basic introduction of agent mode Proxy mode provides a surrogate for an object to control its access.That is, the target object is accessed through the proxy mode.The advantage of this is that on the basis of the implementation of the target object, additional functional operations can be enhanced, that is, to extend the function of the ta ...

Posted by squimmy on Sun, 29 Dec 2019 10:48:47 -0800

Getting started with Python

Getting started with Python 1, What is a list In order to store the operation data conveniently, python provides some built-in data structures. For example: list, tuple, dictionary, set, etc. The so-called "built-in" means that they are part of the python language, So they can be used directly in the program. 1. Structure of list p ...

Posted by LacOniC on Sun, 29 Dec 2019 09:47:14 -0800

Path weight of JSK-243 triangle [dynamic planning]

Path weight of triangle A number triangle is shown. Please make a program to calculate a path from the top to the bottom, so that the total number of the path is the largest.   Each step can go down along the left diagonal or the right diagonal 1 < number of triangle lines < 25 Numbers in triangles are integers < ...

Posted by rs_nayr on Sun, 29 Dec 2019 09:13:14 -0800

Using Scheme to simulate classes and objects

a. Classes and objects A function definition can be interpreted as a class, and function calls can play the role of objects. In other words, lambda expressions can be treated as classes, and closures can be treated as objects. A point class is defined below, and the lambda expression will be returned as an instance object handle of the point cl ...

Posted by colossus_09 on Sun, 29 Dec 2019 05:01:51 -0800

springcloud feign resolves multiobject participation

background Business Split creates a new project that wants to reference a new technology stack (using the springcloud family bucket, temporarily unable to upgrade to springboot 2.0 for project reasons, so feign is used here for rpc), but it still uses the previous RPC interface (the original RPC framework is thrift) Problem occurs when there ...

Posted by avo on Sat, 28 Dec 2019 21:53:41 -0800

bootstrap js dynamically adds option element to select without display

In the afternoon, when using bootstrap to add option elements to select, js is used to generate them dynamically, and it is found that they can't be generated. So F12 checks that select has been added. The actual display is not the select but the contents of the div below. At this time, you need to force the refresh of the elem ...

Posted by EagerWolf on Sat, 28 Dec 2019 08:27:23 -0800

Python simulation airline ticketing program

Application scenario: an airline needs to sell tickets for a certain flight. The ticket inventory of a flight is limited, and many channels are selling tickets at the same time. How to ensure that there is no repeat sales. Implementation method: create python file TicketDB.py by simulating ticket inventory import threading import time ...

Posted by alexz on Sat, 28 Dec 2019 06:31:42 -0800

T rust asynchronous tasks communicate through channels

In async STD of rust, it is convenient to use. await to enable asynchronous calls, but task calls use green threads, so recv cannot be used to receive messages from this channel, Because it will block operating system threads, many green threads will follow and wait. Here is a small function: Multithreading writes data to the log module. The lo ...

Posted by ntohky14 on Sat, 28 Dec 2019 06:19:38 -0800

C Language Notes 12_Variable Parameters-Memory Management-Command Line Parameters

Variable parameters Sometimes, you may encounter situations where you want a function to have a variable number of parameters instead of a predefined number of parameters.The C language provides a solution to this situation by allowing you to define a function that accepts a variable number of parameters depending on your specific needs.The fol ...

Posted by dannel77 on Fri, 27 Dec 2019 17:43:15 -0800

Basic concepts of Netty

Boot BossGroup and WorkerGroup: the former is responsible for receiving client connections, and the latter is responsible for network reading and writing. All types are NioEventLoopGroup NioEventLoopGroup is equivalent to an event loop group, which contains multiple event loops. Each event loop is NioEventLoop NioEventLoop refers to a thr ...

Posted by jaco on Fri, 27 Dec 2019 11:43:42 -0800