将大小王看成0
排序 然后求出0的个数 如果0的个数大于差值且不为对子就返回true
#include
//n张牌判断是否是顺子
using namespace std;
int partition(int *number,int start,int end){
int temp = number[start];
while(start < end){
while(start ...
分类:
其他好文 时间:
2014-08-12 13:38:24
阅读次数:
142
2014-08-12HDFS存储过慢,内存过高而且不释放网络方面:使用 netstat-n |awk'/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}' 查看网络情况:情况如下: CLOSE_WAIT 102 FIN_WAIT2 2 ESTABLIS...
分类:
其他好文 时间:
2014-08-12 13:07:14
阅读次数:
601
js中substring和substr的用法substring 方法用于提取字符串中介于两个指定下标之间的字符substring(start,end)开始和结束的位置,从零开始的索引参数 描述 start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。.....
分类:
Web程序 时间:
2014-08-12 13:05:54
阅读次数:
180
KVC简介KVC(KeyValueCoding)也就是所谓的键/值编码,键/值编码中的基本调用是-ValueForKye:和-setValue:forKey:。例子:定义个Student类,Student.h头文件如下:#import<Foundation/Foundation.h>
//学生类
@interfaceStudent:NSObject
{
NSString*name;
intage;
}
@end..
分类:
其他好文 时间:
2014-08-12 10:31:34
阅读次数:
233
Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the be...
分类:
其他好文 时间:
2014-08-11 21:13:02
阅读次数:
219
'; } function save($path) { echo ""; $data = ob_get_contents(); ob_end_clean(); $this->wirtefile($path, $data); } function wirtefile($...
分类:
Web程序 时间:
2014-08-11 11:54:22
阅读次数:
199
gzip: stdin: unexpected end of filetar: Unexpected EOF in architar: Unexpected EOF in archivevetar: Error is not recoverable: exiting now从网上下载了一个tar的文...
分类:
其他好文 时间:
2014-08-11 11:35:22
阅读次数:
320
var
??Bmp:?TBitmap;
procedure?TForm1.FormCreate(Sender:?TObject);
begin
??Bmp?:=?TBitmap.Create;
??Bmp.LoadFromFile(‘D:\test.bmp‘);
??Brush.Bitmap?:=?Bmp;
end;
procedure?TForm1.Fo...
#include //从小到大排列#include#includeusing namespace std;int main(){ int i,x; vectormy ; for(i=1;i>x; my.push_back(x); } sort(my.begin(),my.end()); f...
分类:
其他好文 时间:
2014-08-10 18:34:30
阅读次数:
188
參考glog写了现有的Logging系统。直接有enum LoggingEnum{LOG_INFO,LOG_DBBUG,LOG_ERROR,LOG_WARNNING,LOG_END};几种等级的日志,实时刷到console上,异步延迟写到日志上,建立队列缓存日志,时间一到一起刷到file,好了,看下...
分类:
其他好文 时间:
2014-08-10 15:22:20
阅读次数:
297