• Moya writing simplified ideas: enum


    Use Moya to make IOS network requests, There are more than 100 network request methods in the project, and the corresponding enum entries are established Fill in the path, and copy it again under the general case “/” + string (specific case) Look like this public enum Xxx { case zen case userProfile(String) case userRepositories(String) […]

  • Moya writing simplified idea 2: task of enum


    Use Moya to make IOS network requests, There are more than 100 network request methods in the project, and the corresponding enum entries are established Fill in the task in the general case, and then do this enum NetHud{ case modify_content(R_create_content) // … } extension NetHud{ public var task: Task { case .modify_content(dat): return .requestJSONEncodable(dat) […]

  • Memory fragmentation of openresty and nginx shared memory area


    Memory fragmentationIs a common problem in computer system, although there are many ingenious algorithms to solve this problem. Memory fragmentation will waste empty and idle memory blocks in the memory area. These free memory blocks cannot be merged into larger memory areas to meet the application’s future application for larger memory blocks, and cannot be […]

  • October CMS – quick start 10 relationships


    In the previous section, we used one-to-one and one to many relationships to attach pictures and album albums to the movies table. In this section, we will create a label like table to describe the type of video. Learn about Duoduo’s relationship through this example. Create database tables Create model Add background menu Create controller […]

  • Flutter GridView Jiugong grid


    I have collected some learning materials, including a lot of learning, interview, middle and high-level fluuter materials, and a lot of video explanations. If any students want to know more, please see the end of the article for details. We also welcome all the great gods to install X. one   introduction GridView is one […]

  • Reading elf structure with PHP


    Prerequisite knowledge The executable files of UNIX system adopt elf format, and the types are divided into target file, executable file and shared library Analysis of ELF format III: Sections The ELF file format This example is based on a 64 bit small endian Linux machine Description of the first parameter of the unpack function […]

  • Catalina.webresources.cache.getresource space is still insufficient


    environment Linux/Ubuntu20.04LTS IntelliJ IDEA Community Editon 2021.1 apache-tomcat-8.5.68 apache-tomcat-7.0.109 abnormal The version used is apache-tomcat-8.5.68 Org.apache.catalina.webresources.cache.getresource because there is still insufficient free space after clearing expired cache entries org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/ WEB-INF / classes /] to the cache of web application [/ SSH], Because there is still not enough free […]

  • When it comes to NPM dependencies, in addition to dependencies, there are also optional dependencies


    Today, we solved a problem that we thought we needed to replace the NPM package, or even modify the source code of the NPM package. The key to a simple solution is to know that NPM has an optional dependencies. Today, we found a problem when the customer was installing: That is to say, DTrace […]

  • Kill two birds with one stone — ID and custom in org mode_ ID field


    stayorg-modeIn, an entry can set multiple properties(Properties)。 Some attributes areorg-modeBuilt in, they have special uses. Some properties are custom, used in some plug-ins or just for recording information.CUSTOM_IDIt belongs to the former, not the latterIDAttribute is the latter. CUSTOM_ID CUSTOM_IDUsed to jump.org-modeSupport richExternal linksFormat, one of which is to link to the specified.orgFile designationCUSTOM_IDEntry for. […]

  • How to use Android listview and precautions


    1、 Using listview directly in a layout file 1. Layout file 1 2 7 8 12 13 2. Fill in listview code 1 package com.ietree.listviewdemo; 2 3 import androidx.appcompat.app.AppCompatActivity; 4 5 import android.os.Bundle; 6 import android.view.View; 7 import android.view.ViewGroup; 8 import android.widget.BaseAdapter; 9 import android.widget.ListAdapter; 10 import android.widget.ListView; 11 import android.widget.TextView; 12 13 public class […]

  • Changes of cluster members in raft algorithm


    1、 Possible problems caused by the change of cluster members Cluster member change is a common operation, mainly to add and delete nodes. The main scenarios include upgrade, server aging, etc. of course, if we don’t have much requirement for SLA of service, it’s the easiest way to shut down the cluster directly. But if […]

  • Python function cache (qbit)


    preface Python 3.8 in this article is applicable As of April 14, 2021,functools.lru_cacheandcachetoolsDoes not support caching of asynchronous functions(async) functools.lru_cache Official standard library:functools.lru_cache tolru_cacheAdd life cycle management:https://stackoverflow.com/que… cachetools pypi: https://pypi.org/project/cach… github: https://github.com/tkem/cache… file:https://cachetools.readthedoc… Cachetools v4.2.1 has implemented caching mechanism FIFO: first in first out LFU: least frequently used LRU: least recently used MRU: most recently […]