- 博客(11)
- 收藏
- 关注
原创 C++11类(2)构造,清理,复制,移动 Construction, Cleanup, Copy, and Move
Reference:The C++ Programming Language 4th edition (Bjarne Stroustrup)先来看一个简单的例子string ident(string arg) { return arg;}int main (){ string s1 {"Adams"}; s1 = indet(s1); str
2015-05-12 06:40:05 1242
原创 C++11类(1) 基础技巧 Class Basic
Reference:The C++ Programming Language 4th edition (Bjarne Stroustrup)1.explicit构造函数单参数的构造函数会默认作为参数类型到此类类型隐式类型转换,在许多情况下这种隐式的类型转换很有可能导致错误幸运的是,我们可以用explicit关键字显示声明构造函数(并不必须是单参数)不用作隐式的类型转换struc
2015-05-11 10:07:16 547
原创 C++标准库——字符串(Standard library: String)
Reference:The C++ Programming Language 4th edition (Bjarne Stroustrup)1.字符分类(Character Classification)#include isspace(c) //' ', '\t', '\n', '\v', '\f', '\r'isalpha(c) //'a'..'z', 'A..Z'is
2015-05-10 08:17:58 1528
原创 SQL技巧(4)分组的定义和性质
(Molinaro-SQL cookbook笔记)给部门10的员工分组,且返回组中成员数,最高工资和最低工资select deptno, count(*) as cnt, max(sal) as hi_sal, min(sal) as lo_salfrom empwhere deptno = 10group by deptnoSQL组的定义把SQL组定义为(G, e),其
2015-05-10 00:42:06 571
原创 SQL技巧(3)多表操作
(Molinaro-SQL cookbook笔记)1. 记录叠加叠加的表不必有相同的关键字,但是对对应列的数据类型必须相同。select ename as ename_and_dname, deptnofrom empwhere deptno = 10union allselect '--------------', nullfrom t1union allselec
2015-05-08 13:12:46 581
原创 SQL技巧(2) 查询结果排序
(Molinaro-SQL cookbook笔记)1. 以指定次序返回结果select ename, job, salfrom empwhere deptno = 10order by sal ascORDER BY默认以升序方式排序ASC 升序DESC 降序ORDER BY中可以指定列编号,从1 开始, 从左到右依次对应SELECT中各个属性2. 按
2015-05-08 12:49:39 1171
原创 SQL技巧(1)检索记录
(Molinaro-SQL cookbook笔记)1.检索所有列和行(*匹配所有列)select *from empBetter style:select empno, ename, job, sal, mgr, hiredate, comm, deptnofrom emp两者性能相同,但列出所有列的名称提高了可读性。2.检索满足条件的行多数厂
2015-05-08 09:03:10 452
翻译 Linux下调试——GDB新手教程
原文链接:http://www.cprogramming.com/gdb.html作者:Manasij Mukherjee 一个好的调试软件是一个程序猿的工具箱里最重要的工具之一,在UNIX或Linux系统中,GDB(GUN debugger)是一个雄壮而流行的调试工具,它让你可以对在GDB下运行的程序做任何你爱做的事情。我应该读这篇文章吗?
2014-12-12 21:37:15 6743
原创 后继指针取代父指针的二叉搜索树
(如有错漏,欢迎指正)算法导论,第三版(Introduction to Algorithms, CLRS, 3rd edition)第十二章二叉搜索树(binary search tree)课后有这么一道练习题:Exercises 12.3-5Suppose that instead of each node x keeping the attribute x.p, poin
2014-12-12 09:00:49 1902 1
原创 linux(ubuntu)常用命令(2)
Ctrl + l:终端清屏Ctrl + d:关闭终端Ctrl + Shift + c: 终端中复制Ctrl + Shift + v: 终端中粘贴Ctrl + a:终端中跳转到行首Ctrl + e:终端中跳转到行尾Ctrl + k :从光标处删除到行尾 Ctrl + w - 删除最后一个单词/参数文件权限权限分类r:reading
2014-12-11 22:27:53 376
原创 linux(ubuntu)常用命令(1)
man + 命令 :显示命令手册文档echo:显示一行文本echo this is a testecho *echo ~文件系统跳转绝对路径start with "/ "(根目录): /home /user相对路径 . 当前目录 . . 当前目录父目录 :./userpwd: 显示当前目录ls:显示当前目录内容cd + 路径:跳
2014-12-11 11:58:18 416
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人