1 2 3 4 5 ··· 10 下一页
摘要: 点击查看代码 class Solution { public: int search(vector<int>& nums, int target) { int left = 0; int right = nums.size(); int middle; while (left < right) { 阅读全文
posted @ 2025-07-17 18:48 wangshaodong 阅读(4) 评论(0) 推荐(0)
摘要: 定义的时候 int hash[26] = { 0 }; // 编译器会把其他的元素都初始化 定义后 使用函数调用或者for循环 // for 循环 int i; int hash[26]; for (i = 0; i < 26; i++) { hash[i] = 0; } // 库函数 memset 阅读全文
posted @ 2025-07-16 19:20 wangshaodong 阅读(8) 评论(0) 推荐(0)
摘要: 使用spinlock的线程会忙等待,不断的检测锁是否可以用,适用条件,锁的内容比较少的时候 使用mutex的线程会引起线程的切换,适用条件,锁的内容比较多的时候 等待的代价小于线程切换的代价的时候可以考虑使用自旋锁, 阅读全文
posted @ 2024-02-17 20:01 wangshaodong 阅读(15) 评论(0) 推荐(0)
摘要: 关于中文字符的各种编码,初等数学的几何图形等等, https://www.haomeili.net/Code/DetailCodes?wd=%E8%B7%AF%E5%BE%84 国内科研及新闻 成果网站 https://news.sciencenet.cn/sbhtmlnews/2022/11/37 阅读全文
posted @ 2023-03-21 09:40 wangshaodong 阅读(335) 评论(0) 推荐(0)
摘要: | 变量 | 说明 | | : | : | | $n | n是一个参数,从1开始表示参数的位置,例如:$1表示第一个参数,$2表示第二个参数 | | $# | 命令行参数的个数 | | $0 | 当前shell脚本的名称 | | $? | 前一个命令或者是函数的返回状态码,0代表执行成功,非0即失败 阅读全文
posted @ 2023-03-15 16:53 wangshaodong 阅读(37) 评论(0) 推荐(0)
摘要: # 举例子,修改cd的默认路径 function cd() { if [ $# == 0 ]; then builtin cd ~/work else builtin cd $* fi } ref如下,一下博客中 还有其他方法,只是选了其中一个,try and it works https://ww 阅读全文
posted @ 2023-03-09 09:07 wangshaodong 阅读(28) 评论(0) 推荐(0)
摘要: 修改 buildroot的配置选项,增删软件包 cd builroot make xxx_defconfig # xxx_defconfig 就在 buildroot 目录下中对应的板子文件 make menuconfig # 字符图形化界面修改配置 make savedefconfig BR2_D 阅读全文
posted @ 2023-03-09 08:57 wangshaodong 阅读(1987) 评论(0) 推荐(0)
摘要: 编辑要调试的脚本compile.sh的开头,加入 set +xv # 这个命令会把shell脚本的执行过程和执行的相应语句都打印出来,感觉可以类比 gdb中的逐步调试 然后重定向脚本的运行结果到一个日志文件,像这样,然后执行 ./compile.sh 2>&1 | tee build.output. 阅读全文
posted @ 2023-03-09 08:28 wangshaodong 阅读(82) 评论(0) 推荐(0)
摘要: 复制可执行文件的路径 shift + 鼠标右键,选择复制文件地址 当前路径打开cmd 或者powershell ##方法1: shift + 鼠标右键,选择在此处打开powershell ##方法2: 在资源管理器上方鼠标选中全部路径,然后输入cmd 阅读全文
posted @ 2023-03-09 08:18 wangshaodong 阅读(36) 评论(0) 推荐(0)
摘要: # clean the DNScache ipconfig/flushdns #display result ipconfig /displaydns 阅读全文
posted @ 2023-03-07 11:46 wangshaodong 阅读(17) 评论(0) 推荐(0)
1 2 3 4 5 ··· 10 下一页