码迷,mamicode.com
首页 >  
搜索关键字:count    ( 18169个结果
memcpy的初次认识与理解
#include<stdio.h>#include<assert.h>#include<stdlib.h>//模拟memcpyvoidmy_momcpy(char*dest,constchar*str,intcount){assert(dest!=NULL);assert(str!=NULL);char*ret=dest;inti=0;for(i=0;i<count;i++){*dest++=*str++;}}intmain(){chara[100]="abcde..
分类:其他好文   时间:2015-09-10 17:46:33    阅读次数:198
Javascript 中的闭包和引用
Javascript中一个最重要的特性就是闭包的使用。因为闭包的使用,当前作用域总可以访问外部的作用域。因为Javascript没有块级作用域,只有函数作用域,所以闭包的使用与函数是紧密相关的。模拟私有变量function Counter(start) { var count = start;...
分类:编程语言   时间:2015-09-10 17:22:56    阅读次数:161
mysql 分组之后统计记录条数
selectcount(*)from表名groupbyid 得到的结果如下你会很神奇的发现你获取的不是总条数,而是每个组的条数,这很有作用,但是如果你要获取总条数的话就会很麻烦select count(*)from(selectcount(*)from表名groupbyid) a 得到的结果是:
分类:数据库   时间:2015-09-10 12:53:20    阅读次数:208
增加Swap内存
增加12G的Swap内存命令如下:dd if=/dev/zero of=/swap/tmpswap bs=1M count=12000chmod 600 tmpswap#这步是对划出来的硬盘进行格式化/sbin/mkswap /swap/tmpswap#启动swap空间/sbin/swapon /s...
分类:其他好文   时间:2015-09-10 09:38:31    阅读次数:181
B树索引和位图索引的区别!
B树索引主键和唯一性约束字段的B树索引,效率几乎和海量数据没有关系。键值重复率低的字段比较适合使用B树索引。位图索引键值重复率高的字段比较适合使用位图索引。count、and、or、in这些特定的操作更适合位图索引。DML操作比较多的表不适合使用位图索引。复合索引在where条件中必须带驱动列,复合...
分类:其他好文   时间:2015-09-10 00:14:56    阅读次数:286
c++机试整理
#includeusing namespace std;int taoZi(int m);int sum(int m);int main(){ cout<<sum(4); return 0;} int taoZi(int m){ int count=1; in...
分类:编程语言   时间:2015-09-09 21:27:10    阅读次数:221
机试题及答案整理
#includeusing namespace std;int taoZi(int m);int sum(int m);int main(){ cout<<sum(4); return 0;} int taoZi(int m){ int count=1; in...
分类:其他好文   时间:2015-09-09 21:26:45    阅读次数:149
转 :asp教程.net c#数组遍历、排序、删除元素、插入、随机元素 数组遍历
asp教程.net c#数组遍历、排序、删除元素、插入、随机元素数组遍历short[] sts={0,1,100,200};for(int i=0;i50){ ..... }}数组随机元素public hashtable noorder(int count) { arraylist mylist =...
分类:编程语言   时间:2015-09-09 21:14:56    阅读次数:231
c++11 输出时间
C++11中输出当前时间最直接的方法:std::time_t t2 = std::time(nullptr);cout (ms).count();auto const msecs = diff % 1000;std::time_t t = system_clock::to_time_t(n1);co...
分类:编程语言   时间:2015-09-09 21:04:55    阅读次数:221
std::weak_ptr 每次 lock() 都会导致自身use_count自增一次
代码: #include <memory> #include <iostream> int main(int argc, char*argv[]){ ? ? std::shared_ptr<int> a(new int(1)); ? ? std::weak_ptr<int>d(a); ? ? std::cout<<"d.use_count() = "<<d.use_cou...
分类:其他好文   时间:2015-09-09 19:53:59    阅读次数:211
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!