Observer mode in design mode

Observer mode The observer pattern defines one to many dependencies between objects, so that when an object changes state, all its dependencies are notified and automatically updated The observer model has two roles, one is the observer, the other is the observed (subject), which can also be considered as the subscriber and publisher. It's the ...

Added by JohnMC on Fri, 01 Nov 2019 13:40:14 +0200

[PostgreSQL] prefix fuzzy query level optimization

Pre match blur Using B-Tree to speed up matching fuzzy query before optimization Tectonic data Create a new product table and insert 10 million pieces of data. create table goods(id int, name varchar); insert into goods select generate_series(1,10000000),md5(random()::varchar); Query the product name of "123%" when the index is not ...

Added by DaPrince on Thu, 31 Oct 2019 22:46:18 +0200

GIT learning notes

System version: CentOS Linux release 7.6.1810ip: 192.168.3.58 git installation (1) //Dependency library installation 2. # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel 3. # yum install gcc perl-ExtUtils-MakeMaker //Uninstall the older version of Git 4. # yum remove git //Download the new version of git source pack ...

Added by lovely on Thu, 31 Oct 2019 11:57:20 +0200

go and websocket (golang.org/x/net/websocket)

Reference resources https://github.com/ukai/go-websocket-sample/blob/master/websocket_echo_sample.go https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/08.2.md WebSocket is an important feature of HTML5. It implements remote socket based on browser. It enables full duplex ...

Added by Tezread on Wed, 30 Oct 2019 20:06:46 +0200

Performance comparison of Unity NewtonsoftJson, LitJson and SimpleJSON

Performance comparison test of Json Library in Unity Class library size comparison: Class library file type Size NewtonsoftJson .dll 353KB LitJson .dll 56KB SimpleJSON .cs 68KB Analysis time comparison:Execution times: 10000 times test method NewtonsoftJson LitJson SimpleJSON Test 1 114ms 158ms 52ms Test 2 136ms 288ms 126ms ...

Added by angel1987 on Wed, 30 Oct 2019 19:21:30 +0200

How to use Swagger to add JWT authorization documents for. NET Core 3.0 applications

brief introduction This tutorial is written in the thinking mode of WHAT-what-HOW Golden Circle. The Golden Circle principle emphasizes learning from WHY to WHAT to learn and HOW to learn. From fuzzy to clear learning mode. Everyone's time is very precious. Before we do something, we should first think about WHY we should do it and WHAT kind o ...

Added by Dethman on Wed, 30 Oct 2019 03:57:09 +0200

Making wheels by hand: realizing a simple dependency injection

Making wheels by hand: realizing a simple dependency injection (1) Intro In the previous article, I mainly introduced the overall design and general programming experience of dependency injection. This article will start to write code and start to implement its own dependency injection framework. Class diagram Let's review the class diagram men ...

Added by kunalk on Tue, 29 Oct 2019 19:52:02 +0200

Vue unit test (Karma+Mocha+Chai)

In daily work and JavaScript development, especially in Vue JS project, testing is very important. Combined with the example given by Vue.js on the official website, it can be summarized as follows: use Mocha & karma, and combine with the official recommendation of Vue. vue-test-utils Go to unit ...

Added by barbgd on Tue, 29 Oct 2019 19:21:23 +0200

Using vscode to build Golang development environment on Mac platform

This article introduces how to use visual studio code to build golang development environment and debug environment on Mac platform. 1. brew install golang # install brew install golang # Check whether the installation is successful $ go version go version go1.12.7 darwin/amd64 $ brew info go go: stable 1.13.3 (bottled), HEAD Open source progra ...

Added by Codewarrior123 on Tue, 29 Oct 2019 12:09:10 +0200

js original imitation of Taobao magnifier effect

This effect mainly imitates that of Taobao shopping. When the mouse hovers over the top of the picture, the corresponding amplification module appears, and the corresponding picture information is displayed in the nearby area. It mainly uses the monitoring function of js monitoring mouse in the corresponding area: The onmousenter event fires w ...

Added by bluegreen1 on Mon, 28 Oct 2019 12:16:29 +0200