name = $in_name; $this->age = $in_age;
$this->owner = $in_owner; } function getage() { return ($this->age * 365);
} f...
分类:
其他好文 时间:
2014-05-08 12:36:51
阅读次数:
336
1 duration = $duration;10 $this->costtype =
$costtype;11 }12 13 function cost(){14 switch ($this->costtype){15 ...
分类:
其他好文 时间:
2014-05-08 12:02:21
阅读次数:
190
如果要获取一张图片原本的高度和宽度,我们一般这样获取var url =
"../images/1.jpg";var img = new Image();img.src = url;img.onload = function(){
//do something.....}当图片从服务器传到本来(也即....
分类:
其他好文 时间:
2014-05-08 11:23:03
阅读次数:
358
#include#includetemplateinline T const&
max(T const& a,T const &b){ //如果a<b,那么返回a return a<b?b:a;}int
main(){ int i=42; std::cout<<"max(7,...
分类:
其他好文 时间:
2014-05-08 09:50:44
阅读次数:
264
写在选择器源码分析之前这里指对1.7.2版本的源码分析,更高版本添加了更多代码。整个jQuery的代码是写在一个(function(window,undefined){})(window);这样一个闭包里。请思考,为什么要这样做?将其写在一个闭包函数里,并传入window直接运行的好处有三:
1,统...
分类:
Web程序 时间:
2014-05-08 09:38:16
阅读次数:
453
Nodejs模仿commonJS模块系统,内置的require函数很容易include存在于各个分离的文件中的模块。Require函数的基本功能是读取一个javaScript文件并且执行它,返回exports对象。一个模块的例子:
console.log("evaluating example.js");
var invisible = function () {
console.log(...
分类:
Web程序 时间:
2014-05-07 23:25:39
阅读次数:
324
困惑一:先看一个例子:function test(){
message = "hi";
}
test();
alert(message);会输出字符串“hi"在函数内部使用var定义的变量是局部变量,省略var操作符的变量是全局变量。困惑二:alert(undefined == null)结果是”true"我们知道在js中分为基本类型和引用类型,基本类型包括number、string、boole...
分类:
编程语言 时间:
2014-05-07 23:20:30
阅读次数:
361
问题描述
OTP的supervisor中为了防止淘气的Child从link的另一端断掉link,supervisor会在shutdown child之前unlink(Child)并切换为monitor状态,这样supervisor对Child的监控将无法被Chlid终止。这段代码是由monitor_child/1实现的,其具体实现代码如下:
872 %% Help function to...
分类:
其他好文 时间:
2014-05-07 23:14:21
阅读次数:
390
因为公司网页需要顶部的设置首页的收藏需要更新,因为浏览器更新之后,一些js就不能用了只能兼容ie和火狐收藏:火狐:window.sidebar.addPanel(sTitle,sURL,"");这个不能用了但是发现在a标签添加rel="sidebar"也是可以添加收藏的,title为收藏的名字所以:functionaddFavorite(..
分类:
Web程序 时间:
2014-05-07 22:00:54
阅读次数:
484
lua中打印所以类型功能实现
本人测试 number、string、bool、nil、table嵌套table、userdata没问题 共享一下有什么问题请拍砖 代码如下 cclog = function( ... )
local tv = "\n"
local xn = 0
local function tvlinet(xn)
-- body...
分类:
其他好文 时间:
2014-05-07 21:51:38
阅读次数:
347