码迷,mamicode.com
首页 >  
搜索关键字:count    ( 18169个结果
[C/C++标准库]_[初级]_[如何实现std::string自己的Format(sprintf)函数]
场景: 1. C语言有自己的sprintf函数,但是这个函数有个缺点,就是不知道需要创建多大的buffer, 这时候可以使用snprintf函数来计算大小,只要参数 buffer为NULL, count为0即可. 2. 这里实现std::string自己的sprintf也是用了snprintf的特性,先计算大小,再创建空间,之后存入std::string. 3. 还使用了C的可变参数特性....
分类:编程语言   时间:2015-07-01 12:21:10    阅读次数:149
mongodb数据库简单类
selectDb("test_db"); * 创建索引 * $mongo->ensureIndex("test_table", array("id"=>1), array('unique'=>true)); * 获取表的记录 * $mongo->count("test_table")...
分类:数据库   时间:2015-07-01 11:36:24    阅读次数:196
【C语言】统计一个数二进制中1的个数
//统计一个数二进制中1的个数 #include int count_one(int num) { int count = 0; while (num) { count++; num = num&(num - 1); //每次消去最后面的一个1,直至没有 } return count; } int main() { printf("%d\n", count_one(12)...
分类:编程语言   时间:2015-07-01 10:02:35    阅读次数:142
model转字典
+(NSDictionary*)entityToDictionary:(id)entity{Classclazz=[entityclass];u_intcount;objc_property_t*properties=class_copyPropertyList(clazz,&count);NSMutableArray*propertyArray=[NSMutableArrayarrayWithCapacity:count];NSMutableArray*valueArray=[NSMutableAr..
分类:其他好文   时间:2015-07-01 06:24:28    阅读次数:111
Redis 笔记与总结8 PHP + Redis 信息管理系统(分页+好友关注)
分页要对列表页进行分页,需要知道:①用户总数 $count② 页大小 $pageSize:用户自定义③ 当前页:$page:GET 方式获取 ④ 总页数:$pageCount = ceil($count / $pageSize)关键是用户总数 $count 的获取:可以采取的方案是,在用户注册时,....
分类:Web程序   时间:2015-07-01 00:55:25    阅读次数:164
mysql查找重复
??? ? ?? ??SELECT ???, count(*) FROM ???? GROUP BY ???mysql> SELECT t1, count(*) FROM test GROUP BY t1??? ??? n? ??? ? ??SELECT ???, count(*) as ??? F...
分类:数据库   时间:2015-06-30 20:17:02    阅读次数:167
字符串string
string.count(str, beg=0, end=len(string))#返回 str 在 string 里面出现的次数,如果 beg 或者 end 指定则返回指定范围内 str 出现的次数 string.endswith(obj, beg=0, end=len(string))#检...
分类:其他好文   时间:2015-06-30 19:57:55    阅读次数:81
8086CPU寄存器简介
8086CPU中寄存器总共为14个,且均为16位。即AX,BX,CX,DX,SP,BP,SI,DI,IP,FLAG,CS,DS,SS,ES共14个。通用寄存器:AX,BX,CX,DX称作为数据寄存器:AX(Accumulator):累加寄存器,也称之为累加器;BX(Base):基地址寄存器;CX(Count):计数器寄存器;DX(Date):数据寄存器;SP和BP又..
分类:其他好文   时间:2015-06-30 18:48:41    阅读次数:181
【C语言】求两个数中不同的位的个数
//求两个数中不同的位的个数 #include int count_different(int a, int b) { int count = 0; int c = a^b; //a,b中不同的位即为1 while (c) { count++; c = c&(c - 1); //把c中最后一个1去掉 } return count; } int main() {...
分类:编程语言   时间:2015-06-30 18:34:49    阅读次数:111
80386寄存器
①8个32-bit寄存器: %eax 一般用作累加器; %ebx 一般用作基址寄存器(Base); %ecx 一般用来计数(Count); %edx 一般用来存放数据(Data); %esp 一般用作堆栈指针(Stack Pointer); %ebp 一般用作基址指针(Base Poin...
分类:其他好文   时间:2015-06-30 14:26:49    阅读次数:122
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!