悉野小楼

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

08 2023 档案

二叉堆例子
摘要:参考: https://blog.csdn.net/lyqzzy/article/details/59849252 https://baike.baidu.com/item/二叉堆 二叉堆是一种特殊的堆,二叉堆是完全二元树(二叉树)或者是近似完全二元树(二叉树)。 二叉堆有两种:最大堆和最小堆。最大 阅读全文

posted @ 2023-08-30 19:20 悉野 阅读(7) 评论(0) 推荐(0) 编辑

cocos creator使用用vscode调试
摘要:1.vscode 安装 JavaScript Debugger (Nightly) 2.修改launch.json里面端口的值 端口号是cocos creator运行打开网页的端口号, vscode launch.json修改好后, 保存, 按F5就要吧启动调试了, 原typescript文件里面打 阅读全文

posted @ 2023-08-27 19:47 悉野 阅读(864) 评论(0) 推荐(0) 编辑

[转]C++使用虚函数的时候,子类也要使用virtual关键字吗
摘要:原文地址:https://blog.csdn.net/gao1440156051/article/details/45670715 父类使用虚函数是为了让子类重写,那子类重写的时候也需要带virtual关键字吗?比如:class Base{virtual bool init();};class De 阅读全文

posted @ 2023-08-26 15:11 悉野 阅读(82) 评论(0) 推荐(0) 编辑

一个引用没效果错误示范
摘要:#include <iostream> #include <unordered_map> using namespace std; class TestClass { public: std::unordered_map<int, int>& GetData() { return m_data; } 阅读全文

posted @ 2023-08-25 18:59 悉野 阅读(5) 评论(0) 推荐(0) 编辑

c++ stl std::sort使用例子
摘要:例子1: class User { public: int32_t m_fight_power; private: int32_t m_level; }; bool CenterData::compare(const User *left, const User *right) { if(left- 阅读全文

posted @ 2023-08-25 10:15 悉野 阅读(30) 评论(0) 推荐(0) 编辑

C++11 四种强制类型转换的区别
摘要:static_cast: 指针强转, 如果某个基类有多个子类, 基类的指针实际是指向A类的对象, 但使用强转为B类对象, 运行时会报错, 静态强转没做检测dynamic_cast: 只能用于虚函数类, 子类与父类指针互转, 会检测, 转换失败为返回空, 不会崩const_cast: 用于转换常量, 阅读全文

posted @ 2023-08-24 20:17 悉野 阅读(252) 评论(0) 推荐(0) 编辑

自定义游戏服务端时间 C++ 11实现
摘要:原理: 系统已运行时间是不断增长的, 用户修改系统自带的时钟, 这个值不会变. 利用这个固定值加上自定义的时间长度, 计算出当前时间. C++ 98, windows使用 GetTickCount64()取固定时间, linux使用clock_gettime(CLOCK_MONOTONIC, &tp 阅读全文

posted @ 2023-08-24 10:11 悉野 阅读(33) 评论(0) 推荐(0) 编辑

[转]c++ function使用方法
摘要:原帖:https://blog.csdn.net/myRealization/article/details/111189651 cppreference https://en.cppreference.com/w/cpp/utility/functional/function boost源码剖析之 阅读全文

posted @ 2023-08-11 20:59 悉野 阅读(53) 评论(0) 推荐(0) 编辑

C++多线程不加锁操作同一个整数
摘要:#include <iostream> #include <thread> #include <vector> #include <chrono> #include <atomic> using namespace std; int num = 0; //volatile int num = 0; 阅读全文

posted @ 2023-08-11 14:41 悉野 阅读(133) 评论(0) 推荐(0) 编辑

[go]学习笔记1
摘要:package main import "fmt" //全局变量不使用, 不报错, 局部变量会 var n1 = 1 var n2 = 2 var ( n3 = 3 n4 = "netty" ) var abc uint = 15 // ab := 3 //non-declaration state 阅读全文

posted @ 2023-08-08 15:35 悉野 阅读(8) 评论(1) 推荐(0) 编辑

[转]virtualbox centos无法上网问题
摘要:原文地址 https://www.cnblogs.com/Joke-Jay/p/8215295.html virualbox里面设置nat模式(我这儿配置virtual时, 第一张网卡是NAT模式, 还加了一张网卡, 选择了host-only模式, 估计不是必须) 修改centos里面文件: vi 阅读全文

posted @ 2023-08-07 13:59 悉野 阅读(10) 评论(0) 推荐(0) 编辑

[转]java调试
摘要:[原]https://www.cnblogs.com/yzlsthl/p/15193756.html 1 cpu、内存、io进程排查,使用 top、iotop、nethogs、iostat -x 1等命令2 慢sql优化,加索引,sql逻辑3 接口响应慢的,缓存4 执行时间长的定时任务,异步5 对3 阅读全文

posted @ 2023-08-06 19:02 悉野 阅读(8) 评论(0) 推荐(0) 编辑

[转]linux查看版本
摘要:原文:https://www.cnblogs.com/opensmarty/p/10936315.html lsb_release -a 查看发行版本 lsb表示 linux standard base, -a表示显示全部 cat /proc/version 看内核版本 阅读全文

posted @ 2023-08-06 15:53 悉野 阅读(2) 评论(0) 推荐(0) 编辑

[转]windows与linux下 TCP端口转发
摘要:原文: https://blog.csdn.net/cw_hello1/article/details/105968359 1.在window中,进行端口转发时,使用portproxy模式下进行配置。必须使用管理员身份运行下面的命令。 2.创建一个端口转发: netsh interface port 阅读全文

posted @ 2023-08-06 15:50 悉野 阅读(187) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示