摘要: 参见的 slide 介绍:thesecretlivesofdata 上述 slide 结合下面 blog 一起看 Raft概述 阅读全文
posted @ 2021-01-11 13:37 sinpo828 阅读(91) 评论(0) 推荐(0) 编辑
摘要: C++智能指针 auto_ptr 不支持数组,因为删除器调用的 delete不是delete [] 不支持循环引用,需要用 shared_ptr 和 weak_ptr 所有权问题,发生所有权转移后(=操作或者作为参数等),原指针将被 reset,再次使用原指针的操作会导致崩溃 class Base 阅读全文
posted @ 2020-12-23 14:48 sinpo828 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 左值(lvalue, left value),顾名思义就是赋值符号左边的值。准确来说, 左值是表达式(不一定是赋值表达式)后依然存在的持久对象。 右值(rvalue, right value),右边的值,是指表达式结束后就不再存在的临时对象。 C++11 中为了引入强大的右值引用,将右值的概念进行了 阅读全文
posted @ 2020-12-22 13:37 sinpo828 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 前言 经常会有这种问题: 1.一个100万的无序数组,在接近复杂度内找到其中位数。 2.一个100万的无序数组,找到其第 K 大的数。 这种问题最常见,也最经常被问到!也有很多对应的解决方法。这里给出一种用快排来解决问题的方法! 快排 快排的性能在所有排序算法里面是最好的,数据规模越大快速排序的性能 阅读全文
posted @ 2020-12-16 13:29 sinpo828 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 之前写了一篇 QEMU User 模式运行 mips 程序的随笔。进体内再来补充下,如何使用 QEMU system 模式运行 Arm64 的系统。 QEMU 环境 略,直接 apt、dnf、pacman 搜索安装下就行。注意需要安装 qemu-arch-extra。 系统镜像 https://mi 阅读全文
posted @ 2020-12-11 22:13 sinpo828 阅读(2475) 评论(0) 推荐(0) 编辑
摘要: 前述 改博文使用的是 iptables 来做端口映射。如果使用的系统是 Centos/Redhat/Fedora 那么需要关闭 firewalld 服务才能成功。 firewall 与 iptables 两个防火墙的关系,请自行百度。 打开 IP 转发 打开 IP 转发(路由器设备是默认打开的),必 阅读全文
posted @ 2020-12-08 17:36 sinpo828 阅读(9940) 评论(0) 推荐(0) 编辑
摘要: 查看文件信息 ➜ Wdir fdisk -l ../Downloads/openwrt-19.07.4-x86-generic-combined-ext4.img Disk ../Downloads/openwrt-19.07.4-x86-generic-combined-ext4.img:272. 阅读全文
posted @ 2020-12-03 16:12 sinpo828 阅读(2601) 评论(0) 推荐(0) 编辑
摘要: 很简单修改 /etc/config/firewall,添加如下 config rule # allow web option name Allow-wan-80 option target ACCEPT option dest_port 80 option proto tcp option src 阅读全文
posted @ 2020-12-03 12:47 sinpo828 阅读(1317) 评论(0) 推荐(0) 编辑
摘要: 配置 修改 /etc/config/dhcp config dhcp 'lan' option interface 'lan' option start '100' option limit '150' option leasetime '12h' option ra_management '1' 阅读全文
posted @ 2020-10-29 21:59 sinpo828 阅读(4342) 评论(0) 推荐(0) 编辑
摘要: 摘要 关键字: qemu mips 前述 QEMU是一个处理器模拟软件,可以用来在PC中模拟ARM、MIPS等多种架构的软硬件运行环境。QEMU主要有两种模拟模式: System Mode System模式中,它可以虚拟多种CPU架构的虚拟计算机系统,比如可以在x86 的 Ubuntu系统中虚拟出一 阅读全文
posted @ 2020-09-15 18:00 sinpo828 阅读(2351) 评论(0) 推荐(1) 编辑