摘要: ArrayList‌ 默认初始容量为10,无参构造时首次添加元素扩容至10 后续扩容按旧容量的1.5倍计算(newCapacity = oldCapacity + (oldCapacity >> 1)) 若扩容后仍不足,则直接采用所需最小容量 Vector‌ 默认初始容量为10,扩容策略与Array 阅读全文
posted @ 2025-08-29 09:31 朝阳1 阅读(19) 评论(0) 推荐(0)
 
摘要: *args和**kwargs: *args接收可变数量的位置参数(元组) **kwargs接收可变数量的关键字参数(字典) grep查找a.txt文件中某字符,并打印该字符的位置.-n显示行号,-o仅输出匹配字符,-b显示字节偏移量 grep -nob '目标字符' a.txt is和==的区别: 阅读全文
posted @ 2025-08-04 14:41 朝阳1 阅读(19) 评论(0) 推荐(0)
 
摘要: 个人博客新地址 https://qzy123456.github.io 技术栈 PHP、Go、Python、Js、Rust、Html、Vue、Mysql、Redis、Mongo、Linux、Es、ClickHouse、K8s、Docker、分布式... 最近老是传博客园倒闭的消息。。。所以想把文章都 阅读全文
posted @ 2024-09-29 16:40 朝阳1 阅读(72) 评论(0) 推荐(0)
 
摘要: k8s主要由以下核心组件组成: Etcd 保存了整个集群的状态; Apiserver提供了资源操作的唯一入口,并提供认证、授权、访问控制、API注册和发现等机制; Controller Manager负责维护集群的状态,比如故障检测、自动扩展、滚动更新等, 🔹 Node Controller 👉 阅读全文
posted @ 2024-03-05 09:25 朝阳1 阅读(51) 评论(0) 推荐(0)
  2026年5月21日
摘要: 武器、子弹、普通伤害、aoe伤害、减速等 package game import ( "fmt" "log" "math" "math/rand" "sync" "time" ) // Position 坐标位置 type Position struct { X float64 Y float64 阅读全文
posted @ 2026-05-21 11:45 朝阳1 阅读(10) 评论(0) 推荐(0)
  2026年5月19日
摘要: 最好是两个屏幕、或者再找个电脑测试 package main import ( "bytes" "fmt" "image" "image/jpeg" "log" "net/http" "sync" "time" "github.com/kbinani/screenshot" ) var ( qual 阅读全文
posted @ 2026-05-19 14:46 朝阳1 阅读(7) 评论(0) 推荐(0)
摘要: 方式1 # 安装cmirror cargo install cmirror # 自动测试并选择最快的源进行配置 cmirror cargo --fastest 还原 cmirror cargo --restore 方式2配置文件,没有就新建 Windows:%USERPROFILE%\.cargo\ 阅读全文
posted @ 2026-05-19 11:40 朝阳1 阅读(28) 评论(0) 推荐(0)
  2026年5月18日
摘要: json格式、自动备份 chrono = "0.4.19" tracing = "0.1.29" tracing-appender = "0.2" tracing-subscriber = { version = "0.3.3", features = ["json", "env-filter"] 阅读全文
posted @ 2026-05-18 17:57 朝阳1 阅读(6) 评论(0) 推荐(0)
  2026年5月15日
摘要: toml [dependencies] redis = { version = "1.2", features = [ "tokio-comp", # 异步支持 "connection-manager", # 内置连接池 "tokio-native-tls-comp", ] } tokio = { 阅读全文
posted @ 2026-05-15 11:44 朝阳1 阅读(5) 评论(0) 推荐(0)
  2026年5月13日
摘要: 依赖 [dependencies] sqlx = { version = "0.8", features = [ "runtime-tokio-native-tls" , "mysql" ] } tokio = { version = "1", features = ["full"] } #时间 c 阅读全文
posted @ 2026-05-13 15:31 朝阳1 阅读(5) 评论(0) 推荐(0)
摘要: 在写后台管理的时候、有个生成二维码的需求、本来想用php的composer包、感觉太麻烦、也太重了、直接前端处理 cnd地址 https://cdn.jsdelivr.net/npm/qrcode/build/qrcode.min.js 用法1:创建二维码 并显示到id为qrcode的元素中 var 阅读全文
posted @ 2026-05-13 10:22 朝阳1 阅读(12) 评论(0) 推荐(0)
  2026年5月12日
摘要: 以下都是参考网上的 ├── api # protobuf 文件和生成的*pb.go 目录--可选 ├── assets # 其他与资源库一起使用的资产(图片、logo 等)目录--可选 ├── cmd # 程序入口目录 ├── configs # 配置文件的目录 ├── deployments # 阅读全文
posted @ 2026-05-12 17:07 朝阳1 阅读(4) 评论(0) 推荐(0)
  2026年4月29日
摘要: 中间件 middleware/error.go package middleware import ( "net/http" "github.com/gin-gonic/gin" ) // ErrorHandler 全局错误处理中间件 func ErrorHandler() gin.HandlerF 阅读全文
posted @ 2026-04-29 08:33 朝阳1 阅读(10) 评论(0) 推荐(0)
  2026年4月27日
摘要: 一键安装 curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash 安装完根据提示 source "/root/.g/env" 使用 g NAME: g - Golang Version Manage 阅读全文
posted @ 2026-04-27 11:28 朝阳1 阅读(10) 评论(0) 推荐(0)