this 的几种情况: function a(){ alert(this); } 1.直接调用a()时,this指的是window对象。 2.对象调用 var obj = { a : a}obj.a(); 当一个对象调用a()时,this 指向这个对象(即上例中的obj)。 3.var x; a.c
分类:
其他好文 时间:
2016-03-03 01:32:10
阅读次数:
135
// 定义结构体 typeTmyRec= recordname:string[10];password:string[10];end; function RawToBytes(const AValue; const ASize: Integer): TBytes;beginSetLength(Res
分类:
其他好文 时间:
2016-03-03 01:18:27
阅读次数:
203
心里一直有个疑问. jquery是如何做到一个jQuery即可以当方法用比如$();又可以当对象用$.extend(); 现在总结一下吧 function method(){} var m=new method(); m.version="123"; console.log(m.version) /
分类:
Web程序 时间:
2016-03-03 01:17:07
阅读次数:
211
T-SQL修改表数据 INSERT语句 语法: INSERT [TOP(expression) [PERCENT]] [INTO] { <object> | rowset_function_limited [ WITH ( <Table_Hint_Limited> [ ...n ] ) ] /*指定
分类:
数据库 时间:
2016-03-03 00:07:33
阅读次数:
437
解决方法: //作用于整个html中 function check(form) { //topic是input的id,descrip是textarea的id var topic = $("#topic").val().length; var descrip = $("#descrip").val()
分类:
Web程序 时间:
2016-03-03 00:05:50
阅读次数:
203
public function logIn($msg){ $fp = fopen($this->file,"a+"); flock($fp, LOCK_EX) ; //锁定文件 fwrite($fp,"执行日期:".date("Y-m-d H:i:s",time())."\n".$msg."\n\n
分类:
其他好文 时间:
2016-03-03 00:04:59
阅读次数:
138
解决办法: 在开发中,多少会遇到一些界面,输入限制字数。 例如: //页面加载完毕 $(function() { //descrip是textarea的id $("#descrip").on('input',function(event) { //实时改变span的数值 descrip_lenth是
分类:
Web程序 时间:
2016-03-03 00:03:02
阅读次数:
248
function Person(){}; Person.prototype={ constructor:Person, name:"Nacholas", age:29, friends:{"sun","li"}, sayName:function(){ alert(this.name); } };
分类:
Web程序 时间:
2016-03-02 23:42:57
阅读次数:
264
map() Return an iterator that applies function to every item of iterable, yielding the results 例如: a = map(lambda x:x**2 ,[1,2,3]) print([b for b in a
分类:
编程语言 时间:
2016-03-02 23:31:39
阅读次数:
233
类似于linear regression,K-means算法也optimization objective或者是试图使cost function求最小值。 了解K-means算法的optimization objective有助于我们(1)调试算法时,看算法是否运行正确(在本节中可以看到)(2)使算
分类:
其他好文 时间:
2016-03-02 23:27:21
阅读次数:
595