list构造函数://default:list l; //空的list//fill:list
l(n); //n个元素, 元素默认初始化list l(n, value); //n个元素值为value//range:list l(fir...
分类:
其他好文 时间:
2014-05-23 09:49:56
阅读次数:
314
题目:Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
罗马表示方式如下:
I = 1;
V = 5;
X = 10;
L = 50;
C = 100;
D = 500;
M = 1000;
其中每...
分类:
其他好文 时间:
2014-05-22 13:00:09
阅读次数:
240
Fence Repair
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 24153
Accepted: 7703
Description
Farmer John wants to repair a small length of the fence aroun...
分类:
其他好文 时间:
2014-05-22 07:55:44
阅读次数:
255
【题目】
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 is not found in the array, return [-1, -1].
For example,
Given [5...
分类:
其他好文 时间:
2014-05-22 06:44:39
阅读次数:
265
返回目录为什么要对minLength和maxLength这两个方法进行扩展呢,是因为这样一个需求,在用户注册时,可以由用户自己决定他们输入的字符,中文,英文,数字均可,这样做了之后,使用户的体验更好,但对于程序来说就有些麻烦了,因为我们的Length方法只针对英文字符和数字而言的原因1:事实上,真实...
分类:
Web程序 时间:
2014-05-22 00:56:17
阅读次数:
334
1. Post: http://localhost:11804/My/Commentfor
plain html parameter submission, like the GET in URL:Request Header:User-Agent:
FiddlerContent-Length: 3...
分类:
其他好文 时间:
2014-05-21 20:54:49
阅读次数:
346
public class setZero {
static void print(int [][]a){
for(int i=0;i<a.length;i++){
for(int j=0;j<a[i].length;j++){
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
/*stati...
分类:
其他好文 时间:
2014-05-21 16:16:56
阅读次数:
252
最近编写Python程序时经常遇见中文相关的问题,这里说一个问题的解决方法。
我在使用json模块的dumps()函数时,因为涉及到中文,报出如下错误:
ascii codec can't decode byte 0xe8 in position 0:ordinal not in range(128)
这是编码相关的问题,在该程序中加入如下代码:
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
这样就可以解决该问题了,希望对大家有所帮助。...
分类:
编程语言 时间:
2014-05-21 09:47:21
阅读次数:
323
1,使用MD5,本地文件下载完后去文件的md5值与服务器的该文件md5进行比对,一致证明下载完全。2,比较文件的size,文件长度,下载完成取下File.length,与服务器的文件长度比对,一致则下载完全。3,文件命名法,开始下载时,把文件命名为宜别名如xxx.tmp,下载完成后再把文件名称修改过...
分类:
其他好文 时间:
2014-05-21 03:59:00
阅读次数:
197
【题目】
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring is "()", which has length = 2.
Another example is ")()())", whe...
分类:
其他好文 时间:
2014-05-20 16:39:07
阅读次数:
280