• The map function of the implementation object is similar to array prototype. map


    //Implement a map function const targetData = { a:2, b:3, c:4 } const objMap = (obj,fn)=>{ if(typeof fn !==”function”){ throw new TypeError(`${fn} is not a function !`); } return JSON.parse(JSON.stringify(obj,fn)); } const tempArr = objMap(targetData,(key,value)=>{ if(value%2===0){ return value/2 } return value }) console.log(tempArr)//{a: 1, b: 3, c: 2, d: 5} JSON.stringify() JSON. Stringify (value, replace, […]

  • GitHub desktop 3.0: help you better integrate pull requests


    GitHub desktop aims to simplify the workflow for millions of developers around the world. GitHub desktop 3.0 was officially released on April 28. This version enhances the improved support for git operation, including suppression, reordering or modification submission. And exciting new features: review your pull requests status to help developers confirm that the code is […]

  • C + + foundation-6-inheritance


    6. Succession 1 #include 2 using namespace std; 3 4 5 class Base { 6 public: 7 Base() { 8 m_A = 10; 9 } 10 int m_A; 11 12 }; 13 14 class Son: public Base { 15 public: 16 Son() { 17 m_A = 20; 18 } 19 int m_A; 20 }; 21 […]

  • Dynamic splicing expression


    Will we encounter the following query requirements in the project? For example, you need to find members that meet the following conditions:  Condition group 1: male members aged 30-40 Condition group 2: female members aged 20-30 Condition group 3: members aged 60-80 with Unknown Gender There are and relationships within condition groups, but there are […]

  • Redis learning notes – (6) – Zset set (leaderboard / topn)


    Previous: redis learning notes – (5) – list (stack / queue / blocking queue) 6.1 leaderboard / topn basic commands Membership:zadd key score member Query members:zrange key start stop [withscores]Note: start = 0 end = – 1 note: both start / end include Delete member:zrem key member View a member’s score:zscore key member Add a […]

  • Easyexcel Java API usage


    1、 First acquaintance with easyexcel 1.1、Apache POI Apache POIIt is the open source function library of Apache Software Foundation, which provides cross platformJava APIrealizationMicrosoft OfficeFormat file reading and writing. However, there are some problems as follows: the cost of learning and using is high, the memory consumption of POI is large, the code writing is […]

  • Source code interpretation of various classes of gfx (6) webgl2commandbuffer


    Source code interpretation of various classes of gfx (6) webgl2commandbufferWebgl2commandbuffer inwebgl2-command-buffer.ts yesWebGL2CmdPackageClass Command filling and state saving, WebGL2CommandAllocatorAlloc responsible for CMD,The above two class instances are in member variables and are not global Member variables: protected _cmdAllocator: WebGL2CommandAllocator = new WebGL2CommandAllocator(); protected _cmdAllocator: WebGL2CommandAllocator = new WebGL2CommandAllocator(); State saving member variables (which will be explained […]

  • C + + 11 strong type enumeration


    Enumeration is to define a category and enumerate the individuals under the unified category for code use. Defects of C + + 98 enumeration: Whether namedEnumeration namestillEnumerating members in types, bothGlobal scopeYes, itsThe scope is globalof Appears if the same enumeration member is defined in a different enumerationRedeclarationWrong. enum PUBLIC_COLOR { RED, YELLOW, GREEN }; […]

  • C# (IX) Fundamentals – static members and exception handling


      C# If you have a book to summarize and correct, please use it to consolidate your knowledge     Static member When you define the class member attribute or method, add static, that is, it is a static member. The static member can not be referenced by the object of the class. The value […]

  • A jser dart learning log (3): Class


    This article is the third in the series of “a jser’s dart learning log”. This series of articles mainly explore the similarities and differences between JS and dart, and smoothly transition to dart language while reviewing and consolidating JS.Since the author is still a beginner of dart, his understanding may be superficial and one-sided. If […]

  • Huawei membership kit helps mobile applications quickly build a membership ecosystem


    Member open service(membership Kit) is Huawei’s coupon code opening ability for developers. Developers can carry out flexible and diverse marketing activities through membership kit to help developers build a membership ecosystem and achieve the goal of user operation and incremental income generation. The coupon code opening ability provided by membership kit this time provides developers […]

  • Efcore operation entity attribute and implementation model of DDD


    1. Efcore operation entity attribute and implementation model of DDD 1.1 efcore operation entity attribute (1) Object operation entity properties will call get and set methods (2) Based on the consideration of performance and support for special functions, when reading and writing attributes, EF core will directly skip get and set and directly operate the […]