• [C + + memory management] 11_ G2. 9 STD:: alloc concept sorting


    Concept sorting Supplementary notes Memory size requested by the list node from the allocator: sizeof (foo) + sizeof (node < foo > *) x 2 Critical struggle Conference Learn to use:”Constant = = variable”Format. When the equal sign is leaked, the compiler will issue a compilation error prompt Note: newer compilers are available in”Constant = […]

  • Increasingly simple data class definition: named tuple


    I’m ashamed to say that I’ve been using Python for a long time. I found such a good thing as namedtuple for the first time. First code: from collections import namedtuple Point = namedtuple(‘Point’, [‘x’, ‘y’]) pt1 = Point(1.0, 5.0) pt2 = Point(2.5, 1.5) from math import sqrt line_length = sqrt((pt1.x-pt2.x)**2 + (pt1.y-pt2.y)**2) Isn’t it […]

  • Base-demo07 program readability 08 class variables, local variables, 09 modifiers. There is no order of precedence


    package base; public class Demo07 { public static void main(String[] args) { // int a,b,c; // int a=1,b=2,c=3; // Program readability String name =”xulei”; char x= ‘X’; double pi =3.14; } package base; public class Demo08 { //Class variable static static double salary = 2500; //Attributes: Variables //Instance variable: subordinate object; If you do not […]

  • Online yaml to HTML tool


    Online yaml to HTML tool Online yaml to HTML tool Yaml is a highly readable format used to express data serialization. Yaml refers to many other languages, including C, Python and Perl, and is inspired by the data format of XML and e-mail (RFC 2822). Yaml is a highly readable format used to express data […]

  • Enumeration method


    Algorithm analysis and Design — Enumeration method A method of brute force cracking The enumeration method of policy mode is commonly used in combination, which simplifies the readability of code, the number of classes and the problems that must be exposed to the outside world under the policy mode; Limited to the cognition of existing […]

  • Responsibility chain mode in JS


    Responsibility chain model Definition of responsibility chain mode:Make multiple objects have the opportunity to process the request, so as to avoid the coupling relationship between the sender and receiver of the request. This pattern is similar to calling the prototype method: when the object does not have the method, look for the method on the […]

  • [Java] learn java enumeration classes again


    What can enumeration do Suppose we want to express week now. In order to avoid the occurrence of magic value, we may write a constant class: package com.tea.modules.java8.enums; /** * com.tea.modules.java8.enums <br> *Use abstract classes to express constants to prevent tampering * @author jaymin * @since 2021/6/9 */ public abstract class WeekConstant { /** *Monday […]

  • [forward] RPC and HTTP requests


    HTTP and RPC are not equivalent concepts. RPC is a complete remote calling scheme, which includes: interface specification + serialization and deserialization specification + communication protocol, etc.andHTTP is just a communication protocol. It works in the seventh layer of OSI,Is not a complete remote invocation scheme. Therefore, to answer this question, we should flatten it […]

  • HOC vs Render Props vs Hooks


    Warehouse address of complete high frequency question bank:https://github.com/hzfe/aweso… Complete high frequency question bank reading address:https://febook.hzfe.org/ Related issues What is hoc / render props / hooks Why do you need hoc / render props / hooks How to improve code reusability Implementation principle of hooks What are the advantages of hooks over other schemes Answer key […]

  • Use lists, dictionaries, and set generators to shorten your code


    By Philip WilkinsonCompile VKSource: towards Data Science I’ve been using Python for nearly a year, and I often encounter it“Generative formula”This word, but I don’t have a generative formula, its exact meaning or what it covers. Only recently did I find that with a generator, I can use a list to shorten my code from […]

  • Vue basic introductory notes 03: binding V-model, class and style


    Vue basic introduction notes 03 V-model implements bidirectional binding between form elements and data in data Class: three forms Array form Ternary expression Replace ternary expressions with objects (improve readability) style Key value pair object <!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <meta http-equiv=”X-UA-Compatible” content=”ie=edge”> <title>Document</title> <script src=”https://cdn.jsdelivr.net/npm/vue”></script> <style> .class1{ font-size: […]

  • Vue optimization tips


    Internal use of hook monitoring life cycle <template> <div> < H5 > life cycle hook usage: < / H5 > <p> <span v-for=”item in arrList”>{{item}},</span> <br> < El button @ Click = “addfruit” > start < / El button > </p> </div> </template> <script> export default { data(){ return{ arrList:[ ‘Apple’, ‘Apple’, ‘Banana’, ‘grape’, ‘add […]