Beetl 最近版本修改了SessionWrap,不主动创建session(导致了不兼容以前版本),因此要在模板判断是否有session存在,需要自己写一个Function判断,如下: public?class?HasWebSession?implements?Function
...
分类:
其他好文 时间:
2015-07-03 14:13:46
阅读次数:
131
基本触摸事件 #pragma mark - 重写方法
#pragma mark 触摸开始
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"touchesBegan");
NSLog(@"%s",__FUNCTION__);
} #pragma mark - 触摸移动
- (void)t...
分类:
其他好文 时间:
2015-07-03 14:04:08
阅读次数:
91
// 普通递归函数的调用 时间复杂度为 O(n)function fn(num){ if(num === 1) return 1; return num * fn (num -1);}// 等同于 该函数耦合性更小function fn(num){ if(num === 1) r...
分类:
其他好文 时间:
2015-07-03 13:59:46
阅读次数:
128
$("#slideleft button").click(function(){ var $lefty = $(this).next(); $lefty.animate({ left:parseInt($lefty.css('left'),10)==0 ? -$lefty....
分类:
Web程序 时间:
2015-07-03 13:47:23
阅读次数:
125
/**********************一个简单的目录递归函数第一种实现办法:用dir返回对象***********************/function tree($directory) { $arr = array(0=>array(), 1=>array()); $my...
分类:
Web程序 时间:
2015-07-03 13:43:15
阅读次数:
125
这是一个很经典的概率算法函数: function?get_rand($proArr)?{?
????$result?=?‘‘;?
????//概率数组的总概率精度?
????$proSum?=?array_sum($proArr);?
????//概率数组循环?
????...
分类:
编程语言 时间:
2015-07-03 12:38:27
阅读次数:
124
_proto_实际上是指向某个对象实例的属性,而prototype这是其构造器函数的属性,所以两者并不等价;然而ie说这并没有什么卵用var objA = { name:"Mack",sex:'male' };function Human(){};Human.prototype=objA;var d...
分类:
其他好文 时间:
2015-07-03 12:19:26
阅读次数:
176
原文地址:http://www.sucker-fly.com/archives/476 $(function () { $("input[name='sub']").on("click", function () { if (...
分类:
移动开发 时间:
2015-07-03 12:04:02
阅读次数:
139
Generate Parentheses:
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())"...
分类:
其他好文 时间:
2015-07-03 09:22:17
阅读次数:
142
学习地址 :http://stackoverflow.com/questions/111102/how-do-javascript-closures-work
1,关于闭包的简单实现
//example 1
function sayHello(name) {
var words = "hello," + name;
var sayForAlert = function ()...
分类:
编程语言 时间:
2015-07-03 00:16:43
阅读次数:
186