9 cuiyong_cn

尚未进行身份认证

暂无相关简介

等级
TA的排名 10w+

对 virtualbox 虚拟机镜像硬盘扩容

文章目录扩大容量大小使扩容生效扩大容量大小VBoxManage.exe modifyhd '/path/to/the/virtual_hard_disk' --resize 'size_in_MB'确保 VBoxManage.exe 再环境变量中找得到, 当然将路径定位到 VBoxmanage.exe 也可以.使扩容生效virtualbox 用 gparted 镜像启动, 加载扩容后...

2019-08-19 20:58:10

Fail to LSB:AppArmor

文章目录发生了什么AppArmor怎么解决发生了什么还是虚拟机 ubuntu 启动时的错误, (host win10, virtualbox). 每次都有该错误, 看着有点难受.AppArmor引用 ubuntu 的解释AppArmor is a Linux Security Module implementation of name-based mandatory access con...

2019-08-19 20:47:41

Ubuntu: a start job started by dev-disk-by

文章目录发生了什么如何解决如何获取硬盘 uuid发生了什么最近虚拟机启动 ubuntu 非常慢(host win10, virtualbox), 里面有一段错误 a start job started by dev-disk-by (1m30s). 也就是每次启动至少要多等 1m30s. 这肯定不能忍如何解决查资料得知, 这个错误大概率使因为 /etc/fstab 文件的配置有问题. 因为...

2019-08-19 20:33:07

Conert a string to lowercase in c++

文章目录Using ranged for loopusing std::for_eachusing std::transformUsing ranged for loopchar toLowerCase(char c){ if (c >= 'A' && c <= 'Z') { return c + 32; } return c;}std::stri...

2019-08-11 19:30:27

理解c++11中的static_assert

文章目录是什么?c++11之前的日子#error的问题简单的 static_assert 使用范例static_assert 相较于 #error 的优势使用范围是什么?static_assert简单来说就是在编译时进行断言判断. 如果条件不满足, 编译停止并输出指定错误信息.语法:static_assert(constant_expression, string_literal); ...

2019-08-07 23:25:45

auto_ptr vs unique_ptr

auto_ptr and unique_ptrThe new type std::unique_ptr is introduced in c++11, and supposed to be a replacement for std::auto_ptr.But think this, if it is a direct replacement, why give it a new name ...

2019-07-26 23:00:18

Call of Overloaded Function is ambiguous

error: Call of Overloaded Function is ambiguous看例子吧#include<iostream>using namespace std;int sum(int a,int b){ return a+b;}int sum(float a, float b){ return a+b;}int main(){ ...

2019-07-26 22:58:21

SIGPIPE and EPIPE

SIGPIPE and EPIPESIGPIPE 是如下情况引起的 (这里只是一个例子)grep "pattern" < reallyhugefile | headgrep 有可能会输出上百万行, 但是 head 只需要读取10行就会退出. 一旦 head 将管道的读端关闭, 那么 grep 就会获得 SIGPIPE 信号, 然后被强制退出, 使其节约资源.如果不想自己的程序因为这...

2019-07-20 22:06:17

error: invalid static_cast from type 'xxx*' to type 'yyy*'

文章目录error: invalid static_cast from type 'xxx*' to type 'yyy*'[What good is static_cast?][1]error: invalid static_cast from type ‘xxx*’ to type ‘yyy*’通常来说, static_cast 不适用于不同指针类型之间的转换, 因为它们是完全不同的两个类...

2019-07-20 21:58:08

Decorator Pattern

文章目录Decorator Pattern适用范围Decorator Pattern用图来表示适用范围动态的为单个对象实例添加新特性而不干扰其他对象实例通过子类的方式来实现拓展变得不实际的情况下...

2019-07-14 22:14:26

Bridge Pattern

文章目录Bridge Pattern使用范围Bridge Pattern一张图来展示使用范围将接口定义和实现分离接口定义和实现分辨独立扩展用户端对实现端的代码修改无感知对用户端屏蔽实现部分多个对象之间共享实现部分...

2019-07-10 22:20:57

In-class Initialization

文章目录Non-static Data Member InitializersISO C++ forbids in-class initialization of non-const static member[Why I can't initialize static data members in class?][1]C++03 9.4.2 Static data membersWhat ar...

2019-07-09 21:28:46

error: expected unqualified-id before 'xxx'

发生了什么看如下代码classA{public:voiddo(){}};这会引起GCC报错:error:expectedunqualified-idbefore'do'解释通常expectedunqualified-idbefore这个错误通常是因为语法错误引起的,如上一个语句没有用分毫结尾之类的.这个也不例外,原因就是do是关键字,...

2019-07-01 20:25:37

error 'xxx' is an inaccessible base of 'yyy'

又发生了什么看如下代码class VisibilityTest{public: virtual void doIt() { std::cout << "Base\n"; }};class DVisibilityTest : private VisibilityTest{private: virtual void doIt() override { st...

2019-07-01 20:24:13

Loki::GenScatterHierarchy

Loki::GenScatterHierarchy阅读Loki泛型库, 用图来展示Loki::GenScatterHierarchytemplate<class T>class Collection{public: std::vector<T> m_vector;};Loki::GenScatterHierarchy<MakeTypelist&...

2019-06-30 22:07:56

Abstract Factory Pattern

Abstract Factory Pattern图比语言好使适用范围将对象的创建, 组合和表示方式从系统中独立出来系统需要多种的一类对象相关的对象需要一起的使用, 可以用该方式来进行限制需要对外提供库支持, 但只想暴露接口不想暴露实现...

2019-06-29 23:00:24

How to unit test a method that has void as return type

转 How to unit test a method that has void as return typeHow to unit test a method that has void as return typeHow do I test a method that returns void? For example a method like this.void Foo::Proc...

2019-06-27 21:46:24

inline functin vs #define

Why should I use inline functions instead of plain old #define macros?Unlike #define macros, inline functions avoid infamous macro errors since inline functions always evaluate every argument exactly...

2019-06-26 22:49:51

difference between 'typedef' and 'using' in C++11

文章目录What is the difference between 'typedef' and 'using' in C++11Interesting pointsConclusionWhat is the difference between ‘typedef’ and ‘using’ in C++11Apart from ‘using’ can be used within templa...

2019-06-26 22:47:37

Name mangling in C++

文章目录Name mangling in C++Name mangling in C++Mangling is simply how the compiler keeps the linker happy.In C, you can’t have two functions with the same name, no matter what. So that’s what the link...

2019-06-24 21:18:17

查看更多

勋章 我的勋章
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv2
    勤写标兵Lv2
    授予每个自然周发布4篇到6篇原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。