码迷,mamicode.com
首页 >  
搜索关键字:range    ( 9515个结果
单元测试基础原则
Right-BICEPRight首先,我们需要知道什么是正确的.这是最基本的.Boundary边界是否所有的边界条件都正确?CorrectConformance一致性结果值是否和期望值一致.Ordering顺序性值是否跟期望一样,是有序/无序的.Range区间性值是否位于合理的最大值和最小值之间.R...
分类:其他好文   时间:2014-06-17 19:51:20    阅读次数:166
[数据结构与算法分析(Mark Allen Weiss)]不相交集 @ Python
最简单的不相交集的实现,来自MAW的《数据结构与算法分析》。代码:class DisjSet: def __init__(self, NumSets): self.S = [0 for i in range(NumSets+1)] def SetUnion(self, S,...
分类:编程语言   时间:2014-06-17 15:17:56    阅读次数:265
MFC 操作excel 读写 感悟
在项目实现中,要操作excel 对表格进行读写,或者是将listcontrol控件里面的内容导入到表格中,为此在网上找了很多代码作为参考,但是都没有达到自己想要的效果!在此,将自己在项目开发中遇到的问题和解决方法一一列出,希望能帮到其他人。 问题1 出现range等类的重定义,报错1...
分类:其他好文   时间:2014-06-17 15:07:47    阅读次数:681
Range-Based for Loops
for ( decl : coll ){ statement}where decl is the declaration of each element of the passed collection coll and for which the statements specified are....
分类:其他好文   时间:2014-06-15 22:11:18    阅读次数:295
索引的五种访问模式
1 index unique scan 效率最高,主键或唯一索引2 index fast full scan 读的最快,可以并行访问索引,但输出不按顺序3 index full scan 有顺序的输出,不能并行读索引。4 index range scan 在给定的区间查询5 index s...
分类:其他好文   时间:2014-06-15 19:41:17    阅读次数:169
Search for a Range
题目 Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the order of O(log n). If the target i...
分类:其他好文   时间:2014-06-15 16:53:32    阅读次数:177
[LeetCode] Search for a Range [34]
题目 Given a sorted array of integers, find the starting and ending position of a given target value. 解题思路: 查找一个数出现的范围,给一个排好序的数组和一个数,找出这个数在数组中出现的范围。 这个题直接使用一次遍历就可以得到结果,这样的时间复杂度为O(n)。但是对于有序数组我们一般可以使用二分查找可以得到更好的O(logn)的时间复杂度。我们可以使用二分查找找到这个数第一次出现的位置和这个数最后一次出现的位...
分类:其他好文   时间:2014-06-15 16:19:16    阅读次数:237
UItexfile实时验证输入字符
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; {     NSString * toBeString = [textField.text stringByReplacingCharacter...
分类:其他好文   时间:2014-06-15 15:39:11    阅读次数:162
Control Flow
【Control Flow】1、for loop中的元素可以省略: 2、for initializer中的变量只能在循环内使用。3、if、else if、else的用法: 最后一个else可选。4、switch用法: 5、range match: 6、tuple作为case: 7、va...
分类:其他好文   时间:2014-06-15 14:07:20    阅读次数:283
Python生成测试数据
本文出自:http://blog.csdn.net/svitter 生成1~10的随机数1000个: import random fp = open("test", 'w'); for i in range(1, 1000): a = random.randint(1,10) fp.write(str(a)+"\n"); fp.close() 注意:写入文件的不会在最后写...
分类:编程语言   时间:2014-06-15 13:39:10    阅读次数:321
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!