【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
本文出自: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
这是一道让人泪奔的题,它深刻的说明了什么是剪枝,哪怕是再小的一个细节,一旦递归规模增大都会引发巨大的时间消耗,真是神题~
Sticks
时间限制:3000 ms | 内存限制:65535 KB
难度:5
描述George took sticks of the same length and cut them randomly until all part...
分类:
其他好文 时间:
2014-06-15 12:18:43
阅读次数:
174
超过70秒的请求是通过分析IIS日志发现的,通过Wireshark抓包分析请求是9:22:21收到的。这个请求响应内容的长度是:Content-Length 1154110(1.1MB),云服务器在收到请求后,发了一个ACK包。接下来就是一堆的TCP segment of a reassembled...
分类:
其他好文 时间:
2014-06-15 12:08:40
阅读次数:
527
Given a sorted array, remove the duplicates in place such that each element appear only onceand return the new length.Do not allocate extra space for ...
分类:
其他好文 时间:
2014-06-14 16:59:58
阅读次数:
221
原始题目如下,意为寻找数组和最大的子串,返回这个最大和即可。
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the...
分类:
其他好文 时间:
2014-06-14 15:08:00
阅读次数:
224
产生这个问题的原因的是将项目部署到tomcat的时间超过了45秒,当项目比较大,用的框架比较复杂常会出现这个问题。
解决方法很简单,找到下面这个路径中 workspace\.metadata\.plugins\org.eclipse.wst.server.core\servers.xml的server.xml文件
将start-timeout设置为100或者更长即可~...
分类:
其他好文 时间:
2014-06-14 13:21:11
阅读次数:
351
Problem Description
give you a string, please output the result of the following function mod 1000000007
n is the length of the string
f() is the function of fibonacci, f(0) = 0, f(1) = 1...
a...
分类:
其他好文 时间:
2014-06-14 11:45:49
阅读次数:
243
package com.he.list;
import java.util.Arrays;
import org.w3c.dom.ls.LSException;
class ArrayList {
private int length;// the list's length
private int[] store;// store the data
// initialize ...
分类:
其他好文 时间:
2014-06-14 11:16:05
阅读次数:
224
曾经整理过一篇《关于PHP连接处理中set_time_limit()、connection_status()和ignore_user_abort()深入解析》,是讲解浏览器客户端断开时,服务器PHP脚本的处理。
这篇文章,将讲解一下服务器PHP脚本怎样主动断开与浏览器的连接,主要方法是使用http协议header中的Content-Length和Connection
Content-Length的作用:浏览器接收到指定Content-Length大小的消息实体后,则会断开与服务器的连接。
Connectio...
分类:
Web程序 时间:
2014-06-14 09:24:21
阅读次数:
229