悉野小楼

导航

2026年4月27日

几种服务注册与发现的区别

摘要: 组件CAP开发语言一致性协议配置中心多数据中心健康检查适用场景 Nacos AP/CP Java Raft ✅ ✅ 心跳 + 主动 Spring Cloud/Dubbo、国内微服务 etcd CP Go Raft ✅(KV) ❌ Lease K8s、云原生、强一致元数据 Zookeeper CP J 阅读全文

posted @ 2026-04-27 17:59 悉野 阅读(6) 评论(0) 推荐(0)

2026年4月25日

mybatis测试

摘要: 完整测试demo 测试项目结构 com.example.demo ├── controller │ └── UserController.java ├── service │ └── UserService.java ├── mapper │ └── UserMapper.java ├── enti 阅读全文

posted @ 2026-04-25 11:19 悉野 阅读(7) 评论(0) 推荐(0)

2026年4月23日

向量点乘与叉乘

摘要: Vector3.Dot点乘得到标量, 如果值为0, 说明这两个向量垂直 (x1,y1,z1)*(x2,y2,z2)=x1*x2+y1*y2+z1*z2Vector3.Cross叉乘法, 得向量(得到的向量垂直于原两个向量组成的平面), 原来(x1,y1,z1) x (x2,y2,z2) = (y1z 阅读全文

posted @ 2026-04-23 21:12 悉野 阅读(15) 评论(0) 推荐(0)

unity画布3种渲染模式

摘要: 在 Unity 的 Canvas(画布)​ 组件中,Render Mode(渲染模式)决定了 UI 元素在场景中的空间形态、渲染方式以及与摄像机的关联。共有三个选项,分别适用于不同的 UI 需求: 1. Screen Space - Overlay(屏幕空间 - 叠加)这是 默认的、最常用的模式,适 阅读全文

posted @ 2026-04-23 21:10 悉野 阅读(16) 评论(0) 推荐(0)

2026年4月16日

go学习笔记10(HTTP)

摘要: http服务.go package main import ( "fmt" "net/http" ) func PageHandler(w http.ResponseWriter, r *http.Request) { fmt.Println(r.RequestURI) w.Write([]byte 阅读全文

posted @ 2026-04-16 20:39 悉野 阅读(4) 评论(0) 推荐(0)

go学习笔记9(TCP)

摘要: tcp服务端: package main import ( "fmt" "net" "time" ) func main() { listen, err := net.Listen("tcp", ":8081") if err != nil { return } fmt.Println("liste 阅读全文

posted @ 2026-04-16 20:22 悉野 阅读(5) 评论(0) 推荐(0)

go学习笔记8(反射)

摘要: package main import ( "fmt" "reflect" ) func reflectType(obj any) { typeObj := reflect.TypeOf(obj) switch typeObj.Kind() { case reflect.Struct: fmt.Pr 阅读全文

posted @ 2026-04-16 20:21 悉野 阅读(5) 评论(0) 推荐(0)

2026年4月14日

c++简单的线程池

摘要: #include <iostream> #include <vector> #include <queue> #include <mutex> #include <condition_variable> #include <functional> #include <thread> class Th 阅读全文

posted @ 2026-04-14 16:45 悉野 阅读(6) 评论(0) 推荐(0)

2026年4月12日

operator new 是 C++ 动态内存分配的核心函数,负责分配原始内存,不调用构造函数

摘要: // 全局重载示例 void* operator new(std::size_t size) { std::cout << "Custom operator new called, size: " << size << std::endl; return malloc(size); // 调用 ma 阅读全文

posted @ 2026-04-12 17:40 悉野 阅读(5) 评论(0) 推荐(0)

C++的定位放置new(Placement new)

摘要: c++ primer第18章 特殊工具与技术 优化内存分配 char buffer[sizeof(MyClass)]; MyClass* obj = new (buffer) MyClass(); // 在buffer上构造对象 内存池(Memory Pool)通过预分配大块内存并使用定位new在其 阅读全文

posted @ 2026-04-12 12:51 悉野 阅读(9) 评论(0) 推荐(0)