class Solution {public: int maxSubArray(int A[], int n) { int cur_sum = 0; int max_sum = INT_MIN; for (int i=0; i max_...
分类:
其他好文 时间:
2014-07-19 15:18:15
阅读次数:
160
在SQL Server中,利用SQL进行分页的方法也有很多,今天要总结的是SQL Server 2005中引入的OVER开窗口函数,然后利用开窗函数进行分页。 示例代码如下: -- 设置数据库上下文USE TSQLFundamentals2008;GO-- 使用ROW_NUMBER分页,查找第1-1...
分类:
其他好文 时间:
2014-07-19 14:18:50
阅读次数:
285
url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和delete也可以使用,但仅部分浏览器支持。timeout: 要求为Number类型的参数,设置请求超...
分类:
Web程序 时间:
2014-07-19 14:15:06
阅读次数:
262
UVA 11774 - Doom's Day
题目链接
题意:给定一个3^n*3^m的矩阵,要求每次按行优先取出,按列优先放回,问几次能回复原状
思路:没想到怎么推理,找规律答案是(n + m) / gcd(n, m),在topcoder上看到一个证明,如下:
We can associate at each cell a base 3-number, the log3(R...
分类:
其他好文 时间:
2014-07-19 14:06:19
阅读次数:
220
Double 四舍五入保留小数:
/**
* @example roundUpNumber(20.47, 0) = 20.5, roundUpNumber(20.449, 1) = 20.45 * @description round up double number * @param Double d * @param Integer index * @return *...
分类:
其他好文 时间:
2014-07-19 08:08:55
阅读次数:
219
说起backlog, 都会想起socket编程中的listen backlog 参数,而这个backlog 是linux内核中处理的backlog么?
int listen(int sockfd, int backlog)man listen
可以看到关于listen 的解释
The backlog argument defines the maximum length to wh...
分类:
系统相关 时间:
2014-07-19 02:44:36
阅读次数:
534
Fibbonacci Number
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13234 Accepted Submission(s): 6628
Problem Description
Your object...
分类:
其他好文 时间:
2014-07-19 02:17:06
阅读次数:
169
原文出处:http://www.codesky.net/article/201203/177810.html4.3 Flexpaper参数说明SwfFile (String) 需要使用Flexpaper打开的文档Scale (Number) 初始化缩放比例,参数值应该是大于零的整数ZoomTrans...
分类:
其他好文 时间:
2014-07-19 00:15:27
阅读次数:
215
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-07-18 20:09:38
阅读次数:
433
DescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each ...
分类:
其他好文 时间:
2014-07-18 18:22:11
阅读次数:
263