#coding=utf-8#python装饰器'''装饰器可以用def的形式来定义。装饰器接收一个可调用对象作为输入参数,并返回一个新的可调用对象。装饰器新建了一个可调用对象,也就是return返回的函数funx,在新增的函数中,可以添加我们需要的功能,并通过调用原有函数来实现原有函数的功能'''d...
分类:
编程语言 时间:
2015-06-29 13:01:23
阅读次数:
157
问题描述Given a sorted integer array without duplicates, return the summary of its ranges.
For example, given [0,1,2,4,5,7], return [“0->2”,”4->5”,”7”].
意:找出排序数组(无重复数字)中的各个连续的范围...
分类:
其他好文 时间:
2015-06-29 11:49:30
阅读次数:
528
isEmpty方法源码:public static boolean isEmpty(String str) { return (str == null) || (str.length() == 0); }isempty表示根本不存在,没有分配内存“”表示存在(分配内存)但内容为空,一般是指...
分类:
其他好文 时间:
2015-06-29 11:36:35
阅读次数:
143
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After ...
分类:
其他好文 时间:
2015-06-29 11:26:40
阅读次数:
95
Given an indexk, return thekthrow of the Pascal's triangle.For example, givenk= 3,Return[1,3,3,1].Note:Could you optimize your algorithm to use onlyO(...
分类:
其他好文 时间:
2015-06-29 11:26:26
阅读次数:
106
在之前我这里是失败过很多次的,有的时候甚至不得不采用get的传送方式,另外,thinkphp自带的ajax->return方法并不能够解决问题,而且会让问题变得更加复杂,与其不如直接使用jquery的方法,全部采用post提交的方式,get提交是没有任何的问题的,但是post提交问题就一个接一个。我就一直纳闷,为什么在但一脱离框架的页面就能够畅通无阻,这个问题非常的棘手。研究了好长时间终于发现问题所...
分类:
Web程序 时间:
2015-06-29 10:14:48
阅读次数:
142
function checkUpload()
{
for(var i=0;i<document.files.filename.length;i++){
if(document.files.filename[i].value=="未选择文件"){
alert("请检查要上传的文件是否全部添加!");
return false;
}
}
}...
分类:
Web程序 时间:
2015-06-29 10:10:21
阅读次数:
128
Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C pro...
分类:
其他好文 时间:
2015-06-29 08:45:03
阅读次数:
119
Description:Implement int sqrt(int x).Compute and return the square root of x.好好学习数学还是非常有用的,牛顿迭代法 求解。 计算x2= n的解,令f(x)=x2-n,相当于求解f(x)=0的解,如左图所示。 首先取x0,...
分类:
其他好文 时间:
2015-06-29 06:17:21
阅读次数:
102
【题目链接】:click here~~【题目大意】:计算x1^m+x2^m+..xn^m(1 1 )
【解题思路】:
快速幂取模
代码:
#include
#define LL long long
using namespace std;
const LL mod=(LL)1e9+7;
LL pow_mod(LL a,LL p,LL n)
{
if(p==0) return...
分类:
其他好文 时间:
2015-06-29 00:37:24
阅读次数:
173