搭建博客踩坑合集
踩坑 访问 http://localhost:4000/ ,页面显示extends includes/layout.pug block content include ./includes/mixins/indexPostUI.pug +indexPostUI 。需要安装运行` 1npm install hexo-renderer-pug hexo-renderer-stylus --save butterfly官方文档 Butterfly 文檔(二) 主題頁面 | Butterfly 关于hexo-d时spawn-failed参考链接 [最全]解决将Hexo部署到GitHub时报错:Error: Spawn failed_hexo无法部署到github-CSDN博客 但是,个人觉得==网络问题==,最好的办法5min再来吧 hexo g 以及hexo 是卡住 12taskkill /F /IM node.exe 如何解决ssh: connect to host github.com port 22: Connection...
构造函数的初始化列表
构造函数的初始化列表123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657//增加日期,CDate类是CGoods商品信息的一部分class CDate{ public: CDate(int y,int m,int d): //没有默认构造函数了 { _year=y; _month=m; _day=d; } void show() { cout<<_year<<"/"<<month<<"/"<<_day<<endl; } private: int _year,_month,_day;}//CDate没有合适的默认构造函数可用class...
二分查找
二分查找 leetcode 704 vector 需要头文件 include vector& nums nums 是 vector 类型对象的引用知道数组长度 nums.size() 题目给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target ,写一个函数搜索 nums 中的 target,如果目标值存在返回下标,否则返回 -1。 示例 1: 输入: nums = [-1,0,3,5,9,12], target = 9输出: 4解释: 9 出现在 nums 中并且下标为 4示例 2: 输入: nums = [-1,0,3,5,9,12], target = 2输出: -1解释: 2 不存在 nums 中因此返回 -1提示: 你可以假设 nums 中的所有元素是不重复的。n 将在 [1, 10000]之间。nums 的每个元素都将在 [-9999, 9999]之间。 解法暴力解1234567891011121314151617class Solution {public: int n; ...
对象的浅拷贝和深拷贝
对象的浅拷贝和深拷贝一个类有多个对象,共享一套成员方法成员方法如何知道操作哪个对象?成员方法一经编译,方法参数前面添加一个this指针 堆stack 栈heap? 局部变量放栈上 new delete等动态分配在堆上,堆就是一个动态分配的内存区域 全局变量 放数据段,生命周期为整个程序的开始到结束 1234567891011int main(){ SeqStack s; //无参数,默认构造默认析构 SeqStack s1(10); SeqStack s2=s1; //拷贝构造,内存拷贝, //浅拷贝 //s1析构出错 //等同SeqStack s3(s1);} s2析构先将地址释放,s1析构失败 对象默认的拷贝构造,(浅拷贝)是内存的数据拷贝关键是对象若占用外部资源(指针指向外部内存),那么浅拷贝出现问题因此,应该做深拷贝,为新对象也分配内存,再把内存数据拷贝过去,不能用默认的拷贝构造函数 1234567891011121314//需要自定义拷贝构造函数,深拷贝SeqStack(const...
搭建服务器博客
把自己的博客部署在服务器上 画69买了一年,第一次买服务器。。。应该不会踩坑吧,但愿! 傻逼服务器,我感觉是腾讯云装的Ubuntu有问题,yum命令死活用不了,换成centos就好了。。。(25年2/16补充,yum是centos的,ubuntu是sudo apt install那一套) 参考https://lneverl.github.io/posts/2092ec56.htmlb站也有视频讲解很赞 预备软件:1. Xshell(这个无所谓,在命令行隶属都行) 2. WinSCP(这个最好下一下,可视化linux文件目录,也可以直接修改里面的文件,不用vim) 1. 开始安装nginx 安装ngin需要相关的依赖库,我们先进行库的安装。 1.1 安装gcc gcc-c++ 12yum install -y gcc gcc-c++ 1.2 安装PCRE库 1234567891011121314cd /usr/local/ wget...
安装SDN网络数据中心环境
失败安装1. 虚拟机ubuntu16.04https://blog.csdn.net/trackxiaoxin321/article/details/115591796 http://mirrors.ustc.edu.cn/ubuntu-releases/16.04/ desktop 分配cpu一般为本机一半 主机与ubuntu之间复制粘贴sudo apt-get install open-vm-tools-desktop -y重启2. 配置mininet12345678910sudo passwd rootsu rootapt-get install gitgit clone https://github.com/mininet/mininet.gitcd mininetcd util./install.sh -n3vmn // 测试pingallexit 3. RYU安装12345678910111213141516171819202122wget...
redraft相关
rlcraft附魔毒火 法爆 弓 mc调gamma值版本文件夹下option.txt
new,malloc,free,delete
malloc,free;new,delete**malloc和free是c的库函数new和delete是运算符1234567891011121314151617181920212223242526272829303132333435363738394041int main(){int *p=(int*)malloc(sizeof(int)); //开辟一个整型大小的内存//malloc的返回值为void*,(int*)为强制转换,按字节开辟if(p==nullptr) //内存开辟失败,p为空指针{return -1;}//malloc只管开辟,还需要初始化*p=20;free(p); //malloc和free是c的库函数try{int *pl=new int(20);}catch(const bad_alloc &e){}delete p1; //...