python implements LRU replacement algorithm and LFU replacement algorithm (supplement the use of self.map and Dictionary)

About the map of local storage: Essentially an empty dictionary: self.map = {} Each time a new node is added, the key and value of the node will be put into the map: self.map [key] = node = = > self.map should look like {key1:node1, key2:node2} (Note: node is a new custom class, see: https://www.cnblogs.com/marvintang1001/p/11125619.html ) ...

Posted on Thu, 31 Oct 2019 20:59:01 -0400 by dan231

. net core uses NLog+Elasticsearch to log

Original text: . net core uses NLog+Elasticsearch to log In microservice or distributed system, it is very inconvenient to view the system log if the log is output as a file; if the log is saved in the database, full-text search cannot be performed. Here we output the log to ElasticSearch and use Kibana to find the log again. Add Nuget referen ...

Posted on Thu, 31 Oct 2019 17:57:05 -0400 by arjay_comsci

How to use aes-128-ecb encryption to decrypt in c?

Recently, it is necessary to encrypt jwt on nodejs, and decrypt jwt on the C side to get user information. class JwtService extends Service { encrypt(content) { const secretkey = this.app.config.jwt.key // Unique (public) key const cipher = crypto.createCipher('aes-128-ecb', secretkey) // Use aes128 encryption let enc = cipher.upd ...

Posted on Thu, 31 Oct 2019 11:43:25 -0400 by tomd79

File upload of spring MVC

I. configuration To use Spring's file upload function, MultipartResolver needs to be configured in the file context. Add the following paragraph to the configuration file. We can configure the upload file size and other attributes in the Bean definition. <! -- file upload -- > <! - ...

Posted on Thu, 31 Oct 2019 11:01:38 -0400 by JohnnyBlaze

Development and integration of Mapper interface of Mybatis

1. introduction 2. Code example Specification of Mapper agent development 1. The name of the mapper interface and the name of the corresponding Mapper.xml mapping file must be the same 2. The namespace of Mapper.xml file is the same as the classpath of Mapper interface (that is, the interface file ...

Posted on Wed, 30 Oct 2019 13:52:20 -0400 by tobimichigan

centos 7.5 deploying the varnish cache server

Blog Outline: I. Introduction to varnish How does Varnish work 3. Deploy the varnish cache server I. Introduction to varnish Varnish is a high-performance open-source reverse proxy server and HTTP cache server. Its function is similar to squid server, and it can be used for HTTP cache. You can install varnish on any web front end and confi ...

Posted on Tue, 29 Oct 2019 19:11:02 -0400 by msound

select implementation of python-io multiplexing

1. I/O multiplexing refers to a mechanism by which multiple descriptors can be monitored. Once a descriptor is ready (generally read ready or write ready), the program can be notified to perform corresponding read and write operations. 2. I/O multiplexing can avoid blocking on io. The message originally received by multiple processes or thread ...

Posted on Tue, 29 Oct 2019 13:40:01 -0400 by SephirGaine

C ා NETCORE ා web project ා EXCEL data export

The project needs to refer to NPOI's Nuget package:   There are three ways to trigger downloading Excel from A-front end: 1-JS-Url jump request - the background needs to return the file stream data: window.Location.href = "/ajax/toolhelper.js?action=reBuyExport&beginTime=" + beginTime + "&endTime=" + endTime; 2 - use form+ifram ...

Posted on Tue, 29 Oct 2019 13:08:29 -0400 by godfrank

Think.js configuration database

Think.js configuration database Method Preparation Extend model capabilities The Think.js framework does not provide the function of model by default. It needs to load the corresponding extension to support. The corresponding module is think model. Modify the extended configuration file src/config/extend.js, and add the following configurati ...

Posted on Tue, 29 Oct 2019 11:09:12 -0400 by matbennett

python reads and writes to redis using the pipeline

In daily development, we always need to write some files to the cache. In addition, python provides a very useful api to help us connect to redis. In this case, you will use the rediscluster package to connect to the redis cluster and use the pipeline pipeline to insert files. # encoding: utf-8 from red ...

Posted on Mon, 28 Oct 2019 10:39:29 -0400 by ghostcoder