05 2016 档案

摘要:int转stringint n = 0;std::stringstream ss;std::string str;ss<<n;ss>>str;string转intstd::string str = "123";int n = atoi(str.c_str()); 阅读全文
posted @ 2016-05-27 17:18 盛小胖 阅读(160) 评论(0) 推荐(0)
摘要:ASCII码表 0-127 阅读全文
posted @ 2016-05-27 17:17 盛小胖 阅读(208) 评论(0) 推荐(0)
摘要:①首先将vector排序 sort( vecSrc.begin(), vecSrc.end() ); // 1,2,3,3,4,4,6,7,8,9 ②然后使用unique算法,unique返回值是重复元素的开始位置。 vector<int>::iter pos; pos = unique(ivec. 阅读全文
posted @ 2016-05-27 13:56 盛小胖 阅读(1160) 评论(0) 推荐(0)
摘要:When a table column is defined with the implicitly hidden attribute, that column is unavailable unless it is explicitly referenced. For example, if a 阅读全文
posted @ 2016-05-27 12:04 盛小胖 阅读(589) 评论(0) 推荐(0)
摘要:现已有一行数据,要复制为多行,每行只有两个字段值不同,db2 没有sql server的top关键字,本只想复制几次,然后update逐条数据,发现不行。 然后想到不如临时创建一张表B,插入此行数据,然后不断修改B再插入A. DB2复制表结构: create table table_name_new 阅读全文
posted @ 2016-05-23 17:27 盛小胖 阅读(7035) 评论(0) 推荐(0)
摘要:挺有趣的,转来记录 随着C++11标准的出现,C++标准添加了许多有用的特性,C++代码的写法也有比较多的变化。 vector是经常要使用到的std组件,对于vector的遍历,本文罗列了若干种写法。 (注:本文中代码为C++11的代码,需要在较新的编译器中编译运行) 假设有这样的一个vector: 阅读全文
posted @ 2016-05-20 14:25 盛小胖 阅读(1129) 评论(0) 推荐(0)
摘要:http://www.169it.com/article/3215620760.html http://www.cnblogs.com/sharpfeng/archive/2012/09/18/2691096.html 在C++的STL库中,要实现排序可以 通过将所有元素保存到vector中,然后通 阅读全文
posted @ 2016-05-20 14:09 盛小胖 阅读(23365) 评论(0) 推荐(1)
摘要:Use the LOAD online utility to load one or more tables of a table space. The LOAD utility loads records into the tables and builds or extends any inde 阅读全文
posted @ 2016-05-17 13:17 盛小胖 阅读(388) 评论(0) 推荐(0)
摘要:这个困扰了我两天的问题终于解决了,在运行这个job时:总是提示 一直在努力找为什么这两个DD不存在,明明是默认的好吗,加上对JCL以及主机Z不熟悉,导致一直认为这应该用的是系统配置好的data set。 直到今天下午,仔细看了描述,觉得应该是用来存放东西的,虽然有些描述看不懂,但试着自己创建了一下。 阅读全文
posted @ 2016-05-16 14:39 盛小胖 阅读(701) 评论(0) 推荐(0)
摘要:An identity column contains a unique numeric value for each row in the table. DB2® can automatically generate sequential numeric values for this colum 阅读全文
posted @ 2016-05-12 16:03 盛小胖 阅读(528) 评论(0) 推荐(0)
摘要:可以创建在任何表上的索引: Unique Index:An index that ensures that the value in a particular column or set of columns is unique. Primary index:A unique index on th 阅读全文
posted @ 2016-05-10 16:57 盛小胖 阅读(445) 评论(0) 推荐(0)
摘要:如果没有限制,这是一道很简单的题目。 但是有趣的是,要用O(1)的空间复杂度和小雨O(n2)的时间复杂度解决。 这里遇到了一个很有趣的算法:龟兔算法。 Adam:龟兔算法为什么有效: http://adam8157.info/blog/2015/08/why-does-tortoise-and-ha 阅读全文
posted @ 2016-05-10 11:44 盛小胖 阅读(202) 评论(0) 推荐(0)
摘要:题目很简单,但实现上有个新的有趣的东西: std::bitset是STL的一部分,std::bitset是一个模板类,有了它我们可以像使用数组一样使用位。 #include<bitset> std::bitset<8> bs; bs[0]=1; bs[3]=true; bs[7]=0; bitset 阅读全文
posted @ 2016-05-06 16:54 盛小胖 阅读(181) 评论(0) 推荐(0)
摘要:查看DB2版本: db2level 创建instance: 进入安装目录instance文件夹,db2icrt -u ${USR} ${USR} 由于instance多和系统用户关联,直接用系统用户名称 删除instance: db2idrop ${NAME} 列出所有instance: db2il 阅读全文
posted @ 2016-05-05 10:52 盛小胖 阅读(4102) 评论(0) 推荐(0)
摘要:Src URL:http://www.cnblogs.com/QQParadise/articles/2642677.html 阅读全文
posted @ 2016-05-04 17:06 盛小胖 阅读(232) 评论(0) 推荐(0)
摘要:Src URL:http://www.cnblogs.com/wanghonghu/archive/2012/05/25/2518604.html 1、db2可以通过SYSIBM.SYSDUMMY1、SYSIBM.DUAL获取寄存器中的值,也可以通过VALUES关键字获取寄存器中的值。 2、CURR 阅读全文
posted @ 2016-05-04 16:47 盛小胖 阅读(550) 评论(0) 推荐(0)
摘要:Src URL:http://www.linuxidc.com/Linux/2014-05/102248.htm 通常我们知道,DB2的package在统计信息或依赖对象发生变化后需要做下重新绑定,否则DB2优化器会采用效率较差或者错误的执行计划运行该 package,造成执行性能严重下降或者SP一 阅读全文
posted @ 2016-05-04 15:01 盛小胖 阅读(7641) 评论(0) 推荐(0)
摘要:Src Url:http://blog.csdn.net/cws1214/article/details/12996351 A.预编译部分 1.预编译DB2篇 1.1 什么是DB2预编译 在我们用C语言编写访问DB2的程序过程中,需要用到嵌入式SQL,其作用是将DB2 SQL混入一般C程序中, DB 阅读全文
posted @ 2016-05-04 14:45 盛小胖 阅读(2059) 评论(0) 推荐(0)
摘要:这又是一道看上去就是“我一定能做出来,但是不是有更好的方法呢”的问题。 我的第一反应是概率论里往样本中插隔板的模型,只要判断每个隔板间是不是0-255就行了,在11个空中间插3个点,是不是用循环更好些? class Solution { public: vector<string> restoreI 阅读全文
posted @ 2016-05-04 11:04 盛小胖 阅读(329) 评论(0) 推荐(0)
摘要:这是一道第一眼看到就觉得有故事的题目! 想到用穷举法,用DFS去做,但问题在于,如果数字特别大,岂不会特别慢,即使可以剪枝,剩下的还是会有大量的重复。 然后就开始试着找规律,想用数学的方法去证明,能不能采用分治法或者贪心算法把这些规律搞掉。 对于C=A+B而言,当A=B=1/2*C时,A*B的乘积最 阅读全文
posted @ 2016-05-04 10:39 盛小胖 阅读(147) 评论(0) 推荐(0)
摘要:这个题目本身来说应该算是学初级入门第一课的难度了,相信学过数组的小朋友就能解决。 比较简单的实现方式有很多,但还是考虑算法的效率问题。 但如果这样,并没有发挥C++语言强大的功能,我们可以试试STL库。 reverse (STL Samples) 所以,这道题目可以这样解决: 跑476个case,两 阅读全文
posted @ 2016-05-04 10:13 盛小胖 阅读(842) 评论(0) 推荐(0)