悉野小楼

导航

上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页

2023年8月25日

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 悉野 阅读(13) 评论(0) 推荐(0) 编辑

2023年8月24日

C++11 四种强制类型转换的区别

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

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

自定义游戏服务端时间 C++ 11实现

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

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

2023年8月11日

[转]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 悉野 阅读(31) 评论(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 悉野 阅读(63) 评论(0) 推荐(0) 编辑

2023年8月8日

[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 悉野 阅读(4) 评论(0) 推荐(0) 编辑

2023年8月7日

[转]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 悉野 阅读(8) 评论(0) 推荐(0) 编辑

2023年8月6日

[转]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 悉野 阅读(4) 评论(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 悉野 阅读(107) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页