2017-05-30 Lu Huang
This blog is reprinted from colah's blog and some changes are added by myself. About RNN Humans don’t start their thinking from scratch every second. And traditional neural networks have a major shortcoming, and they cannot learn from the previous information. Recurrent neural networks (RNN) address this issue. RNN 继续阅读 »
2016-08-30 曹强
写在前面 很多前端工程师的人说自己精通Javascript语言,问他call()和apply()这两个方法有什么区别,结果往往是一问三不知。 其实区分 apply和call就一句话: Javascript foo.call(this,arg1,arg2,arg3)==foo.apply(thsi,arguments)==this.foo(arg1,arg2,arg3); more 两者区别 call 和 apply都属于Function.prototype的一个方法,它是Javascript引擎内在实现的,因为属于Function.prototype对象的实例,也就是每个方法都有call,apply属性 继续阅读 »
2015-04-18 Alex Sun
render 在使用React.createClass创建一个组件类的时候,必须要提供一个render方法,其它的生命周期相关方法是可选的。 当组件的render方法被调用的时候,它会检查this.props和this.state,然后返回一个单独的子元素。所谓一个单独的子元素,即最外层只能是一个元素,无论它内部有多少层嵌套,例如下面的例子就是错误的: 继续阅读 »
2015-12-16 Klaus Ma
Description: The target of this JIRA is to offer the allocation slack resources to the framework. Here're the key points of this design: 继续阅读 »
2017-01-20 Oliver Wang
一般情况下,textarea 的高度是定死的,rows 指定了之后,高度就不变了,内容多了之后会出现滚动条,这样的设定在大部分的场景下面是够用的, 但是有时就会很丑陋(废话😊)。 我们都知道 HTML 的元素都有一个 scrollHeight 这个属性,就是当该元素出现滚动条的时候,内容的高度。 那就方便了: js $(".weui-textarea").on('input propertychange keyup',function () { $(this).height(this.scrollHeight); }); 这样就实现了高度自动增加的 Textarea,但当我试着删掉几行,想让它自动降低高度的时候不禁菊花 继续阅读 »
2017-02-12 Lim Geng
最近在网上看到有部分人在面试(比如1月面试记)的时候被问到了LazyMan,而且网友也有不同的实现方式。这里我用两种方式实现了lazyman,以供参考,如有更好的方法,欢迎留言。 队列 这种方式,每次都是往queue里添加执行函数,next函数用来决定什么时候调用下一个函数。 ``js var LazyMan = function LazyMan (name) { if (!(this instanceof LazyMan)) return new LazyMan(name); this.queue = [() => { console.log(hello ${name}`); 继续阅读 »
2015-11-27 Oliver Wang
直接写 js function imgError(image) { image.onerror = null; // prevent event bubble image.src = "/images/noimage.gif"; return true; } html 使用 jQuery ```js $("img").error(function () { $(this).unbind("error").attr("src", "broken.gif"); }); //If you use this technique you can use the "one" method to av 继续阅读 »
2019-01-21 Xie Jingyi
This chapter develop a small language of numbers and booleans, serving as a straightforward vehicle for the introduction of serveral fundamental concepts like, abstract syntax tree, evaluation and runtime errors. Syntax BNF-like Definition Terms of this language are defined as below: t ::= true false i 继续阅读 »
2016-01-07 Klaus Ma
Introduction The purpose of this document is to give an introduction and overall description of the contribution process for contributors new to Mesos. This document is intended to extend the existing documentation with a focus on on-boarding contributors to the community as quickly as possible. 继续阅读 »
2015-04-13 Alex Sun
事件处理 React中的事件处理方式与HTML方式类似,都是通过为标签添加属性来声明事件处理函数。如下所示: ```javascript var LikeButton = React.createClass({ getInitialState: function(){ return {like: true}; }, handleClick: function(){ this.setState({like: !this.state.like}); }, render: function(){ return ( 继续阅读 »