void monizhuzhan::filenameInDir(){ //判断路径是否存在 QDir dir(path); if(!dir.exists()) return; //查看路径中后缀为.cfg格式的文件 QStringList filters; filters<<QString("*.....
分类:
其他好文 时间:
2015-07-10 13:26:24
阅读次数:
141
妈妈呀我终于会写乘法逆元+排列组合了。 1 void exgcd(int a,int b,int&x,int&y){ 2 if(b==0){x=1;y=0;return;}exgcd(b,a%b,x,y);int t=x;x=y;y=t-a/b*y; 3 } 4 int qpow(int x...
分类:
其他好文 时间:
2015-07-10 13:08:42
阅读次数:
142
go 语言中的结构体方法结构体名称的大小写有着不同的意义: 小写表示不能被别的包访问package mainimport "fmt"type Rect struct { width,height int}func (r *Rect) area() int { return r.width*r.hei...
分类:
编程语言 时间:
2015-07-10 12:53:15
阅读次数:
141
我最终才去的方案如下:
/**
* 动态发布图片压缩
*
* @param source_image 原图image
* @param maxSize 限定的图片大小
*
* @return 返回处理后的图片
*/
- (NSData *)resetSizeOfImageData:(UIImage *)source_image maxSize:(NSInteg...
分类:
移动开发 时间:
2015-07-10 11:32:34
阅读次数:
312
First Missing Positive
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in ...
分类:
其他好文 时间:
2015-07-10 11:27:12
阅读次数:
92
1. 取某个范围的任意数public static String getRandom(int min, int max){Random random = new Random();int s = random.nextInt(max) % (max - min + 1) + min;return S...
分类:
其他好文 时间:
2015-07-10 11:17:52
阅读次数:
95
结论:1、不管有木有出现异常,finally块中代码都会执行;2、当try和catch中有return时,finally仍然会执行;3、finally是在return后面的表达式运算后执行的(此时并没有返回运算后的值,而是先把要返回的值保存起来,管finally中的代码怎么样,返回的值都不会改变,任...
分类:
其他好文 时间:
2015-07-10 11:02:17
阅读次数:
97
A*搜索 实际上只有空格再走 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #define rep(i,l,r) for(int i=l;ians) return 0;34 ret...
分类:
其他好文 时间:
2015-07-10 10:56:12
阅读次数:
136
var name = "The Window";var object = {name : "My Object",getNameFunc : function(){return function(){return this.name; //这里之所以是全局对象是因为调用函数getNameFunc()...
分类:
其他好文 时间:
2015-07-10 10:55:44
阅读次数:
120
题目:
Given a digit string, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
Input...
分类:
编程语言 时间:
2015-07-10 09:41:01
阅读次数:
181