07 2023 档案

摘要:编译一些测试函数。 心得: 0, 可用stdio.h, 可用printf 1, 先声明,后赋值; 2, main函数的形式只能用int main(), 不能是int main(void)或int main(int argc, char *argv[]),否则报错,bad parameter decl 阅读全文
posted @ 2023-07-30 19:29 安然春夏 阅读(10) 评论(0) 推荐(0) 编辑
摘要:当编辑文件或不小心按下Ctrl+Z,就会将当前任务转为suppended, 查看jobs, 将其当前任务转入前台fg. 阅读全文
posted @ 2023-07-24 12:06 安然春夏 阅读(8) 评论(0) 推荐(0) 编辑
摘要:"Linux图形界面多数使用的是 X Server, 我们有时需要关闭/重启它. 比如: 安装 NVIDIA 的驱动程序时,就需要先关闭 X server; 希望让系统以 server 方式运行,关闭桌面环境以降低不必要的性能损耗."[1] 检查图形界面 X Server 的状态: systemct 阅读全文
posted @ 2023-07-24 12:06 安然春夏 阅读(194) 评论(0) 推荐(0) 编辑
摘要:既然sizeof是运算符,不是函数,那么它的机制到底是什么?C语言规范或编译器应该有所体现。 gcc-0.9,其他版本的有需要再看, 暂时不能handle cmake, 以后再看CLANG/LLVM。 搞清楚编译器,就可以相信编译器。 未经本人同意,禁止转载。 阅读全文
posted @ 2023-07-24 12:04 安然春夏 阅读(14) 评论(0) 推荐(0) 编辑
摘要:LLVM中引入了无分支的排序函数 [1] https://reviews.llvm.org/D118029 阅读全文
posted @ 2023-07-24 12:02 安然春夏 阅读(14) 评论(0) 推荐(0) 编辑
摘要:计算机组成原理:哈工大,刘宏伟 操作系统:南京大学,蒋炎岩,《深入理解计算机体系》,《现代操作系统》 数据库:初学者《MySQL必知必会》,深入《MySQL技术内幕--Innodb存储引擎》,中国人民大学的数据库系统概论课程////哈工大,战德臣 计算机网络:计算机网络微课堂,《计算机网络:自顶向下 阅读全文
posted @ 2023-07-24 11:55 安然春夏 阅读(14) 评论(0) 推荐(0) 编辑
摘要:从官网下载时速度很慢,选择的是免费版本, 下面有百度云的下载链接。 v2.19.2 链接: https://pan.baidu.com/s/1AVENBcnIVHXbYq0zWM_0VQ 提取码: dei7 阅读全文
posted @ 2023-07-23 14:20 安然春夏 阅读(72) 评论(0) 推荐(0) 编辑
摘要:阅读Lua语言的原因:1, c语言实现;2,top 20语言中,v 5.1.4含1.3万行,在可接受范围;3, 动态脚本语言;4, 含有虚拟机;5, 含GC.; 阅读全文
posted @ 2023-07-23 12:51 安然春夏 阅读(10) 评论(0) 推荐(0) 编辑
摘要:使用32个元素的数组代表unsigned int型数字(32 bit)的加法。 1 #include <stdbool.h> 2 #include <stdio.h> 3 4 unsigned int num1[32]; 5 unsigned int num2[32]; 6 unsigned int 阅读全文
posted @ 2023-07-20 21:33 安然春夏 阅读(74) 评论(0) 推荐(0) 编辑
摘要:239个梅森数,x=2^239-1=883423532389192164791648750371459257913741948437809479060803100646309887 小于10000的因子:479, 1913, 5737 python和java BigInteger计算结果一致。 阅读全文
posted @ 2023-07-20 15:57 安然春夏 阅读(4) 评论(0) 推荐(0) 编辑
摘要:f(x)=sin(x) 的逆函数 y=asin(x),定义域[-1,1],值域[-pi/2, pi/2]+n*pi, n=0 g(x)=cos(x) 的逆函数 y=acos(x),定义域[-1,1],值域[0, pi]+n*pi, n=0 t(x)=tan(x) 的逆函数 y=atan(x),定义域 阅读全文
posted @ 2023-07-20 12:42 安然春夏 阅读(47) 评论(0) 推荐(0) 编辑
摘要:连分数x=[a0; a1,a2,a3,a4,a5,a6....] = p/q 0级近似:a0/1 = p0/q0 p0=a0, q0=1 1级近似:a0+1/a1=(a0*a1+1)/a1 = p1/q1 = (a1*p0+p-1)/(a1*q0+q-1) p-1=1, q-1=0 2级近似:a0+ 阅读全文
posted @ 2023-07-20 03:52 安然春夏 阅读(13) 评论(0) 推荐(0) 编辑
摘要:img[i][j]周围的单元格,img[i+i1][j+j1], i1=-1,0,1, j1=-1,0,1, 每个都判断一次。O(9*m*n) class Solution { public: std::vector<std::vector<int>> imageSmoother( std::vec 阅读全文
posted @ 2023-07-20 00:54 安然春夏 阅读(26) 评论(0) 推荐(0) 编辑
摘要:1 class Solution { 2 public: 3 string toLowerCase(string s) { 4 for(char &ch: s){ 5 if(ch>='A' && ch<='Z'){ 6 ch=tolower(ch); 7 } 8 } 9 return s; 10 } 阅读全文
posted @ 2023-07-20 00:49 安然春夏 阅读(6) 评论(0) 推荐(0) 编辑
摘要:【GDB调试教程:1小时玩转Linux gdb命令 sudo dnf debuginfo-install glibc-2.32-2.fc33.x86_64 编译时, gcc -g test.c -o test,因为在调试二进制文件的时候,我们需要在二进制文件中加入调试信息,而调试信息是怎么添加的呢? 阅读全文
posted @ 2023-07-14 22:38 安然春夏 阅读(36) 评论(0) 推荐(0) 编辑
摘要:主内存中内存单元(比特)有唯一编号,可寻址。c语言中变量可占用连续几个比特,那么有几种办法定位变量占用的地址? 变量名,引用,指针都是地址的别名 int num = 5; 1, 直接变量名的地址,一阶指针 int *r1 = &num; *r1是num的内容,r1内指向num的地址。 2, 取地址+ 阅读全文
posted @ 2023-07-14 18:15 安然春夏 阅读(14) 评论(0) 推荐(0) 编辑
摘要:查看c/c++文件中的头文件,可以使用gf跳转,但是有时会出现Error 447:not found in path1, 命名模式中输入,临时修改 :set path=.,/usr/include,,/usr/include/c++/*/ 2, 修改vimrc set path+=.,/usr/in 阅读全文
posted @ 2023-07-14 15:43 安然春夏 阅读(63) 评论(0) 推荐(0) 编辑
摘要:#include<typeinfo> int main(){ int i=5; int &ir=i; std::cout<<typeid(ir).name()<<std::endl; // output: i return 0; } 阅读全文
posted @ 2023-07-14 15:29 安然春夏 阅读(7) 评论(0) 推荐(0) 编辑
摘要:g++也可以编译c语言函数, 1 // filename: extern_c.cc 2 3 #include <iostream> 4 5 #ifdef __cplusplus 6 extern "C" { 7 #endif 8 //c语言语句开始 9 #include <stdio.h> 10 1 阅读全文
posted @ 2023-07-14 14:15 安然春夏 阅读(9) 评论(0) 推荐(0) 编辑
摘要:cpplint可用于检查代码是否遵守google c++代码规范。我的理解是检查你使用的是不是正确的C++。 安装: python3 -m pip install cpplint 与之对应,代码需要格式化为满足google c++规范的格式,比如使用 clang-format --style=goo 阅读全文
posted @ 2023-07-10 20:58 安然春夏 阅读(972) 评论(0) 推荐(0) 编辑

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