Explain the principle and implementation of Bloom filter in detail
Why do I need a bloom filter
Imagine how you would handle the following scenario:
Whether the mobile phone number is registered repeatedly
Has the user participated in a second kill activity
Forge requests for a large number of id query records that do not exist. At this time, the cache misses. How to avoid cache penetration
To solv ...
Posted by bogdaniel on Mon, 06 Dec 2021 20:40:19 -0800
2021SC@SDUSC Application and practice of software engineering in Software College of Shandong University -- Ebiten code analysis and source code analysis
2021SC@SDUSC
1, Overview
This paper will mainly describe the related methods in packing package in ebiten. Packing package provides a two-dimensional space packing algorithm. The file is located in the internal/packing/packing.go folder.
2, Code analysis
const (
minSize = 1
)
type Page struct {
root *Node
size int
maxSize int
...
Posted by bouwob on Sun, 05 Dec 2021 10:49:08 -0800
Full stack blog development add rendering
Original link
https://llfc.club/category?catid=20RbopkFO8nsJafpgCwwxXoCWAs#!aid/21lVoQbhTZo83drdNp10Iv2WOfc
Objectives of this section
In the previous section, we added the routing of the home page and the html template of the home page. In this section, we return a template with parameter rendering, add the load data from the database to the h ...
Posted by Vidya_tr on Sun, 05 Dec 2021 08:29:07 -0800
Go select is deadlocked...
Original text: https://mp.weixin.qq.com/s?__biz=MzAxNzY0NDE3NA==&mid=2247488032&idx=1&sn=5d0c370dd992e1dd82030e5ac5600244&chksm=9be33dc1ac94b4d7798bb7ed230c899088a5c972c1c099e48779505f89539f0a840520cd0d4d&scene=178&cur_album_id=1877309550266007553#rd
--------------------
Hello, I'm polarisxu.
Two days ago, Huoding wr ...
Posted by stratguitar on Sun, 05 Dec 2021 06:53:47 -0800
Golang sort package sorting (full set of details)
1, Integer
First of all, use the simplest example provided inside to sort the shaping
package main
import (
"fmt"
"sort"
)
func main() {
a := sort.IntSlice{2, 8, 3, 7, 9, 4, 1, 6}
fmt.Println("Before sorting", a)
sort.Sort(a)
fmt.Println("After sorting", a)
}
You'd better wonder what sort.IntSlice is. Click to view the source ...
Posted by Johan Beijar on Sun, 05 Dec 2021 03:28:54 -0800
Bugs in Golang caused by zero value and gob Library Characteristics
0 originIn September this year, the Department platform project I was responsible for released a new version, which also launched a new function. In short, it is a little similar to scheduled tasks. On the first day, everything was normal, but on the second day, very few tasks were not executed normally (the suspended tasks continued to be exec ...
Posted by jcbones on Sat, 04 Dec 2021 23:24:10 -0800
Implementation of four file configuration methods in Golang
explainIn the actual development process, we are bound to use MySQL, Redis and other services. In order to realize the configuration of the system, we will put some configuration information in some files separately, and read the configuration file directly where we use it.There are many common file configuration methods, such as json, tomal, y ...
Posted by wildwobby on Fri, 03 Dec 2021 18:58:33 -0800
Go--Redis Quick Start Guide
Go—Redis
1, Basic introduction, installation and principle of Redis
1. Basic introduction:
① Redis is a NoSQL database (non relational database) 💨 Official website
② Redis (remote dictionary server), which means remote dictionary server, can reach 15w qps on a single machine. It is suitable for caching and persistence.
③ Redis is a high-p ...
Posted by bltesar on Fri, 03 Dec 2021 15:16:46 -0800
Golang memory escape analysis
summary
A variable is defined in Go. Whether it is allocated on the heap or on the stack. The official Go document tells us that it doesn't need to be controlled. They will analyze it. In fact, this analysis is escape analysis
Generally speaking, when the pointer of an object is referenced by multiple methods or threads, we call the pointer a ...
Posted by jamessw on Fri, 03 Dec 2021 11:56:30 -0800
goland basic package - use of unsafe
Warm tips: suitable for students with memory operation experience
1, The role of unsafe
According to the definition of golang, unsafe is a type safe operation. As the name suggests, it should be used very carefully; Unsafe can be dangerous, but it can also be very useful. For example, when using system calls and Go structures that must have t ...
Posted by rob323 on Fri, 03 Dec 2021 00:32:08 -0800