通过简单的command(命令)模式,理解apply, call, 作用域 (function(){ var carManager = { requestInfo:function(model,id){ return 'the inf...
分类:
其他好文 时间:
2014-07-18 16:09:42
阅读次数:
183
DescriptionGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to ...
分类:
其他好文 时间:
2014-07-18 15:28:57
阅读次数:
234
前面介绍了C语言得发展,原理运行机制下面写两个C程序,下面介绍C源程序得基本部分和书写格式。 【例1-1】输出Hello World!1 #include2 3 int main(void)4 {5 printf("Hello World!%/n");6 return 0;7 }V...
分类:
编程语言 时间:
2014-07-18 15:23:11
阅读次数:
241
#include uint32_t arg = 0x12345678;uint32_t getArgVal0( uint32_t * arg){ return *arg;}uint32_t getArgVal( uint32_t arg){ return getArgVal0( &arg );}.....
分类:
其他好文 时间:
2014-07-18 14:39:54
阅读次数:
187
#includeintnum[]={3,5,7,9,10,10,10,12,15,20,25,30};//10个数intlower_bound(int*A,intL,intR,intV){intm;while(L=V)R=m;//所求点在中点以左elseL=m+1;//所求点在中点以右}return...
分类:
其他好文 时间:
2014-07-18 14:29:37
阅读次数:
268
var f1 = function (x, y) { //【1】 定义一个匿名函数,用变量f1来指向它(f1相当于一个委托,这个时候f1就可以当做一个函数来用了)
return x + y;
}
//调用这个匿名函数
alert(f1(5, 6)); //输出11
//【2】 还可声明匿名函数立即使用
...
分类:
编程语言 时间:
2014-07-18 11:18:02
阅读次数:
204
参见hdu 3068 的manacher算法
代码如下:#include
#include
#define M 110010
int s[M],ss[M*2];//s代表原来的字符串,ss代表插入之后的字符串
int p[M*2]; //表示以i为中心的(包含i这个字符)回文串半径长
int min(int a,int b)
{
return a>b?b:a;
}
int mai...
分类:
其他好文 时间:
2014-07-18 11:06:33
阅读次数:
249
可以转化为着色模型dfs + 四色定理 1 #include 2 #include 3 int n,num; 4 int d[100][100]; 5 int c[100]; 6 7 bool ok(int step) 8 { 9 for(int i = 0; i = n) return ...
分类:
其他好文 时间:
2014-07-18 10:18:34
阅读次数:
239
FMDatabase 的使用方法- (NSString*) getPath { NSArray* paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) ; return[[pathso...
分类:
移动开发 时间:
2014-07-18 10:08:04
阅读次数:
342
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-07-18 09:37:55
阅读次数:
161