解决Hexo插入图片失败问题
解决Hexo插入图片失败问题
第一步:安装插件在hexo根目录下打开cmd或Git Bash,执行:
$ npm install hexo-asset-image --save
第二步:配置hexo
打开hexo根目录下的配置文件_config.yml,找到post_asset_folder,将其值由false修改为true
打开/node_modules/hexo-asset-image/index.js,将其内容替换为以下内容:
'use strict';var cheerio = require('cheerio');// http://stackoverflow.com/questions/14480345/how-to-get-the-nth-occurrence-in-a-stringfunction getPosition(str, m, i) { return str.split(m, i).join(m).length;}var version = String(hexo.version).spli ...
Codeggs的常用命令
Git
将本地新建的项目提交到远程仓库
git init初始化本地仓库
git add .将工作目录内容添加至暂存区
git commit -m "first commit"将暂存区添加至本地仓库
git push -u https://github.com master将本地仓库内容push到远程仓库
Hexo
hexo cl清空缓存
hexo g编译
hexo s启动本地服务
hexo d上传到远程仓库
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post$ hexo new "My New Post"
More info: Writing
Run server$ hexo server
More info: Server
Generate static files$ hexo generate
More info: Generating
Deploy to remote sites$ hexo deploy
More info: Deployment
继承球体和圆柱体
编写程序,定义抽象基类Container,由此派生出2个派生类球体类Sphere,圆柱体类Cylinder,分别用虚函数分别计算表面积和体积。(不要更改主程序)
题目:
编写程序,定义抽象基类Container,由此派生出2个派生类球体类Sphere,圆柱体类Cylinder,分别用虚函数分别计算表面积和体积。(不要更改主程序)
int main(){Container *ptr;Sphere s(5);ptr=&s;cout<<"The area of sphere is "<<ptr->area()<<endl;cout<<"The colume of sphere is "<<ptr->volume()<<endl;Cylinder c(3,7);ptr=&c;cout<<"The area of cylinder is "<<ptr->area()<<endl;c ...
时间类TIME
题目:
设计一个时钟类TIME,内含数据成员hour,minute,second表示时间,成员函数set( )设置时间数据,show( )显示时间数据。
重载运算符 ++和– (具有返回值),每执行一次++,second自增1,执行一次–,second自减1。
second和minute的值在0 ~ 59区间循环(满59后再自增则归0,minute加1;second为0时再自减则为59,minute减1)。hour的值在0 ~ 23区间循环。
参考:
#include <iostream>using namespace std;class TIME {private: int hour; int minute; int second; TIME ruler(void); //用于规范时间的格式,public: TIME(); TIME(int, int, int); void sethour(int); void setminute(int); void setsecond(int); TIME operator++(); TIME operator++(i ...
成员函数对Point类重载"++"运算符
题目:
定义Point类,有坐标x,y两个成员变量,利用成员函数对Point类重载“++”运算符,实现对坐标值的改变。具体要求如下:
(1) 编写程序定义Point类,在类中定义整型的私有成员变量x,y;
(2) 定义成员函数Point& operator++(); Point operator++(int);以实现对Point类重载“++”运算符,分别重载前置++和后置++;
(3) 编写主函数测试。
参考:
#include <iostream>using namespace std;class Point {private: double x; double y;public: Point(double X = 0, double Y = 0) :x(X), y(Y) {} Point operator++(); Point operator++(int); void print(); };Point Point::operator++() { ++ ...
利用友元函数对Point类重载“++”运算符
题目:
定义Point类,有坐标x,y两个成员变量,利用友元函数对Point类重载“++”运算符,实现对坐标值的改变。具体要求如下:
(1) 编写程序定义Point类,在类中定义整型的私有成员变量x,y;
(2) 在类中定义两个友元函数,分别重载前置++和后置++;
(3) 编写主函数测试。主函数如下,不能更改。
主函数如下:
int main(){Point a(1,2);a++;a.print();Point b;b=++a;b.print();a.print();return 0;}
参考
#include <iostream>using namespace std;class Point {public: Point(int X , int Y ); friend Point operator++(Point& p); friend Point operator++(Point& p, int); void print(void);private: int x; int y;};Point::P ...
用函数模板求最大值
题目:
完善如下代码,实现complex类,在主程序中调用模板函数max比较两个复数大小(复数大小比较规则是复数实部和虚部的平方和,即realreal+imagimag,平方和大的复数较大)。注意不要修改主程序.
#include <iostream>using namespace std;template <typename T>T Max(T x,T y){return (x>y)?x:y; }class complex{double real,imag;public:};int main(){int i1=2,i2=3;cout<<"Max of i1 and i2 is <<Max(i1,i2)<<endl;complex a1(2,3),a2(1,2),a3;cout<<"a1=";a1.print();cout<<"a2=";a2.print();a3=Max(a1,a2);cout&l ...
模板
以后的题目和参考就写到这里啦!
title: 模板date: 2021年4月25日23:56:55categories:
程序设计——TUT版专栏
Problem Record
tags:
模板
Hexo
author: 邱智录CodeEggs
headtitle: 文章标题
date:
categories:
程序设计——TUT版专栏
Problem Record
面试经历与复盘
前端面经
ToolBox
tags:
模板
Hexo
C++
Java
HTML
CSS
JavaScript
Linux
Git
Hexo常用命令hexo cl //清空缓存hexo g //编译hexo s //启动本地服务(可在localhost:4000浏览访问)hexo d //上传到外部仓库hexo n //在source/_posts中生成新文章
Problem Record 模板
项目场景
问题描述
原因分析
解决方案
数学公式:
VS E0289 没有与参数列表匹配的参数“XX::XX”实例
项目场景创建学生类,在通过构造函数创建对象后,编译器(vs2019)报错
#include <iostream>using namespace std;class S {private: int m_id; char* m_name;public: S(int id, char* name); void show(void);};S::S(int id=1, char* name) { m_id = id; m_name = name;}void S::show(void){ cout << m_name << m_id << endl;}int main(void) { S s(2, "abab"); s.show(); return 0;}
问题描述这个错误会在vs2019中报错,但是在Dev C++中不会报错。
原因分析vs2019对语法的要求更加严格了,在通过引用传递数组的时候必须添加const关键字。const char* ...