Java implements 23 design patterns: sharing element pattern

Classification of 23 design patterns 1, Overview Definition of Flyweight pattern: using sharing technology to support reuse of a large number of fine-grained objects. It can reduce the number of objects to be created and avoid the cost of a large number of similar classes by sharing the existing o ...

Added by bronzemonkey on Wed, 10 Jun 2020 07:10:32 +0300

JS Event Processing Details

An event is an action of a user, and event handling is a function that handles that action.In this section, let's look at event handling in JS. Article Directory Three ways to add event handling Add in line Label Attribute Add Add Event Listening Focus Events Click and double click events Mouse even ...

Added by Grim... on Tue, 09 Jun 2020 19:10:37 +0300

Overview of pre -, middle -, and suffix expressions and calculator principle and code analysis of conversion + stack (including complete source code)

catalog: 1. Overview of suffixes 2. Middle order expression to suffix expression 3. Implement the principle and steps of calculator with stack suffix expression 4. Code implementation and analysis 1. Overview and mutual conversion of suffixes Prefix expression: the operator precedes the operand. ...

Added by Naithin on Sun, 07 Jun 2020 08:56:33 +0300

HashMap: Source code (constructor, put, resize, get, remove, replace)

1. Constants (1) Default table size, 1 shifts left four bits to 8 static final int DEFAULT_INITIAL_CAPACITY = 1 << 4; // aka 16 (2) Maximum table length static final int MAXIMUM_CAPACITY = 1 << 30; (3) Default load factor size: static final float DEFAULT_LOAD_FACTOR = 0.75f; (4) Tree threshold static final int TREEIFY_ ...

Added by defect on Thu, 04 Jun 2020 07:52:52 +0300

Partition Subtable for MySQL

1. Why divide tables?The database data becomes larger and larger, with too much data in a single table.This results in slower queries and database performance bottlenecks due to the lock mechanism of tables, which can seriously affect application operations.One mechanism in mysql is table and row locking to ensure data integrity.A table lock m ...

Added by johnnyblaze9 on Thu, 04 Jun 2020 03:09:26 +0300

Visitor mode of behavior mode

1 General Visitor pattern is a behavior pattern, which is not commonly used. It can separate the algorithmic logic acting on the object from the object itself. 2 visitor mode When we need to operate on a group of similar types of objects, we can maintain the operation logic within each object separately, but this violates the principle of singl ...

Added by riyaz123 on Sun, 31 May 2020 12:54:46 +0300

Aggregate operators of [LINQ standard query operator summary]

LINQ in C ා provides two operation modes: query expression and query operator. All query expressions are replaced by corresponding query operator classes. Query expression is a bit of "class" SQL. When writing SQL in the code, I always feel that it is not "elegant". Using query operators is "elegant". This series i ...

Added by nloding on Sat, 30 May 2020 17:01:17 +0300

vue upload image to base64, binary array, save encoded data to file

functional requirement 1. Picture to base64 2.base 64 to binary array 3. Save binary data to file and download to local resolvent Question 1: reference material vue element upload picture to base64 Specific code getBase64(file) { return new Promise(function (resolve, reject) { let reader = new FileReader(); let imgResu ...

Added by error_22 on Fri, 29 May 2020 17:49:11 +0300

Hegel: aspire to be the best JavaScript static type checker

Yunqi information:[ Click to see more industry information]Here you can find the first-hand cloud information of different industries. What are you waiting for? Come on! As a rookie in JavaScript type checker, Hegel aspires to be the best JavaScript static type checker. It claims to provide a reliable type system with strong type inference. At ...

Added by drakal30 on Fri, 29 May 2020 09:31:34 +0300

Learning C + + DLL injection and interprocess communication

I always think that learning c + + is too complex, and there are many types in it, which are too many to distinguish at all. However, most of the online materials are c + +, and some problems are not solved perfectly with other methods (can be used in c, java, python) Then I decided to do it. Because I had to do c + +, I had to do VC + +, and ...

Added by Virii on Wed, 27 May 2020 07:19:14 +0300