Using LiveData to implement EventBus

Introduction This article is a study note written after learning the article of the big guy and doing it yourself. The article of the big guy is well written. I can't describe it clearly by myself, so many parts of this article directly quote the article of the big guy. Source code: https://github.com/LinYaoTian... Design sketch: Tip: it's best ...

Posted by wgh on Fri, 15 Nov 2019 02:14:53 -0800

Query in mongoose

find() Model.find(filter[, projection][, options][, callback]) Parameter 1: filter The query condition uses the format of JSON document, and the syntax of JSON document follows MongoDB shell The same is true. { field1: value1, field2: { operator: value2 } ... } 1. Find all Model.find() Model.find({}) 2. Accurate search Model.find({author:'dora' ...

Posted by lplatz on Thu, 14 Nov 2019 22:29:05 -0800

Spring security spring boot + spring security SMS confirmation

Now there are three main login methods: account password login, SMS verification code login and third-party authorized login. The previous section Spring security (3) -- authentication process We have analyzed the spring security account password mode login. Now let's analyze the spring security SMS mode authentication login.   &emsp ...

Posted by aissa on Thu, 14 Nov 2019 20:19:01 -0800

An example of Java simulating ordered linked list data structure

Ordered list: Sort by key. When the chain head is deleted, the minimum (/ maximum) value is deleted. When inserting, the insertion position is searched. When inserting, you need to compare O(N), average O(N/2), and delete the minimum (/ maximum) data in the chain head with an efficiency of O(1), If an application needs frequent access to (ins ...

Posted by jeffshead on Thu, 14 Nov 2019 06:51:59 -0800

Gin framework - custom error handling

SummaryMany readers ask me for the Demo source code of the Gin framework Practice Series in the background. Let me explain again here. I updated the source code to GitHub at https://github.com/xinliangnote/GoStarting today's article, why do you want to customize error handling? What is the default error handling method?Well, let's talk about de ...

Posted by my_mind on Thu, 14 Nov 2019 06:45:23 -0800

Red black tree? AVL? First understand the most basic binary tree!

What is a tree? Tree data structure is very common in life, such as going to the library to find a book, which is placed according to different categories. For example, the disk folder in the computer and so on. Using a tree structure to store data can be surprisingly efficient. As the name implies, the data structure of tree is like an inverte ...

Posted by vic vance on Thu, 14 Nov 2019 02:23:45 -0800

[advanced search] chivalry

Title Link Solving problems There are many ways to solve this problem. First of all, let's think about it. If it's more than 15, it will output - 1. Then let's find the minimum value. Obviously. It can be done with iteration deepening. We can enumerate the minimum steps directly. But that's only 20 points... You know, if t ...

Posted by DanielHardy on Wed, 13 Nov 2019 07:27:22 -0800

[Leetcode algorithm weekly] issue 3

First appeared in the WeChat public's front-end growth notes, written in 2019.11.13 background This paper records the whole thinking process in the process of writing questions for reference. The main contents include: Assumption of topic analysis Write code validation Consult others' solution Thinking and summing up Catalog 35. Search inser ...

Posted by rogeriobrito on Wed, 13 Nov 2019 05:03:42 -0800

Different LCA - luoguP1852 Chess

Logu Title Link loj End Title Link Topic: Play a chess game on one axis.Chess pieces can only be placed on the whole point.No more than one piece can be placed at each point.Complete with Chess: There are 3 pieces on the board, in the three positions a, b and c.We want to move their positions to x, y, z with the least jumps. Rule of Jump: Selec ...

Posted by CaseyC1 on Tue, 12 Nov 2019 19:34:06 -0800

E. Balance Reset (Interactive dp)

Original title: http://codeforces.com/gym/101848/problem/E Title: There are 2n dishes with their own prices. Each day, N dishes will be randomly selected. You have p yuan now. You can charge money first and then have a meal or not every day. Ask if you can make the balance zero in 365 days. Analysis: First of all, it is the requ ...

Posted by powerofphp on Tue, 12 Nov 2019 13:49:07 -0800