• Protocol extensions in swift


    extension Extensions add new functionality to existing classes, structs, enumeration types, or protocols. This also includes the ability to extend types for source code without access (so-called reverse modeling) The extension is similar to the category in Objective-C. (different from the classification of Objective-C, Swift’s extension has no name) Extension capability Add calculation instance properties […]

  • Professor Tsinghua, take you hand in hand to deeply interpret Java enumeration, theory and practice fly together


    Today’s sharing begins. Please give us more advice~ Java enumeration is mainly shared today. The type modified by enum keyword is enumeration type. If no method is added to enumeration, the enumeration value defaults to an ordered value starting from 0. For example: enum color {red, green, blue}; Organize constants for unified management. The application […]

  • Inside of mybatis technology — typehandler and principle of custom enumeration under springboot


    The original simple way to customize typehandler http://followtry.cn/2016-08-1… background Because mybatis only supports the default enum typehandlerorg.apache.ibatis.type.EnumTypeHandlerperhapsorg.apache.ibatis.type.EnumOrdinalTypeHandler。 However, in many businesses, enumeration is used to define types, and the fields stored in the database are int or varchar types. Generally, the default name or ordinal of enumeration is not used as the value storage in […]

  • Rust – helloworld


    notice Rust hasn’t reached 1.0 yet. The development is fast. Please see the official documents Rust is a programming language that focuses on type safety, memory safety, concurrency, and performance. It is designed to write large-scale and high-performance software. As a multi paradigm language, rust supports functional, procedural and object-oriented programming styles. The advanced features […]

  • Rust data structure


    notice Rust hasn’t reached 1.0 yet. The development is fast. Please see the official documents Structs Rust structures can usestruct Name { field1: T1, field2: T2 [, …] }Formal declaration of. T1 and T2 represent types. Similar syntax is used to instantiate a struct. There is no struct keyword, such asPoint { x: 1.0, y: […]

  • Technical debt! How to realize multiple enum free conversion concisely and efficiently


    1: Background 1. Tell a story Some time ago, I was in charge of two business modules of a project with my colleagues. Maybe there was a lack of communication, which led to the definition of an enum. As a result, we customized one respectively, which made it annoying for the latter two enums to […]

  • TypeScript


    1、 Overview of typescript (superset and extension set of JavaScript) image.png Any JavaScript runtime environment supports The function is more powerful, and the ecology is more sound and perfect Angular 、Vue3. 0 replaces flow with typescript Second language in front-end domain Disadvantages: there are many concepts in itself. Typescript will increase some costs at the […]

  • Detailed explanation of spring boot validation parameter validation custom annotation rules and grouping validation


    preface Hibernate validator is the reference implementation of bean validation. Hibernate validator provides the implementation of all built-in constraints in JSR 303 specification. In addition, there are some additional constraintsIn daily development, hibernate validator is often used to verify the fields of beans. Based on annotations, it is convenient, fast and efficient. It can be […]

  • [go time] go language constant definition keyword const


    constant Constant defined in function func consts() { const filename = “abc.txt” const a, b = 3, 4 var c int c = int(math.Sqrt(a*a + b*b)) fmt.Println(filename, c) } Constant defined in package package main const filename = “abc.txt” const()definition const ( filename = “abc.txt” a, b = 3, 4 ) Const value, the compiler […]

  • Use of object.keys and object.hasownproperty


    1. Use of object. Hasownproperty() hasOwnProperty() Method returns a Boolean value indicating the object’s own properties(Ignore prototype chain)Has the specified property in Syntax:obj.hasOwnProperty(prop) parameterprop: the attribute to detectStringA name in string form, orSymbol Return value: Boolean value used to judge whether an object contains the specified attributeBoolean **Note * *: even if the value of […]

  • I often use rust little crate


    Original link:Karol Kuczmarski’s Blog – Small Rust crates I (almost) always use Due to the relatively poor standard library of rust, the use of rust will inevitably introduce many third generation dependencies. These third-party dependencies are used to solve some problems that can be solved by relying on built-in libraries.A good example is pythonreModule, which […]

  • Solution of IOS tableview multi style cell


    1、 Background In daily development, it is always necessary to use tableview to display data. However, in the slightly complex tableview, there will always be multiple styles of cells, which requires us to customize different styles of cells and apply them in tableview. This paper aims to solve the above problems. Don’t talk much, say […]