Tag:decorate

  • Notes on how to learn Python decorator

    Time:2021-6-18

    The function of decorator is to decorate something. Attention is to decorate, not to modify. Personal feeling is like make-up. It only makes some modifications on the original appearance of a person,It doesn’t really change people. The following is a simple case to realize the decorator step by step: import time This work adoptsCC agreementReprint […]

  • React high level component hoc (1)

    Time:2021-6-18

    Official document on react high level componentshttps://reactjs.org/docs/high…。 cause In the process of discussing react with a few friends before, we all thought that we were very familiar with react. When we talked about the problem of react high-level components, we couldn’t clearly explain why. On the surface, we seldom use react high-level components, but in […]

  • Python iterator generator decorator context manager

    Time:2021-6-6

    Basic agreement Clsx: class X Valx: variable x Funcx: function x Codex: code fragment x Special methods / properties of Python internal objects 1.__ dict__ Properties: ClsA.__ dict__, Property Dictionary of class A, including Properties, https://www.cnblogs.com/alvin2010/p/9102344.html ValA.__ dict__, Attribute dictionary of variable x 2.__getattr__(self, item): #Gets the property named item #The default value is return […]

  • Midway serverless 2.0, integration makes front-end R & D more effective again

    Time:2021-4-22

    Introduction:In March 2021, midway serverless launched its second major version. As I said two years ago, open source is just the beginning, but the end is far from coming. Midway system hopes to be able to continuously evolve forward at the current crossroads, so that the front end can develop and move towards application engineers. […]

  • Validating passwords in C++

    Time:2021-4-3

    Problems Write a program to verify the password strength, according to the pre-defined rules, according to various permutations and combinations to set the password strength.Minimum requirement: each password must meet the minimum length requirement.For additional requirements, other rule restrictions can be added, such as: There is at least one number At least one special character […]

  • CSS emphasis marks

    Time:2021-4-1

    We often highlight a keyword in the text in the web page, and decorate it with a series of relatively matching styles, such as bold, highlight, underline and so on, so as to attract users’ attention. Today, let’s take a look at another implementation method, text emphasis. In the text paragraph of a page, sometimes […]

  • Mobx getting started

    Time:2021-3-31

    I used to use Redux more. I’ve always heard that mobx can let you experience the feeling of writing Vue in react. Today I’m going to try to see if mobx really has the feeling of writing Vue. Digression Before introducing the usage of mobx, let’s make a digression. We can take a look at […]

  • Thoroughly understand mybatis cache (Part one)

    Time:2021-3-29

    In web application, cache is an indispensable component. Usually, we use redis or memcached and other caching middleware to intercept a large number of requests to the database and reduce the pressure on the database. As an important component, mybatis naturally provides corresponding support internally. By adding caching function at the framework level, the pressure […]

  • How to use the getter and setter methods in Python

    Time:2021-3-20

    The main contents of this paper are as follows Explain how to use setters and getters Explain the magic of @ property decorator In Python, the setter and getter methods are not the same as in other programming languages. Basically, in object-oriented programming languages, the main purpose of using setter and getter methods is to […]

  • Midway serverless releases 2.0, integration makes front-end R & D more effective again

    Time:2021-3-16

    By Zhang TingSource|Serverless official account Since the launch of Midway serverless 1.0 last year, many businesses began to try it, and took advantage of the flexibility of serverless container to reduce the attention of a large number of R & D personnel on infrastructure and operation and maintenance. For front-end developers, they only need to […]

  • Well written adapter mode, decoration mode

    Time:2021-3-14

    I hope you can enjoy it preface There are three typesFactory modelIn addition to factory mode, there are other modes of interview, which I will talk about this timeAdapter mode,Decoration modeIt’s still the old rule. Put it in theIt’s in. JavaCopy and serve Adapter mode Adapter modes are divided intoClass Adapter andobject adapter . The […]

  • Some understanding of Python decorator

    Time:2021-3-11

    Ornament It is essentially a function that takes a parameter as a function. Function: add additional general functions to implemented methods, such as logging and runtime. Decorator without [email protected] #Decorator without parameters def do_something(a,b,c): print(a) time.sleep(1) print(b) time.sleep(1) print(c) return a if __ name__ == ‘__ main__ ‘: #Output It’s equivalent to do_ The something […]