<html>
<head>
<title>测试</title>
<script?language="javascript">
?var?scrollFunc=function(e){?
??e=e?||?window.event;?
??if(e.wheelDelta?&&?event.ctrlKey){//IE/Opera/Chrome?
???eve...
分类:
Web程序 时间:
2014-08-28 16:22:20
阅读次数:
301
//使用命名函数表达式实现递归
var?factorial?=?(function?f(num)?{
????if?(num?<=?1)?{
????????return?1;
????}?else?{
????????return?num?*?f(num?-?1);
????...
分类:
其他好文 时间:
2014-08-28 16:22:10
阅读次数:
195
/*
* Helper functions for managing events -- not part of the public interface.
* Props to Dean Edwards' addEvent library for many of the ideas.
*/
jQuery.event = {
add: function( elem, types, han...
分类:
Web程序 时间:
2014-08-28 16:19:39
阅读次数:
214
var Sizzle = function( selector, context, results, seed ) {
//context 默认为document,可以人为指定
results = results || [];
context = context || document;
var origContext = context;
//判断文档节点
if ( context...
分类:
Web程序 时间:
2014-08-28 16:19:21
阅读次数:
224
Sizzle.find = function( expr, context, isXML ) {
var set, i, len, match, type, left;
//expr是否为空
if ( !expr ) {
return [];
}
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
type = Expr...
分类:
Web程序 时间:
2014-08-28 16:16:59
阅读次数:
236
标量相加
import theano.tensor as T
from theano import function
x = T.dscalar('x')
y = T.dscalar('y')
z = x + y
f = function([x, y], z)
输入定义两个符号变量来代替数值,输出是一个0维的numpy.ndarray数组。
矩阵相加
把输入类型换一下就行了,矩阵如果...
分类:
其他好文 时间:
2014-08-28 16:13:59
阅读次数:
642
1.对象工具封装
testdiv
sssss
var ss = {};
ss.tools = function(){
var a=1;
var b=2;
return{
aaa:a,
show_1:function(){
return a+b;
},
show_2:function(){
return a-b;
}
}
}()...
分类:
Web程序 时间:
2014-08-28 16:10:10
阅读次数:
258
//以下代码均摘自?Nicholas?C.Zakas《Professional?JavaScript?for?Web?Developers》
//组合继承实例代码:
function?SuperType(name)?{
????this.name?=?name;
????this.colors?=?["red",...
分类:
其他好文 时间:
2014-08-28 15:03:59
阅读次数:
188
function?Bird(name,?age)?{
????this.name?=?name;
????this.age?=?age;
????this.sons?=?["Tom",?"John"];
????//在sayName()方法不存在的情况下,添加到原型中
????if?(typeof...
分类:
其他好文 时间:
2014-08-28 13:28:29
阅读次数:
166
记入一些容易出错的地方 function someClass() { this.name = null; 或 undefined } var obj = new someClass(); console.log(Objec...
分类:
编程语言 时间:
2014-08-28 13:17:29
阅读次数:
195