- 博客(1)
- 资源 (4)
- 收藏
- 关注
原创 Linux下find命令——根据文件的大小查找(带截图)
最近在学习Linux下命令,偶尔发现网上不少对于find -size命令的解释都是错误的。比如查找当前目录下文件大小小于1k的文件:find . -size -1k (这是错误的),你会发现什么都找不到。接下来的说明都是在ubuntu的虚拟机下做的。
2017-08-28 14:17:20
22705
4
提问的智慧
这是我自己把网上的下下来重新排版过的,还加了两种思维图和文中提到的那篇《如何有效的报告Bug》,都在附录中。
目录如下
声明 3
简介 3
在提问之前 4
当你提问时 5
慎选提问的论坛 5
Stack Overflow 6
网站和IRC论坛 6
第二步,使用项目邮件列表 7
使用有意义且描述明确的标题 7
使问题容易回复 8
用清晰、正确、精准并语法正确的语句 8
使用易于读取且标准的文件格式发送问题 9
精确的描述问题并言之有物 10
话不在多而在精 10
别动辄声称找到Bug 10
可以低声下气,但还是要先做功课 11
描述问题症状而非猜测 11
按发生时间先后列出问题症状 12
描述目标而不是过程 12
别要求使用私人电邮回复 12
清楚明确的表达你的问题以及需求 12
询问有关代码的问题时 13
别把自己家庭作业的问题贴上来 13
去掉无意义的提问句 14
即使你很急也不要在标题写紧急 14
礼多人不怪,而且有时还很有帮助 14
问题解决后,加个简短的补充说明 14
如何解读答案 15
RTFM和STFW:如何知道你已完全搞砸了 15
如果还是搞不懂 16
处理无礼的回应 16
如何避免扮演失败者 16
不该问的问题 17
好问题与蠢问题 18
如果得不到回答 19
如何更好地回答问题 20
相关资源 21
附录 21
思维图1 21
思维图2 22
《如何有效地报告Bug》 23
2017-09-06
Google C++编程规范
目录
一、头文件....................................................................................................................................4
1. #define的保护....................................................................................................................... 4
2. 头文件依赖.......................................................................................................................... 4
3. 内联函数.............................................................................................................................. 5
4. -inl.h文件.......................................................................................................................... 5
5. 函数参数顺序(Function Parameter Ordering)............................................5
6. 包含文件的名称及次序......................................................................................................6
二、作用域....................................................................................................................................7
1. 命名空间(Namespaces)..........................................................................................7
2. 嵌套类(Nested Class)............................................................................................. 9
3. 非成员函数(Nonmember)、静态成员函数(Static Member)和全局函
数(Global Functions)...................................................................................................9
4. 局部变量(Local Variables)..................................................................................10
5. 全局变量(Global Variables)............................................................................... 10
三、类..........................................................................................................................................11
1. 构造函数(Constructor)的职责..............................................................................11
2. 默认构造函数(Default Constructors)............................................................. 12
3. 明确的构造函数(Explicit Constructors).........................................................12
4. 拷贝构造函数(Copy Constructors)...................................................................13
5. 结构体和类(Structs vs. Classes)......................................................................14
6. 继承(Inheritance)..................................................................................................14
7. 多重继承(Multiple Inheritance)...................................................................... 15
8. 接口(Interface)....................................................................................................... 15
9. 操作符重载(Operator Overloading)...............................................................16
10. 存取控制(Access Control)................................................................................16
11. 声明次序(Declaration Order).........................................................................17
12. 编写短小函数(Write Short Functions)........................................................17
四、Google特有的风情.......................................................................................................... 18
1. 智能指针(Smart Pointers).................................................................................. 18
五、其他C++特性.....................................................................................................................19
1. 引用参数(Reference Arguments)...................................................................19
2. 函数重载(Function Overloading)....................................................................19
3. 缺省参数(Default Arguments)......................................................................... 20
4. 变长数组和alloca(Variable-Length Arrays and alloca())................ 20
5. 友元(Friends)............................................................................................................20
6. 异常(Exceptions)....................................................................................................20
7. 运行时类型识别(Run-Time Type Information, RTTI)........................... 22
8. 类型转换(Casting)................................................................................................... 22
9. 流(Streams)..............................................................................................................23
10. 前置自增和自减(Preincrement and Predecrement)............................24
11. const的使用(Use of const).............................................................................24
12. 整型(Integer Types)..........................................................................................25
13. 64位下的可移植性(64-bit Portability)........................................................ 26
14. 预处理宏(Preprocessor Macros)..................................................................27
15. 0和NULL(0 and NULL)....................................................................................27
16. sizeof(sizeof)........................................................................................................28
17. Boost库(Boost)................................................................................................... 28
六、命名约定..............................................................................................................................29
1. 通用命名规则(General Naming Rules)..........................................................29
2. 文件命名(File Names)........................................................................................... 30
3. 类型命名(Type Names).........................................................................................31
4. 变量命名(Variable Names).................................................................................31
5. 常量命名(Constant Names)............................................................................... 31
6. 函数命名(Function Names)................................................................................32
7. 命名空间(Namespace Names)......................................................................... 32
8. 枚举命名(Enumerator Names).........................................................................32
9. 宏命名(Macro Names)..........................................................................................33
10. 命名规则例外(Exceptions to Naming Rules)..........................................33
七、注释......................................................................................................................................34
1. 注释风格(Comment Style)..................................................................................34
2. 文件注释(File Comments)...................................................................................34
3. 类注释(Class Comments)...................................................................................34
4. 函数注释(Function Comments)....................................................................... 35
5. 变量注释(Variable Comments)........................................................................36
6. 实现注释(Implementation Comments)...................................................... 37
7. 标点、拼写和语法(Punctuation, Spelling and Grammar)................... 38
8. TODO注释(TODO Comments).........................................................................38
八、格式......................................................................................................................................39
1. 行长度(Line Length)..............................................................................................39
2. 非 ASCII字符(Non-ASCII Characters)..........................................................40
3. 空格还是制表位(Spaces vs. Tabs).................................................................... 40
4. 函数声明与定义(Function Declarations and Definitions)...................40
5. 函数调用(Function Calls).................................................................................... 42
6. 条件语句(Conditionals)........................................................................................43
7. 循环和开关选择语句(Loops and Switch Statements).............................44
8. 指针和引用表达式(Pointers and Reference Expressions)...................45
9. 布尔表达式(Boolean Expressions)................................................................. 46
10. 函数返回值(Return Values)............................................................................. 46
11. 变量及数组初始化(Variable and Array Initialization)........................ 46
12. 预处理指令(Preprocessor Directives)....................................................... 46
13. 类格式(Class Format)........................................................................................47
14. 初始化列表(Initializer Lists)...........................................................................48
15. 命名空间格式化(Namespace Formatting).................................................48
16. 水平留白(Horizontal Whitespace).............................................................. 49
17. 垂直留白(Vertical Whitespace).................................................................... 50
九、规则之例外..........................................................................................................................52
1. 现有不统一代码(Existing Non-conformant Code)...................................52
2. Windows代码(Windows Code)......................................................................52
十、团队合作..............................................................................................................................53
2017-09-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人