摘要: 参考:https://www.zhihu.com/question/421767822/answer/1481328334 (从 int *到int的转换损失精度) 做了如下测试: class A { public: A() {} A(const A* pa) { a[0] = pa->a[0]; 阅读全文
posted @ 2021-07-29 15:04 SimbaStar 阅读(628) 评论(0) 推荐(0) 编辑
摘要: 1. 建立tcp连接时,server端使用的端口号和listen port的关系 tcp连接是一个4元组:[clientIP, clientPort, serverIP, serverPort],四个元素中有一个元素不同,就是一个不同的tcp连接。以ssh为例,监听在22端口,不同的client连接 阅读全文
posted @ 2021-07-09 16:30 SimbaStar 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 在windows端下载vs code,我下的版本是1.55.2。远端服务器是centos7 1. 配置SSH登录 在vs code左侧列图表中,找到Extensions,然后搜索ssh,安装Remote-SSH插件 和 Remote Development插件。安装成功后,会在相同列下方出现Remo 阅读全文
posted @ 2021-04-28 14:34 SimbaStar 阅读(1282) 评论(0) 推荐(0) 编辑
摘要: 主要测试了各方式clone的情况: 1. 安装gitlab,配置ip:port。 常规步骤: yum install -y curl policycoreutils-python openssh-server wget https://mirrors.tuna.tsinghua.edu.cn/git 阅读全文
posted @ 2021-04-14 14:50 SimbaStar 阅读(2124) 评论(0) 推荐(0) 编辑
摘要: 直接上代码: #include <stdio.h> #include <fcntl.h> #include <string.h> #include <sys/types.h> #include <unistd.h> int main() { FILE *f1 = fopen("./sysv_msgq 阅读全文
posted @ 2021-03-31 14:04 SimbaStar 阅读(1445) 评论(0) 推荐(0) 编辑
摘要: 如下测试: #include <iostream> #include <string.h> using namespace std; int main() { char a[]="123123"; cout<<strlen(a)<<endl; cout<<sizeof(a)<<endl; char 阅读全文
posted @ 2020-12-21 15:35 SimbaStar 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 测试代码: #include <iostream> using namespace std; class AA { public: AA(size_t count = 1) { _a = new int[count]; cout<<"AA()"<<endl; } ~AA() { cout<<"~AA 阅读全文
posted @ 2020-12-16 17:27 SimbaStar 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 运行时动态库 not found。即使在使用-L和-l参数使得成功编译,在运行时仍然可能会找不到库,因为运行时库的搜索路径可能并没有包含-L的目录。 第一种方法:找到缺少的动态库(由于编译和链接时候的使用到了这个动态库,所以很容易找得到),将其加到/lib,/usr/lib中的一个文件夹下,这几个文 阅读全文
posted @ 2020-12-07 15:45 SimbaStar 阅读(880) 评论(0) 推荐(0) 编辑
摘要: #include <time.h> #include <chrono> #include <unistd.h> #include <iostream> using namespace std; int main() { int sum = 0; auto t = std::chrono::high_ 阅读全文
posted @ 2020-11-29 19:02 SimbaStar 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 几个结论: 1. linux查看tcp缓冲区参数命令: cat /proc/sys/net/ipv4/tcp_wmem # 写缓冲区大小4096 16384 4194304 # 分别表示最小值,默认值,最大值cat /proc/sys/net/ipv4/tcp_rmem # 读缓冲区大小4096 8 阅读全文
posted @ 2020-11-19 22:53 SimbaStar 阅读(987) 评论(0) 推荐(0) 编辑