functionsecondsToTime(time,forceHours){
varhours=Math.floor(time/3600)%24,
minutes=Math.floor(time/60)%60,
seconds=Math.floor(time%60),
result=((forceHours||hours>0)?(hours<10?‘0‘+hours:hours)+‘:‘:‘‘)+(minutes<10?‘0‘+minutes:minutes)+‘:‘+(secon..
分类:
其他好文 时间:
2015-06-09 17:37:55
阅读次数:
155
1. mailbox数据收发模块一个RPC客户端可能同时需要调用多个远端(server)提供的服务,在pomelo里每个server抽象为一个mailbox。先来看看mailbox的实现:var MailBox = function(server, opts) {
EventEmitter.call(this); this.curId = 1;
this.id = server...
分类:
其他好文 时间:
2015-06-09 17:21:47
阅读次数:
186
Implication is a function of two logical arguments, its value is false if and only if the value of the first argument is true and the value of the second argument is false.
Implication is written b...
分类:
其他好文 时间:
2015-06-09 17:14:18
阅读次数:
90
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where in...
分类:
其他好文 时间:
2015-06-09 17:12:28
阅读次数:
97
一、取URL中的参数 function getParameterByName(name) { var match = RegExp('[?&]' + name + '=([^&]*)') .exec(window.location.search); ...
分类:
编程语言 时间:
2015-06-09 17:07:06
阅读次数:
124
1.需要引入2.加js里面请求路径根据需要进行更改3.设置需要分页的列表{dede:arclist tagid="dedecms" pagesize="2"}[field:arcurl/][field:writer/][field:pubdate function="GetDateTimeMK(@m...
分类:
其他好文 时间:
2015-06-09 17:03:44
阅读次数:
139
1 GUI.Window 窗口static function Window (id : int, clientRect : Rect, func : WindowFunction, text : String, style : GUIStyle) : RectwindowRect = GUI.Win...
分类:
其他好文 时间:
2015-06-09 16:55:53
阅读次数:
115
//获取元素属性function getStyle(obj, attr) { return obj.currentStyle ? obj.currentStyle[attr] : getComputedStyle(obj, 0)[attr];}//运动函数function doMove(obj, a...
分类:
Web程序 时间:
2015-06-09 16:52:24
阅读次数:
133
获取日期:全局:{dede:field.pubdate function="MyDate('Y-m-d H:i',@me)"/}局部:[field:pubdate function="GetDateTimeMK(@me)"/]作者:{dede:field.writer/}来源:{dede:field...
分类:
其他好文 时间:
2015-06-09 16:49:48
阅读次数:
168
jquery 事件处理handler函数的参数在如下的函数中,我们在处理jquery里经常使用:$("#foo").bind("click",function(){alert($(this).text());});click的handler处理函数一般为function(){},不传参数。那么,这个...
分类:
Web程序 时间:
2015-06-09 16:49:34
阅读次数:
193