Name | Example | ECMAScript | TypeScript | Babel |
---|---|---|---|---|
Class decorator | @Component() |
Stage 1 | Yes | Yes |
Property decorator | @Input() |
Stage 1 |
/** | |
* @author zhixin wen <wenzhixin2010@gmail.com> | |
* @version 0.0.1 | |
* @github https://github.com/wenzhixin/ | |
* @blog http://wenzhixin.net.cn | |
*/ | |
(function($) { | |
'use strict'; |
import numpy as np | |
import pylab as pl | |
x = np.random.uniform(1, 100, 1000) | |
y = np.log(x) + np.random.normal(0, .3, 1000) | |
pl.scatter(x, y, s=1, label="log(x) with noise") | |
pl.plot(np.arange(1, 100), np.log(np.arange(1, 100)), c="b", label="log(x) true function") | |
pl.xlabel("x") | |
pl.ylabel("f(x) = log(x)") |
Original discussion began on Twitter and can be found by starting here and here. Discussion was continued on es-discuss mailing list in the thread Pure win: Array.from and Array.of
Update Nov. 3, 2011
Official strawman has been posted: http://wiki.ecmascript.org/doku.php?id=strawman:array_extras
title: express4.2源码解析 date: 2014-05-18 15:00:50 categories: express tags: [nodejs, node, js, express]
express是nodejs平台上一个非常流行的框架,4.2.0是最新的版本,相比3.x版本优化了代码和api,去除了connect模块,自己实现了一个router组件,实现http请求的顺序流程处理,去除了很多绑定的中间件,使代码更清晰。
##1.使用express 如何使用express在官网有很好的讲解,只用experssjs实例app的几个函数,就可以构建构建web程序。
##MAC OS下安装和配置android-sdk
###安装
在MAC上安装android-sdk,标准的安装方法是使用homebrew
,运行如下命令:
brew update
brew install android-sdk
Options included below:
- Using Docker
docker-compose
- Using Homebrew
brew
This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew
any longer. Instead consider adding a barebones docker-compose.yml
for each project and run docker-compose up
to start each project's mysql service.
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
-
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
Alter the port the script talks to from 8000 to 80:
}).listen(80);
npm set registry https://r.npm.taobao.org # 注册模块镜像 | |
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像 | |
## 以下选择添加 | |
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像 | |
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像 | |
npm set ELECTRON_MIRROR https://cdn.npm.taobao.org/dist/electron/ # electron 二进制包镜像 | |
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像 | |
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像 | |
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像 |