Basics There are three types of forms in Go Web: r.Form r.PostForm r.MultipartForm PostForm supports form-data and x-www-form-urlencoded request b[......] 继续阅读
Basics There are three types of forms in Go Web: r.Form r.PostForm r.MultipartForm PostForm supports form-data and x-www-form-urlencoded request b[......] 继续阅读
基础 Go Web 的表单类型有三种: r.Form r.PostForm r.MultipartForm PostForm 支持 form-data 和 x-www-form-urlencoded 两种请求体,但是不支持上传文件。 MultipartForm 只支持 for[......] 继续阅读
[TOC] 笔者前段时间在学习数据结构时,恰好听说了 LSM Tree,于是试着通过 LSM Tree 的设计思想,自己实现一个简单的 KV 数据库。 代码已开源,代码仓库地址:https://github.com/whuanle/lsm 笔者使用 Go 语言来实现 LSM Tree 数据库,因为[......] 继续阅读
Pursuit is not about getting what you wish for, but rather about the twists and turns of fate. [......] 继续阅读
Face yourself and maintain a calm mindset. Everyone goes through periods of underestimation and discomfort, and there are many things that cause us p[......] 继续阅读
要正视自己,放平心态,每个人处于低估和难受的时期,很多事让自己痛苦,希望可以找一个人一起陪伴。 其实,不用管想着有人陪伴你受苦,经历磨难。而是你应该经历苦难后,走出低谷,摆脱困境,这才是当前最应该做的事情。 即使是找到另一半,别人也没有义务承担你的痛苦,何必在痛苦的时候,让另一个也痛苦呢。 悲喜自[......] 继续阅读
Title: Given an integer array nums. Return true if any value appears at least twice in the array, and return false if every element is distinct. Examp[......] 继续阅读
题目: 给你一个整数数组 nums 。如果任一值在数组中出现 至少两次 ,返回 true ;如果数组中每个元素互不相同,返回 false 。 示例 1: 输入:nums = [1,2,3,1] 输出:true 示例 2: 输入:nums = [1,2,3,4] 输出:false 示例 3: 输入:n[......] 继续阅读
第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读
第一种: private bool IsDefaultValue(T value) { Span<byte> valueBytes = MemoryMarshal.AsBytes<T>(new T []{ value }.AsSpan());[......]继续阅读
<ItemGroup> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0-preview.2.22152.2"[......]继续阅读
<ItemGroup> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0-preview.2.22152.2" /> <Packag[......]继续阅读
Using interfaces has another benefit: it facilitates mocking. To evaluate whether your code is good, properly separated, or over-designed, write compr[......] 继续阅读
Packages: Microsoft.AspNetCore.Mvc.Testing Microsoft.AspNetCore.TestHost Moq Integration testing can ensure that application components are functioni[......] 继续阅读
包: Microsoft.AspNetCore.Mvc.Testing Microsoft.AspNetCore.TestHost Moq 集成测试可在包含应用支持基础结构(如数据库、文件系统和网络)的级别上确保应用组件功能正常。 ASP.NET Core 通过将单元测试框架与测试 Web 主机和内[......] 继续阅读