摘要: 本方法适合NAT模式,其他模式没测试。 第一步:打开VM,执行 ip address(或ifconfig)记住虚拟机的Mac地址。 第二步:在宿主机打开 C:\ProgramData\VMware\vmnetdhcp.conf 在文件最后加上 host MyVM { hardware etherne 阅读全文
posted @ 2022-06-24 10:25 BinarySong 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 解决调试器无法正常显示Qt类型的问题(QString,QList等) 本方法适用于gdb。如果你的IDE使用的是gdb(MinGW),那么也应该是支持的。 本方法适合Windows平台。 第一步:下载 qt5printers https://github.com/Lekensteyn/qt5prin 阅读全文
posted @ 2022-06-10 15:24 BinarySong 阅读(659) 评论(0) 推荐(0) 编辑
摘要: MinGW 工具链 获取 MinGW CLion 自带 MinGW,但只能编译64位程序,如果需要编译32位程序,可以去自己下载 MSYS2。在另一篇博客中可以找到下载安装教程。 下面的教程假设你自己在 D:/MSYS2 安装了 MSYS2 (用自带的也是同理) 添加 toolchain 按照下图设 阅读全文
posted @ 2022-05-13 17:38 BinarySong 阅读(1376) 评论(0) 推荐(0) 编辑
摘要: 去https://www.msys2.org/下载安装新版MSYS2 在开始菜单会多出几个程序,我们用下面2个就行了: 在x64版(蓝色)运行: pacman -Syu pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw-w6 阅读全文
posted @ 2022-05-13 15:38 BinarySong 阅读(954) 评论(0) 推荐(0) 编辑
摘要: int main() { QPushButton quit("Quit"); QWidget window; quit.setParent(&window); //double free! ... } 解决方案:子对象都用new,不要用栈对象 阅读全文
posted @ 2022-05-08 20:40 BinarySong 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 如何ssh连接VMWare虚拟机(0废话) VMWare 虚拟网卡配置 在 VMWare Workstation 中: 右键虚拟机 → 设置 → 网络适配器 → 选择 NAT 模式 安装 openssh 在 虚拟机 中执行: sudo apt install openssh-client opens 阅读全文
posted @ 2022-05-07 22:47 BinarySong 阅读(4167) 评论(1) 推荐(1) 编辑
摘要: 信息量 事件A发生的信息量: \[ I(A) = -\log_2(P(A)) \] 这样定义有以下好处: 概率越小的事件发生,带来的信息量就越大。 相互独立的事件A,B同时发生,信息量为A、B单独发生时信息量的和: \[ \begin{align} I(AB) =&& -\log_2(P(AB)) 阅读全文
posted @ 2022-02-15 00:34 BinarySong 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 解决方案: 手动生成compile_commands.json: xmake project -k compile_commands 然后把它拷贝到.vscode中即可。 c_cpp_properties.json(参考) { "configurations": [ { "compileComman 阅读全文
posted @ 2021-08-10 00:20 BinarySong 阅读(299) 评论(0) 推荐(0) 编辑
摘要: target_include_directories()从PRIVATE改成PUBLIC即可 阅读全文
posted @ 2021-07-14 15:00 BinarySong 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 第三章 5. 汉诺塔问题 解: // 从a经过b移动n个盘子到c void hanoi(int n, int a, int b, int c) { hanoi(n-1, a, c, b); print(f"从{a}移1个到{c}"); hanoi(n-1, b, a, c); } 6. 整数分划问题 阅读全文
posted @ 2021-06-25 23:26 BinarySong 阅读(150) 评论(0) 推荐(0) 编辑