Git Product home page Git Product logo

learn-es6's Introduction

Hi there 👋

绰号: 🍉
座右铭: 行至水穷处,坐看云起时。
希望: 做一个有趣的人
口头禅: 一朵小花.jpg
居住地址:5rmW5YyX5q2m5rGJ

Stunning insights

mowatermelon's github stats

Top Langs

NOTE: Top languages does not indicate my skill level or something like that, it's a github metric of which languages i have the most code on github, it's a new feature of github-readme-stats

开源项目
项目 描述 tag
up-video 基于mdui , egg 和 b 站 api 的UP 更新日历,支持发布视频的详细预览,支持全年日历的切换。 egg、bilibili-api、mdui、calender
mw2-antd 基于 antd 的 midwayjs V2 静态项目 函数计算发布案例 middway V2、typescript、umi、antd、static-server
mwegg 基于 middway + egg + typeorm + swagger 的后端服务项目 middway V2、typescript、egg、typeorm、swagger
watermelon-todolist 基于electron,localstorage和vue的todolist桌面应用,默认有三个背景色可切换。支持基础任务添加,关闭和删除。 electron、todolist、vue、localstorage
vue-admin 基于axios,bootstrap,vue-router,webpack和express等等的基础vue后台控制模板,默认有三个颜色主题可切换。 axios、vue、vue-router、webpack、vue-admin、express、mo-theme、vuex、localstorage
vue-ersi 基于axios,Element UI,vue-router,esri,webpack和express等等地图后台操作模板。 axios、vue、vue-router、webpack、express、vuex、localstorage、dojo、arcgis-js-api-4、arcgis-js-api-3d
vue-webapp 基于vue做的webapp模版,基于mdui的webapp,在mdui分支 axios、vue、vue-router、webpack、express、mdui、vuex、localstorage
visualKeyboard 自己写的支持中文和英文输入的虚拟键盘,主要业务场景是PC查询机,中文输入法有搜狗默认皮肤、西瓜皮肤和三个coding洋葱猴皮肤。 css、jquery、simpleInputMethod
modal.js 这是一个基于bootstrap二次开发的dialog插件,支持多个参数的定制,配有基础使用文档,使用本插件之前需要引用bootstrap的前置环境。 bootstrap、jQuery、modal、gitbook
all-year-calendar 基于jq,amazeui与bootstrap的一个全年考勤日历插件,支持工作日和非工作日状态的修改设置,支持全年日历的切换 amazeui、jquery、calender、all-year
ACE-WEBIDE An online javascript Editor based on ace Editor and layui ace、layui、online-editor、webide
wu_nyu_dictionary 基于apollo,graphQL,mdui,vue全家桶等等的吳語小詞典。 apollo、apollo-client、apollographql、mdui、vue-router3、webpack4、express、wu-nyu、vue-apollo
moTool 集合了一些平时写的小工具函数,方便自己做相关api能力测试。 vue、plugins、layui-demo、motool
更多作品 更多作品可以去我的github仓库中查看 bootstrap、vue、ionic5、angular7、typescript3、ionic、electron、es6、node、python、luppo、travis-cli、iceworks、html2canvas、echart、json、io、localStorage、session、mvvm、OOCSS、bem、graphql、express、nodejs、apollo-graphql、apollo-server-express、graphql-tools、apollo-server、esri、layui、mui

开源贡献
项目 描述 tag
xgplayer 修改文档说明错误 video
pipcook 修改文档说明错误 machine-learning、js
midwayjs 在社区帮忙答疑,提有效 bug issue midwayjs,eggjs
qiankun 在社区帮忙答疑,提有效 bug issue jquery,qiankun,requirejs,ztree
ice 飞冰 - 让前端开发简单而友好 https://alibaba.github.io/ice/block?type=vue,主要是做vue社区物料贡献,vue社区一共20个物料,我这边贡献了四个异常错误页面,和大部分图表示例代码(大概十个左右) vue、alibaba、ice、echart、exception
scaffold-market scaffold market for single page application,http://scaffold.ant.design/,主要是向社区提供了一个vue-admin模板,当时结合bootstrap和vue写的一个后台模板,主要写了五个通用组件。 vue、ant-design、scaffold-market、bootstrap、vue-router、vuex、localStorage
hexo-theme-melon 在hexo-theme-yilia主题基础上,个人定制一定样式,支持gitment的hexo主题,添加文章内容检索功能,修改了左侧目录区和右侧文章区相关宽度占比,修改之后的主题比较适合girl hexo、sass、gulp、gitment、npm、ejs、git、webpack、yilia、vue

社区共建
书名 描述 tag
rust-tutorial 学习rust过程中,相关基础文章综合,希望帮助他人更好入门rust rust、roket、llvm、lldb、rust-book、gfx-rs
learn-es6 学习阮一峰老师的es6tutorial文章输出,之前阅读时由于每个章节内容比较综合,对于学习持续性要求比较高,这边学习过程中按照个人习惯分了十二章,进行辅助分类学习 es6、ruanyf
GraphQL-chatSheet 学习GraphQL过程中相关知识的速查表 graphql、express、nodejs、apollo-graphql、apollo-server-express、graphql-tools、apollo-server、child-process

learn-es6's People

Contributors

mowatermelon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

learn-es6's Issues

Array.prototype.filter()

基础语法

var new_array = arr.filter(callback(element[, index[, array]])[, thisArg])

参数说明

callback

用来测试数组的每个元素的函数。调用时使用参数 (element, index, array)。
返回true表示保留该元素(通过测试),false则不保留。它接受三个参数:

- element
  当前在数组中处理的元素。
- index 可选
   正在处理元素在数组中的索引。
- array 可选
   调用了filter的数组。

thisArg 可选

可选。执行 callback 时的用于 this 的值。

返回值说明

一个新的通过测试的元素的集合的数组,如果没有通过测试则返回空数组

详细说明

filter() 方法创建一个新数组, 其包含通过所提供函数实现的测试的所有元素。

filter 为数组中的每个元素调用一次 callback 函数,并利用所有使得 callback 返回 true 或 等价于 true 的值 的元素创建一个新数组。callback 只会在已经赋值的索引上被调用,对于那些已经被删除或者从未被赋值的索引不会被调用。那些没有通过 callback 测试的元素会被跳过,不会被包含在新数组中。

callback 被调用时传入三个参数:元素的值元素的索引被遍历的数组

如果为 filter 提供一个 thisArg 参数,则它会被作为 callback 被调用时的 this 值。否则,callbackthis 值在非严格模式下将是全局对象,严格模式下为 undefined

callback 最终观察到的this值是根据通常函数所看到的 this的规则确定的。

filter 不会改变原数组,它返回过滤后的新数组。

filter 遍历的元素范围在第一次调用 callback 之前就已经确定了。在调用 filter 之后被添加到数组中的元素不会被 filter 遍历到。如果已经存在的元素被改变了,则他们传入 callback 的值是 filter 遍历到它们那一刻的值。被删除或从来未被赋值的元素不会被遍历到。

案例

筛选排除掉所有的小值

下例使用 filter 创建了一个新数组,该数组的元素由原数组中值大于 10 的元素组成。

function isBigEnough(element) {
  return element >= 10;
}
var filtered = [12, 5, 8, 130, 44].filter(isBigEnough);
// filtered is [12, 130, 44]

过滤JSON中的无效条目

以下示例使用filter()创建具有非零idjson

var arr = [
  { id: 15 },
  { id: -1 },
  { id: 0 },
  { id: 3 },
  { id: 12.2 },
  { },
  { id: null },
  { id: NaN },
  { id: 'undefined' }
];

var invalidEntries = 0;

function isNumber(obj) {
  return obj !== undefined && typeof(obj) === 'number' && !isNaN(obj);
}

function filterByID(item) {
  if (isNumber(item.id) && item.id !== 0) {
    return true;
  } 
  invalidEntries++;
  return false; 
}

var arrByID = arr.filter(filterByID);

console.log('Filtered Array\n', arrByID); 
// Filtered Array
// [{ id: 15 }, { id: -1 }, { id: 3 }, { id: 12.2 }]

console.log('Number of Invalid Entries = ', invalidEntries); 
// Number of Invalid Entries = 5

在数组中搜索

以下示例使用filter()根据搜索条件过滤数组内容

const fruits = ['apple', 'banana', 'grapes', 'mango', 'orange'];

/**
 * Array filters items based on search criteria (query)
 */
const filterItems = (query) => {
  return fruits.filter((el) =>
    el.toLowerCase().indexOf(query.toLowerCase()) > -1
  );
}

console.log(filterItems('ap')); // ['apple', 'grapes']
console.log(filterItems('an')); // ['banana', 'mango', 'orange']

Polyfill

该代码允许在那些没有原生支持 filter 的实现环境中使用它。该算法是 ECMA-262 第 5 版中指定的算法,假定 fn.call 等价于 Function.prototype.call 的初始值,且 Array.prototype.push 拥有它的初始值。

if (!Array.prototype.filter)
{
  Array.prototype.filter = function(fun /* , thisArg*/)
  {
    "use strict";

    if (this === void 0 || this === null)
      throw new TypeError();

    var t = Object(this);
    var len = t.length >>> 0;
    if (typeof fun !== "function")
      throw new TypeError();

    var res = [];
    var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
    for (var i = 0; i < len; i++)
    {
      if (i in t)
      {
        var val = t[i];

        // NOTE: Technically this should Object.defineProperty at
        //       the next index, as push can be affected by
        //       properties on Object.prototype and Array.prototype.
        //       But that method's new, and collisions should be
        //       rare, so use the more-compatible alternative.
        if (fun.call(thisArg, val, i, t))
          res.push(val);
      }
    }

    return res;
  };
}

Array.prototype.includes()

基础语法

arr.includes(searchElement)
arr.includes(searchElement, fromIndex)

参数说明

searchElement

需要查找的元素值。

fromIndex 可选

从该索引处开始查找 searchElement。如果为负值,则按升序从 array.length - fromIndex 的索引开始搜索。默认为 0

返回值说明

一个 Boolean

详细说明

includes() 方法用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回 true,否则返回false

案例

[1, 2, 3].includes(2);     // true
[1, 2, 3].includes(4);     // false
[1, 2, 3].includes(3, 3);  // false
[1, 2, 3].includes(3, -1); // true
[1, 2, NaN].includes(NaN); // true

fromIndex 大于等于数组长度

如果fromIndex 大于等于数组长度 ,则返回 false 。该数组不会被搜索。

var arr = ['a', 'b', 'c'];

arr.includes('c', 3);   //false
arr.includes('c', 100); // false

计算出的索引小于 0

如果 fromIndex 为负值,计算出的索引将作为开始搜索searchElement的位置。如果计算出的索引小于 0,则整个数组都会被搜索。

// 数组长度是3
// fromIndex 是 -100
// computed index 是 3 + (-100) = -97

var arr = ['a', 'b', 'c'];

arr.includes('a', -100); // true
arr.includes('b', -100); // true
arr.includes('c', -100); // true

includes() 作为一个通用方法

includes() 方法有意设计为通用方法。它不要求this值是数组对象,所以它可以被用于其他类型的对象 (比如类数组对象)。下面的例子展示了 在函数的arguments对象上调用的includes() 方法。

(function() {
  console.log([].includes.call(arguments, 'a')); // true
  console.log([].includes.call(arguments, 'd')); // false
})('a','b','c');

Polyfill

// https://tc39.github.io/ecma262/#sec-array.prototype.includes
if (!Array.prototype.includes) {
  Object.defineProperty(Array.prototype, 'includes', {
    value: function(searchElement, fromIndex) {

      // 1. Let O be ? ToObject(this value).
      if (this == null) {
        throw new TypeError('"this" is null or not defined');
      }

      var o = Object(this);

      // 2. Let len be ? ToLength(? Get(O, "length")).
      var len = o.length >>> 0;

      // 3. If len is 0, return false.
      if (len === 0) {
        return false;
      }

      // 4. Let n be ? ToInteger(fromIndex).
      //    (If fromIndex is undefined, this step produces the value 0.)
      var n = fromIndex | 0;

      // 5. If n ≥ 0, then
      //  a. Let k be n.
      // 6. Else n < 0,
      //  a. Let k be len + n.
      //  b. If k < 0, let k be 0.
      var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);

      // 7. Repeat, while k < len
      while (k < len) {
        // a. Let elementK be the result of ? Get(O, ! ToString(k)).
        // b. If SameValueZero(searchElement, elementK) is true, return true.
        // c. Increase k by 1.
        // NOTE: === provides the correct "SameValueZero" comparison needed here.
        if (o[k] === searchElement) {
          return true;
        }
        k++;
      }

      // 8. Return false
      return false;
    }
  });
}

mobx 概念与原则

概念

MobX 区分了以下几个应用中的概念。 在之前的要点中已经见过了,现在让我们更深入地了解它们。

1. State(状态)

状态 是驱动应用的数据。 通常有像待办事项列表这样的领域特定状态,还有像当前已选元素的视图状态。 记住,状态就像是有数据的excel表格

2. Derivations(衍生)

任何源自状态并且不会再有任何进一步的相互作用的东西就是衍生衍生以多种形式存在:

  • 用户界面
  • 衍生数据,比如剩下的待办事项的数量。
  • 后端集成,比如把变化发送到服务器端。

MobX 区分了两种类型的衍生:

  • Computed values(计算值) - 它们是永远可以使用纯函数(pure function)从当前可观察状态中衍生出的值。
  • Reactions(反应) - Reactions 是当状态改变时需要自动发生的副作用。需要有一个桥梁来连接命令式编程(imperative programming)和响应式编程(reactive programming)。或者说得更明确一些,它们最终都需要实现I / O 操作。

刚开始使用 MobX 时,人们倾向于频繁的使用 reactions黄金法则: 如果你想创建一个基于当前状态的值时,请使用 computed

回到excel表格这个比喻中来,公式计算值衍生。但对于用户来说,能看到屏幕给出的反应则需要部分重绘GUI

3. Actions(动作)

动作 是任一一段可以改变状态的代码。用户事件后端数据推送预定事件、等等。 动作类似于用户在excel单元格中输入一个新的值。

MobX 中可以显式地定义动作,它可以帮你把代码组织的更清晰。 如果是在严格模式下使用 MobX的话,MobX 会强制只有在动作之中才可以修改状态

原则

MobX 支持单向数据流,也就是动作改变状态,而状态的改变会更新所有受影响的视图。

Action ==> State ==> View

当状态改变时,所有衍生都会进行原子级自动更新。因此永远不可能观察到中间值。

所有衍生默认都是同步更新。这意味着例如动作可以在改变状态之后直接可以安全地检查计算值

计算值延迟更新的。任何不在使用状态的计算值将不会更新,直到需要它进行副作用(I / O)操作时。 如果视图不再使用,那么它会自动被垃圾回收。

所有的计算值都应该是纯净的。它们不应该用来改变状态。

实例

import {observable, autorun} from 'mobx';

var todoStore = observable({
    /* 一些观察的状态 */
    todos: [],

    /* 推导值 */
    get completedCount() {
        return this.todos.filter(todo => todo.completed).length;
    }
});

/* 观察状态改变的函数 */
autorun(function() {
    console.log("Completed %d of %d items",
        todoStore.completedCount,
        todoStore.todos.length
    );
});

/* ..以及一些改变状态的动作 */
todoStore.todos[0] = {
    title: "Take a walk",
    completed: false
};
// -> 同步打印 'Completed 0 of 1 items'

todoStore.todos[0].completed = true;
// -> 同步打印 'Completed 1 of 1 items'

momentjs

官网

http://momentjs.com/

image

官方仓库

https://github.com/moment/moment

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/moment

image

在线运行地址

https://npm.runkit.com/moment

image

基础介绍

一个轻量级JavaScript日期库,用于解析验证操作格式化日期。

基础安装

npm install moment --save   # npm
yarn add moment             # Yarn
Install-Package Moment.js   # NuGet
spm install moment --save   # spm
meteor add momentjs:moment  # meteor

基础使用

Token Output
Month M 1 2 ... 11 12
Mo 1st 2nd ... 11th 12th
MM 01 02 ... 11 12
MMM Jan Feb ... Nov Dec
MMMM January February ... November December
Quarter Q 1 2 3 4
Qo 1st 2nd 3rd 4th
Day of Month D 1 2 ... 30 31
Do 1st 2nd ... 30th 31st
DD 01 02 ... 30 31
Day of Year DDD 1 2 ... 364 365
DDDo 1st 2nd ... 364th 365th
DDDD 001 002 ... 364 365
Day of Week d 0 1 ... 5 6
do 0th 1st ... 5th 6th
dd Su Mo ... Fr Sa
ddd Sun Mon ... Fri Sat
dddd Sunday Monday ... Friday Saturday
Day of Week (Locale) e 0 1 ... 5 6
Day of Week (ISO) E 1 2 ... 6 7
Week of Year w 1 2 ... 52 53
wo 1st 2nd ... 52nd 53rd
ww 01 02 ... 52 53
Week of Year (ISO) W 1 2 ... 52 53
Wo 1st 2nd ... 52nd 53rd
WW 01 02 ... 52 53
Year YY 70 71 ... 29 30
YYYY 1970 1971 ... 2029 2030
Y 1970 1971 ... 9999 +10000 +10001 Note: This complies with the ISO 8601 standard for dates past the year 9999
Week Year gg 70 71 ... 29 30
gggg 1970 1971 ... 2029 2030
Week Year (ISO) GG 70 71 ... 29 30
GGGG 1970 1971 ... 2029 2030
AM/PM A AM PM
a am pm
Hour H 0 1 ... 22 23
HH 00 01 ... 22 23
h 1 2 ... 11 12
hh 01 02 ... 11 12
k 1 2 ... 23 24
kk 01 02 ... 23 24
Minute m 0 1 ... 58 59
mm 00 01 ... 58 59
Second s 0 1 ... 58 59
ss 00 01 ... 58 59
Fractional Second S 0 1 ... 8 9
SS 00 01 ... 98 99
SSS 000 001 ... 998 999
SSSS ... SSSSSSSSS 000[0..] 001[0..] ... 998[0..] 999[0..]
Time Zone z or zz EST CST ... MST PST Note: as of 1.6.0, the z/zz format tokens have been deprecated from plain moment objects. Read more about it here. However, they do work if you are using a specific time zone with the moment-timezone addon.
Z -07:00 -06:00 ... +06:00 +07:00
ZZ -0700 -0600 ... +0600 +0700
Unix Timestamp X 1360013296
Unix Millisecond Timestamp x 1360013296123

格式化日期

  • M()对于[]|{}|undefined认为和未传参的结果一样,获取当前时间。
  • M()对于""|''|null认为和其他非法参数的结果一样,返回的是一个_isValid: falseMoment对象,如果尝试格式化会直接返回Invalid date
  • M()对于时间戳支持解析转译。
  • M()对于日期格式字符串也支持解析转译。
    • M(String, String);---> M(dateVar, formatConfig); ---> M("12-25-1995", "MM-DD-YYYY");
    • M(String, String[]);---> M(dateVar, formatConfigArr); ---> M("12-25-1995", ["MM-DD-YYYY", "YYYY-MM-DD"]);只要在formatConfigArr找到一个可以正确解析dateVar,就可以正常解析日期。
    • M(String, String, String);---> M(dateVar, formatConfig,locateName); ---> M("2012 juillet', 'YYYY MMM', 'fr');
    • M(String, String, Boolean);---> M(dateVar, formatConfig,isStrictParse); ---> M("12-25-1995", "MM-DD-YYYY",true);
    • M(String, String, String, Boolean);---> M(dateVar, formatConfig,locateName,isStrictParse); ---> M("2012 juillet', 'YYYY MMM', 'fr',true);
  • M()对于日期格式数组也支持解析转译。
(function (log) {
    const M = require('moment');
    log(M());
    // Moment
    // _d: Sun Jan 26 2019 23:00:17 GMT+0800 (**标准时间)
    // _isAMomentObject: true
    // _isUTC: false
    // _isValid: true
    // _locale: Locale {_abbr: "en", _calendar: Object {lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", …}, …}
    // _pf: Object {charsLeftOver: 0, empty: false, invalidFormat: false, invalidMonth: null, iso: false, meridiem: null, …}
    log(M([]).format('YYYY/MM/d HH:mm:ss'));// "2019/01/6 23:00:17"
    log(M({}).format('YYYY/MM/d HH:mm:ss'));// "2019/01/6 23:00:17"
    log(M(undefined).format('YYYY/MM/d HH:mm:ss'));// "2019/01/6 23:00:17"

    log(M(""));
    // Moment
    // _d: Invalid Date
    // _i: NaN
    // _isAMomentObject: true
    // _isUTC: true
    // _isValid: false
    // _locale: Locale {_abbr: "en", _calendar: Object {lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", …}, …}
    // _pf: Object {charsLeftOver: 0, empty: false, invalidFormat: false, invalidMonth: null, iso: false, meridiem: null, …}
    log(M('').format('YYYY/MM/d HH:mm:ss'));// "Invalid date"
    log(M(null).format('YYYY/MM/d HH:mm:ss'));// "Invalid date"

    log(M(1).format('YYYY/MM/d HH:mm:ss'));// "1970/01/4 08:00:00" 不知晓这个是为何
    log(M(678).format('YYYY/MM/d HH:mm:ss'));// "1970/01/4 08:00:00" 不知晓这个是为何
    log(M("123", "hmm").format("HH:mm"));// "01:23"
    log(M("1234", "hmm").format("HH:mm"));// "12:34"
    log(M().format('YYYY/MM/d HH:mm:ss'));// "2019/01/6 23:00:17"
    log(M().format('YYYYMMdHHmmss'));// "2019016230017"
    log(M().format('MMMM Do YYYY, h:mm:ss a'));// "January 26th 2019, 11:00:17 pm"
    log(M().format('MMMM Do YYYY, h:mm:ss'));// "January 26th 2019, 11:00:17"
    log(M().format('MMMM Do YYYY, H:mm:ss'));// "January 26th 2019, 23:00:17"
    log(M().format('dddd'));// "Saturday"
    log(M().format("MMM Do YY"));// "Jan 26th 19"
    log(M().format('YYYY [escaped] YYYY'));// "2019 escaped 2019"
    log(M().format());// "2019-01-26T23:00:17+08:00"

    log(M(1318781876406).format('YYYY/MM/d HH:mm:ss'));       // "2011/10/1 00:17:56"
    log(M("12-25-1995", "MM-DD-YYYY").format('YYYY/MM/d HH:mm:ss'));// "1995/12/1 00:00:00"
    log(M("12/25/1995", ["MM-DD-YYYY", "YYYY-MM-DD"]).format('YYYY/MM/d HH:mm:ss'));// "1995/12/1 00:00:00"

    log(M('2012 juillet', 'YYYY MMM').format('YYYY/MM/d HH:mm:ss'));// "Invalid date"
    log(M('2012 juillet', 'YYYY MMM', 'fr').format('YYYY/MM/d HH:mm:ss'));// "2012/07/0 00:00:00"

    log(M('It is 2012-05-25', 'YYYY-MM-DD').format('YYYY/MM/d HH:mm:ss'));       // "2012/05/5 00:00:00"
    log(M('It is 2012-05-25', 'YYYY-MM-DD', true).format('YYYY/MM/d HH:mm:ss')); // "Invalid date"
    log(M('2012-05-25',       'YYYY-MM-DD', true).format('YYYY/MM/d HH:mm:ss')); // "2012/05/5 00:00:00"
    log(M('2012.05.25',       'YYYY-MM-DD').format('YYYY/MM/d HH:mm:ss')); // "2012/05/5 00:00:00"
    log(M('2012.05.25',       'YYYY-MM-DD', true).format('YYYY/MM/d HH:mm:ss')); //"Invalid date"

    log(M(['2012','.05','.25'],       'YYYY-MM-DD').format('YYYY/MM/d HH:mm:ss')); // "2012/05/5 00:00:00"
    log(M(['2012','.05','.25'],       'YYYY-MM-DD', true).format('YYYY/MM/d HH:mm:ss')); //"Invalid  date"
})(console.log)

验证指定值是否是一个合法的日期值

通过M(xx).isValid()进行数据校验

(function (log) {
    const M = require('moment');
    log(M([]).isValid());// true
    log(M({}).isValid());// true
    log(M(undefined).isValid());// true

    log(M("").isValid());// false
    log(M('').isValid());// false
    log(M(null).isValid());// false

    log(M("12-25-1995", "MM-DD-YYYY").isValid());// true
    log(M("12/25/1995", "MM-DD-YYYY").isValid());// true

    log(M('2012 juillet', 'YYYY MMM').isValid());// false 默认的locate是en,juillet不是一个合法的月份名
    log(M('2012 juillet', 'YYYY MMM', 'fr').isValid());// true

    log(M('It is 2012-05-25', 'YYYY-MM-DD').isValid());       // true
    log(M('It is 2012-05-25', 'YYYY-MM-DD', true).isValid()); // false 严格模式下,只解析纯时间字符串
    log(M('2012-05-25',       'YYYY-MM-DD', true).isValid()); // true
    log(M('2012.05.25',       'YYYY-MM-DD').isValid()); // true
    log(M('2012.05.25',       'YYYY-MM-DD', true).isValid()); // false 严格模式下,只解析纯时间字符串

    log(M([2018, 13]).isValid());     // false 月份不存在13月
    log(M("2018 13",           "YYYY MM").isValid());     // false 月份不存在13月
    log(M([2018, 11, 31]).isValid()); // true 黑人问号脸.jpg
    log(M("2018 11 31",        "YYYY MM DD").isValid());   // false 十一月没有31号
    log(M([2018, 2, 29]).isValid());  // true 黑人问号脸.jpg
    log(M("2018 2 29",         "YYYY MM DD").isValid());   // false 不是闰年,二月没有29号
    log(M("2018 notamonth 29", "YYYY MMM DD").isValid()); // false 不是一个真实的月份名称
})(console.log)

获取指定日期距离今天的时间

可以获取指定日期距离今天的时间间隔

  • 如果指定日期是今天之前的日期,会返回X year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s) ago
  • 如果指定日期是今天之后的日期,会返回in X year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s)
  • 可以通过startOf指定检测类型year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s),返回格式是为X year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s) ago,获取当年已经过了多少或者当天已经过了多少小时当前小时段内已经过了多少分钟,当前分钟内段已经过了多少
  • 可以通过endOf指定检测类型year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s),返回格式是为in X year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s),获取当年剩余多少或者当天剩余多少小时当前小时段内剩余多少分钟,当前分钟内段还剩余多少
(function (log) {
    const M = require('moment');

    log(M("20110620", "YYYYMMDD").fromNow());// "8 years ago"
    log(M("20111031", "YYYYMMDD").fromNow());// "7 years ago" 不知晓这个是为何
    log(M("20120620", "YYYYMMDD").fromNow());// "7 years ago"
    log(M("20181225", "YYYYMMDD").fromNow());// "a month ago"
    log(M("20190125", "YYYYMMDD").fromNow());// "2 day ago"
    log(M("20190126", "YYYYMMDD").fromNow());// "a day ago"
    log(M("20190126 10:00:00", "YYYYMMDD").fromNow());// "a day ago"
    log(M("20190126 10:00:00", "YYYYMMDD h:mm:ss").fromNow());// "13 hours ago"
    log(M("20190126 22:14:00", "YYYYMMDD h:mm:ss").fromNow());// "18 minutes ago"
    log(M("20190126 22:33:00", "YYYYMMDD h:mm:ss").fromNow());// "a few seconds ago"

    log(M("20200620", "YYYYMMDD").fromNow());// "in a year"
    log(M("20191031", "YYYYMMDD").fromNow());// "in 9 months"
    log(M("20190225", "YYYYMMDD").fromNow());// "in a month"
    log(M("20190128", "YYYYMMDD").fromNow());// "in a day"
    log(M("20190128 10:00:00", "YYYYMMDD").fromNow());// "in a day"
    log(M("20190127 00:00:00", "YYYYMMDD h:mm:ss").fromNow());// "in an hour"
    log(M("20190126 22:45:00", "YYYYMMDD h:mm:ss").fromNow());// "in 5 minutes"
    log(M("20190126 22:39:59", "YYYYMMDD h:mm:ss").fromNow());// "in a few seconds"

    // 2019/01/26 22:47:00
    log(M().startOf('year').fromNow());// "a month ago"
    log(M().startOf('month').fromNow());// "a month ago"
    log(M().startOf('day').fromNow());// "an hour ago" 不知晓这个是为何
    log(M().startOf('hour').fromNow());// "44 minutes ago"
    log(M().startOf('minutes').fromNow());// "a few seconds ago"
    log(M().startOf('second').fromNow());// "a few seconds ago"

    // 2019/01/26 22:47:33
    log(M().endOf('year').fromNow());// "in a year"
    log(M().endOf('month').fromNow());// "in 5 days"
    log(M().endOf('day').fromNow());// "in an hour"
    log(M().endOf('hour').fromNow());// "in 12 minutes"
    log(M().endOf('minutes').fromNow());// "a few seconds ago"
    log(M().endOf('second').fromNow());// "a few seconds ago"
})(console.log)

获取当前日期计算之后的指定日期

  • 可以通过subtract指定检测类型year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s),返回格式是为dd/MM/YYYYxx at x:xx AM/PM,之后再通过calendar函数,获取当前日期减去指定时间之后的日期值
  • 可以通过add指定检测类型year(s)|day(s)|month(s)|hour(s)|minute(s)|second(s),返回格式是为dd/MM/YYYYxx at x:xx AM/PM,之后再通过calendar函数,获取当前日期加上指定时间之后的日期值
  • 也可以直接调用calendar()函数,,返回格式是为Today at x:xx AM/PM,获取当前日期日期值
(function (log) {
    const M = require('moment');

    log(M().subtract(10, 'years').calendar());// "01/26/2009"
    log(M().subtract(10, 'months').calendar());// "03/26/2018"
    log(M().subtract(10, 'days').calendar());// "01/16/2019"
    log(M().subtract(10, 'hours').calendar());// "Today at 1:09 PM"
    log(M().subtract(10, 'minutes').calendar());// "Today at 10:59 PM"
    log(M().subtract(10, 'seconds').calendar());// "Today at 11:09 PM"
    log(M().subtract(6, 'days').calendar());// "Last Sunday at 11:09 PM"
    log(M().subtract(3, 'days').calendar());// "Last Wednesday at 11:09 PM"
    log(M().subtract(1, 'days').calendar());// "Yesterday at 11:09 PM"

    log(M().add(10, 'years').calendar());// "01/26/2029"
    log(M().add(10, 'months').calendar());// "11/26/2019"
    log(M().add(10, 'days').calendar());// "02/05/2019"
    log(M().add(10, 'hours').calendar());// "Tomorrow at 9:15 AM"
    log(M().add(10, 'minutes').calendar());// "Today at 11:25 PM"
    log(M().add(10, 'seconds').calendar());// "Today at 11:16 PM"
    log(M().add(6, 'days').calendar());// "Friday at 11:15 PM"
    log(M().add(3, 'days').calendar());// "Tuesday at 11:15 PM"
    log(M().add(1, 'days').calendar());// "Tomorrow at 11:15 PM"

    log(M().calendar());// "Today at 11:17 PM"
})(console.log)

将当前日期按照指定locale格式进行格式化

http://momentjs.com/docs/#/i18n/

  • 使用默认的国际化地区
(function (log) {
    const M = require('moment');

    log(M.locale());// "en"
    log(M().format('LT'));// "11:21 PM"
    log(M().format('LTS'));// "11:21:30 PM"
    log(M().format('L'));// "01/26/2019"
    log(M().format('l'));// "1/26/2019"
    log(M().format('LL'));// "January 26, 2019"

    log(M().format('ll'));// "Jan 26, 2019"
    log(M().format('LLL'));// ""Jan 26, 2019 11:21 PM"
    log(M().format('lll'));// "Jan 26, 2019 11:21 PM"
    log(M().format('LLLL'));// "Saturday, January 26, 2019 11:21 PM"
    log(M().format('llll'));// "Sat, Jan 26, 2019 11:21 PM"
})(console.log)
  • 指定国际化的地区配置
    • M.locale(localeName[,localeSetting]),会返回当前默认的locale,如果没有设置过,会返回en,也可以通过传入正确的locale类型,修改当前的locale,如果传入的locale类型不对,则返回上一次的设置值。
    • 按照指定locale,显示对应区域中指定格式的日期值。
(function (log) {
    const M = require('moment');
    M.locale('fr', {
        months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
        monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
        monthsParseExact : true,
        weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
        weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
        weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'),
        weekdaysParseExact : true,
        longDateFormat : {
            LT : 'HH:mm',
            LTS : 'HH:mm:ss',
            L : 'DD/MM/YYYY',
            LL : 'D MMMM YYYY',
            LLL : 'D MMMM YYYY HH:mm',
            LLLL : 'dddd D MMMM YYYY HH:mm'
        },
        calendar : {
            sameDay : '[Aujourd’hui à] LT',
            nextDay : '[Demain à] LT',
            nextWeek : 'dddd [à] LT',
            lastDay : '[Hier à] LT',
            lastWeek : 'dddd [dernier à] LT',
            sameElse : 'L'
        },
        relativeTime : {
            future : 'dans %s',
            past : 'il y a %s',
            s : 'quelques secondes',
            m : 'une minute',
            mm : '%d minutes',
            h : 'une heure',
            hh : '%d heures',
            d : 'un jour',
            dd : '%d jours',
            M : 'un mois',
            MM : '%d mois',
            y : 'un an',
            yy : '%d ans'
        },
        dayOfMonthOrdinalParse : /\d{1,2}(er|e)/,
        ordinal : function (number) {
            return number + (number === 1 ? 'er' : 'e');
        },
        meridiemParse : /PD|MD/,
        isPM : function (input) {
            return input.charAt(0) === 'M';
        },
        // In case the meridiem units are not separated around 12, then implement
        // this function (look at locale/id.js for an example).
        // meridiemHour : function (hour, meridiem) {
        //     return /* 0-23 hour, given meridiem token and hour 1-12 */ ;
        // },
        meridiem : function (hours, minutes, isLower) {
            return hours < 12 ? 'PD' : 'MD';
        },
        week : {
            dow : 1, // Monday is the first day of the week.
            doy : 4  // Used to determine first week of the year.
        }
    });
    log(M.locale('fr'));// "fr"
    log(M.locale('swtyu'));// "fr" 因为 swtyu 不正确,所以自动保留上次设置值
    var m = M(1316116057189);
    log(m.fromNow()); // "il y a 7 ans"
    log(M().format('LT'));// "23:44"
    log(M().format('LTS'));// "23:44:00"
    log(M().format('L'));// "26/01/2019"
    log(M().format('l'));// "26/1/2019"
    log(M().format('LL'));// "26 janvier 2019"

    log(M().format('ll'));// "26 janv. 2019"
    log(M().format('LLL'));// "26 janvier 2019 23:44"
    log(M().format('lll'));// "26 janv. 2019 23:44"
    log(M().format('LLLL'));// "samedi 26 janvier 2019 23:44"
    log(M().format('llll'));// "sam. 26 janv. 2019 23:44"

    log(M.locale('en'));// "en"
    log(m.fromNow()); // il y a une heure 这个会记住在这个变量声明时的当前默认时区
    log(M(1316116057189).fromNow()); // "7 years ago"

})(console.log)

相关网站

算法刷题相关建议

算法刷题网站推荐

国内

力扣

https://leetcode-cn.com/problemset/all/

leetcode**

nowcoder

https://www.nowcoder.com/

牛客网作为**最大的IT题库,来到这就是一个字,刷~而且结合着论坛,求职,给程序员很好的一个体验,里面的帖子都很有含量,要不就是你去提问总有热心牛友帮你回答,牛客网的CEO叶神,牛妹也会经常出没,帮助大家。

lintcode

https://www.lintcode.com/zh-cn/

这个被称作中文版的leetcode,也是可以做为编程能力提升的一个中转站。

hihocoder

http://www.hihocoder.com/

对这个网站的好感度也比较好,可能是因为跟acm的风格很像的缘故吧,每周都会有一个竞赛题目,可以参与其中,据说最早来自于原北京大学POJ团队,一周一个编程题,非常不错的,主要是有一定趣味性。

codevs

http://www.codevs.cn/problemset/

OI 竞赛网站,全国信息学竞赛专用刷题网站。

从专业角度来看题库比较全,容纳了绝大多数题库并购买了国外的一些正版题库的版权。

评测系统专业,题解和论坛交流的系统都用起来很方便,也有稳定的大量使用者。

从界面来看基本是最新的,很符合年轻人口味。

luogu

https://www.luogu.org/

洛谷刷题,题目比较全,界面比较友好。

赛码网

http://www.acmcoder.com/index

IT笔试加分利器

uestc OJ

https://acm.uestc.edu.cn/home

https://github.com/lutece-awesome/osiris

电子科技大学OJ平台,墙裂推荐,界面比其他大学的OJ界面好太多。

POJ

https://poj.org/

北京大学的OJ,上面题目有点久远,不过很适合上手,题目相对比较简单,经典算法会比较多,不过不是特别建议这个了,经典题目在其他很多网站上也能找到的,如果就想来看看这些经典题目,也是可以的。

ZOJ

https://acm.zju.edu.cn/onlinejudge/

这个是浙江大学的Online Judge,也是经典题目会比较多,更新也是几乎到一个阶段了,我已经很久没有来过了。

HOJ

http://acm.hdu.edu.cn/

杭州电子大学acm

july刷题总结

https://github.com/julycoding/The-Art-Of-Programming-By-July/blob/master/ebook/zh/Readme.md

计蒜课

https://nanti.jisuanke.com/

有相关课程,比赛和题库

国外

topCoder

https://www.topcoder.com/

就这名字就足以让人感觉到它的地位了,没错,这可是全世界规模最大的程序竞赛网站了,也会有一些算法竞赛,这个比较适合一些高端的或者搞acm的,也会举办一些比赛,能参观一下也是多少人心之所向。

leetcode

https://leetcode.com/problemset/all/

美国的刷题网站,支持多种语言,目前只支持英文刷题。

HackerRank

https://www.hackerrank.com/domains/algorithms?filters%5Bstatus%5D%5B%5D=unsolved&badge_type=problem-solving

专门举办各种算法竞赛的网站,只支持英文。

VJ

https://vjudge.net/

这个是一个集成平台,收集了很多平台的题目。

POJ ZOJ UVALive SGU URAL HUST SPOJ HDU HYSBZ UVA CodeForces Z-Trening Aizu LightOJ UESTC NBUT FZU CSU SCU ACdream CodeChef CF::Gym OpenJudge Kattis HihoCoder HIT HRBUST EIJudge AtCoder HackerRank 51Nod TopCoder E-Olymp

Codility

https://codility.com/

这个网站也是非常有名的,主要是帮助各大公司笔试的,可以在线编程,而且支持的语言非常多,很适合来这列刷题的,所以英语不好的一定要多学习的,其实英语这个东西就是你越不看英文的就越没有感觉,身为一个程序员,英文不好怎么行呢

Codeforces

http://codeforces.com/

这个网站是俄罗斯的最大的算法比赛网站了,可以和大家交流学习,也是一个自学的好地方,当然,要有一定的自学能力。

AtCoder

https://atcoder.jp/

这个网站是 日本最大的算法竞赛网站,题风很棒。有英文和日文题解,很贴心,但是我们应该很少有人能够用日语看题看网站,所以我们可以将网站调成英文的。

Timus Online Judge

http://acm.timus.ru/

这个网站是一个俄罗斯的题库,页面特别朴素,里面的题目也是比较适合有一定基础的来这里提升。

SPOJ

https://www.spoj.com/problems/

全称是Sphere Online Judge (SPOJ) - Problems,这个网站是波兰的,但是讨厌的是广告好多,弄的不知所以,界面还挺好看的,也是有一定基础才可以。

USACO

http://www.usaco.org/

全称是USA Computing Olympiad,usaco是美国中学生的官方竞赛网站。

是美国著名在线题库,专门为信息学竞赛选手准备。推荐直接阅读英语原文,既准确可靠又可提高英语水平。

做题方式模拟正式比赛,采用标准测评机、文件输入输出、直接提交程序源文件的测评方式。

网站的Training题目全面,是学习信息学不可不知的网站,每年NOI,NOIP 都会参考上面的题目。每道题附有详细题解,可查看测试数据和运行结果,便于调试、发现错误并改正。

采用章节递进的层次结构,由易到难,讲授知识、练习编程结合,题目必须依次完成,避免了只挑简单题做的行为。各章节犹如一本竞赛辅导书,形成了一个鲜明的知识结构,利于OI初学者和高手逐步提高水平,充分学习信息学各方面知识,避免偏颇。

UOJ

https://uva.onlinejudge.org/

全称Valladolid Online Judge,西班牙Valladolid大学的Online Judge。是最古老也是全世界最知名的Online Judge,这个是比较适合初学者的。国内也就是那么OJ,其实可以一段一段的练习,永远不怕练的多。

programmingpraxis

https://programmingpraxis.com/

此网站编程练习不保存分数、不排名、不竞赛

projecteuler

https://projecteuler.net/

有590道题,会显示难度水平和提交完成率

careercup

这个网站在墙外

https://www.careercup.com/


type-check

// Generated by LiveScript 1.4.0
(function(){
  var ref$, any, all, isItNaN, types, defaultType, customTypes, toString$ = {}.toString;
  ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN;
  types = {
    Number: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it);
      }
    },
    NaN: {
      typeOf: 'Number',
      validate: isItNaN
    },
    Int: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it) && it % 1 === 0;
      }
    },
    Float: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it);
      }
    },
    Date: {
      typeOf: 'Date',
      validate: function(it){
        return !isItNaN(it.getTime());
      }
    }
  };
  defaultType = {
    array: 'Array',
    tuple: 'Array'
  };
  function checkArray(input, type){
    return all(function(it){
      return checkMultiple(it, type.of);
    }, input);
  }
  function checkTuple(input, type){
    var i, i$, ref$, len$, types;
    i = 0;
    for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
      types = ref$[i$];
      if (!checkMultiple(input[i], types)) {
        return false;
      }
      i++;
    }
    return input.length <= i;
  }
  function checkFields(input, type){
    var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types;
    inputKeys = {};
    numInputKeys = 0;
    for (k in input) {
      inputKeys[k] = true;
      numInputKeys++;
    }
    numOfKeys = 0;
    for (key in ref$ = type.of) {
      types = ref$[key];
      if (!checkMultiple(input[key], types)) {
        return false;
      }
      if (inputKeys[key]) {
        numOfKeys++;
      }
    }
    return type.subset || numInputKeys === numOfKeys;
  }
  function checkStructure(input, type){
    if (!(input instanceof Object)) {
      return false;
    }
    switch (type.structure) {
    case 'fields':
      return checkFields(input, type);
    case 'array':
      return checkArray(input, type);
    case 'tuple':
      return checkTuple(input, type);
    }
  }
  function check(input, typeObj){
    var type, structure, setting, that;
    type = typeObj.type, structure = typeObj.structure;
    if (type) {
      if (type === '*') {
        return true;
      }
      setting = customTypes[type] || types[type];
      if (setting) {
        return setting.typeOf === toString$.call(input).slice(8, -1) && setting.validate(input);
      } else {
        return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj));
      }
    } else if (structure) {
      if (that = defaultType[structure]) {
        if (that !== toString$.call(input).slice(8, -1)) {
          return false;
        }
      }
      return checkStructure(input, typeObj);
    } else {
      throw new Error("No type defined. Input: " + input + ".");
    }
  }
  function checkMultiple(input, types){
    if (toString$.call(types).slice(8, -1) !== 'Array') {
      throw new Error("Types must be in an array. Input: " + input + ".");
    }
    return any(function(it){
      return check(input, it);
    }, types);
  }
  module.exports = function(parsedType, input, options){
    options == null && (options = {});
    customTypes = options.customTypes || {};
    return checkMultiple(input, parsedType);
  };
}).call(this);

type-check Build Status

type-check is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of levn. MIT license. Version 0.3.2. Check out the demo.

For updates on type-check, follow me on twitter.

npm install type-check

Quick Examples

// Basic types:
var typeCheck = require('type-check').typeCheck;
typeCheck('Number', 1);               // true
typeCheck('Number', 'str');           // false
typeCheck('Error', new Error);        // true
typeCheck('Undefined', undefined);    // true

// Comment
typeCheck('count::Number', 1);        // true

// One type OR another type:
typeCheck('Number | String', 2);      // true
typeCheck('Number | String', 'str');  // true

// Wildcard, matches all types:
typeCheck('*', 2) // true

// Array, all elements of a single type:
typeCheck('[Number]', [1, 2, 3]);                // true
typeCheck('[Number]', [1, 'str', 3]);            // false

// Tuples, or fixed length arrays with elements of different types:
typeCheck('(String, Number)', ['str', 2]);       // true
typeCheck('(String, Number)', ['str']);          // false
typeCheck('(String, Number)', ['str', 2, 5]);    // false

// Object properties:
typeCheck('{x: Number, y: Boolean}', {x: 2, y: false});             // true
typeCheck('{x: Number, y: Boolean}',       {x: 2});                 // false
typeCheck('{x: Number, y: Maybe Boolean}', {x: 2});                 // true
typeCheck('{x: Number, y: Boolean}',      {x: 2, y: false, z: 3});  // false
typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3});  // true

// A particular type AND object properties:
typeCheck('RegExp{source: String, ...}', /re/i);          // true
typeCheck('RegExp{source: String, ...}', {source: 're'}); // false

// Custom types:
var opt = {customTypes:
  {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}};
typeCheck('Even', 2, opt); // true

// Nested:
var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}'
typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true

Check out the type syntax format and guide.

Usage

require('type-check'); returns an object that exposes four properties. VERSION is the current version of the library as a string. typeCheck, parseType, and parsedTypeCheck are functions.

// typeCheck(type, input, options);
typeCheck('Number', 2);               // true

// parseType(type);
var parsedType = parseType('Number'); // object

// parsedTypeCheck(parsedType, input, options);
parsedTypeCheck(parsedType, 2);       // true

typeCheck(type, input, options)

typeCheck checks a JavaScript value input against type written in the type format (and taking account the optional options) and returns whether the input matches the type.

arguments
  • type - String - the type written in the type format which to check against
  • input - * - any JavaScript value, which is to be checked against the type
  • options - Maybe Object - an optional parameter specifying additional options, currently the only available option is specifying custom types
returns

Boolean - whether the input matches the type

example
typeCheck('Number', 2); // true

parseType(type)

parseType parses string type written in the type format into an object representing the parsed type.

arguments
  • type - String - the type written in the type format which to parse
returns

Object - an object in the parsed type format representing the parsed type

example
parseType('Number'); // [{type: 'Number'}]

parsedTypeCheck(parsedType, input, options)

parsedTypeCheck checks a JavaScript value input against parsed type in the parsed type format (and taking account the optional options) and returns whether the input matches the type. Use this in conjunction with parseType if you are going to use a type more than once.

arguments
  • type - Object - the type in the parsed type format which to check against
  • input - * - any JavaScript value, which is to be checked against the type
  • options - Maybe Object - an optional parameter specifying additional options, currently the only available option is specifying custom types
returns

Boolean - whether the input matches the type

example
parsedTypeCheck([{type: 'Number'}], 2); // true
var parsedType = parseType('String');
parsedTypeCheck(parsedType, 'str');     // true
## Type Format

Syntax

White space is ignored. The root node is a Types.

  • Identifier = [\$\w]+ - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. String
  • Type = an Identifier, an Identifier followed by a Structure, just a Structure, or a wildcard * - eg. String, Object{x: Number}, {x: Number}, Array{0: String, 1: Boolean, length: Number}, *
  • Types = optionally a comment (an Indentifier followed by a ::), optionally the identifier Maybe, one or more Type, separated by | - eg. Number, String | Date, Maybe Number, Maybe Boolean | String
  • Structure = Fields, or a Tuple, or an Array - eg. {x: Number}, (String, Number), [Date]
  • Fields = a {, followed one or more Field separated by a comma , (trailing comma , is permitted), optionally an ... (always preceded by a comma ,), followed by a } - eg. {x: Number, y: String}, {k: Function, ...}
  • Field = an Identifier, followed by a colon :, followed by Types - eg. x: Date | String, y: Boolean
  • Tuple = a (, followed by one or more Types separated by a comma , (trailing comma , is permitted), followed by a ) - eg (Date), (Number, Date)
  • Array = a [ followed by exactly one Types followed by a ] - eg. [Boolean], [Boolean | Null]

Guide

type-check uses Object.toString to find out the basic type of a value. Specifically,

{}.toString.call(VALUE).slice(8, -1)
{}.toString.call(true).slice(8, -1) // 'Boolean'

A basic type, eg. Number, uses this check. This is much more versatile than using typeof - for example, with document, typeof produces 'object' which isn't that useful, and our technique produces 'HTMLDocument'.

You may check for multiple types by separating types with a |. The checker proceeds from left to right, and passes if the value is any of the types - eg. String | Boolean first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false.

Adding a Maybe in front of a list of multiple types is the same as also checking for Null and Undefined - eg. Maybe String is equivalent to Undefined | Null | String.

You may add a comment to remind you of what the type is for by following an identifier with a :: before a type (or multiple types). The comment is simply thrown out.

The wildcard * matches all types.

There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'.

If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of Object and the properties pass - this allows for duck typing - eg. {x: Boolean}.

To check if the properties pass, and the value is of a certain type, you can specify the type - eg. Error{message: String}.

If you want to make a field optional, you can simply use Maybe - eg. {x: Boolean, y: Maybe String} will still pass if y is undefined (or null).

If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator ... - eg. {x: Boolean, ...} will match an object with an x property that is a boolean, and with zero or more other properties.

For an array, you must specify one or more types (separated by |) - it will pass for something of any length as long as each element passes the types provided - eg. [Number], [Number | String].

A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. (String, Number).

An array and tuple structure check that the value is of type Array by default, but if another type is specified, they will check for that instead - eg. Int32Array[Number]. You can use the wildcard * to search for any type at all.

Check out the type precedence library for type-check.

Options

Options is an object. It is an optional parameter to the typeCheck and parsedTypeCheck functions. The only current option is customTypes.

### Custom Types

Example:

var options = {
  customTypes: {
    Even: {
      typeOf: 'Number',
      validate: function(x) {
        return x % 2 === 0;
      }
    }
  }
};
typeCheck('Even', 2, options); // true
typeCheck('Even', 3, options); // false

customTypes allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a typeOf property - a string, and validate property - a function.

The typeOf property is the type the value should be, and validate is a function which should return true if the value is of that type. validate receives one parameter, which is the value that we are checking.

Technical About

type-check is written in LiveScript - a language that compiles to JavaScript. It also uses the prelude.ls library.

Array.prototype.indexOf()

基础语法

arr.indexOf(searchElement)
arr.indexOf(searchElement[, fromIndex = 0])

参数说明

searchElement

要查找的元素

fromIndex

开始查找的位置。如果该索引值大于或等于数组长度,意味着不会在数组里查找,返回-1。如果参数中提供的索引值是一个负值,则将其作为数组末尾的一个抵消,即-1表示从最后一个元素开始查找,-2表示从倒数第二个元素开始查找 ,以此类推。 注意:如果参数中提供的索引值是一个负值,并不改变其查找顺序,查找顺序仍然是从前向后查询数组。如果抵消后的索引值仍小于0,则整个数组都将会被查询。其默认值为0.

返回值说明

首个被找到的元素在数组中的索引位置; 若没有找到则返回 -1

详细说明

indexOf()方法返回在数组中可以找到一个给定元素的第一个索引,如果不存在,则返回-1。

indexOf 使用strict equality (无论是 ===, 还是 triple-equals操作符都基于同样的方法)进行判断 searchElement与数组中包含的元素之间的关系。

案例

以下例子使用indexOf方法确定多个值在数组中的位置。

var array = [2, 5, 9];
array.indexOf(2);     // 0
array.indexOf(7);     // -1
array.indexOf(9, 2);  // 2
array.indexOf(2, -1); // -1
array.indexOf(2, -3); // 0
找出指定元素出现的所有位置节
var indices = [];
var array = ['a', 'b', 'a', 'c', 'a', 'd'];
var element = 'a';
var idx = array.indexOf(element);
while (idx != -1) {
  indices.push(idx);
  idx = array.indexOf(element, idx + 1);
}
console.log(indices);
// [0, 2, 4]
判断一个元素是否在数组里,不在则更新数组节
function updateVegetablesCollection (veggies, veggie) {
    if (veggies.indexOf(veggie) === -1) {
        veggies.push(veggie);
        console.log('New veggies collection is : ' + veggies);
    } else if (veggies.indexOf(veggie) > -1) {
        console.log(veggie + ' already exists in the veggies collection.');
    }
}

var veggies = ['potato', 'tomato', 'chillies', 'green-pepper'];

// New veggies collection is : potato,tomato,chillies,green-papper,spinach
updateVegetablesCollection(veggies, 'spinach'); 
// spinach already exists in the veggies collection.
updateVegetablesCollection(veggies, 'spinach');

Polyfill

indexOfECMA-262 标准 的第5版中被加入,但并非所有的浏览器都支持该方法。你可以在编写scripts时,在其开头使用以下代码,它能够允许你在没有本地支持的情况下使用indexOf方法。该算法符合ECMA-262第5版其中一项规定, 即假定 TypeErrorMath.abs 呈现它们原有的价值。

// Production steps of ECMA-262, Edition 5, 15.4.4.14
// Reference: http://es5.github.io/#x15.4.4.14
if (!Array.prototype.indexOf) {
  Array.prototype.indexOf = function(searchElement, fromIndex) {

    var k;

    // 1. Let O be the result of calling ToObject passing
    //    the this value as the argument.
    if (this == null) {
      throw new TypeError('"this" is null or not defined');
    }

    var O = Object(this);

    // 2. Let lenValue be the result of calling the Get
    //    internal method of O with the argument "length".
    // 3. Let len be ToUint32(lenValue).
    var len = O.length >>> 0;

    // 4. If len is 0, return -1.
    if (len === 0) {
      return -1;
    }

    // 5. If argument fromIndex was passed let n be
    //    ToInteger(fromIndex); else let n be 0.
    var n = +fromIndex || 0;

    if (Math.abs(n) === Infinity) {
      n = 0;
    }

    // 6. If n >= len, return -1.
    if (n >= len) {
      return -1;
    }

    // 7. If n >= 0, then Let k be n.
    // 8. Else, n<0, Let k be len - abs(n).
    //    If k is less than 0, then let k be 0.
    k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);

    // 9. Repeat, while k < len
    while (k < len) {
      // a. Let Pk be ToString(k).
      //   This is implicit for LHS operands of the in operator
      // b. Let kPresent be the result of calling the
      //    HasProperty internal method of O with argument Pk.
      //   This step can be combined with c
      // c. If kPresent is true, then
      //    i.  Let elementK be the result of calling the Get
      //        internal method of O with the argument ToString(k).
      //   ii.  Let same be the result of applying the
      //        Strict Equality Comparison Algorithm to
      //        searchElement and elementK.
      //  iii.  If same is true, return k.
      if (k in O && O[k] === searchElement) {
        return k;
      }
      k++;
    }
    return -1;
  };
}

通俗易懂的解释微服务

程序员有了老婆之后就是累,上次好不容易给她解释了什么是Restful,这不,麻烦又来了…

一个周日的清晨,阳光洒在我的脸上,慢慢把我唤醒。我翻过身,感觉好像少了些什么东西,缓缓地睁开眼睛,“咦,老婆呢?”
突然,我发现床上多了张纸条:

看到这封信时,我已经在回娘家的路上,原因我相信你懂的。如果你不懂,请将信翻到背面。

我一脸懵逼,将纸翻了过来:

哼,你怎么可能不知道原因,你翻过来看就是想确认我发现的是不是你那个秘密而已,那我就告诉你吧。
在你的书桌上,有一本叫《微服务设计》的书,我虽然是女生,但也知道“服务”是个什么勾当,没想到你放着好好的程序员不做,居然做起了“服务”,你和旧时代的老鸨有什么区别?
书我翻了一下,想看看你的这种“微服务”是怎么个“微”法,哼,你们程序员挺精明的,看的书都加密过的?别以为我不知道那些是代码,是你们程序员的通用语言。鬼知道里面讲了什么东西。
不管怎样,既然你选择了这条路,也就别怪我不仁不义,再见。不,再也不见。 —— 对你很失望的静香

我渐渐地缓过神来,百感交集,思绪万千,冥想了一会,拿起手机,给她发了信息:
“下午四点,老地方,给你解释什么是微服务。”

沃尔兹百货超市

我提前十五分钟来到了咖啡厅。临近四点,我开始望着门口,59分49秒,一个熟悉的身影走了进来,戴着墨镜,披着纱巾,是她。
“服务员,一个芝士蛋糕,两杯拿铁,谢谢”,我对服务员说。

“说吧,你有什么要解释的?”
“嗯,首先,我向你保证,我在看的“微服务”,绝对不是你想的那种“服务””
“那是什么?”
“这个解释起来要花点时间,我们先吃点蛋糕,待会再慢慢和你解释”

过了一会,蛋糕吃的差不多了。“看到对面那家沃尔兹百货超市了么?”,我指着窗外面的沃尔兹超市,对老婆说。

沃尔兹百货超市图

“嗯?”

“那里面什么都有,衣服、食品、文具、家私、电器,应有尽有,而且不管你去到哪一家连锁店,店里的格局都是一模一样的。也正因为如此,这才带来了问题。”

“有什么问题呢?我觉得这样挺好呀,顾客去了那里,想买什么都找得着。”

“首先,这些卖不同物品的__隔间之间会互相影响__。你看,一楼是珠宝店和电器店,假如珠宝店想进行装修,装修时的噪声和灰尘,势必会影响到电器店;还有,假如由于电器店一名员工的疏忽,引发了火灾,旁边的珠宝店是不是也会受到牵连?”

“你这乌鸦嘴…”

“哈哈,都说是假如啦。除了这点,还有一个问题,我考考你,我们这个城市里有几家沃尔兹超市?”

“我想想,好像就这一家?”

“没错,只在西区这里开了一家店。这时候市场总监发现,住在东区的多是上层阶级,他们对珠宝的需求量比较大,这时候要怎么办?”

“那就在东区也开一家沃尔兹百货超市罗。”

“嗯,只能是这样了,可是东区的居民对其他东西的需求并不多,而沃尔兹超市又想让每家分店卖的东西都是一样的,所以他们不得不在东区开一家分店,不仅卖珠宝,也卖食品、衣服还有其他东西“

“这挺浪费的呀,为了满足人们对珠宝的需求,又开了一个百货超市。”,老婆若有所思。

“的确,什么都有、什么都卖的百货超市实在是太笨重了,这才有了“微服务””

“哦?终于要讲微服务了?哼哼。”

沃尔兹小店

“你看,假如我们把沃尔兹百货超市,拆成很多个卖不同商品的小店,比如卖珠宝的沃尔福、卖家私的沃尔家、卖食品的沃尔良还有卖衣服的沃尔衣,这些提供不同服务的店,分布在城市的各个地方,这样他们之间就不会互相影响了。东区二巷的沃尔家搞装修,三巷的沃尔福不会受到影响;三巷的沃尔福发生火灾了,二巷的沃尔家也安然无恙。”

“Soga,原来是这种微服务”,老婆笑着说。

“不仅如此,现在,我们发现东区的居民对珠宝的需求量大,那我们就在东区多开几家__沃尔福__,而在西区,中产阶级较多的地方,我们就多开几家沃尔良。”

沃尔良-沃尔福

“哇塞,这样看来,微服务让沃尔兹变得__轻巧__了许多!哪个地方对某种服务的需求大,就在对应的地方多开几家卖那种服务的小店就好了。

沃尔兹网店

“看来微服务就是把一个百货店变成各个小店嘛,讲这个东西至于用那么厚一本书么?”,老婆是个好奇心很强的女生。

“哈,微服务当然不只是这些,我们现在只是把一个百货店拆成各个小店,但是对于__如何管理这些小店__,我们还没做好准备”

“哦?这里面还有什么门道?”

“当然,别忘了,沃尔兹可是有网店的。以前还是百货超市的时候,要是有顾客从网上买了一件衣服,那直接从百货超市的仓库里取出这件衣服,给顾客寄过去就好了;现在呢,每一家卖衣服的沃尔衣都有自己的仓库,顾客下单后,工作人员要怎么知道顾客所在区域有哪几家沃尔衣?要从哪家沃尔衣发货呢?
“哟西,还有这个问题。那__沃尔兹总店肯定知道他们在哪个地方开有什么分店吧?__”

“没错,这时候网店工作人员会从总店那里查出,顾客收货地址所在区域有哪些家沃尔衣,接下来就是从这些沃尔衣店里,选一家,给顾客寄快递过去。”

“就选离顾客最近那一家就好啦。”

“哈,那万一东区有两家沃尔衣,一家靠近居民区,一家靠近商业区,而顾客通常写的收获地址都是写自己家呢?”

“这样… 那靠近居民区的沃尔衣就会收到很多订单,经常要不断的进货,而靠近商业区的那家,就没什么订单了,是吧?”,老婆睁大双眼看着我。

“对!这就是问题,所以网店工作人员会对在一个区域内的沃尔衣,进行__轮流发货__的操作,比如这一次是靠近居民区的这家发货,那下一次,就让靠近商业区的沃尔衣发货。”

“Soga!”

“用计算机术语来说,就是__Load Balancing__,负载均衡”

“呵呵,少扯这些术语,我只知道New Balance”

“哈哈,怎么样,微服务不是你想象的那样吧,当然,在经济学领域,要考虑的因素还有很多,现实生活中的沃尔兹依然是一个大百货超市,自然是有它的道理的。微服务的应用主要是在更为纯粹的计算机领域,也就是你看到的那些代码”

“得了,看到那些头就大,走,带我去娘家拿行李”
“……”

对程序员的话

用了大白话,给老婆讲明白了微服务的来龙去脉,当然,我还是有些话想说的,还是怕老婆听完一脸懵逼,没给她说:

1、
讲微服务,就不得不从单体应用(Monolithic )讲起。

所谓单体应用,就像一开始的沃尔兹百货超市一样,把所有业务的代码都放在一起。这对于小型项目来说自然是很合适的,可是项目一旦大了起来,业务一多,这个单体也就膨胀了,膨胀后的单体应用主要有以下两个缺点:

  • 牵一发而动全身。我改了一个业务的一行代码,需要重启整个单体应用,这显然不不合理的。就像珠宝店装修时影响了旁边的电器店,电器店着火时殃及珠宝店一样。

  • 只能水平扩展,不能纵向扩展。对于单体应用,如果发现某一业务的请求量非常大,那么是无法单独扩展该业务的,只能拷贝整个单体应用,再部署一套环境,来实现集群。

正因为单体应用有着这些缺陷,才有了微服务。微服务和单体应用的区别,可以用__Martin Fowler__的这张图来解释:

微服务-vs-单体应用

2、
微服务虽然带来了架构上的优势,但同时也引入了复杂性。我们不得使用一些组件,来解决技术复杂性提高之后带来的问题:

  • 服务注册中心
    一个服务可以有多个实例,那么我们在向一个服务发出请求的时候,怎么知道这个服务有哪些实例呢?为了减少手工维护的麻烦,我们需要服务注册中心。每个服务实例在启动时,向注册中心注册自己的IP地址等信息。这样,服务在调用别的服务的接口时,就可以通过注册中心,查询到其他服务的实例,向实例发起请求。沃尔兹总店就是起到注册中心的作用。

  • 负载均衡
    由于一个服务可以有多个实例,所以不管是来自外部客户端的请求,还是微服务系统内部服务之间发起的请求,都需要引入负载均衡的机制,来发挥多实例集群的作用。有的书也称这两种负载均衡为__服务器端负载均衡和客户端负载均衡__,各自具有代表性意义的实现分别是Nginx和Ribbon。

  • API Gateway
    一个外部请求过来之后,我们需要知道这个请求是发给哪个服务的,也就是我们需要一个请求路由的功能,比如/cm/*的请求,要发给客户管理服务,/om/*的请求,要发给订单管理服务。另外,不是所有请求都可以被我们系统处理的,我们需要判断这个请求是否携带一些必要的鉴权信息,并对其进行鉴权,也就是请求过滤的功能。而API Gateway,就是起到了这两个功能,它就像整个微服务系统的门面,所有请求,都要先经过它的处理,才会转发到对应的服务。

  • ……

client-server

微服务系统的衍生组件还有很多,比如对各个服务进行的配置管理的分布式配置中心、各个服务之间进行消息通讯的消息总线和消息驱动机制(上图中的Message Queue)等,这里就不一一列举了。这篇文章只是想用一种比较有趣的方式,让大家对微服务有一个初步的了解。就像学设计模式,如果直接去看四人帮的《设计模式——可复用面向对象软件的基础》,也许很多人学到一半就学不下去了,而如果先去看《Head First设计模式》,再去看前面那本书,也许就会发现轻松很多。

大家如果想对微服务有进一步的理解,我这边首推Martin Fowler的Microservices - a definition of this new architectural term,微服务这个词也是在这篇文章里被首次提出,可以说是微服务的一手资料了。阅读这篇著作,你可以:

  • 对微服务的来源有更深入的了解,知道微服务这种设计模式,和Unix以及康威定律的关系;
  • 看到微服务是如何影响软件开发的组织结构的,其实也就是康威定律;
  • 看到Martin Fowler总结的设计微服务系统的几个原则;
  • 从这篇著作底下的参考文献,看到一些助推了微服务架构的原始论文。

架构这种东西,和设计模式非常相像,两者都是针对某一类问题的解决方案。和设计模式一样,每种架构都有其优点,当然也会有缺点。只有弄清楚为什么要用这种架构,不用会怎样,用了又会怎样,知其然知其所以然,才能对架构进行灵活运用,在实际项目中发挥架构的优势。

参考

node 使用 import/export

--experimental-modules

准备测试文件

注意这个时候扩展名,改为mjs

./lib/RMath.mjs

'use strict';

export const RMath = {
    inc(x) {
        return Number(x) + 1;
    },
    dec(x) {
        return Number(x) - 1;
    },
    add(a, b) {
        return Number(a) + Number(b);
    },
    subtract(a, b) {
        return Number(a) - Number(b);
    },
    multiply(a, b) {
        return Number(a) * Number(b);
    },
    divide(a, b) {
        return Number(a) / Number(b);
    },
    negate(x){
        return -1 * Number(x);
    },
    modulo(a, b) {
        return Number(a) % Number(b);
    },
    mathMod(a, b) {
        const defaultRes = NaN;
        const tempA = Number(a);
        const tempB = Number(b);
        if (tempA || tempB) {
            return defaultRes;
        }
        if (!Number.isSafeInteger(tempA) || !Number.isSafeInteger(tempB)) {
            return defaultRes;
        }
        if (tempB < 0) {
            return defaultRes;
        }
        return ((tempA % tempB) + tempB) % tempB;
    }
}

test.mjs

(function (log) {
    import {RMath} from './lib/RMath'
    log(RMath);
    const beginNum = 5;
    const endNum = 9.5;
    const defaultNum = 17;

    log(RMath.mathMod(beginNum,endNum)); //=> NaN 因为被除数不是整数,所以返回 NaN
    log(RMath.modulo(RMath.negate(defaultNum),beginNum)); //=> -2 除数可以是负数。
    log(RMath.mathMod(RMath.negate(defaultNum),beginNum)); //=> 3 除数可以是负数,但是mathMod方法返回值,只会是正数。

    const mathModSelf = x => RMath.mathMod(defaultNum,x);// 类似于 defaultNum % x
    const selfMathMod = x => RMath.mathMod(x,defaultNum);// 类似于 x % defaultNum

    log([1, 2, 3].map(mathModSelf)); //=> [ 0, 1, 2 ]
    log([1, 2, 3].map(selfMathMod)); //=> [ 1, 2, 3 ]
})(console.log)

执行命令

注意事项

  • Node 环境必须在 9.0以上
  • 不加loader时候,使用import/export的文件后缀名必须为*.mjs
  • 启动必须加上flag --experimental-modules
  • 文件的importexport必须严格按照ECMAScript Modules语法
  • ECMAScript Modulesrequire()cache机制不一样
$ node -v
v10.13.0
$ node --experimental-modules ./test.mjs
(node:1064) ExperimentalWarning: The ESM module loader is experimental.
file:///X:/XXX/test.mjs:3
    import {RMath} from './lib/RMathM'
           ^
SyntaxError: Unexpected token {
    at translators.set (internal/modules/esm/translators.js:33:13)

官方提供编译案例

./lib/custom-loader.mjs

import path from 'path';
import process from 'process';
import Module from 'module';

const builtins = Module.builtinModules;
const JS_EXTENSIONS = new Set(['.js', '.mjs']);

const baseURL = new URL('file://');
baseURL.pathname = `${process.cwd()}/`;

export function resolve(specifier, parentModuleURL = baseURL, defaultResolve) {
  if (builtins.includes(specifier)) {
    return {
      url: specifier,
      format: 'builtin'
    };
  }
  if (/^\.{0,2}[/]/.test(specifier) !== true && !specifier.startsWith('file:')) {
    // For node_modules support:
    // return defaultResolve(specifier, parentModuleURL);
    throw new Error(
      `imports must begin with '/', './', or '../'; '${specifier}' does not`);
  }
  const resolved = new URL(specifier, parentModuleURL);
  const ext = path.extname(resolved.pathname);
  if (!JS_EXTENSIONS.has(ext)) {
    throw new Error(
      `Cannot load file with non-JavaScript file extension ${ext}.`);
  }
  return {
    url: resolved.href,
    format: 'esm'
  };
}

执行命令

$ node unit.js --experimental-modules --loader ./lib/custom-loader.mjs

    import {RMath} from './lib/RMath.js';
           ^

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:656:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)

Array.prototype.keys()

基础语法

arr.keys()

返回值说明

一个新的 Array 迭代器对象。Array Iterator是对象

详细说明

keys() 方法返回一个包含数组中每个索引键的Array Iterator对象。

案例

索引迭代器会包含那些没有对应元素的索引节

var arr = ["a", , "c"];
var sparseKeys = Object.keys(arr);
var denseKeys = [...arr.keys()];
console.log(sparseKeys); // ['0', '2']
console.log(denseKeys);  // [0, 1, 2]

indexedDB

如果不喜欢看文字的朋友 ,可以直接略过这段名词介绍的部分

初步了解

相关网站推荐

基础介绍

随着浏览器的功能不断增强,越来越多的网站开始考虑,将大量数据储存在客户端,这样可以减少从服务器获取数据,直接从本地获取数据。

现有的浏览器数据储存方案,都不适合储存大量数据:Cookie 的大小不超过4KB,且每次请求都会发送回服务器;LocalStorage2.5MB10MB 之间(各家浏览器不同),而且不提供搜索功能,不能建立自定义的索引。所以,需要一种新的解决方案,这就是 IndexedDB 诞生的背景。

IndexedDBWebSQL 数据库的取代品, W3C组织在2010年11月18日废弃了webSql. IndexedDBWebSQL的不同点在于WebSQL 是关系型数据库(复杂)IndexedDBkey-value型数据库(简单好使).

IndexedDB 是一种可以让你在用户的浏览器内持久化存储数据的方法。IndexedDB 为生成 Web Application 提供了丰富的查询能力,使我们的应用在在线和离线时都可以正常工作。

通俗地说,IndexedDB 就是浏览器提供的本地数据库,它可以被网页脚本创建和操作。IndexedDB 允许储存大量数据,提供查找接口,还能建立索引。这些都是 LocalStorage 所不具备的。就数据库类型而言,IndexedDB 不属于关系型数据库(不支持 SQL 查询语句),更接近 NoSQL 数据库。

它允许您不考虑网络可用性,创建具有丰富查询能力的可离线 Web 应用程序。IndexedDB 对于存储大量数据的应用程序(例如借阅库中的 DVD 目录)和不需要持久 Internet 连接的应用程序(例如邮件客户端、待办事项列表或记事本)很有用。

API包含异步(asynchronous) API 和同步(synchronous)API两种。 异步API适合大多数情况, 同步API必须同 WebWorkers一同使用. 目前,没有主流浏览器支持同步API。 即使同步API被支持了,你也会在大多数的情况使用异步API

优点介绍

键值对储存

IndexedDB 内部采用对象仓库(object store)存放数据。所有类型的数据都可以直接存入,包括 JavaScript 对象。对象仓库中,数据以键值对的形式保存,每一个数据记录都有对应的主键,主键是独一无二的,不能有重复,否则会抛出一个错误。

values 数据可以是结构非常复杂的对象,key可以是对象自身的属性。你可以对对象的某个属性创建索引(index)以实现快速查询列举排序key可以使二进制对象。

支持事务

IndexedDB 支持事务(transaction),这意味着一系列操作步骤之中,只要有一步失败,整个事务就都取消,数据库回滚到事务发生之前的状态,不存在只改写一部分数据的情况。

任何操作都发生在事务(transaction)中。 IndexedDB API提供了索引(indexes)、表(tables)、指针(cursors)等等,但是所有这些必须是依赖于某种事务的。因此,你不能在事务外执行命令或者打开指针。事务(transaction)有生存周期,在生存周期以后使用它会报错。并且,事务(transaction)是自动提交的,不可以手动提交

当用户在不同的标签页同时打开Web应用的两个实例时,这个事务模型就会非常有用。如果没有事务操作的支持,这两个实例就会互相影响对方的修改。如果你不熟悉数据库的事务模型,请参考数据库事务

异步

IndexedDB 操作时不会锁死浏览器,用户依然可以进行其他操作,这与 LocalStorage 形成对比,后者的操作是同步的。

异步设计是为了防止大量数据的读写,拖慢网页的表现。

IndexedDBAPI不通过return语句返回数据,而是需要你提供一个回调函数来接受数据。执行API时,你不以同步(synchronous)方式对数据库进行存储读取操作,而是向数据库发送一个操作请求。当操作完成时,数据库会以DOM事件的方式通知你,同时事件的类型会告诉你这个操作是否成功完成。这个过程听起来会有些复杂,但是里面是有明智的原因的。这个和XMLHttpRequest请求是类似的。

无处不在

IndexedDB数据库请求无处不在,数据库请求负责接受成功或失败的DOM事件。每一个请求都包含onsuccessonerror事件属性,同时你还对事件调用addEventListener()removeEventListener()请求还包括readyStateresulterrorCode属性,用来表示请求的状态。result属性尤其神奇,他可以根据请求生成的方式变成不同的东西,例如:IDBCursor实例、刚插入数据库的数值对应的键值(key)等。

面向对象

indexedDB不是用二维表来表示集合的关系型数据库。这一点非常重要,将影响你设计建立你的应用程序。

传统的关系型数据库,你需要用到二维表来存储数据集合(每一行代表一个数据,每一列代表一个属性),indexedDB有所不同,它要求你为一种数据创建一个对象仓库(object Store),只要这种数据一个JavaScript对象即可。每个对象仓库都有一个索引(index)集合以方便查询迭代遍历。如果你不熟悉面向对象的数据库管理系统,可以参考维基百科有关对象数据库的内容。

indexedDB不使用结构化查询语言(SQL)。它通过索引(index)所产生的指针(cursor)来完成查询操作,从而使你可以迭代遍历到结果集合。

同源限制

IndexedDB 受到同源限制,每一个数据库对应创建它的域名。网页只能访问自身域名下的数据库,而不能访问跨域的数据库。

指脚本所在文档URL的域名、应用层协议和端口。每一个都有与其相关联的数据库。在同一个内的所有数据库都有唯一、可区别的名称。

IndexedDB的安全机制避免应用访问非同的数据。例如,http://www.example.com/app/ 的应用或页面可以访问 http://www.example.com/dir/ 的数据,因为他们同。但是它们不能访问http://www.example.com:8080/dir/(不同端口)或https://www.example.com/dir/(不同协议)的数据,因为他们不同`源`。

储存空间大

IndexedDB 的储存空间比 LocalStorage 大得多,一般来说不少于 250MB,甚至没有上限。

一个单独的数据库项目的大小没有限制。然而可能会限制每个 IndexedDB 数据库的大小。这个限制(以及用户界面对它进行断言的方式)在各个浏览器上也可能有所不同:

Firefox

IndexedDB 数据库的大小没有限制。在用户界面上只会针对存储超过 50 MB 大小的 BLOB(二进制大对象)请求权限。

这个大小的限额可以通过 dom.indexedDB.warningQuota 首选项进行自定义 (定义在 https://dxr.mozilla.org/mozilla-central/source/modules/libpref/src/init/all.js)。

Google Chrome

参见 https://developers.google.com/chrome...rage#temporary

支持二进制储存

IndexedDB 不仅可以储存字符串,还可以储存二进制数据(ArrayBuffer 对象和 Blob 对象)。

缺点介绍

以下情况不适合使用IndexedDB

  • 全球多种语言混合存储。国际化支持不好。需要自己处理。
  • 和服务器端数据库同步。你得自己写同步代码。
  • 全文搜索。IndexedDB 接口没有类似 SQL 语句中 LIKE 的功能。

注意,在以下情况下,数据库可能被清除:

  • 用户请求清除数据。
  • 浏览器处于隐私模式。最后退出浏览器的时候,数据会被清除。
  • 硬盘等存储设备的容量到限。
  • 数据损坏。
  • 进行与特性不兼容的操作。

确切的环境和浏览器特性会随着时间改变,但浏览器厂商通常会遵循尽最大努力保留数据的理念。

维基百科名词解析

事务

基础说明

一个数据库事务通常包含了一个序列的对数据库的读/写操作。它的存在包含有以下两个目的:

为数据库操作序列提供了一个从失败中恢复到正常状态的方法,同时提供了数据库即使在异常状态下仍能保持一致性的方法。
当多个应用程序在并发访问数据库时,可以在这些应用程序之间提供一个隔离方法,以防止彼此的操作互相干扰。
当事务被提交给了DBMS(数据库管理系统),则DBMS(数据库管理系统)需要确保该事务中的所有操作都成功完成且其结果被永久保存在数据库中,如果事务中有的操作没有成功完成,则事务中的所有操作都需要被回滚,回到事务执行前的状态;同时,该事务对数据库或者其他事务的执行无影响,所有的事务都好像在独立的运行。

但在现实情况下,失败的风险很高。在一个数据库事务的执行过程中,有可能会遇上事务操作失败、数据库系统/操作系统失败,甚至是存储介质失败等情况。这便需要DBMS对一个执行失败的事务执行恢复操作,将其数据库状态恢复到一致状态(数据的一致性得到保证的状态)。为了实现将数据库状态恢复到一致状态的功能,DBMS通常需要维护事务日志以追踪事务中所有影响数据库数据的操作。

ACID性质

并非任意的对数据库的操作序列都是数据库事务。数据库事务拥有以下四个特性,习惯上被称之为ACID特性。

  • 原子性(Atomicity):事务作为一个整体被执行,包含在其中的对数据库的操作要么全部被执行,要么都不执行。
  • 一致性(Consistency):事务应确保数据库的状态从一个一致状态转变为另一个一致状态。一致状态的含义是数据库中的数据应满足完整性约束。
  • 隔离性(Isolation):多个事务并发执行时,一个事务的执行不应影响其他事务的执行。
  • 持久性(Durability):已被提交的事务对数据库的修改应该永久保存在数据库中。

使用方法

SQL国际标准使用START TRANSACTION开始一个事务(也可以用方言命令BEGIN)。COMMIT语句使事务成功完成。ROLLBACK语句结束事务,放弃从BEGIN TRANSACTION的一切改变。若autocommitSTART TRANSACTION的使用禁止,在事务结束时autocommit将被重新置位。

对象数据库

基础说明

对象数据库是一种以对象形式表示信息的数据库。对象数据库的数据库管理系统被称为ODBMSOODBMS

两个主要原因让用户使用对象数据库技术。首先,关系数据库在管理复杂数据时显得笨重。其次,被应用软件操作的数据一般是用面向对象的编程语言如C++, Java, DelphiC#写成,而那些用来转化数据表示和关系数据库元组的代码很冗繁,执行时也有不少耗时。这种应用程序和数据库表示信息的模式之间的不匹配有时也被称为impedance mismatch

历史

对象数据库管理系统,发端于1970年代早中期为支持对图结构对象的原生数据库管理而开展的研究。面向对象数据库系统这一术语第一次出现于1985年。著名的研究项目包括Encore-Ob/Server(布朗大学)EXODUS(Wisconsin大学)IRIS(惠普)ODE(Bell实验室)ORION(MCC), Vodak(GMD-IPSI)Zeitgeist(Texas Instruments)。其中以ORION项目发表的论文数为最多。MCCWon Kim将这些论文中最有价值的一部分汇编成书并由MIT出版社出版。

对象数据库管理系统为面向对象编程语言增加了持久的概念。早期的商品数据库集成了多种语言:GemStone(Smalltalk)Gbase(Lisp)Vbase(COP)COP C Object Processor``(C对象处理器),是一种基于`C`的专有语言,比`C++`早。`1990`年代大部分时间里,`C++`**着商用对象数据库管理系统市场。厂商在`1990`年代晚期加入了`Java`并于最近加入了`C#`。

对象数据库的采纳

基于持久编程的对象数据库在一些应用领域获得了认可,如工程和空间数据库,通信和科学领域如高能物理和分子生物。他们对主流的商业数据处理没有什么影响,尽管获得了一些应用在部分特殊领域如金融服务。值得指出的是:对象数据库保持着世界上最大的数据库(超过1000Terabytes在斯坦福线性加速中心)和最高摄取率(一Terabyte每小时)的记录。

2004年以来,当出现了易用和普遍可支付的开放源代码对象数据库时,对象数据库进入了第二次增长期。这些开放源代码的对象数据库完全用OOP语言如Java,C++,或C#写出。ObjectDB是对象关系数据库的一个例子。

技术特性

在纯对象式数据库中,资料以对象的形式存储,这些对象只能由其所属的类中定义的方法来操作。对象被组成一种类型层次(有时是格式lattic),子类继承其超类的特性。对象中可以有到其他对象的引用,于是应用程序可以以一种导航式的编程风格访问数据。

多数对象式数据库也提供了一些查询语言,允许用声明式编程访问对象。在对象查询语言以及查询和导航接口的集成领域,产品间出现了很大的区别。ODMG用对象查询语言OQL作了标准化的尝试。

访问数据可以更快,表的联合常常是不必要的(在关系数据库的表实现方式下)。这是因为无需查询只需通过指针(Pointer)就可以直接获得对象。

产品间的另一点不同是数据库定义模式的方式。然而一般的特征是编程语言和数据库模式使用相同类型的定义。

多媒体应用程序将变得容易因为与数据相关的类方法保证了数据的正确解释。

许多对象数据库提供对版本的支持。一个对象可以看作是他所有版本的集合。同时,对象版本也可以被看作是对象自身的属性。一些对象数据库也提供了对触发器和约束的语义支持,这些特性是活跃数据库(active database)的基础。

优势和劣势

ODBMS和关系DBMS的基准测试显示ODBMS在某些任务上优势明显。主要原因是许多操作使用导航式而不是声明式接口,并且对数据的导航式访问通常可以有指针高效的实现。

对基于导航数据库技术,如ODBMS的批评指出,基于指针的技术为一些特殊的搜索路径或视点(viewpoint)作了优化。而且,对一般目的的查询,基于指针的技术比关系型要慢并难于形式化。导航式显得适合于特定应用而失了普遍,未来的使用。

ODBMS的其他技术,显得缺失了与SQL世界中大量工具或特性的互操作性,包括但不限于产业标准互联性,报告工具,OLAP工具以及备份和恢复标准。另外,不像关系数据库,对象数据库缺少形式化的数学基础,而这反过来导致他们在查询支持上的弱势。不过,这一缺陷被部分弥补,因为一些ODBMS除了导航式访问外也提供了对SQL的完全支持,如Objectivity/SQL++。

事实上,在概念封装,即隐藏数据,使他只能通过公布的一些接口访问和关系数据库技术假定:数据只能由基于数据内容的查询,而不是预定义的查询路径的形式访问之间,存在着本质的张力。

数据库中心论,倾向于用声明和属性驱动的观点看世界,而面向对象倾向于从行为的观点看世界。这就是围绕着OOP和数据库的许多impedance mismatch问题之一。

尽管很多评论认为对象数据库是失败的,但主要的辩护者仍很活跃,更紧密地整合数据库的功能和对象编程语言的尝试在研究和产业社区里仍在继续。

flutter--window

flutter 官网

https://github.com/flutter/flutter/wiki/Using-Flutter-in-China

配置前置环境

  • 系统需要安装git环境
  • 和powerShell

配置flutter SDK

flutter sdk 解压之后的文件

# 到flutter所在目录,执行`tree > ./content.txt`就可以将当前tree生成的树目录结构,写入到根级目录下`content.txt`中,如果这个文件不存在,则是先生成再写入数据。

卷 文档 的文件夹 PATH 列表
卷序列号为 B0CD-B58D
E:.
├─.github
│  └─ISSUE_TEMPLATE
├─.idea
│  └─runConfigurations
├─.pub-cache
│  ├─git
│  │  ├─cache
│  │  │  └─gallery-assets-872fce92eb9f55133a9580149278163532d0d218
│  │  │      ├─hooks
│  │  │      ├─info
│  │  │      ├─objects
│  │  │      │  ├─info
│  │  │      │  └─pack
│  │  │      └─refs
│  │  │          ├─heads
│  │  │          └─tags
│  │  └─gallery-assets-43590e625ab1b07f6a5809287ce16f7e61d9e165
│  │      └─lib
│  │          ├─appbar
│  │          ├─cupertino_navigation
│  │          ├─fitness_demo
│  │          ├─fonts
│  │          ├─logo
│  │          ├─pesto
│  │          │  └─fonts
│  │          ├─shrine
│  │          │  ├─fonts
│  │          │  │  └─abrilfatface
│  │          │  ├─products
│  │          │  └─vendors
│  │          ├─videos
│  │          ├─weather_demo
│  │          └─white_logo
│  │              ├─1.5x
│  │              ├─2.5x
│  │              ├─3.0x
│  │              └─4.0x
│  ├─hosted
│  │  └─pub.dartlang.org
│  │      ├─analyzer-0.31.2-alpha.2
│  │      │  ├─benchmark
│  │      │  ├─doc
│  │      │  │  └─support
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  ├─context
│  │      │  │  ├─dart
│  │      │  │  │  ├─analysis
│  │      │  │  │  ├─ast
│  │      │  │  │  ├─constant
│  │      │  │  │  └─element
│  │      │  │  ├─error
│  │      │  │  ├─exception
│  │      │  │  ├─file_system
│  │      │  │  ├─instrumentation
│  │      │  │  ├─plugin
│  │      │  │  ├─source
│  │      │  │  ├─src
│  │      │  │  │  ├─analysis_options
│  │      │  │  │  │  └─error
│  │      │  │  │  ├─codegen
│  │      │  │  │  ├─command_line
│  │      │  │  │  ├─context
│  │      │  │  │  ├─dart
│  │      │  │  │  │  ├─analysis
│  │      │  │  │  │  ├─ast
│  │      │  │  │  │  ├─constant
│  │      │  │  │  │  ├─element
│  │      │  │  │  │  ├─error
│  │      │  │  │  │  ├─resolver
│  │      │  │  │  │  ├─scanner
│  │      │  │  │  │  └─sdk
│  │      │  │  │  ├─error
│  │      │  │  │  ├─fasta
│  │      │  │  │  ├─file_system
│  │      │  │  │  ├─generated
│  │      │  │  │  │  └─testing
│  │      │  │  │  ├─html
│  │      │  │  │  │  └─error
│  │      │  │  │  ├─kernel
│  │      │  │  │  ├─lint
│  │      │  │  │  ├─plugin
│  │      │  │  │  ├─pubspec
│  │      │  │  │  ├─services
│  │      │  │  │  ├─source
│  │      │  │  │  ├─summary
│  │      │  │  │  ├─task
│  │      │  │  │  │  ├─api
│  │      │  │  │  │  └─strong
│  │      │  │  │  ├─test_utilities
│  │      │  │  │  └─util
│  │      │  │  └─task
│  │      │  ├─test
│  │      │  │  ├─dart
│  │      │  │  │  ├─analysis
│  │      │  │  │  ├─ast
│  │      │  │  │  └─element
│  │      │  │  ├─error
│  │      │  │  ├─file_system
│  │      │  │  ├─generated
│  │      │  │  ├─instrumentation
│  │      │  │  ├─source
│  │      │  │  └─src
│  │      │  │      ├─command_line
│  │      │  │      ├─context
│  │      │  │      ├─dart
│  │      │  │      │  ├─analysis
│  │      │  │      │  ├─ast
│  │      │  │      │  ├─constant
│  │      │  │      │  ├─element
│  │      │  │      │  └─sdk
│  │      │  │      ├─fasta
│  │      │  │      │  └─recovery
│  │      │  │      │      └─partial_code
│  │      │  │      ├─lint
│  │      │  │      ├─pubspec
│  │      │  │      ├─source
│  │      │  │      ├─summary
│  │      │  │      ├─task
│  │      │  │      │  └─strong
│  │      │  │      └─util
│  │      │  └─tool
│  │      │      ├─analysis_driver
│  │      │      ├─summary
│  │      │      └─task_dependency_graph
│  │      ├─archive-1.0.33
│  │      │  ├─bin
│  │      │  ├─example
│  │      │  │  └─res
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─bzip2
│  │      │  │      ├─io
│  │      │  │      ├─tar
│  │      │  │      ├─util
│  │      │  │      ├─zip
│  │      │  │      └─zlib
│  │      │  └─test
│  │      │      └─res
│  │      │          ├─bzip2
│  │      │          ├─tar
│  │      │          ├─test2
│  │      │          │  ├─bin
│  │      │          │  ├─lib
│  │      │          │  ├─test
│  │      │          │  └─tool
│  │      │          └─zip
│  │      ├─args-1.4.3
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─async-2.0.7
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─delegate
│  │      │  │      ├─result
│  │      │  │      ├─stream_sink_transformer
│  │      │  │      └─typed
│  │      │  └─test
│  │      │      ├─result
│  │      │      └─typed_wrapper
│  │      ├─barback-0.15.2+16
│  │      │  ├─example
│  │      │  │  ├─aggregate_transformer
│  │      │  │  │  └─lib
│  │      │  │  │      └─recipes-grammas
│  │      │  │  ├─lazy_transformer
│  │      │  │  │  └─lib
│  │      │  │  ├─markdown_converter
│  │      │  │  │  └─lib
│  │      │  │  │      └─images
│  │      │  │  └─simple_transformer
│  │      │  │      └─lib
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─asset
│  │      │  │      ├─graph
│  │      │  │      ├─transformer
│  │      │  │      └─utils
│  │      │  └─test
│  │      │      ├─package_graph
│  │      │      │  └─transform
│  │      │      └─transformer
│  │      ├─boolean_selector-1.0.3
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─browser-0.10.0+3
│  │      │  └─lib
│  │      ├─charcode-1.1.1
│  │      │  ├─lib
│  │      │  └─tool
│  │      ├─cli_util-0.1.2+1
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  ├─test
│  │      │  └─tool
│  │      ├─collection-1.14.6
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─combined_wrappers
│  │      │  └─test
│  │      │      ├─combined_wrapper
│  │      │      └─typed_wrapper
│  │      ├─connectivity-0.3.0
│  │      │  ├─android
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─java
│  │      │  │              └─io
│  │      │  │                  └─flutter
│  │      │  │                      └─plugins
│  │      │  │                          └─connectivity
│  │      │  ├─example
│  │      │  │  ├─android
│  │      │  │  │  ├─app
│  │      │  │  │  │  └─src
│  │      │  │  │  │      └─main
│  │      │  │  │  │          ├─java
│  │      │  │  │  │          │  └─io
│  │      │  │  │  │          │      └─flutter
│  │      │  │  │  │          │          └─plugins
│  │      │  │  │  │          │              └─connectivity_example
│  │      │  │  │  │          └─res
│  │      │  │  │  │              ├─mipmap-hdpi
│  │      │  │  │  │              ├─mipmap-mdpi
│  │      │  │  │  │              ├─mipmap-xhdpi
│  │      │  │  │  │              ├─mipmap-xxhdpi
│  │      │  │  │  │              └─mipmap-xxxhdpi
│  │      │  │  │  └─gradle
│  │      │  │  │      └─wrapper
│  │      │  │  ├─ios
│  │      │  │  │  ├─Flutter
│  │      │  │  │  ├─Runner
│  │      │  │  │  │  ├─Assets.xcassets
│  │      │  │  │  │  │  └─AppIcon.appiconset
│  │      │  │  │  │  └─Base.lproj
│  │      │  │  │  ├─Runner.xcodeproj
│  │      │  │  │  │  ├─project.xcworkspace
│  │      │  │  │  │  └─xcshareddata
│  │      │  │  │  │      └─xcschemes
│  │      │  │  │  └─Runner.xcworkspace
│  │      │  │  └─lib
│  │      │  ├─ios
│  │      │  │  ├─Assets
│  │      │  │  └─Classes
│  │      │  └─lib
│  │      ├─convert-2.0.1
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─hex
│  │      │  │      └─percent
│  │      │  └─test
│  │      ├─coverage-0.11.0
│  │      │  ├─bin
│  │      │  ├─ios
│  │      │  │  ├─Flutter
│  │      │  │  └─Runner
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  ├─test
│  │      │  │  └─test_files
│  │      │  └─tool
│  │      ├─crypto-2.0.3
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─csslib-0.14.4
│  │      │  ├─bin
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      └─examples
│  │      ├─cupertino_icons-0.1.2
│  │      │  ├─assets
│  │      │  └─lib
│  │      ├─dart_style-1.0.12
│  │      │  ├─benchmark
│  │      │  ├─bin
│  │      │  ├─dist
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─line_splitting
│  │      │  │      └─rule
│  │      │  ├─test
│  │      │  │  ├─comments
│  │      │  │  ├─regression
│  │      │  │  │  ├─0000
│  │      │  │  │  ├─0100
│  │      │  │  │  ├─0200
│  │      │  │  │  ├─0300
│  │      │  │  │  ├─0400
│  │      │  │  │  ├─0500
│  │      │  │  │  ├─0600
│  │      │  │  │  └─other
│  │      │  │  ├─selections
│  │      │  │  ├─splitting
│  │      │  │  └─whitespace
│  │      │  ├─tool
│  │      │  └─web
│  │      ├─device_info-0.2.0
│  │      │  ├─android
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─java
│  │      │  │              └─io
│  │      │  │                  └─flutter
│  │      │  │                      └─plugins
│  │      │  │                          └─deviceinfo
│  │      │  ├─example
│  │      │  │  ├─android
│  │      │  │  │  ├─app
│  │      │  │  │  │  └─src
│  │      │  │  │  │      └─main
│  │      │  │  │  │          ├─java
│  │      │  │  │  │          │  └─io
│  │      │  │  │  │          │      └─flutter
│  │      │  │  │  │          │          └─plugins
│  │      │  │  │  │          │              └─deviceinfoexample
│  │      │  │  │  │          └─res
│  │      │  │  │  │              ├─mipmap-hdpi
│  │      │  │  │  │              ├─mipmap-mdpi
│  │      │  │  │  │              ├─mipmap-xhdpi
│  │      │  │  │  │              ├─mipmap-xxhdpi
│  │      │  │  │  │              └─mipmap-xxxhdpi
│  │      │  │  │  └─gradle
│  │      │  │  │      └─wrapper
│  │      │  │  ├─ios
│  │      │  │  │  ├─Flutter
│  │      │  │  │  ├─Runner
│  │      │  │  │  │  ├─Assets.xcassets
│  │      │  │  │  │  │  └─AppIcon.appiconset
│  │      │  │  │  │  └─Base.lproj
│  │      │  │  │  ├─Runner.xcodeproj
│  │      │  │  │  │  ├─project.xcworkspace
│  │      │  │  │  │  └─xcshareddata
│  │      │  │  │  │      └─xcschemes
│  │      │  │  │  └─Runner.xcworkspace
│  │      │  │  └─lib
│  │      │  ├─ios
│  │      │  │  ├─Assets
│  │      │  │  └─Classes
│  │      │  └─lib
│  │      ├─file-5.0.0
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─backends
│  │      │  │      │  ├─chroot
│  │      │  │      │  ├─local
│  │      │  │      │  ├─memory
│  │      │  │      │  └─record_replay
│  │      │  │      ├─forwarding
│  │      │  │      └─interface
│  │      │  └─test
│  │      ├─file_testing-2.0.0
│  │      │  └─lib
│  │      │      └─src
│  │      │          └─testing
│  │      ├─front_end-0.1.0-alpha.12
│  │      │  ├─benchmarks
│  │      │  │  └─ikg
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─api_prototype
│  │      │  │      ├─api_unstable
│  │      │  │      ├─base
│  │      │  │      ├─byte_store
│  │      │  │      ├─codegen
│  │      │  │      ├─fasta
│  │      │  │      │  ├─builder
│  │      │  │      │  ├─dill
│  │      │  │      │  ├─kernel
│  │      │  │      │  ├─parser
│  │      │  │      │  ├─scanner
│  │      │  │      │  ├─source
│  │      │  │      │  ├─testing
│  │      │  │      │  ├─type_inference
│  │      │  │      │  └─util
│  │      │  │      ├─incremental
│  │      │  │      ├─scanner
│  │      │  │      └─testing
│  │      │  ├─test
│  │      │  │  ├─fasta
│  │      │  │  │  ├─parser
│  │      │  │  │  ├─scanner
│  │      │  │  │  ├─testing
│  │      │  │  │  └─type_inference
│  │      │  │  ├─src
│  │      │  │  │  ├─base
│  │      │  │  │  ├─byte_store
│  │      │  │  │  └─incremental
│  │      │  │  └─tool
│  │      │  ├─testcases
│  │      │  │  ├─dartino
│  │      │  │  ├─expression
│  │      │  │  ├─incremental_initialize_from_dill
│  │      │  │  ├─inference
│  │      │  │  ├─inference_new
│  │      │  │  ├─instantiate_to_bound
│  │      │  │  ├─new_const_insertion
│  │      │  │  ├─no_such_method_forwarders
│  │      │  │  ├─rasta
│  │      │  │  ├─regress
│  │      │  │  ├─runtime_checks
│  │      │  │  ├─runtime_checks_new
│  │      │  │  └─shaker
│  │      │  │      └─lib
│  │      │  └─tool
│  │      │      ├─status_files
│  │      │      └─_fasta
│  │      ├─glob-1.1.5
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─html-0.13.3
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      ├─data
│  │      │      │  ├─parser_feature
│  │      │      │  ├─tokenizer
│  │      │      │  └─tree-construction
│  │      │      │      └─scripted
│  │      │      └─selectors
│  │      ├─http-0.11.3+16
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      ├─html
│  │      │      └─io
│  │      ├─http_multi_server-2.0.4
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─http_parser-3.1.2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─chunked_coding
│  │      │  └─test
│  │      ├─image-1.1.32
│  │      │  ├─.dart_tool
│  │      │  │  └─pub
│  │      │  │      └─bin
│  │      │  │          ├─archive
│  │      │  │          └─test
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─draw
│  │      │  │      ├─effects
│  │      │  │      ├─filter
│  │      │  │      ├─fonts
│  │      │  │      ├─formats
│  │      │  │      │  ├─exr
│  │      │  │      │  ├─gif
│  │      │  │      │  ├─jpeg
│  │      │  │      │  ├─png
│  │      │  │      │  ├─psd
│  │      │  │      │  │  ├─effect
│  │      │  │      │  │  └─layer_data
│  │      │  │      │  ├─pvrtc
│  │      │  │      │  ├─tga
│  │      │  │      │  ├─tiff
│  │      │  │      │  └─webp
│  │      │  │      ├─hdr
│  │      │  │      ├─internal
│  │      │  │      ├─transform
│  │      │  │      └─util
│  │      │  ├─test
│  │      │  │  └─res
│  │      │  │      ├─exr
│  │      │  │      ├─font
│  │      │  │      ├─gif
│  │      │  │      ├─jpg
│  │      │  │      ├─png
│  │      │  │      │  └─broken
│  │      │  │      ├─psd
│  │      │  │      ├─pvr
│  │      │  │      ├─tga
│  │      │  │      ├─tiff
│  │      │  │      └─webp
│  │      │  ├─tool
│  │      │  └─web
│  │      │      └─res
│  │      ├─intl-0.15.6
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─data
│  │      │  │      │  └─dates
│  │      │  │      │      ├─patterns
│  │      │  │      │      └─symbols
│  │      │  │      └─intl
│  │      │  ├─test
│  │      │  └─tool
│  │      ├─intl_translation-0.16.6
│  │      │  ├─.dart_tool
│  │      │  │  └─pub
│  │      │  │      ├─bin
│  │      │  │      │  ├─dart_style
│  │      │  │      │  └─test
│  │      │  │      └─deps
│  │      │  │          └─debug
│  │      │  │              ├─dart_style
│  │      │  │              │  └─lib
│  │      │  │              │      └─src
│  │      │  │              │          ├─line_splitting
│  │      │  │              │          └─rule
│  │      │  │              └─intl
│  │      │  │                  └─lib
│  │      │  │                      └─src
│  │      │  │                          ├─data
│  │      │  │                          │  └─dates
│  │      │  │                          │      ├─patterns
│  │      │  │                          │      └─symbols
│  │      │  │                          └─intl
│  │      │  ├─bin
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      ├─messages_with_transformer
│  │      │      ├─message_extraction
│  │      │      └─two_components
│  │      ├─io-0.3.2+1
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      └─_files
│  │      ├─isolate-2.0.0
│  │      │  ├─.dart_tool
│  │      │  │  └─pub
│  │      │  │      └─bin
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─js-0.6.1
│  │      │  ├─example
│  │      │  └─lib
│  │      │      └─src
│  │      ├─json_rpc_2-2.0.7
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      ├─client
│  │      │      └─server
│  │      ├─json_schema-1.0.8
│  │      │  ├─.github
│  │      │  ├─bin
│  │      │  ├─dot_samples
│  │      │  │  ├─original
│  │      │  │  ├─schemaout
│  │      │  │  └─schemas
│  │      │  ├─example
│  │      │  │  ├─from_json
│  │      │  │  └─from_url
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─json_schema
│  │      │  ├─test
│  │      │  │  ├─invalid_schemas
│  │      │  │  ├─JSON-Schema-Test-Suite
│  │      │  │  │  ├─bin
│  │      │  │  │  ├─remotes
│  │      │  │  │  │  └─folder
│  │      │  │  │  └─tests
│  │      │  │  │      ├─draft3
│  │      │  │  │      │  └─optional
│  │      │  │  │      └─draft4
│  │      │  │  │          └─optional
│  │      │  │  └─unit
│  │      │  │      └─vm
│  │      │  │          └─json_schema
│  │      │  └─tool
│  │      ├─kernel-0.3.0-alpha.12
│  │      │  ├─bin
│  │      │  ├─coq
│  │      │  ├─doc
│  │      │  │  └─semantics
│  │      │  ├─lib
│  │      │  │  ├─analyzer
│  │      │  │  ├─binary
│  │      │  │  ├─frontend
│  │      │  │  ├─interpreter
│  │      │  │  │  └─tools
│  │      │  │  ├─src
│  │      │  │  │  └─tool
│  │      │  │  ├─target
│  │      │  │  ├─testing
│  │      │  │  ├─text
│  │      │  │  ├─transformations
│  │      │  │  │  ├─closure
│  │      │  │  │  └─reify
│  │      │  │  │      ├─analysis
│  │      │  │  │      └─transformation
│  │      │  │  ├─util
│  │      │  │  └─vm
│  │      │  ├─runtime
│  │      │  │  └─reify
│  │      │  ├─test
│  │      │  │  ├─closures
│  │      │  │  ├─closures_initializers
│  │      │  │  ├─closures_type_vars
│  │      │  │  ├─interpreter
│  │      │  │  └─reify
│  │      │  └─testcases
│  │      │      ├─closures
│  │      │      ├─closures_initializers
│  │      │      ├─closures_type_vars
│  │      │      ├─interpreter
│  │      │      └─reify
│  │      ├─linter-0.1.50
│  │      │  ├─bin
│  │      │  ├─doc
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─rules
│  │      │  │      │  └─pub
│  │      │  │      └─util
│  │      │  ├─test
│  │      │  │  ├─rules
│  │      │  │  │  └─pub
│  │      │  │  │      └─package_names
│  │      │  │  ├─util
│  │      │  │  └─_data
│  │      │  │      ├─always_require_non_null_named_parameters
│  │      │  │      ├─avoid_private_typedef_functions
│  │      │  │      ├─avoid_relative_lib_imports
│  │      │  │      │  └─lib
│  │      │  │      ├─avoid_renaming_method_parameters
│  │      │  │      │  ├─lib
│  │      │  │      │  └─test
│  │      │  │      ├─cancel_subscriptions
│  │      │  │      ├─close_sinks
│  │      │  │      │  └─src
│  │      │  │      ├─directives_ordering
│  │      │  │      │  ├─dart_directives_go_first
│  │      │  │      │  ├─export_directives_after_import_directives
│  │      │  │      │  ├─lint_one_node_no_more_than_once
│  │      │  │      │  ├─package_directives_before_relative
│  │      │  │      │  ├─sort_directive_sections_alphabetically
│  │      │  │      │  └─third_party_package_directives_before_own
│  │      │  │      ├─only_throw_errors
│  │      │  │      ├─overridden_fields
│  │      │  │      │  └─src
│  │      │  │      ├─p1
│  │      │  │      │  └─src
│  │      │  │      ├─p2
│  │      │  │      │  └─src
│  │      │  │      │      └─ignored
│  │      │  │      ├─p3
│  │      │  │      ├─p4
│  │      │  │      │  └─lib
│  │      │  │      ├─p5
│  │      │  │      ├─p6
│  │      │  │      │  └─lib
│  │      │  │      ├─p8
│  │      │  │      │  └─src
│  │      │  │      │      └─ignored
│  │      │  │      ├─prefer_asserts_in_initializer_lists
│  │      │  │      ├─prefer_const_constructors_in_immutables
│  │      │  │      ├─public_member_api_docs
│  │      │  │      │  ├─lib
│  │      │  │      │  └─test
│  │      │  │      └─synthetic
│  │      │  └─tool
│  │      ├─logging-0.11.3+1
│  │      │  ├─lib
│  │      │  └─test
│  │      ├─matcher-0.12.2+1
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─meta-1.1.5
│  │      │  └─lib
│  │      ├─mime-0.9.6
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─mockito-3.0.0-alpha+5
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  ├─test
│  │      │  │  └─example
│  │      │  │      └─iss
│  │      │  └─tool
│  │      ├─multi_server_socket-1.0.1
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─mustache-1.0.0
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  ├─test
│  │      │  │  └─no_spec
│  │      │  └─tool
│  │      ├─node_preamble-1.4.1
│  │      │  ├─lib
│  │      │  └─tool
│  │      ├─package_config-1.0.3
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─package_resolver-1.0.2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─path-1.5.1
│  │      │  ├─benchmark
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─style
│  │      │  └─test
│  │      ├─petitparser-1.7.6
│  │      │  ├─example
│  │      │  │  ├─dart
│  │      │  │  │  └─src
│  │      │  │  ├─json
│  │      │  │  │  └─src
│  │      │  │  ├─lisp
│  │      │  │  │  └─src
│  │      │  │  ├─lispshell
│  │      │  │  ├─lispweb
│  │      │  │  └─smalltalk
│  │      │  │      └─src
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─core
│  │      │  │      │  ├─actions
│  │      │  │      │  ├─characters
│  │      │  │      │  ├─combinators
│  │      │  │      │  ├─contexts
│  │      │  │      │  ├─definition
│  │      │  │      │  ├─expression
│  │      │  │      │  ├─parsers
│  │      │  │      │  ├─predicates
│  │      │  │      │  └─repeaters
│  │      │  │      ├─debug
│  │      │  │      └─reflection
│  │      │  ├─test
│  │      │  └─tool
│  │      ├─platform-2.1.2
│  │      │  ├─dev
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─interface
│  │      │  │      └─testing
│  │      │  └─test
│  │      ├─plugin-0.2.0+2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─pool-1.3.4
│  │      │  ├─.idea
│  │      │  │  └─libraries
│  │      │  ├─lib
│  │      │  └─test
│  │      ├─process-3.0.1
│  │      │  ├─dev
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─interface
│  │      │  │      └─record_replay
│  │      │  └─test
│  │      │      ├─data
│  │      │      │  └─replay
│  │      │      └─src
│  │      │          └─interface
│  │      ├─pub_semver-1.4.1
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─quiver-0.29.0+1
│  │      │  ├─lib
│  │      │  │  ├─src
│  │      │  │  │  ├─async
│  │      │  │  │  ├─cache
│  │      │  │  │  ├─collection
│  │      │  │  │  │  └─delegates
│  │      │  │  │  ├─core
│  │      │  │  │  ├─iterables
│  │      │  │  │  ├─pattern
│  │      │  │  │  └─time
│  │      │  │  └─testing
│  │      │  │      └─src
│  │      │  │          ├─async
│  │      │  │          ├─equality
│  │      │  │          ├─runtime
│  │      │  │          └─time
│  │      │  ├─test
│  │      │  │  ├─async
│  │      │  │  ├─cache
│  │      │  │  ├─collection
│  │      │  │  │  └─delegates
│  │      │  │  ├─core
│  │      │  │  ├─iterables
│  │      │  │  ├─pattern
│  │      │  │  ├─testing
│  │      │  │  │  ├─async
│  │      │  │  │  └─equality
│  │      │  │  └─time
│  │      │  └─tool
│  │      ├─shelf-0.7.3
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─middleware
│  │      │  └─test
│  │      ├─shelf_packages_handler-1.0.3
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─shelf_static-0.2.7
│  │      │  ├─example
│  │      │  │  └─files
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─shelf_web_socket-0.2.2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─source_maps-0.10.5
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─source_map_stack_trace-1.1.4
│  │      │  ├─lib
│  │      │  └─test
│  │      ├─source_span-1.4.0
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─stack_trace-1.9.2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      │      └─chain
│  │      ├─stream_channel-1.6.6
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─transformer
│  │      │  └─test
│  │      ├─string_scanner-1.0.2
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─term_glyph-1.0.0
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  ├─test
│  │      │  └─tool
│  │      ├─test-0.12.37
│  │      │  ├─bin
│  │      │  ├─doc
│  │      │  ├─image
│  │      │  ├─lib
│  │      │  │  ├─bootstrap
│  │      │  │  └─src
│  │      │  │      ├─backend
│  │      │  │      ├─bootstrap
│  │      │  │      ├─frontend
│  │      │  │      ├─runner
│  │      │  │      │  ├─browser
│  │      │  │      │  │  └─static
│  │      │  │      │  ├─configuration
│  │      │  │      │  ├─node
│  │      │  │      │  ├─plugin
│  │      │  │      │  ├─reporter
│  │      │  │      │  └─vm
│  │      │  │      └─util
│  │      │  ├─test
│  │      │  │  ├─backend
│  │      │  │  ├─frontend
│  │      │  │  │  └─matcher
│  │      │  │  ├─runner
│  │      │  │  │  ├─browser
│  │      │  │  │  ├─configuration
│  │      │  │  │  └─node
│  │      │  │  └─util
│  │      │  └─tool
│  │      ├─typed_data-1.1.5
│  │      │  ├─lib
│  │      │  └─test
│  │      ├─url_launcher-3.0.0
│  │      │  ├─android
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─java
│  │      │  │              └─io
│  │      │  │                  └─flutter
│  │      │  │                      └─plugins
│  │      │  │                          └─urllauncher
│  │      │  ├─example
│  │      │  │  ├─android
│  │      │  │  │  ├─app
│  │      │  │  │  │  └─src
│  │      │  │  │  │      └─main
│  │      │  │  │  │          ├─java
│  │      │  │  │  │          │  └─io
│  │      │  │  │  │          │      └─flutter
│  │      │  │  │  │          │          └─plugins
│  │      │  │  │  │          │              └─urllauncherexample
│  │      │  │  │  │          └─res
│  │      │  │  │  │              ├─mipmap-hdpi
│  │      │  │  │  │              ├─mipmap-mdpi
│  │      │  │  │  │              ├─mipmap-xhdpi
│  │      │  │  │  │              ├─mipmap-xxhdpi
│  │      │  │  │  │              └─mipmap-xxxhdpi
│  │      │  │  │  └─gradle
│  │      │  │  │      └─wrapper
│  │      │  │  ├─ios
│  │      │  │  │  ├─Flutter
│  │      │  │  │  ├─Runner
│  │      │  │  │  │  ├─Assets.xcassets
│  │      │  │  │  │  │  └─AppIcon.appiconset
│  │      │  │  │  │  └─Base.lproj
│  │      │  │  │  ├─Runner.xcodeproj
│  │      │  │  │  │  ├─project.xcworkspace
│  │      │  │  │  │  └─xcshareddata
│  │      │  │  │  │      └─xcschemes
│  │      │  │  │  └─Runner.xcworkspace
│  │      │  │  └─lib
│  │      │  ├─ios
│  │      │  │  ├─Assets
│  │      │  │  └─Classes
│  │      │  ├─lib
│  │      │  └─test
│  │      ├─usage-3.4.0
│  │      │  ├─.idea
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  ├─src
│  │      │  │  └─uuid
│  │      │  ├─test
│  │      │  │  └─src
│  │      │  └─tool
│  │      ├─utf-0.9.0+4
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─vector_math-2.0.6
│  │      │  ├─benchmark
│  │      │  ├─bin
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─vector_math
│  │      │  │      │  └─third_party
│  │      │  │      ├─vector_math_64
│  │      │  │      │  └─third_party
│  │      │  │      ├─vector_math_geometry
│  │      │  │      │  ├─filters
│  │      │  │      │  └─generators
│  │      │  │      ├─vector_math_lists
│  │      │  │      └─vector_math_operations
│  │      │  ├─test
│  │      │  └─tool
│  │      ├─video_player-0.5.1
│  │      │  ├─android
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─java
│  │      │  │              └─io
│  │      │  │                  └─flutter
│  │      │  │                      └─plugins
│  │      │  │                          └─videoplayer
│  │      │  ├─doc
│  │      │  ├─example
│  │      │  │  ├─android
│  │      │  │  │  ├─app
│  │      │  │  │  │  └─src
│  │      │  │  │  │      └─main
│  │      │  │  │  │          ├─java
│  │      │  │  │  │          │  └─io
│  │      │  │  │  │          │      └─flutter
│  │      │  │  │  │          │          └─plugins
│  │      │  │  │  │          │              └─videoplayerexample
│  │      │  │  │  │          └─res
│  │      │  │  │  │              ├─drawable
│  │      │  │  │  │              ├─mipmap-hdpi
│  │      │  │  │  │              ├─mipmap-mdpi
│  │      │  │  │  │              ├─mipmap-xhdpi
│  │      │  │  │  │              ├─mipmap-xxhdpi
│  │      │  │  │  │              ├─mipmap-xxxhdpi
│  │      │  │  │  │              └─values
│  │      │  │  │  └─gradle
│  │      │  │  │      └─wrapper
│  │      │  │  ├─assets
│  │      │  │  ├─ios
│  │      │  │  │  ├─Flutter
│  │      │  │  │  ├─Runner
│  │      │  │  │  │  ├─Assets.xcassets
│  │      │  │  │  │  │  ├─AppIcon.appiconset
│  │      │  │  │  │  │  └─LaunchImage.imageset
│  │      │  │  │  │  └─Base.lproj
│  │      │  │  │  ├─Runner.xcodeproj
│  │      │  │  │  │  ├─project.xcworkspace
│  │      │  │  │  │  └─xcshareddata
│  │      │  │  │  │      └─xcschemes
│  │      │  │  │  └─Runner.xcworkspace
│  │      │  │  └─lib
│  │      │  ├─ios
│  │      │  │  ├─Assets
│  │      │  │  └─Classes
│  │      │  └─lib
│  │      ├─vm_service_client-0.2.4+1
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  └─test
│  │      ├─watcher-0.9.7+7
│  │      │  ├─benchmark
│  │      │  ├─example
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      ├─directory_watcher
│  │      │  │      └─file_watcher
│  │      │  └─test
│  │      │      ├─directory_watcher
│  │      │      ├─file_watcher
│  │      │      ├─no_subscription
│  │      │      └─ready
│  │      ├─web_socket_channel-1.0.7
│  │      │  ├─lib
│  │      │  │  └─src
│  │      │  │      └─copy
│  │      │  └─test
│  │      ├─xml-3.0.0
│  │      │  ├─lib
│  │      │  │  └─xml
│  │      │  │      ├─iterators
│  │      │  │      ├─nodes
│  │      │  │      ├─utils
│  │      │  │      └─visitors
│  │      │  ├─test
│  │      │  └─tool
│  │      └─yaml-2.1.13
│  │          ├─benchmark
│  │          ├─lib
│  │          │  └─src
│  │          └─test
│  └─_temp
├─bin
│  ├─cache
│  │  ├─artifacts
│  │  │  ├─engine
│  │  │  │  ├─android-arm
│  │  │  │  ├─android-arm-profile
│  │  │  │  │  └─windows-x64
│  │  │  │  ├─android-arm-release
│  │  │  │  │  └─windows-x64
│  │  │  │  ├─android-arm64
│  │  │  │  ├─android-arm64-profile
│  │  │  │  │  └─windows-x64
│  │  │  │  ├─android-arm64-release
│  │  │  │  │  └─windows-x64
│  │  │  │  ├─android-x64
│  │  │  │  ├─android-x86
│  │  │  │  ├─common
│  │  │  │  │  └─flutter_patched_sdk
│  │  │  │  └─windows-x64
│  │  │  ├─gradle_wrapper
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  └─material_fonts
│  │  ├─dart-sdk
│  │  │  ├─bin
│  │  │  │  └─snapshots
│  │  │  │      └─resources
│  │  │  │          └─dartdoc
│  │  │  │              ├─resources
│  │  │  │              │  └─css
│  │  │  │              └─templates
│  │  │  ├─include
│  │  │  └─lib
│  │  │      ├─analysis_server
│  │  │      │  ├─benchmark
│  │  │      │  │  ├─integration
│  │  │      │  │  └─perf
│  │  │      │  ├─bin
│  │  │      │  ├─lib
│  │  │      │  │  ├─plugin
│  │  │      │  │  │  ├─analysis
│  │  │      │  │  │  │  └─occurrences
│  │  │      │  │  │  ├─edit
│  │  │      │  │  │  │  ├─assist
│  │  │      │  │  │  │  └─fix
│  │  │      │  │  │  └─protocol
│  │  │      │  │  ├─protocol
│  │  │      │  │  └─src
│  │  │      │  │      ├─channel
│  │  │      │  │      ├─computer
│  │  │      │  │      ├─domains
│  │  │      │  │      │  ├─analysis
│  │  │      │  │      │  └─execution
│  │  │      │  │      ├─edit
│  │  │      │  │      ├─flutter
│  │  │      │  │      ├─operation
│  │  │      │  │      ├─plugin
│  │  │      │  │      ├─protocol
│  │  │      │  │      ├─provisional
│  │  │      │  │      │  └─completion
│  │  │      │  │      │      └─dart
│  │  │      │  │      ├─search
│  │  │      │  │      ├─server
│  │  │      │  │      ├─services
│  │  │      │  │      │  ├─completion
│  │  │      │  │      │  │  ├─dart
│  │  │      │  │      │  │  ├─postfix
│  │  │      │  │      │  │  └─statement
│  │  │      │  │      │  ├─correction
│  │  │      │  │      │  ├─kythe
│  │  │      │  │      │  ├─refactoring
│  │  │      │  │      │  └─search
│  │  │      │  │      ├─status
│  │  │      │  │      └─utilities
│  │  │      │  └─tool
│  │  │      │      ├─instrumentation
│  │  │      │      │  ├─log
│  │  │      │      │  └─page
│  │  │      │      └─spec
│  │  │      │          └─generated
│  │  │      │              └─java
│  │  │      │                  └─types
│  │  │      ├─analyzer
│  │  │      │  ├─benchmark
│  │  │      │  ├─example
│  │  │      │  ├─lib
│  │  │      │  │  ├─context
│  │  │      │  │  ├─dart
│  │  │      │  │  │  ├─analysis
│  │  │      │  │  │  ├─ast
│  │  │      │  │  │  ├─constant
│  │  │      │  │  │  └─element
│  │  │      │  │  ├─error
│  │  │      │  │  ├─exception
│  │  │      │  │  ├─file_system
│  │  │      │  │  ├─instrumentation
│  │  │      │  │  ├─plugin
│  │  │      │  │  ├─source
│  │  │      │  │  ├─src
│  │  │      │  │  │  ├─analysis_options
│  │  │      │  │  │  │  └─error
│  │  │      │  │  │  ├─codegen
│  │  │      │  │  │  ├─command_line
│  │  │      │  │  │  ├─context
│  │  │      │  │  │  ├─dart
│  │  │      │  │  │  │  ├─analysis
│  │  │      │  │  │  │  ├─ast
│  │  │      │  │  │  │  ├─constant
│  │  │      │  │  │  │  ├─element
│  │  │      │  │  │  │  ├─error
│  │  │      │  │  │  │  ├─resolver
│  │  │      │  │  │  │  ├─scanner
│  │  │      │  │  │  │  └─sdk
│  │  │      │  │  │  ├─error
│  │  │      │  │  │  ├─fasta
│  │  │      │  │  │  ├─file_system
│  │  │      │  │  │  ├─generated
│  │  │      │  │  │  │  └─testing
│  │  │      │  │  │  ├─html
│  │  │      │  │  │  │  └─error
│  │  │      │  │  │  ├─kernel
│  │  │      │  │  │  ├─lint
│  │  │      │  │  │  ├─plugin
│  │  │      │  │  │  ├─pubspec
│  │  │      │  │  │  ├─services
│  │  │      │  │  │  ├─source
│  │  │      │  │  │  ├─summary
│  │  │      │  │  │  ├─task
│  │  │      │  │  │  │  ├─api
│  │  │      │  │  │  │  └─strong
│  │  │      │  │  │  ├─test_utilities
│  │  │      │  │  │  └─util
│  │  │      │  │  └─task
│  │  │      │  └─tool
│  │  │      │      ├─analysis_driver
│  │  │      │      ├─summary
│  │  │      │      └─task_dependency_graph
│  │  │      ├─async
│  │  │      ├─cli
│  │  │      ├─collection
│  │  │      ├─convert
│  │  │      ├─core
│  │  │      ├─developer
│  │  │      ├─front_end
│  │  │      │  ├─benchmarks
│  │  │      │  │  └─ikg
│  │  │      │  ├─lib
│  │  │      │  │  └─src
│  │  │      │  │      ├─api_prototype
│  │  │      │  │      ├─api_unstable
│  │  │      │  │      ├─base
│  │  │      │  │      ├─byte_store
│  │  │      │  │      ├─codegen
│  │  │      │  │      ├─fasta
│  │  │      │  │      │  ├─builder
│  │  │      │  │      │  ├─dill
│  │  │      │  │      │  ├─kernel
│  │  │      │  │      │  ├─parser
│  │  │      │  │      │  ├─scanner
│  │  │      │  │      │  ├─source
│  │  │      │  │      │  ├─testing
│  │  │      │  │      │  ├─type_inference
│  │  │      │  │      │  └─util
│  │  │      │  │      ├─incremental
│  │  │      │  │      ├─scanner
│  │  │      │  │      └─testing
│  │  │      │  └─tool
│  │  │      │      ├─status_files
│  │  │      │      └─_fasta
│  │  │      ├─html
│  │  │      │  ├─dart2js
│  │  │      │  ├─dartium
│  │  │      │  └─html_common
│  │  │      ├─internal
│  │  │      ├─io
│  │  │      ├─isolate
│  │  │      ├─kernel
│  │  │      │  ├─bin
│  │  │      │  ├─coq
│  │  │      │  ├─lib
│  │  │      │  │  ├─analyzer
│  │  │      │  │  ├─binary
│  │  │      │  │  ├─frontend
│  │  │      │  │  ├─interpreter
│  │  │      │  │  │  └─tools
│  │  │      │  │  ├─src
│  │  │      │  │  │  └─tool
│  │  │      │  │  ├─target
│  │  │      │  │  ├─testing
│  │  │      │  │  ├─text
│  │  │      │  │  ├─transformations
│  │  │      │  │  │  ├─closure
│  │  │      │  │  │  └─reify
│  │  │      │  │  │      ├─analysis
│  │  │      │  │  │      └─transformation
│  │  │      │  │  ├─util
│  │  │      │  │  └─vm
│  │  │      │  └─runtime
│  │  │      │      └─reify
│  │  │      ├─math
│  │  │      ├─mirrors
│  │  │      ├─profiler
│  │  │      ├─typed_data
│  │  │      ├─_http
│  │  │      └─_internal
│  │  │          ├─js_runtime
│  │  │          │  └─lib
│  │  │          │      ├─preambles
│  │  │          │      └─shared
│  │  │          ├─pub
│  │  │          │  └─asset
│  │  │          │      └─7zip
│  │  │          └─sdk_library_metadata
│  │  │              └─lib
│  │  ├─downloads
│  │  └─pkg
│  │      └─sky_engine
│  │          ├─lib
│  │          │  ├─async
│  │          │  ├─collection
│  │          │  ├─convert
│  │          │  ├─core
│  │          │  ├─developer
│  │          │  ├─internal
│  │          │  ├─io
│  │          │  ├─isolate
│  │          │  ├─math
│  │          │  ├─typed_data
│  │          │  ├─ui
│  │          │  └─_http
│  │          └─sdk_ext
│  ├─internal
│  └─mingit
│      ├─cmd
│      ├─etc
│      │  ├─post-install
│      │  ├─profile.d
│      │  └─ssh
│      ├─mingw64
│      │  ├─bin
│      │  ├─doc
│      │  │  └─git-credential-manager
│      │  ├─etc
│      │  ├─lib
│      │  │  └─engines
│      │  ├─libexec
│      │  │  └─git-core
│      │  │      └─mergetools
│      │  ├─share
│      │  │  ├─doc
│      │  │  │  ├─expat
│      │  │  │  ├─mpfr
│      │  │  │  │  └─examples
│      │  │  │  └─spdylay
│      │  │  ├─git
│      │  │  ├─git-core
│      │  │  │  └─templates
│      │  │  │      ├─hooks
│      │  │  │      └─info
│      │  │  └─licenses
│      │  │      ├─expat
│      │  │      ├─gcc-libs
│      │  │      ├─gettext
│      │  │      │  ├─gettext-runtime
│      │  │      │  │  ├─intl
│      │  │      │  │  └─libasprintf
│      │  │      │  ├─gettext-tools
│      │  │      │  │  └─gnulib-lib
│      │  │      │  │      └─libxml
│      │  │      │  └─gnulib-local
│      │  │      │      └─lib
│      │  │      │          └─libxml
│      │  │      ├─libffi
│      │  │      ├─libiconv
│      │  │      │  └─libcharset
│      │  │      ├─libssh2
│      │  │      ├─libtasn1
│      │  │      ├─libunistring
│      │  │      ├─libwinpthread
│      │  │      │  └─mingw-w64-libraries
│      │  │      │      └─winpthreads
│      │  │      ├─openssl
│      │  │      ├─pcre
│      │  │      └─zlib
│      │  └─ssl
│      │      └─certs
│      └─usr
│          ├─bin
│          ├─share
│          │  ├─licenses
│          │  │  ├─gcc-libs
│          │  │  ├─libsqlite
│          │  │  ├─ncurses
│          │  │  ├─openssh
│          │  │  ├─openssl
│          │  │  └─zlib
│          │  └─makepkg
│          │      └─lint_package
│          └─ssl
├─dev
│  ├─automated_tests
│  │  ├─flutter_test
│  │  └─test_smoke_test
│  ├─benchmarks
│  │  ├─complex_layout
│  │  │  ├─android
│  │  │  │  ├─app
│  │  │  │  │  └─src
│  │  │  │  │      └─main
│  │  │  │  │          └─res
│  │  │  │  │              ├─mipmap-hdpi
│  │  │  │  │              ├─mipmap-mdpi
│  │  │  │  │              ├─mipmap-xhdpi
│  │  │  │  │              ├─mipmap-xxhdpi
│  │  │  │  │              └─mipmap-xxxhdpi
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  ├─ios
│  │  │  │  ├─Flutter
│  │  │  │  ├─Runner
│  │  │  │  │  ├─Assets.xcassets
│  │  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  │  └─Base.lproj
│  │  │  │  └─Runner.xcodeproj
│  │  │  │      └─project.xcworkspace
│  │  │  ├─lib
│  │  │  └─test_driver
│  │  └─microbenchmarks
│  │      ├─android
│  │      │  ├─app
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─res
│  │      │  │              ├─mipmap-hdpi
│  │      │  │              ├─mipmap-mdpi
│  │      │  │              ├─mipmap-xhdpi
│  │      │  │              ├─mipmap-xxhdpi
│  │      │  │              └─mipmap-xxxhdpi
│  │      │  └─gradle
│  │      │      └─wrapper
│  │      ├─ios
│  │      │  ├─Flutter
│  │      │  ├─Runner
│  │      │  │  ├─Assets.xcassets
│  │      │  │  │  └─AppIcon.appiconset
│  │      │  │  └─Base.lproj
│  │      │  └─Runner.xcodeproj
│  │      │      └─project.xcworkspace
│  │      └─lib
│  │          ├─gestures
│  │          │  └─data
│  │          └─stocks
│  ├─bots
│  │  ├─docker
│  │  └─test
│  ├─devicelab
│  │  ├─bin
│  │  │  └─tasks
│  │  ├─images
│  │  ├─lib
│  │  │  ├─framework
│  │  │  └─tasks
│  │  └─test
│  ├─docs
│  │  └─platform_integration
│  │      └─lib
│  ├─integration_tests
│  │  ├─channels
│  │  │  ├─android
│  │  │  │  ├─app
│  │  │  │  │  └─src
│  │  │  │  │      └─main
│  │  │  │  │          ├─java
│  │  │  │  │          │  └─com
│  │  │  │  │          │      └─yourcompany
│  │  │  │  │          │          └─channels
│  │  │  │  │          └─res
│  │  │  │  │              ├─mipmap-hdpi
│  │  │  │  │              ├─mipmap-mdpi
│  │  │  │  │              ├─mipmap-xhdpi
│  │  │  │  │              ├─mipmap-xxhdpi
│  │  │  │  │              └─mipmap-xxxhdpi
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  ├─ios
│  │  │  │  ├─Flutter
│  │  │  │  ├─Runner
│  │  │  │  │  ├─Assets.xcassets
│  │  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  │  └─Base.lproj
│  │  │  │  ├─Runner.xcodeproj
│  │  │  │  │  ├─project.xcworkspace
│  │  │  │  │  └─xcshareddata
│  │  │  │  │      └─xcschemes
│  │  │  │  └─Runner.xcworkspace
│  │  │  ├─lib
│  │  │  │  └─src
│  │  │  └─test_driver
│  │  ├─external_ui
│  │  │  ├─android
│  │  │  │  ├─app
│  │  │  │  │  └─src
│  │  │  │  │      └─main
│  │  │  │  │          └─java
│  │  │  │  │              └─io
│  │  │  │  │                  └─flutter
│  │  │  │  │                      └─externalui
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  ├─ios
│  │  │  │  ├─Flutter
│  │  │  │  ├─Runner
│  │  │  │  │  └─Base.lproj
│  │  │  │  ├─Runner.xcodeproj
│  │  │  │  │  ├─project.xcworkspace
│  │  │  │  │  └─xcshareddata
│  │  │  │  │      └─xcschemes
│  │  │  │  └─Runner.xcworkspace
│  │  │  ├─lib
│  │  │  └─test_driver
│  │  ├─flavors
│  │  │  ├─android
│  │  │  │  ├─app
│  │  │  │  │  └─src
│  │  │  │  │      └─main
│  │  │  │  │          └─java
│  │  │  │  │              └─com
│  │  │  │  │                  └─yourcompany
│  │  │  │  │                      └─flavors
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  ├─ios
│  │  │  │  ├─Flutter
│  │  │  │  ├─Runner
│  │  │  │  │  ├─Assets.xcassets
│  │  │  │  │  │  ├─AppIcon.appiconset
│  │  │  │  │  │  └─LaunchImage.imageset
│  │  │  │  │  └─Base.lproj
│  │  │  │  ├─Runner.xcodeproj
│  │  │  │  │  ├─project.xcworkspace
│  │  │  │  │  └─xcshareddata
│  │  │  │  │      └─xcschemes
│  │  │  │  └─Runner.xcworkspace
│  │  │  ├─lib
│  │  │  └─test_driver
│  │  ├─platform_interaction
│  │  │  ├─android
│  │  │  │  ├─app
│  │  │  │  │  └─src
│  │  │  │  │      └─main
│  │  │  │  │          ├─java
│  │  │  │  │          │  └─com
│  │  │  │  │          │      └─yourcompany
│  │  │  │  │          │          └─platforminteraction
│  │  │  │  │          └─res
│  │  │  │  │              ├─mipmap-hdpi
│  │  │  │  │              ├─mipmap-mdpi
│  │  │  │  │              ├─mipmap-xhdpi
│  │  │  │  │              ├─mipmap-xxhdpi
│  │  │  │  │              └─mipmap-xxxhdpi
│  │  │  │  └─gradle
│  │  │  │      └─wrapper
│  │  │  ├─ios
│  │  │  │  ├─Flutter
│  │  │  │  ├─Runner
│  │  │  │  │  ├─Assets.xcassets
│  │  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  │  └─Base.lproj
│  │  │  │  ├─Runner.xcodeproj
│  │  │  │  │  ├─project.xcworkspace
│  │  │  │  │  └─xcshareddata
│  │  │  │  │      └─xcschemes
│  │  │  │  └─Runner.xcworkspace
│  │  │  ├─lib
│  │  │  │  └─src
│  │  │  └─test_driver
│  │  └─ui
│  │      ├─android
│  │      │  ├─app
│  │      │  │  └─src
│  │      │  │      └─main
│  │      │  │          └─java
│  │      │  │              └─com
│  │      │  │                  └─yourcompany
│  │      │  │                      └─integration_ui
│  │      │  └─gradle
│  │      │      └─wrapper
│  │      ├─ios
│  │      │  ├─Flutter
│  │      │  ├─Runner
│  │      │  │  └─Base.lproj
│  │      │  ├─Runner.xcodeproj
│  │      │  │  ├─project.xcworkspace
│  │      │  │  └─xcshareddata
│  │      │  │      └─xcschemes
│  │      │  └─Runner.xcworkspace
│  │      ├─lib
│  │      └─test_driver
│  ├─manual_tests
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─io
│  │  │  │          │      └─flutter
│  │  │  │          │          └─examples
│  │  │  │          │              └─manual_tests
│  │  │  │          └─res
│  │  │  │              └─mipmap-xxxhdpi
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  └─test
│  ├─missing_dependency_tests
│  └─tools
│      ├─lib
│      └─vitool
│          ├─bin
│          ├─lib
│          ├─test
│          └─test_assets
├─examples
│  ├─catalog
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─com
│  │  │  │          │      └─yourcompany
│  │  │  │          │          └─animated_list
│  │  │  │          └─res
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              └─mipmap-xxxhdpi
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─bin
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  ├─test
│  │  └─test_driver
│  ├─flutter_gallery
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      ├─androidTest
│  │  │  │      │  └─java
│  │  │  │      │      └─io
│  │  │  │      │          └─flutter
│  │  │  │      │              └─demo
│  │  │  │      │                  └─gallery
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─io
│  │  │  │          │      └─flutter
│  │  │  │          │          └─demo
│  │  │  │          │              └─gallery
│  │  │  │          └─res
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              └─mipmap-xxxhdpi
│  │  │  ├─fastlane
│  │  │  │  └─metadata
│  │  │  │      └─android
│  │  │  │          └─en-US
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─ios
│  │  │  ├─fastlane
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  │  ├─demo
│  │  │  │  ├─animation
│  │  │  │  ├─calculator
│  │  │  │  ├─cupertino
│  │  │  │  ├─material
│  │  │  │  └─shrine
│  │  │  └─gallery
│  │  ├─test
│  │  │  ├─calculator
│  │  │  └─demo
│  │  │      └─material
│  │  ├─test_driver
│  │  └─tool
│  ├─flutter_view
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─com
│  │  │  │          │      └─example
│  │  │  │          │          └─view
│  │  │  │          └─res
│  │  │  │              ├─color
│  │  │  │              ├─drawable
│  │  │  │              ├─layout
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              ├─mipmap-xxxhdpi
│  │  │  │              └─values
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─assets
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  └─lib
│  ├─hello_world
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─io
│  │  │  │          │      └─flutter
│  │  │  │          │          └─examples
│  │  │  │          │              └─hello_world
│  │  │  │          └─res
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              └─mipmap-xxxhdpi
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  └─test
│  ├─layers
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─io
│  │  │  │          │      └─flutter
│  │  │  │          │          └─examples
│  │  │  │          │              └─Layers
│  │  │  │          └─res
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              └─mipmap-xxxhdpi
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  ├─raw
│  │  ├─rendering
│  │  │  └─src
│  │  ├─services
│  │  ├─test
│  │  │  └─smoketests
│  │  │      ├─lib
│  │  │      ├─raw
│  │  │      ├─rendering
│  │  │      ├─services
│  │  │      └─widgets
│  │  └─widgets
│  ├─platform_channel
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      ├─androidTest
│  │  │  │      │  └─java
│  │  │  │      │      └─com
│  │  │  │      │          └─example
│  │  │  │      │              └─platformchannel
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─com
│  │  │  │          │      └─example
│  │  │  │          │          └─platformchannel
│  │  │  │          └─res
│  │  │  │              └─values
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  └─test_driver
│  ├─platform_channel_swift
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  ├─lib
│  │  └─test_driver
│  ├─platform_view
│  │  ├─android
│  │  │  ├─app
│  │  │  │  └─src
│  │  │  │      └─main
│  │  │  │          ├─java
│  │  │  │          │  └─io
│  │  │  │          │      └─flutter
│  │  │  │          │          └─examples
│  │  │  │          │              └─platform_view
│  │  │  │          └─res
│  │  │  │              ├─drawable
│  │  │  │              ├─layout
│  │  │  │              ├─mipmap-hdpi
│  │  │  │              ├─mipmap-mdpi
│  │  │  │              ├─mipmap-xhdpi
│  │  │  │              ├─mipmap-xxhdpi
│  │  │  │              ├─mipmap-xxxhdpi
│  │  │  │              └─values
│  │  │  └─gradle
│  │  │      └─wrapper
│  │  ├─assets
│  │  ├─ios
│  │  │  ├─Flutter
│  │  │  ├─Runner
│  │  │  │  ├─Assets.xcassets
│  │  │  │  │  └─AppIcon.appiconset
│  │  │  │  └─Base.lproj
│  │  │  ├─Runner.xcodeproj
│  │  │  │  ├─project.xcworkspace
│  │  │  │  └─xcshareddata
│  │  │  │      └─xcschemes
│  │  │  └─Runner.xcworkspace
│  │  └─lib
│  └─stocks
│      ├─android
│      │  ├─app
│      │  │  └─src
│      │  │      └─main
│      │  │          ├─java
│      │  │          │  └─io
│      │  │          │      └─flutter
│      │  │          │          └─examples
│      │  │          │              └─stocks
│      │  │          └─res
│      │  │              ├─mipmap-hdpi
│      │  │              ├─mipmap-mdpi
│      │  │              ├─mipmap-xhdpi
│      │  │              ├─mipmap-xxhdpi
│      │  │              └─mipmap-xxxhdpi
│      │  └─gradle
│      │      └─wrapper
│      ├─ios
│      │  ├─Flutter
│      │  ├─Runner
│      │  │  ├─Assets.xcassets
│      │  │  │  └─AppIcon.appiconset
│      │  │  └─Base.lproj
│      │  ├─Runner.xcodeproj
│      │  │  ├─project.xcworkspace
│      │  │  └─xcshareddata
│      │  │      └─xcschemes
│      │  └─Runner.xcworkspace
│      ├─lib
│      │  └─i18n
│      ├─test
│      └─test_driver
└─packages
    ├─flutter
    │  ├─coverage
    │  ├─lib
    │  │  └─src
    │  │      ├─animation
    │  │      ├─cupertino
    │  │      ├─foundation
    │  │      ├─gestures
    │  │      ├─material
    │  │      │  └─animated_icons
    │  │      │      └─data
    │  │      ├─painting
    │  │      ├─physics
    │  │      ├─rendering
    │  │      ├─scheduler
    │  │      ├─semantics
    │  │      ├─services
    │  │      └─widgets
    │  └─test
    │      ├─animation
    │      ├─cupertino
    │      ├─engine
    │      ├─examples
    │      ├─foundation
    │      ├─gestures
    │      ├─harness
    │      ├─material
    │      ├─painting
    │      ├─physics
    │      ├─rendering
    │      ├─scheduler
    │      ├─semantics
    │      ├─services
    │      └─widgets
    ├─flutter_driver
    │  ├─lib
    │  │  └─src
    │  │      ├─common
    │  │      ├─driver
    │  │      └─extension
    │  ├─test
    │  │  └─src
    │  └─test_driver
    ├─flutter_goldens
    │  ├─lib
    │  └─test
    ├─flutter_localizations
    │  ├─lib
    │  │  └─src
    │  │      └─l10n
    │  └─test
    ├─flutter_test
    │  ├─lib
    │  │  └─src
    │  └─test
    │      ├─custom_exception_reporter
    │      └─test_config
    │          ├─child_directory
    │          │  └─grandchild_directory
    │          ├─nested_config
    │          └─project_root
    ├─flutter_tools
    │  ├─.dart_tool
    │  │  └─pub
    │  │      └─bin
    │  │          ├─archive
    │  │          ├─coverage
    │  │          ├─csslib
    │  │          ├─json_schema
    │  │          ├─kernel
    │  │          ├─linter
    │  │          └─test
    │  ├─bin
    │  ├─doc
    │  ├─gradle
    │  ├─ide_templates
    │  │  └─intellij
    │  │      ├─.idea
    │  │      │  └─runConfigurations
    │  │      ├─dev
    │  │      │  ├─benchmarks
    │  │      │  │  └─complex_layout
    │  │      │  ├─bots
    │  │      │  ├─devicelab
    │  │      │  ├─manual_tests
    │  │      │  └─tools
    │  │      ├─examples
    │  │      │  ├─catalog
    │  │      │  ├─flutter_gallery
    │  │      │  ├─flutter_view
    │  │      │  ├─hello_world
    │  │      │  ├─layers
    │  │      │  ├─platform_channel
    │  │      │  ├─platform_channel_swift
    │  │      │  ├─platform_view
    │  │      │  └─stocks
    │  │      └─packages
    │  │          ├─flutter
    │  │          ├─flutter_driver
    │  │          ├─flutter_localizations
    │  │          ├─flutter_test
    │  │          └─flutter_tools
    │  ├─lib
    │  │  └─src
    │  │      ├─android
    │  │      ├─base
    │  │      ├─commands
    │  │      ├─dart
    │  │      ├─fuchsia
    │  │      ├─intellij
    │  │      ├─ios
    │  │      ├─runner
    │  │      ├─test
    │  │      ├─tester
    │  │      └─vscode
    │  ├─schema
    │  ├─templates
    │  │  ├─cocoapods
    │  │  ├─create
    │  │  │  ├─.idea
    │  │  │  │  ├─libraries
    │  │  │  │  └─runConfigurations
    │  │  │  ├─android-java.tmpl
    │  │  │  │  └─app
    │  │  │  │      └─src
    │  │  │  │          └─main
    │  │  │  │              └─java
    │  │  │  │                  └─androidIdentifier
    │  │  │  ├─android-kotlin.tmpl
    │  │  │  │  └─app
    │  │  │  │      └─src
    │  │  │  │          └─main
    │  │  │  │              └─kotlin
    │  │  │  │                  └─androidIdentifier
    │  │  │  ├─android.tmpl
    │  │  │  │  ├─app
    │  │  │  │  │  └─src
    │  │  │  │  │      └─main
    │  │  │  │  │          └─res
    │  │  │  │  │              ├─drawable
    │  │  │  │  │              ├─mipmap-hdpi
    │  │  │  │  │              ├─mipmap-mdpi
    │  │  │  │  │              ├─mipmap-xhdpi
    │  │  │  │  │              ├─mipmap-xxhdpi
    │  │  │  │  │              ├─mipmap-xxxhdpi
    │  │  │  │  │              └─values
    │  │  │  │  └─gradle
    │  │  │  │      └─wrapper
    │  │  │  ├─ios-objc.tmpl
    │  │  │  │  ├─Runner
    │  │  │  │  └─Runner.xcodeproj
    │  │  │  ├─ios-swift.tmpl
    │  │  │  │  ├─Runner
    │  │  │  │  └─Runner.xcodeproj
    │  │  │  ├─ios.tmpl
    │  │  │  │  ├─Flutter
    │  │  │  │  ├─Runner
    │  │  │  │  │  ├─Assets.xcassets
    │  │  │  │  │  │  ├─AppIcon.appiconset
    │  │  │  │  │  │  └─LaunchImage.imageset
    │  │  │  │  │  └─Base.lproj
    │  │  │  │  ├─Runner.xcodeproj
    │  │  │  │  │  ├─project.xcworkspace
    │  │  │  │  │  └─xcshareddata
    │  │  │  │  │      └─xcschemes
    │  │  │  │  └─Runner.xcworkspace
    │  │  │  ├─lib
    │  │  │  └─test
    │  │  ├─driver
    │  │  ├─package
    │  │  │  ├─.idea
    │  │  │  │  └─libraries
    │  │  │  ├─lib
    │  │  │  └─test
    │  │  └─plugin
    │  │      ├─.idea
    │  │      │  ├─libraries
    │  │      │  └─runConfigurations
    │  │      ├─android-java.tmpl
    │  │      │  └─src
    │  │      │      └─main
    │  │      │          └─java
    │  │      │              └─androidIdentifier
    │  │      ├─android-kotlin.tmpl
    │  │      │  └─src
    │  │      │      └─main
    │  │      │          └─kotlin
    │  │      │              └─androidIdentifier
    │  │      ├─android.tmpl
    │  │      │  └─src
    │  │      │      └─main
    │  │      ├─ios-objc.tmpl
    │  │      │  └─Classes
    │  │      ├─ios-swift.tmpl
    │  │      │  └─Classes
    │  │      ├─ios.tmpl
    │  │      │  └─Assets
    │  │      └─lib
    │  ├─test
    │  │  ├─android
    │  │  ├─base
    │  │  ├─commands
    │  │  ├─dart
    │  │  ├─data
    │  │  │  ├─asset_test
    │  │  │  │  ├─font
    │  │  │  │  └─main
    │  │  │  ├─dart_dependencies_test
    │  │  │  │  ├─asci_casing
    │  │  │  │  ├─bad_import
    │  │  │  │  ├─bad_package
    │  │  │  │  ├─bad_path
    │  │  │  │  ├─changed_sdk_location
    │  │  │  │  │  └─lib
    │  │  │  │  ├─good
    │  │  │  │  │  └─lib
    │  │  │  │  └─syntax_error
    │  │  │  ├─intellij
    │  │  │  │  └─plugins
    │  │  │  │      └─Dart
    │  │  │  │          └─lib
    │  │  │  └─vscode
    │  │  │      ├─application
    │  │  │      │  └─resources
    │  │  │      │      └─app
    │  │  │      └─extensions
    │  │  │          └─Dart-Code.flutter-4.5.6
    │  │  ├─integration
    │  │  ├─intellij
    │  │  ├─ios
    │  │  ├─runner
    │  │  ├─src
    │  │  └─tester
    │  └─tool
    └─fuchsia_remote_debug_protocol
        ├─examples
        ├─lib
        │  └─src
        │      ├─common
        │      ├─dart
        │      └─runners
        └─test
            └─src
                ├─dart
                └─runners
  • 在系统变量中配置,FLUTTERPATH变量,避免后期需要多处使用

FLUTTERPATH变量

  • 在系统path变量中配置中使用FLUTTERPATH变量,即%FLUTTERPATH%\bin;,注意在结尾加上分号

%FLUTTERPATH%\bin

  • 测试配置是否成功,进入终端输入flutter -h,可以明显发现输入指令之后,终端的字体和字号都变化了。

image

image

  • 测试E:\IDE\flutter下对应的flutter_console.bat运行效果。

flutter_console

D:\Users\Administrator>flutter -h
Waiting for another flutter command to release the startup lock...
Manage your Flutter app development.

Common commands:

  flutter create <output directory>
    Create a new Flutter project in the specified directory.

  flutter run [options]
    Run your Flutter application on an attached device or in an emulator.

Usage: flutter <command> [arguments]

Global options:
-h, --help            Print this usage information.
-v, --verbose         Noisy logging, including all shell commands executed.
-d, --device-id       Target device id or name (prefixes allowed).
    --version         Reports the version of this tool.
    --bug-report      Captures a bug report file to submit to the Flutter team (
contains local paths, device
                      identifiers, and log snippets).

    --flutter-root    The root directory of the Flutter repository (uses $FLUTTE
R_ROOT if set).

Available commands:
  analyze          Analyze the project's Dart code.
  build            Flutter build commands.
  channel          List or switch flutter channels.
  clean            Delete the build/ directory.
  config           Configure Flutter settings.
  create           Create a new Flutter project.
  devices          List all connected devices.
  doctor           Show information about the installed tooling.
  drive            Runs Flutter Driver tests for the current project.
  emulators        List and launch available emulators.
  format           Format one or more dart files.
  fuchsia_reload   Hot reload on Fuchsia.
  help             Display help information for flutter.
  install          Install a Flutter app on an attached device.
  logs             Show log output for running Flutter apps.
  packages         Commands for managing Flutter packages.
  precache         Populates the Flutter tool's cache of binary artifacts.
  run              Run your Flutter app on an attached device.
  screenshot       Take a screenshot from a connected device.
  stop             Stop your Flutter app on an attached device.
  test             Run Flutter unit tests for the current project.
  trace            Start and stop tracing for a running Flutter app.
  upgrade          Upgrade your copy of Flutter.

Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used opti
ons.

通俗易懂的讲restful

老婆经常喜欢翻看我订阅的技术杂志,她总能从她的视角提出很多有趣的问题。

一个悠闲的周日下午,她午觉醒来,又习惯性的抓起这个月的杂志,饶有兴趣地看了起来。

果不其然,看着看着,她又对我发难了,“Restful是什么呀,老公?是restaurant的形容词吗,突然就觉得好饿了啊......”

作为一个合格的程序员,我一直把能够将一项技术讲给老婆听,并且能给她讲懂,作为我已经掌握了这项技术的标准。
如果我直接回答说,“REST就是Representational State Transfer的缩写呀,翻译为中文就是‘表述性状态转移’”,那她今晚肯定得罚我跪键盘。我必须找个合适的机会,把Restful的来龙去脉给她形象的描述一遍。

“走,咱们去楼下咖啡厅吃个下午茶吧”,我对老婆说。

“一个芝士蛋糕,一杯拿铁,两条吸管,谢谢”,我对前台的服务员说,然后我们找了个角落坐了下来。

Level 0 - 面向前台

“刚才我们向前台点了一杯拿铁,这个过程可以用这段文字来描述”,说着,我在纸上写下了这段JSON,虽然她不知道什么叫JSON,但理解这段文字对于英语专业8级的她,实在再简单不过。

{
    "addOrder": {
        "orderName": "latte"
    }
}

“我们通过这段文字,告诉前台,新增一笔订单,订单是一杯拿铁咖啡”,接着,前台给我们返回这么一串回复:

{
    "orderId": "123456"
}

“订单ID?还是订单编号?”
“恩恩,就是订单编号”
“那我们就等着前台喊‘订单123456的客户可以取餐了’,然后就可以开吃了!”
“哈哈,你真聪明,不过,在这之前,假设我们有一张会员卡,我们想查询一下这张会员卡的余额,这时候,要向前台发起另一个询问”,我继续在纸上写着:

"queryBalance": {
        "cardId": "886333"
    }
}

“查询卡号为886333的卡的余额?”
“真棒!接着,查询的结果返回来了”

{
   "balance": "0"
}

“切,没钱......”
“哈哈,没钱,现在我们要跟前台说,这杯咖啡不要了”,我在纸上写到:

{
    "deleteOrder": {
        "orderId": "123456"
    }
}

“哼,这就把订单取消啦?”

Level 1 - 面向资源

“现在这家咖啡店越做越大,来喝咖啡的人越来越多,单靠前台显然是不行的,店主决定进行分工,每个资源都有专人负责,我们可以直接面向资源操作。”
"面向资源?”
“是的,比如还是下单,请求的内容不变,但是我们多了一条消息”,我在纸上画出这次的模型:

/orders

{
    "addOrder": {
        "orderName": "latte"
    }
}

“多了一个斜杠和orders?这是什么意思?”
“这个表示我们这个请求是发给哪个资源的,订单是一种资源,我们可以理解为是咖啡厅专门管理订单的人,他可以帮我们处理所有有关订单的操作,包括新增订单、修改订单、取消订单等操作”
“Soga...”
“接着还是会返回订单的编号给我们”

{
    "orderId": "123456"
}

“下面,我们还是要查询会员卡余额,这次请求的资源变成了cards”

/cards

{
    "queryBalance": {
        "cardId": "886333"
    }
}

“接下来是取消订单”
“这个我会”,说着,她抢走我手上的笔,在纸上写了起来:

/orders

{
    "deleteOrder": {
        "orderId": "123456"
    }
}

Level2 - 打上标签

“接下来,店主还想继续优化他的咖啡厅的服务流程,他发现负责处理订单的员工,每次都要去订单内容里面看是新增订单还是删除订单,还是其他的什么操作,十分不方便,于是规定,所有新增资源的请求,都在请求上面写上大大的‘POST’,表示这是一笔新增资源的请求”

“其他种类的请求,比如查询类的,用‘GET’表示,删除类的,用‘DELETE’表示”

“还有修改类的,修改分为两种,第一种,如果这个修改,无论发送多少次,最后一次修改后的资源,总是和第一次修改后的一样,比如将拿铁改为猫屎,那么用‘PUT’表示;第二种,如果这个修改,每次修改都会让这个资源和前一次的不一样,比如是加一杯咖啡,那么这种请求用‘PATCH’或者‘POST’表示”,一口气讲了这么多,发现她有点似懂非懂。

“来,我们再来重复上面那个过程,来一杯拿铁”,我边说边画着:

POST /orders

{
    "orderName": "latte"
}

"请求的内容简洁多啦,不用告诉店员是addOrder,看到POST就知道是新增",她听的很认真,理解的也很透彻。
"恩恩,返回的内容还是一样"

{
    "orderId": "123456"
}

“接着是查询会员卡余额,这次也简化了很多”

GET /cards

{
    "cardId": "886333"
}

“这个请求我们还可以进一步优化为这样”

GET /cards/886333

“Soga,直接把要查询的卡号写在后面了”
“没错,接着,取消订单”

DELETE /orders/123456

Level 3 - 完美服务

“忽然有一天,有个顾客抱怨说,他买了咖啡后,不知道要怎么取消订单,咖啡厅一个店员回了一句,你不会看我们的宣传单吗,上面不写着:

DELETE /orders/{orderId}

顾客反问道,谁会去看那个啊,店员不服,又说到,你瞎了啊你......据说后面两人吵着吵着还打了起来...”
“噗,真是悲剧...”

“有了这次教训,店长决定,顾客下了单之后,不仅给他们返回订单的编号,还给顾客返回所有可以对这个订单做的操作,比如告诉用户如何删除订单。现在,我们还是发出请求,请求内容和上一次一样”

POST /orders

{
    "orderName": "latte"
}

“但是这次返回时多了些内容”

{
    "orderId": "123456",
    "link": {
        "rel": "cancel",
        "url": "/order/123456"
    }
}

“这次返回时多了一项link信息,里面包含了一个rel属性和url属性,rel是relationship的意思,这里的关系是cancel,url则告诉你如何执行这个cancel操作,接着你就可以这样子来取消订单啦”

DELETE /orders/123456

“哈哈,这服务真是贴心,以后再也不用担心店员和顾客打起来了”

“订单123456的客户可以取餐了”,伴随着咖啡厅的广播,我们吃起了下午茶,一杯拿铁,两支吸管......

对程序员的话

用了大白话,给老婆讲明白了RESTful的来龙去脉,当然,我还是有些话想说的,只是怕老婆听完一脸懵逼,没给她说:

1、
上面讲的Level0~Level3,来自Leonard Richardson提出的Richardson Maturity
RESTful

Level0和Level1最大的区别,就是Level1拥有了Restful的第一个特征——面向资源,这对构建可伸缩、分布式的架构是至关重要的。同时,如果把Level0的数据格式换成Xml,那么其实就是SOAP,SOAP的特点是关注行为和处理,和面向资源的RESTful有很大的不同。
Level0和Level1,其实都很挫,他们都只是把HTTP当做一个传输的通道,没有把HTTP当做一种传输协议。

Level2,真正将HTTP作为了一种传输协议,最直观的一点就是Level2使用了HTTP动词,GET/PUT/POST/DELETE/PATCH....,这些都是HTTP的规范,规范的作用自然是重大的,用户看到一个POST请求,就知道它不是幂等的,使用时要小心,看到PUT,就知道他是幂等的,调用多几次都不会造成问题,当然,这些的前提都是API的设计者和开发者也遵循这一套规范,确保自己提供的PUT接口是幂等的。

Level3,关于这一层,有一个古怪的名词,叫HATEOAS(Hypertext As The Engine Of Application State),中文翻译为“将超媒体格式作为应用状态的引擎”,核心**就是每个资源都有它的状态,不同状态下,可对它进行的操作不一样。理解了这一层,再来看看REST的全称,Representational State Transfer,中文翻译为“表述性状态转移”,是不是好理解多了?

Level3的Restful API,给使用者带来了很大的便利,使用者只需要知道如何获取资源的入口,之后的每个URI都可以通过请求获得,无法获得就说明无法执行那个请求。

现在绝大多数的RESTful接口都做到了Level2的层次,做到Level3的比较少。当然,这个模型并不是一种规范,只是用来理解Restful的工具。所以,做到了Level2,也就是面向资源和使用Http动词,就已经很Restful了。Restful本身也不是一种规范,我比较倾向于用"风格"来形容它。如果你想深入了解Level3,可以阅读《Rest in Practice》第五章。

2、
我跟老婆讲的时候,用的数据格式是JSON,但是要强调一点,Restful对数据格式没有限制,就算你用的是XML或者其他格式,只要符合上面提到的几个特征,也算Restful。

3、
关于如何写出好的Restful API,阮一峰老师已经写过一篇非常棒的文章:RESTful API 设计指南,这篇文章将指导你写出优雅的Restful。

deepmerge

官方仓库

https://github.com/TehShrike/deepmerge

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/deepmerge

image

在线运行地址

https://npm.runkit.com/deepmerge

image

基础介绍

深入合并两个或多个对象的可枚举属性。

基础安装

npm install deepmerge --save   # npm
yarn add deepmerge             # Yarn

基础使用

merge(x, y, [options])

  • 深度合并两个对象x和y,使用x和y中的元素返回一个新的合并对象。
  • 如果x和y都存在同一个键的元素,则y中的值将出现在结果中。
  • 合并会创建一个新对象,因此不会修改x或y。
  • 注意:默认情况下,通过连接数组来合并数组。
(function (log) {
    const M = require('deepmerge');
    log(M)
    // function deepmerge()
    // name: "deepmerge"
    // Function Prototype
    // apply: function()
    // bind: function()
    // call: function()
    // constructor: function()
    // name: ""
    // toString: function()
    const x = {
        foo: { bar: 3 },
        array: [{
            does: 'work',
            too: [ 1, 2, 3 ]
        }]
    }

    const y = {
        foo: { baz: 4 },
        quux: 5,
        array: [{
            does: 'work',
            too: [ 4, 5, 6 ]
        }, {
            really: 'yes'
        }]
    }

    log(M(x, y));
    // Object
    // array: Array (3 items)
    // 0: Object {does: "work", too: [1, 2, 3]}
    // 1: Object {does: "work", too: [4, 5, 6]}
    // 2: Object {really: "yes"}
    // Array Prototype
    // ...
    // foo: Object {bar: 3, baz: 4}
    // quux: 5
})(console.log)

merge.all(arrayOfObjects, [options])

  • 将任意数量的对象合并为单个结果对象。
(function (log) {
    const M = require('deepmerge');
    const x = { foo: { bar: 3 } }
    const y = { foo: { baz: 4 } }
    const z = { bar: 'yay!' }

    const expected = { foo: { bar: 3, baz: 4 }, bar: 'yay!' }

    log(M.all([x, y, z]));
    // Object
    // bar: "yay!"
    // foo: Object {bar: 3, baz: 4}
})(console.log)

options

arrayMerge

有两种方法可以合并两个数组,下面是一些示例,但您也可以创建自己的自定义函数。

  • Overwrite Array

完全覆盖现有的数组值而不是连接它们

(function (log) {
    const M = require('deepmerge');
    const overwriteMerge = (destinationArray, sourceArray, options) => sourceArray

    log(M(
        [1, 2, 3],
        [3, 2, 1],
        { arrayMerge: overwriteMerge }
    )) // => [3, 2, 1]

})(console.log)

  • Combine Array

组合数组,例如覆盖现有默认值,同时添加/保留不同名称的值

(function (log) {
    const M = require('deepmerge');
    const emptyTarget = value => Array.isArray(value) ? [] : {}
    const clone = (value, options) => M(emptyTarget(value), value, options)

    function combineMerge(target, source, options) {
      const destination = target.slice()

      source.forEach(function(e, i) {
          if (typeof destination[i] === 'undefined') {
              const cloneRequested = options.clone !== false
              const shouldClone = cloneRequested && options.isMergeableObject(e)
              destination[i] = shouldClone ? clone(e, options) : e
          } else if (options.isMergeableObject(e)) {
              destination[i] = M(target[i], e, options)
          } else if (target.indexOf(e) === -1) {
              destination.push(e)
          }
      })
      return destination
  }

  log(M(
      [{ a: true }],
      [{ b: true }, 'ah yup'],
      { arrayMerge: combineMerge }
  )); // => [{ a: true, b: true }, 'ah yup']

})(console.log)

isMergeableObject

  • 默认情况下,deepmerge克隆几乎所有类型对象的每个属性。

  • 如果您的对象是特殊类型,并且您希望复制整个对象而不是仅复制其属性,则可能不需要这样。

  • 您可以通过传入isMergeableObject选项的函数来完成此操作。

  • 如果您只想克隆普通对象的属性,并忽略所有“特殊”类型的实例化对象,您可能希望放入is-plain-object。

  • Overwrite Array

完全覆盖现有的数组值而不是连接它们

(function (log) {
  const M = require('deepmerge');
  const isPlainObject = require('is-plain-object')

  function SuperSpecial() {
      this.special = 'oh yeah man totally'
  }

  const instantiatedSpecialObject = new SuperSpecial()

  const target = {
      someProperty: {
          cool: 'oh for sure'
      }
  }

  const source = {
      someProperty: instantiatedSpecialObject
  }

  const defaultOutput = M(target, source)

  log(defaultOutput.someProperty.cool) // => 'oh for sure'
  log(defaultOutput.someProperty.special) // => 'oh yeah man totally'
  log(defaultOutput.someProperty instanceof SuperSpecial) // => false

  const customMergeOutput = M(target, source, {
      isMergeableObject: isPlainObject
  })

  log(customMergeOutput.someProperty.cool) // => undefined
  log(customMergeOutput.someProperty.special) // => 'oh yeah man totally'
  log(customMergeOutput.someProperty instanceof SuperSpecial) // => true

})(console.log)

win10下开启ubuntu子系统

文章参考 https://www.jianshu.com/p/6d6e629df051

开启功能

  • window+r中输入appwiz.cpl,进入程序和功能管理页面。
  • 点击启用或关闭Windows功能,在出来的弹窗中,将滚动条滑倒底部,勾选适用于Linux的Windows子系统,确定,重启电脑。

检验是否开启成功

  • window+r中输入cmd,进入终端页面,在终端中输入bash,就可以进入Linux Bash命令行效果

  • 注意在linux命令行中进入相关文件夹是/,不能输入\,这样会直接被忽略的。

$ bash
melon@MicroWin10-0003:/mnt/c/Users/Administrator$ cd F:\documentBak\learn\vim
-bash: cd: F:documentBaklearnvim: 没有那个文件或目录 # \ 被直接转译了
melon@MicroWin10-0003:/mnt/c/Users/Administrator$ cd F:/documentBak/learn/vim
-bash: cd: F:/documentBak/learn/vim: 没有那个文件或目录
  • 注意在linux命令行中进入其他盘符是不能使用X:,所有盘符都是挂载在一个主目录下。
melon@MicroWin10-0003:/mnt/c/Users/Administrator$ cd F:
-bash: cd: F:: 没有那个文件或目录
melon@MicroWin10-0003:/mnt/c/Users/Administrator$ cd ../../../
melon@MicroWin10-0003:/mnt$ ll
总用量 0
drwxr-xr-x 1 root  root  4096 8月  19 16:40 ./
drwxr-xr-x 1 root  root  4096 8月  19 16:40 ../
drwxrwxrwx 1 melon melon 4096 8月   1 02:21 c/
drwxrwxrwx 1 melon melon 4096 8月   1 02:21 e/
drwxrwxrwx 1 melon melon 4096 8月   1 02:21 f/
drwxrwxrwx 1 melon melon 4096 8月  19 15:54 g/
drwxrwxrwx 1 melon melon 4096 8月   1 02:21 m/
  • 进入对应盘符,直接输入地址就好了
melon@MicroWin10-0003:/mnt$ cd f/documentBak/learn/vim/
melon@MicroWin10-0003:/mnt/f/documentBak/learn/vim$ ll
总用量 16
drwxrwxrwx 1 melon melon 4096 8月  19 22:02 ./
drwxrwxrwx 1 melon melon 4096 8月  19 16:46 ../
-rwxrwxrwx 1 melon melon 4914 8月  19 21:43 help.md*
-rwxrwxrwx 1 melon melon 5128 8月  19 20:25 shortcut.md*
-rwxrwxrwx 1 melon melon  267 8月  19 22:03 win10_help.md*

安装ubuntu子系统

中间有一个插曲,我开启功能之后,第一遍重启,电脑中的应用商店一直打不开,然后重新重启了一遍就好了。

直接进入win10应用商店,搜索ubuntu选择最新的版本进行安装就可以了,截至到2018/08/19,这边Ubuntu的最新版是18.4,这边直接点击安装就可以了。

安装的时候,这边会自动出现一个终端,安装完成之后,这边会提示需要创建一个UNIX user account,创建完账户和设置密码之后,就可以玩系统了

Installing, this may take a few minutes...

Please create a default UNIX user account. The username does not need to match your Windows username.
For more information visit: https://aka.ms/wslusers
Enter new UNIX username: melon
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Installation successful!
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

修改ubuntu子系统镜像

$ cd /etc/apt # 进入对应文件夹

$ sudo cp sources.list sources.list.bak # 备份文件

$ sudo chmod 777 sources.list # 修改对应文件权限

$ sudo vim sources.list # 打开文件

# 进入文件夹中之后,这边有很多源配置。
# 在普通模式下,按下G,跳到文件最后一行。
# 然后再输入`:1,.d`,删除全部内容,`.`当前行 ,`1,.`表示从第一行到当前行 ,`d`删除。
# 或者在正常模式下 直接输入 ggdG,就可以清空当前文件了 
# 按下`i`,进入编辑模式,将下面配置输入到文件中。
# 注意deb和deb-src的配置各有五个,分别是`trusty`,`trusty-security`,`trusty-updates`,`trusty-proposed`和`trusty-backports`。

# 阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

# 然后按Esc键退出编辑模式,再输入`:wq`保存所写内容并退出

更新ubuntu源

$ sudo apt-get update
Ign:1 http://mirrors.aliyun.com/ubuntu trusty InRelease
Get:2 http://mirrors.aliyun.com/ubuntu trusty-security InRelease [65.9 kB]
Get:3 http://mirrors.aliyun.com/ubuntu trusty-updates InRelease [65.9 kB]
Get:4 http://mirrors.aliyun.com/ubuntu trusty-proposed InRelease [65.9 kB]
Get:5 http://mirrors.aliyun.com/ubuntu trusty-backports InRelease [65.9 kB]
Ign:6 http://mirrors.aliyun.com/ubuncput trusty InRelease
Get:7 http://mirrors.aliyun.com/ubuntu trusty Release [58.5 kB]
Err:8 http://mirrors.aliyun.com/ubuncput trusty Release
  404  Not Found [IP: 101.89.125.213 80]
Get:9 http://mirrors.aliyun.com/ubuntu trusty Release.gpg [933 B]
Get:10 http://mirrors.aliyun.com/ubuntu trusty-security/restricted Sources [4931 B]
Get:11 http://mirrors.aliyun.com/ubuntu trusty-security/main Sources [161 kB]
Get:12 http://mirrors.aliyun.com/ubuntu trusty-security/multiverse Sources [3260 B]
Get:13 http://mirrors.aliyun.com/ubuntu trusty-security/universe Sources [78.4 kB]
Get:14 http://mirrors.aliyun.com/ubuntu trusty-security/main amd64 Packages [760 kB]
Get:15 http://mirrors.aliyun.com/ubuntu trusty-security/main Translation-en [411 kB]
Get:16 http://mirrors.aliyun.com/ubuntu trusty-security/restricted amd64 Packages [14.2 kB]
Get:17 http://mirrors.aliyun.com/ubuntu trusty-security/restricted Translation-en [3556 B]
Get:18 http://mirrors.aliyun.com/ubuntu trusty-security/universe amd64 Packages [242 kB]
Get:19 http://mirrors.aliyun.com/ubuntu trusty-security/universe Translation-en [132 kB]
Get:20 http://mirrors.aliyun.com/ubuntu trusty-security/multiverse amd64 Packages [4806 B]
Get:21 http://mirrors.aliyun.com/ubuntu trusty-security/multiverse Translation-en [2564 B]
Get:22 http://mirrors.aliyun.com/ubuntu trusty-updates/multiverse Sources [7441 B]
Get:23 http://mirrors.aliyun.com/ubuntu trusty-updates/restricted Sources [6322 B]
Get:24 http://mirrors.aliyun.com/ubuntu trusty-updates/universe Sources [206 kB]
Get:25 http://mirrors.aliyun.com/ubuntu trusty-updates/main Sources [420 kB]
Get:26 http://mirrors.aliyun.com/ubuntu trusty-updates/main amd64 Packages [1098 kB]
Get:27 http://mirrors.aliyun.com/ubuntu trusty-updates/main Translation-en [544 kB]
Get:28 http://mirrors.aliyun.com/ubuntu trusty-updates/restricted amd64 Packages [17.2 kB]
Get:29 http://mirrors.aliyun.com/ubuntu trusty-updates/restricted Translation-en [4021 B]
Get:30 http://mirrors.aliyun.com/ubuntu trusty-updates/universe amd64 Packages [469 kB]
Get:31 http://mirrors.aliyun.com/ubuntu trusty-updates/universe Translation-en [252 kB]
Get:32 http://mirrors.aliyun.com/ubuntu trusty-updates/multiverse amd64 Packages [14.6 kB]
Get:33 http://mirrors.aliyun.com/ubuntu trusty-updates/multiverse Translation-en [7616 B]
Get:34 http://mirrors.aliyun.com/ubuntu trusty-proposed/universe Sources [17.0 kB]
Get:35 http://mirrors.aliyun.com/ubuntu trusty-proposed/restricted Sources [783 B]
Get:36 http://mirrors.aliyun.com/ubuntu trusty-proposed/main Sources [8978 B]
Get:37 http://mirrors.aliyun.com/ubuntu trusty-proposed/main amd64 Packages [23.7 kB]
Get:38 http://mirrors.aliyun.com/ubuntu trusty-proposed/main Translation-en [15.5 kB]
Get:39 http://mirrors.aliyun.com/ubuntu trusty-proposed/restricted amd64 Packages [774 B]
Get:40 http://mirrors.aliyun.com/ubuntu trusty-proposed/restricted Translation-en [281 B]
Get:41 http://mirrors.aliyun.com/ubuntu trusty-proposed/universe amd64 Packages [13.2 kB]
Get:42 http://mirrors.aliyun.com/ubuntu trusty-proposed/universe Translation-en [12.1 kB]
Get:43 http://mirrors.aliyun.com/ubuntu trusty-backports/universe Sources [35.4 kB]
Get:44 http://mirrors.aliyun.com/ubuntu trusty-backports/main Sources [9709 B]
Get:45 http://mirrors.aliyun.com/ubuntu trusty-backports/multiverse Sources [1896 B]
Get:46 http://mirrors.aliyun.com/ubuntu trusty-backports/main amd64 Packages [13.3 kB]
Get:47 http://mirrors.aliyun.com/ubuntu trusty-backports/main Translation-en [7503 B]
Get:48 http://mirrors.aliyun.com/ubuntu trusty-backports/universe amd64 Packages [43.1 kB]
Get:49 http://mirrors.aliyun.com/ubuntu trusty-backports/universe Translation-en [36.8 kB]
Get:50 http://mirrors.aliyun.com/ubuntu trusty-backports/multiverse amd64 Packages [1567 B]
Get:51 http://mirrors.aliyun.com/ubuntu trusty-backports/multiverse Translation-en [1215 B]
Get:52 http://mirrors.aliyun.com/ubuntu trusty/main amd64 Packages [1350 kB]
Get:53 http://mirrors.aliyun.com/ubuntu trusty/restricted amd64 Packages [13.0 kB]
Get:54 http://mirrors.aliyun.com/ubuntu trusty/universe amd64 Packages [5859 kB]
Get:55 http://mirrors.aliyun.com/ubuntu trusty/multiverse amd64 Packages [132 kB]
Reading package lists... Done
E: The repository 'http://mirrors.aliyun.com/ubuncput trusty Release' does not have a Release file.
N: Updating from such a repository can’t be done securely, and is therefore disableE: Invalid operation updrade

设置ubuntu语言

概要

$ sudo apt install -y language-pack-zh-hans language-
pack-zh-hans-base # 下载相关语言包
$ echo "LANG=zh_CN.UTF-8" >> ~/.profile # 设置系统语言为中文

全部内容

$ sudo apt install -y language-pack-zh-hans language-
pack-zh-hans-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  language-pack-zh-hans language-pack-zh-hans-base
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1950 kB of archives.
After this operation, 7762 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu trusty-updates/main amd64 language-pack-zh-h
Unpacking language-pack-zh-hans-base (1:14.04+20160720) ...
Selecting previously unselected package language-pack-zh-hans.
Preparing to unpack .../language-pack-zh-hans_1%3a14.04+20160720_all.deb ......]
Unpacking language-pack-zh-hans (1:14.04+20160720) ...
Setting up language-pack-zh-hans (1:14.04+20160720) ...
Setting up language-pack-zh-hans-base (1:14.04+20160720) ...
Generating locales (this might take a while)...
  zh_CN.UTF-8... done
  zh_SG.UTF-8... done
Generation complete.

$ echo "LANG=zh_CN.UTF-8" >> ~/.profile

修改当前用户权限

21行是本次新增的内容,即给melon用户授予sudo权限

$ sudo su # 切换到root用户
$ vi /etc/sudoers # 编辑相关文件

     1  #
     2  # This file MUST be edited with the 'visudo' command as root.
     3  #
     4  # Please consider adding local content in /etc/sudoers.d/ instead of
     5  # directly modifying this file.
     6  #
     7  # See the man page for details on how to write a sudoers file.
     8  #
     9  Defaults        env_reset
    10  Defaults        mail_badpass
    11  Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
    12
    13  # Host alias specification
    14
    15  # User alias specification
    16
    17  # Cmnd alias specification
    18
    19  # User privilege specification
    20  root    ALL=(ALL:ALL) ALL
    21  melon   ALL=(ALL:ALL) ALL
    22
    23  # Members of the admin group may gain root privileges
    24  %admin ALL=(ALL) ALL
    25
    26  # Allow members of group sudo to execute any command
    27  %sudo   ALL=(ALL:ALL) ALL
    28
    29  # See sudoers(5) for more information on "#include" directives:
    30
    31  #includedir /etc/sudoers.d

安装常用应用

$ sudo su # 进入管理员模式

$ apt install tree # 安装tree应用,方便以树结构递归查看文件夹结构
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  tree
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.8 kB of archives.
After this operation, 109 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu trusty/universe amd64 tree amd64 1.6.0-1 [37
.8 kB]
Fetched 37.8 kB in 0s (238 kB/s)
Selecting previously unselected package tree.
(Reading database ... 28726 files and directories currently installed.)
Preparing to unpack .../tree_1.6.0-1_amd64.deb ...
Unpacking tree (1.6.0-1) ...
Setting up tree (1.6.0-1) ...
Processing triggers for man-db (2.8.3-2) ...

Array.prototype.copyWithin()

基础语法

arr.copyWithin(target[, start[, end]])

参数说明

target

0 为基底的索引,复制序列到该位置。如果是负数,target 将从末尾开始计算。
如果 target 大于等于 arr.length,将会不发生拷贝。如果 targetstart 之后,复制的序列将被修改以符合 arr.length

start

0 为基底的索引,开始复制元素的起始位置。如果是负数,start 将从末尾开始计算。
如果 start 被忽略,copyWithin 将会从0开始复制。

end

0 为基底的索引,开始复制元素的结束位置。copyWithin 将会拷贝到该位置,但不包括 end 这个位置的元素。如果是负数, end 将从末尾开始计算。
如果 end 被忽略,copyWithin 将会复制到 arr.length

返回值说明

改变了的数组。

详细说明

copyWithin() 方法浅复制数组的一部分到同一数组中的另一个位置,并返回它,而不修改其大小。

参数target,startend 必须为整数。

如果start为负,则其指定的索引位置等同于length+startlength为数组的长度。end也是如此。

copyWithin方法不要求其this值必须是一个数组对象;除此之外,copyWithin是一个可变方法,它可以改变this对象本身,并且返回它,而不仅仅是它的拷贝。

copyWithin 就像 CC++memcpy 函数一样,且它是用来移动 Array 或者 TypedArray 数据的一个高性能的方法。复制以及粘贴序列这两者是为一体的操作;即使复制和粘贴区域重叠,粘贴的序列也会有拷贝来的值。

copyWithin 函数是设计为通用的,其不要求其 this 值必须是一个数组对象。

The copyWithin 是一个可变方法,它不会改变 thislength,但是会改变 this 本身的内容,且需要时会创建新的属性。

案例

var array1 = ['a', 'b', 'c', 'd', 'e'];

// copy to index 0 the element at index 2 (c)
// ['a', 'b', 'c', 'd', 'e'] ==> ["c", "b", "c", "d", "e"]
console.log(array1.copyWithin(0, 2, 3));

// copy to index 0 the element between index 2 and index 3 (c,d) 
// ["c", "b", "c", "d", "e"] ==> ["c", "d", "c", "d", "e"]
console.log(array1.copyWithin(0, 2, 4));

// copy to index 0 the element between index 2 and index 4 (c,d,e)
// ["c", "d", "c", "d", "e"] ==> ["c", "d", "e", "d", "e"]
console.log(array1.copyWithin(0, 2));

// copy to index 1 the element at index 2 (e)
// ["c", "d", "e", "d", "e"] ==> ["c", "e", "e", "d", "e"]
console.log(array1.copyWithin(1, 2, 3));

// copy to index 1 the element between index 2 and index 3 (e,d) 
// ["c", "e", "e", "d", "e"] ==> ["c", "e", "d", "d", "e"]
console.log(array1.copyWithin(1, 2, 4));

// copy to index 1 the element between index 2 and index 4 (d,d,e) 
// ["c", "e", "d", "d", "e"] ==> ["c", "d", "d", "e", "e"]
console.log(array1.copyWithin(1, 2));

// copy to index 0 the element at index 3 (e)
// ["c", "d", "d", "e", "e"] ==> ["e", "d", "d", "e", "e"]
console.log(array1.copyWithin(0, 3, 4));

// copy to index 2 the element at index 3 (e)
// ["e", "d", "d", "e", "e"] ==> ["e", "d", "e", "e", "e"]
console.log(array1.copyWithin(2, 3, 4));

[1, 2, 3, 4, 5].copyWithin(-2);
// [1, 2, 3, 1, 2]

[1, 2, 3, 4, 5].copyWithin(0, 3);
// [4, 5, 3, 4, 5]

[1, 2, 3, 4, 5].copyWithin(0, 3, 4);
// [4, 2, 3, 4, 5]

[1, 2, 3, 4, 5].copyWithin(-2, -3, -1);
// [1, 2, 3, 3, 4]

[].copyWithin.call({length: 5, 3: 1}, 0, 3);
// {0: 1, 3: 1, length: 5}

// ES2015 Typed Arrays are subclasses of Array
var i32a = new Int32Array([1, 2, 3, 4, 5]);

i32a.copyWithin(0, 2);
// Int32Array [3, 4, 5, 4, 5]

// On platforms that are not yet ES2015 compliant: 
[].copyWithin.call(new Int32Array([1, 2, 3, 4, 5]), 0, 3, 4);
// Int32Array [4, 2, 3, 4, 5]

Polyfill

if (!Array.prototype.copyWithin) {
  Array.prototype.copyWithin = function(target, start/*, end*/) {
    // Steps 1-2.
    if (this == null) {
      throw new TypeError('this is null or not defined');
    }

    var O = Object(this);

    // Steps 3-5.
    var len = O.length >>> 0;

    // Steps 6-8.
    var relativeTarget = target >> 0;

    var to = relativeTarget < 0 ?
      Math.max(len + relativeTarget, 0) :
      Math.min(relativeTarget, len);

    // Steps 9-11.
    var relativeStart = start >> 0;

    var from = relativeStart < 0 ?
      Math.max(len + relativeStart, 0) :
      Math.min(relativeStart, len);

    // Steps 12-14.
    var end = arguments[2];
    var relativeEnd = end === undefined ? len : end >> 0;

    var final = relativeEnd < 0 ?
      Math.max(len + relativeEnd, 0) :
      Math.min(relativeEnd, len);

    // Step 15.
    var count = Math.min(final - from, len - to);

    // Steps 16-17.
    var direction = 1;

    if (from < to && to < (from + count)) {
      direction = -1;
      from += count - 1;
      to += count - 1;
    }

    // Step 18.
    while (count > 0) {
      if (from in O) {
        O[to] = O[from];
      } else {
        delete O[to];
      }

      from += direction;
      to += direction;
      count--;
    }

    // Step 19.
    return O;
  };
}

clickhouse

简介

ClickHouse是一个面向开源列的数据库管理系统,能够使用SQL查询实时生成分析数据报告。

传统数据库在数据大小比较小,索引大小适合内存,数据缓存命中率足够高的情形下能正常提供服务。但残酷的是,这种理想情形最终会随着业务的增长走到尽头,查询会变得越来越慢。你可能通过增加更多的内存,订购更快的磁盘等等来解决问题(纵向扩展),但这只是拖延解决本质问题。如果你的需求是解决怎样快速查询出结果,那么ClickHouse也许可以解决你的问题。

官网

https://clickhouse.yandex/

home

国内论坛

http://www.clickhouse.com.cn/

bbs

应用场景

  • 1.绝大多数请求都是用于读访问的
  • 2.数据需要以大批次(大于1000行)进行更新,而不是单行更新;或者根本没有更新操作
  • 3.数据只是添加到数据库,没有必要修改
  • 4.读取数据时,会从数据库中提取出大量的行,但只用到一小部分列
  • 5.表很“宽”,即表中包含大量的列
  • 6.查询频率相对较低(通常每台服务器每秒查询数百次或更少)
  • 7.对于简单查询,允许大约50毫秒的延迟
  • 8.列的值是比较小的数值和短字符串(例如,每个URL只有60个字节)
  • 9.在处理单个查询时需要高吞吐量(每台服务器每秒高达数十亿行)
  • 10.不需要事务
  • 11.数据一致性要求较低
  • 12.每次查询中只会查询一个大表。除了一个大表,其余都是小表
  • 13.查询结果显著小于数据源。即数据有过滤或聚合。返回结果不超过单个服务器内存大小

本身限制

相应地,使用ClickHouse也有其本身的限制:

  • 1.不支持真正的删除/更新支持 不支持事务(期待后续版本支持)
  • 2.不支持二级索引
  • 3.有限的SQL支持,join实现与众不同
  • 4.不支持窗口功能
  • 5.元数据管理需要人工干预维护

参考网站

https://www.jianshu.com/p/a5bf490247ea

flutter 1.0

window 运行 flutter 1.0 案例

安装环境依赖

flutter

当前步骤大致总耗时半小时。

下载

目前最新版是1.0flutter官方默认地址前缀都是https://storage.googleapis.com/,如果是天朝环境就必须要换成https://storage.flutter-io.cn/,所以1.0的官方默认地址是https://storage.googleapis.com/flutter_infra/releases/stable/windows/flutter_windows_v1.0.0-stable.zip,天朝内下载的话就是https://storage.flutter-io.cn/flutter_infra/releases/stable/windows/flutter_windows_v1.0.0-stable.zip,其他版本以此类推。

将下载好的压缩包放入专门用于存放相关环境配置的文件夹,比如我这边所有涉及到需要配置到环境变量中的压缩包都放在E:\IDE下,所以flutter我本地就是放置到E:\IDE\flutter

flutter path

配置环境变量

  • PUB_HOSTED_URL

https://pub.flutter-io.cn

PUB_HOSTED_URL path

  • FLUTTER_STORAGE_BASE_URL

https://storage.flutter-io.cn

FLUTTER_STORAGE_BASE_URL path

  • FLUTTERPATH

FLUTTERPATH path

  • PATH

%FLUTTERPATH%\bin;,添加到系统的PATH变量中。

FLUTTERPATH bin

检测安装情况

$ flutter
Manage your Flutter app development.

Common commands:

  flutter create <output directory>
    Create a new Flutter project in the specified directory.

  flutter run [options]
    Run your Flutter application on an attached device or in an emulator.

Usage: flutter <command> [arguments]

Global options:
-h, --help                     Print this usage information.
-v, --verbose                  Noisy logging, including all shell commands
                               executed.
                               If used with --help, shows hidden options.

    --quiet                    Reduce the amount of output from some commands.
    --[no-]wrap                Toggles output word wrapping, regardless of
                               whether or not the output is a terminal.
                               (defaults to on)

    --wrap-column              Sets the output wrap column. If not set, uses t

                               width of the terminal. No wrapping occurs if no
                               writing to a terminal. Use --no-wrap to turn of
                               wrapping when connected to a terminal.

-d, --device-id                Target device id or name (prefixes allowed).
    --version                  Reports the version of this tool.
    --machine                  When used with the --version flag, outputs the
                               information using JSON.

    --[no-]color               Whether to use terminal colors (requires suppor
                               for ANSI escape sequences).
                               (defaults to on)

    --[no-]version-check       Allow Flutter to check for updates when this
                               command runs.
                               (defaults to on)

    --suppress-analytics       Suppress analytics reporting when this command
                               runs.

    --bug-report               Captures a bug report file to submit to the
                               Flutter team.
                               Contains local paths, device identifiers, and l

                               snippets.

    --packages                 Path to your ".packages" file.
                               (required, since the current directory does not
                               contain a ".packages" file)

    --flutter-root             The root directory of the Flutter repository.
                               Defaults to $FLUTTER_ROOT if set, otherwise use
                               the parent of the directory that the "flutter"
                               script itself is in.

Local build selection options (not normally required):
    --local-engine-src-path    Path to your engine src directory, if you are
                               building Flutter locally.
                               Defaults to $FLUTTER_ENGINE if set, otherwise
                               defaults to the path given in your pubspec.yaml
                               dependency_overrides for sky_engine, if any, or
                               failing that, tries to guess at the location
                               based on the value of the --flutter-root option

    --local-engine             Name of a build output within the engine out
                               directory, if you are building Flutter locally.
                               Use this to select a specific version of the
                               engine if you have built multiple engine target

                               This path is relative to
                               --local-engine-src-path/out.

Options for testing the "flutter" tool itself:
    --record-to                Enables recording of process invocations
                               (including stdout and stderr of all such
                               invocations), and file system access (reads and
                               writes).
                               Serializes that recording to a directory with t

                               path specified in this flag. If the directory
                               does not already exist, it will be created.

    --replay-from              Enables mocking of process invocations by
                               replaying their stdout, stderr, and exit code
                               from the specified recording (obtained via
                               --record-to). The path specified in this flag
                               must refer to a directory that holds serialized
                               process invocations structured according to the
                               output of --record-to.

    --show-test-device         List the special 'flutter-tester' device in
                               device listings. This headless device is used t
                               test Flutter tooling.

Available commands:
  analyze                  Analyze the project's Dart code.
  attach                   Attach to a running application.
  bash-completion          Output command line shell completion setup scripts.
  build                    Flutter build commands.
  channel                  List or switch flutter channels.
  clean                    Delete the build/ directory.
  config                   Configure Flutter settings.
  create                   Create a new Flutter project.
  daemon                   Run a persistent, JSON-RPC based server to
                           communicate with devices.
  devices                  List all connected devices.
  doctor                   Show information about the installed tooling.
  drive                    Runs Flutter Driver tests for the current project.
  emulators                List, launch and create emulators.
  format                   Format one or more dart files.
  help                     Display help information for flutter.
  ide-config               Configure the IDE for use in the Flutter tree.
  inject-plugins           Re-generates the GeneratedPluginRegistrants.
  install                  Install a Flutter app on an attached device.
  logs                     Show log output for running Flutter apps.
  make-host-app-editable   Moves host apps from generated directories to
                           non-generated directories so that they can be edite
                           by developers.
  packages                 Commands for managing Flutter packages.
  precache                 Populates the Flutter tool's cache of binary
                           artifacts.
  run                      Run your Flutter app on an attached device.
  screenshot               Take a screenshot from a connected device.
  stop                     Stop your Flutter app on an attached device.
  test                     Run Flutter unit tests for the current project.
  trace                    Start and stop tracing for a running Flutter app.
  update-packages          Update the packages inside the Flutter repo.
  upgrade                  Upgrade your copy of Flutter.

Run "flutter help <command>" for more information about a command.
Run "flutter help -v" for verbose help output, including less commonly used
options.

$ flutter --version
Flutter 1.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5391447fae (5 days ago) • 2018-11-29 19:41:26 -0800
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

flutter --version


canvas-webgl

概念

canvas

canvas翻译为画布是HTML5的一个标签,canvas可以使用JavaScript在网页上绘制图像,像是折线啊,圆形,渐变之类。目前在web实际项目中已有不少应用。例如图像的旋转,圆角的生成等。

OpenGL

OpenGL并不专属于web前端领域,OpenGLOpen Graphics Library是个定义了一个跨编程语言、跨平台的编程接口的规格,它用于三维图象,二维的亦可。OpenGL是个专业的图形程序接口,是一个功能强大,调用方便的底层图形库,是行业领域中最为广泛接纳的 2D/3D 图形 API,是个与硬件无关的软件接口,其自诞生至今已催生了各种计算机平台及设备上的数千优秀应用程序。

OpenGL使用简便,效率高。它具有七大功能:建模、变换、颜色模式设置、光照和材质设置、纹理映射(Texture Mapping)、位图显示和图象增强图象功能和双缓存动画(Double Buffering)。

具体可参见OpenGL百科

WebGL

WebGL是一种3D绘图标准,这种绘图技术标准允许把JavaScriptOpenGL ES 2.0结合在一起,通过增加OpenGL ES 2.0的一个JavaScript绑定,WebGL可以为HTML5 Canvas提供硬件3D加速渲染,这样Web开发人员就可以借助系统显卡来在浏览器里更流畅地展示3D场景和模型了,还能创建复杂的导航和数据视觉化。显然,WebGL技术标准免去了开发网页专用渲染插件的麻烦,可被用于创建具有复杂3D结构的网站页面,甚至可以用来设计3D网页游戏等等。

opengl-webgl

由于webgl是基于OpenGLJavaScript技术结合,而OpenGL与微软DirectX存在着竞争关系,而且微软自身也开发了Silverlight插件,与webgl其实是类似的,所以微软对webgl技术并不支持。

微软的不支持并不影响webgl的发展,随着firefox、谷歌和苹果等加入,webgl也开始出现了各种应用。例如小有名气的基于webgl技术的谷歌人体浏览器(Google Body Browser)实验项目,用户可以查看3D人体结构(下图来自cnbeta)。

googlebodybrower
googlebodybrower2

GLSL

GLSLOpenGL着色语言(GLSL――OpenGL Shading Language), 是开发人员用来在OpenGL中着色编程编写的短小的自定义程序,他们是在图形卡的GPU (Graphic Processor Unit图形处理单元)上执行的,代替了固定的渲染管线的一部分。比如:视图转换、投影转换等。GLSL(GL Shading Language)的着色器代码分成2个部分:Vertex Shader(顶点着色器)Fragment(片断着色器),有时还会有Geometry Shader(几何着色器)。负责运行顶点着色的是顶点着色器。它可以得到当前OpenGL 中的状态,GLSL内置变量进行传递。

CSS Shaders

CSS Shaders是Adobe公司在Adobe Max推出的一个全新的项目。这项由AdobeAppleOpera合作研发的新标准已经提交至W3C,将为CSS技术带来3D图形特性。

Shader(着色器)可以理解为是一种运行于显卡端的小程序,通常用于游戏和其他图形相关的应用。

着色器有两种

  • 顶点着色器,用于控制几何体的顶点以绘制出3D表面网格
  • 片元着色器,用于控制像素的颜色。

CSS Shaders技术将允许开发者同时使用顶点着色器和片元着色器。

在CSS中使用着色器可以制作出很多吸引眼球的动态效果。

Adobe展示了一些Demo视频,在第一个视频中Twitter的页面被渲染成了弯曲的表面;第二个视频更加有趣,将Google地图和街景渲染折叠了起来,像真的纸质地图那样。因为着色器可以作用于所有HTML内容,所以CSS Shaders渲染的元素包括了普通的表格、SVG甚至是HTML5 Video等等。
CSS目前已经可以制作一些3D动画效果,但是着色器这个关键角色的加入,将使这项技术变得更加灵活,提高了可编程性。CSS Shaders可以与Adobe Edge配合使用,制作出更多动态效果的网页。Adobe称未来Edge将拥有更强的表现力,而CSS Shaders正是为了达到这个目的而推出的。

CSS Shaders内置了一些常用的滤镜,包括设置模糊、阴影、色调、翻转、灰度、透明度、Gamma值等。另外也允许开发者自己编写着色器代码,使用的语言——不出所料,和WebGL一样——是GLSL

有人可能会疑问,貌似CSS ShadersWebGL作用和接近,使用语言也一致,会不会发生冲突啊。根据Adobe的某些人员的说法,WebGL只能作用于一个Canvas,而CSS Shaders适用于任何Web内容。CSS的本意就是用来定义网页样式的,Shader的加入毋庸置疑可以大大增加灵活度,让开发者有更多的方式去创造出更具想象力的网页。两者是没有冲突。

different

Canvas 是HTML5提供的一个特性,你可以把它当做一个载体,简单的说就是一张白纸。而Canvas 2D 相当于获取了内置的二维图形接口,也就是二维画笔。Canvas 3D 是获取基于 WebGL的图形接口,相当于三维画笔。你可以选择不同的画笔在上面作画。

canvas-opengl-webgl-css-shaders-glsl

use

html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>WebGL</title>
</head>
<body onload="main()">
    <canvas id="container" width="1280px" height="720px"></canvas>
</body>
</html>
<script type="text/javascript" src="main.js"></script>

simple canvas

main.js

function main() {
    var canvas = document.getElementById("container");
    var context = canvas.getContext("2d");
    context.fillStyle = "rgba(0, 0, 255, 1.0)";
    context.fillRect(120, 10, 150, 150);
}

simple webgl

修改main.js

function main() {
    var canvas = document.getElementById("container");
    var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
    gl.clearColor(0.0, 0.0, 0.0, 1.0);// 指定清空canvas的颜色
    gl.clear(gl.COLOR_BUFFER_BIT);// 清空canvas
}

上面是一个最简单的WebGL程序,将canvas的颜色设置为黑色。

Shader

使用WebGL绘制,依赖于着色器shader

  • 顶点着色器Vertex shader: 绘制每个定点都会调用一次;
  • 片段着色器Fragment shader: 每个片源可以简单的理解为像素都会调用一次;
/**
 * 使用WebGL画点
 * [email protected]
 * */

// 顶点着色器源码
var vertexShaderSrc = `
void main(){
    gl_Position = vec4(0.0, 0.0, 0.0, 1.0);// gl_Position 内置变量,表示点的位置,必须赋值
    gl_PointSize = 10.0;// gl_PointSize 内置变量,表示点的大小`单位像素`,可以不赋值,默认为1.0,,绘制单个点时才生效
}`;

// 片段着色器源码
var fragmentShaderSrc = `
void main(){
    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);// 内存变量,表示片元颜色RGBA
}`;

// 初始化使用的shader
function initShader(gl) {
    var vertexShader = gl.createShader(gl.VERTEX_SHADER);// 创建顶点着色器
    gl.shaderSource(vertexShader, vertexShaderSrc);// 绑定顶点着色器源码
    gl.compileShader(vertexShader);// 编译定点着色器

    var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);// 创建片段着色器
    gl.shaderSource(fragmentShader, fragmentShaderSrc);// 绑定片段着色器源码
    gl.compileShader(fragmentShader);// 编译片段着色器

    var shaderProgram = gl.createProgram();// 创建着色器程序
    gl.attachShader(shaderProgram, vertexShader);// 指定顶点着色器
    gl.attachShader(shaderProgram, fragmentShader);// 指定片段着色色器
    gl.linkProgram(shaderProgram);// 链接程序
    gl.useProgram(shaderProgram);//使用着色器
}

function main() {
    var canvas = document.getElementById("container");
    var gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
    initShader(gl);// 初始化着色器
    gl.clearColor(0.0, 0.0, 0.0, 1.0);// 指定清空canvas的颜色
    gl.clear(gl.COLOR_BUFFER_BIT);// 清空canvas
    gl.drawArrays(gl.POINTS, 0, 1);// 画点
}

坐标系

WebGL使用的是右手系,x水平右为正,y竖直上为正,z垂直屏幕外为正

WebGL的宽高范围是从-11

将前面vertexShaderSrc代码中的gl_Position = vec4(0.0, 0.0, 0.0, 1.0);分别修改为:

gl_Position = vec4(1.0, 0.0, 0.0, 1.0);
gl_Position = vec4(-1.0, 0.0, 0.0, 1.0);
gl_Position = vec4(0.0, 1.0, 0.0, 1.0);
gl_Position = vec4(0.0, -1.0, 0.0, 1.0);
gl_Position = vec4(1.0, 1.0, 0.0, 1.0);
gl_Position = vec4-(1.0, 1.0, 0.0, 1.0);
gl_Position = vec4(1.0, -1.0, 0.0, 1.0);
gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);

可以看到点会被绘制在不同的位置。

向shader中传值

shader中传值有两种方式:

attribute变量,传递与顶点相关的数组,只能在顶点着色器中使用;
uniform变量,传递与顶点无关的数据;
前面的代码将点的位置和大小都直接写在了顶点着色器中,现在将其改为由外面的程序传入。首先修改顶点着色器:

var vertexShaderSrc = `
attribute vec4 a_Position;// 接收传入位置坐标,必须声明为全局
attribute float a_PointSize;// 接收传入位置坐标,必须声明为全局
void main(){
    gl_Position = a_Position;// gl_Position 内置变量,表示点的位置,必须赋值
    gl_PointSize = a_PointSize;// gl_PointSize 内置变量,表示点的大小`单位像素`,可以不赋值,默认为1.0
}`;

然后在initShader的最后给这两个变量赋值:

 var a_Position = gl.getAttribLocation(shaderProgram, "a_Position");// 获取shader中的a_Position变量
    gl.vertexAttrib4f(a_Position, 0.0, 0.0, 0.0, 1.0);// 给变量a_Position赋值

    var a_PointSize = gl.getAttribLocation(shaderProgram, "a_PointSize");// 获取shader中的a_PointSize变量
    gl.vertexAttrib1f(a_PointSize, 10.0);// a_PointSize

效果

SouthEast

参考网站

react ETC 规范

react English to Chinese 翻译规范

https://github.com/react-guide/ETC

非常感谢你的关注,为了提高翻译质量和协同效率,特约定些文档。在参与翻译前,请仔细阅读此文档。

质量保证机制

使用互相 Review 机制,修改后发 Pull Request(小修改除外)Collaborator 看到后,如果有问题回复指出;如果没有问题,简单回复一下并 Accept 即可;
每半个月定期与原文对照,并同步更新。

翻译基础约定

  • 不译的英文名词复数改为单数,因为中文没有复数的概念;
  • 专有名词保持大写:HTML, HAML, SASS, REST... 等等;
  • 英文数字与中文之间要留空格中文标点符号中文之间不需要留空格
  • 使用中文标点符号。句号是不是 .,破折号是 —— 不是 -
  • 英文斜体、中文没有,可用强调取代 **强调**
  • 译文原文行数应保持一致,以便于后期同步更新
  • 代码缩进使用两个空格,禁止使用 Tab
  • 按照语义把英文逗号改为中文顿号
  • 译完自己读一次,看看像不像中文
  • 遇到不确定的翻译很正常,请在 Pull Request 里指出,大家一起解决。
  • 与原文同步机制 To Be Determined,保持持续翻译更新

约定翻译的名词

为了免除误解,这些词第一次出现时可以用 () 来显示原文。

英文 中文
plain object 普通对象
manage 管理
compose 组合
action creator action 创建函数
dispatch 发起
note 注意/须知
hold 维持
state shape state 结构
handle 处理
boilerplate 样板代码
normalized 范式化
function 函数?
composition 合成
helper utility 辅助工具
this won’t work 这样做行不通
this will work 这样做行得通
tips 小贴士
create 创建
flag 标记位
package
hook 钩子
component 组件
lifecycle 生命周期
constant 常量

保留不译的名词

前端开发常用的专有名词,在不造成读者理解困难的情况下,尽量保持原汁原味。

英文 说明
action 动作
reducer -
store -
middleware 中间件
dispatcher 分发器
state 状态
state tree 状态树
props 属性
UI 用户界面
monkey patch -
currying 柯里化

Reflect.set()

基础语法

Reflect.set(target, propertyKey, value[, receiver])

参数说明

target

设置属性的目标对象。

propertyKey

设置的属性的名称。

value

设置的值。

receiver

如果遇到 setterthis 将提供给目标调用。

返回值描述

Boolean 表明是否成功设置属性。

如果目标不是 Object,会抛出一个 TypeError

详细描述

Reflect.set 方法允许你在对象上设置属性。它的作用是给属性赋值并且就像 property accessor 语法一样,但是它是以函数的方式。

案例

// Object
var obj = {};
Reflect.set(obj, "prop", "value"); // true
obj.prop; // "value"

// Array
var arr = ["duck", "duck", "duck"];
Reflect.set(arr, 2, "goose"); // true
arr[2]; // "goose"

// It can truncate an array.
Reflect.set(arr, "length", 1); // true
arr; // ["duck"];

// With just one argument, propertyKey and value are "undefined".
var obj = {};
Reflect.set(obj); // true
Reflect.getOwnPropertyDescriptor(obj, "undefined");
// { value: undefined, writable: true, enumerable: true, configurable: true }

尤达条件式

基础介绍

也称为尤达标记法,在计算机编程的术语中,是一种编程风格,其中表达式的两个部分与条件语句中的典型顺序相反。

尤达条件式将表达式的常量部分放在条件语句的左侧。这个风格的名称源于星际大战绝地大师尤达的角色,他以非标准语法讲英语。

尤达条件式是WordPressSymfony编码标准的一部分。

案例

常量写在比较运算符的左侧,要测试其值的变量写入右侧。这个次序相媲美于尤达的非标准口语风格, 大约是宾主动语序(例如,“当九百岁你活到,看起来很好你将不”)。

// 正常表达
// Reads like: "If the value is equal to 42..."
if ( $value === 42 ) { /* ... */ }

// 尤达条件表达
// Reads like: "If 42 equals the value..."
if ( 42  === $value ) { /* ... */ }

优点

避免赋值错误

在表达式中放置常量值不会改变程序的行为(除非此值被评估为false,请参见下文)。在使用单个等号(=)运行赋值操作 而非条件关系比较的编程语法中,可能发生的错误使程序产生意料之外的赋值操作,而并非如程序员原意要编写关系判断的条件语句。

// 正常表达
// This assigns 42 to myNumber instead of evaluating the desired condition
if (myNumber = 42) { /* ... */ }

// 尤达条件表达
if (42 = myNumber) { /* ... */ }
// This is a syntax error and will not compile

由于 42 是一个无法变动的固定常量,因此编译器会捕捉到该错误。

避免null指针

// 正常表达
Boolean myBoolean = true;
if (myBoolean = null) { /* ... */ }
// This causes a NullPointerException in Java Runtime, but legal in compilation.

String myString = null;
if (myString.equals("foobar")) { /* ... */ }
// This causes a NullPointerException in Java

// 尤达条件表达
String myString = null;
if ("foobar".equals(myString)) { /* ... */ }
// This is false, as expected

总结

有人认为尤达条件式的缺乏可读性是一个缺点,超过了上述优点。

一些编程语言如PythonSwift之中是不允许在条件式中进行对变量赋值操作的, 借由定义赋值表达式不会被评估就没有任何值,在这种情况是不可能发生这类错误的。

许多编译器会对如if (myNumber = 42)的源码发出警示消息(例如,GCC-Wall选项会警告括号语句中的赋值为真),让程序员发现可能的错误点。

JavaScript中如ESLint之类的语法建议程序,可以警告条件式中出现赋值操作。

尤达条件式写法避免null行为的优点也可被认为是一个缺点,因为空指针错误或被隐藏,并只出现在程序后期中。

当比较非基本类型时,这种写法在C++中出现了另一个缺点,因为 == 是一个运算符,并可能没有定义适当的重载运算符函数

例如:CComBSTR与字符串文本比较,写成(L"Hello" == cbstrMessage),不会对应到重载的函数。

Array.prototype.reduce()

基础语法

arr.reduce(callback[initialValue])

参数说明

callback

执行数组中每个值的函数,包含四个参数:

- accumulator
  累计器累计回调的返回值; 它是上一次调用回调时返回的累积值,或`initialValue`(见于下方)。
- currentValue
  数组中正在处理的元素。
- currentIndex 可选
  数组中正在处理的当前元素的索引。 如果提供了`initialValue`,则起始索引号为`0`,否则为`1`。
- array 可选
  调用`reduce()`的数组

initialValue 可选

作为第一次调用 callback函数时的第一个参数的值。 如果没有提供初始值,则将使用数组中的第一个元素。 在没有初始值的空数组上调用 reduce 将报错。

返回值说明

函数累计处理的结果

详细说明

reduce() 方法对数组中的每个元素执行一个由您提供的reducer函数(升序执行),将其结果汇总为单个返回值。

reduce为数组中的每一个元素依次执行callback函数,不包括数组中被删除从未被赋值的元素。

reducer 函数接收4个参数:

  • accumulator (acc) (累计器)
  • Current Value (cur) (当前值)
  • Current Index (idx) (当前索引)
  • Source Array (src) (源数组)

reducer 函数的返回值分配给累计器,该返回值在数组的每个迭代中被记住,并最后成为最终的单个结果值。

回调函数第一次执行时,accumulatorcurrentValue的取值有两种情况:如果调用reduce()时提供了initialValueaccumulator取值为initialValuecurrentValue取数组中的第一个值;如果没有提供 initialValue,那么accumulator取数组中的第一个值,currentValue取数组中的第二个值。

注意:如果没有提供initialValue,reduce 会从索引1的地方开始执行 callback 方法,跳过第一个索引。如果提供initialValue,从索引0开始。

如果数组为空且没有提供initialValue,会抛出TypeError 。如果数组仅有一个元素(无论位置如何)并且没有提供initialValue, 或者有提供initialValue但是数组为空,那么此唯一值将被返回并且callback不会被执行。

提供初始值通常更安全,正如下面的例子,如果没有提供initialValue,则可能有三种输出:

var maxCallback = ( acc, cur ) => Math.max( acc.x, cur.x );
var maxCallback2 = ( max, cur ) => Math.max( max, cur );

// reduce() 没有初始值
[ { x: 22 }, { x: 42 } ].reduce( maxCallback ); // 42
[ { x: 22 }            ].reduce( maxCallback ); // { x: 22 }
[                      ].reduce( maxCallback ); // TypeError

// map/reduce; 这是更好的方案,即使传入空数组或更大数组也可正常执行
[ { x: 22 }, { x: 42 } ].map( el => el.x )
                        .reduce( maxCallback2, -Infinity );

运行说明

假如运行下段reduce()代码:

[0, 1, 2, 3, 4].reduce((prev, curr) => prev + curr );

callback 被调用四次,每次调用的参数和返回值如下表:

callback accumulator currentValue currentIndex array return value
first call 0 1 1 [0, 1, 2, 3, 4] 1
second call 1 2 2 [0, 1, 2, 3, 4] 3
third call 3 3 3 [0, 1, 2, 3, 4] 6
fourth call 6 4 4 [0, 1, 2, 3, 4] 10

reduce返回的值将是上次回调调用的值(10)

如果你打算提供一个初始值作为reduce()方法的第二个参数,以下是运行过程及结果:

[0, 1, 2, 3, 4].reduce((accumulator, currentValue, currentIndex, array) => { return accumulator + currentValue; }, 10 );
callback accumulator currentValue currentIndex array return value
first call 10 0 0 [0, 1, 2, 3, 4] 10
second call 10 1 1 [0, 1, 2, 3, 4] 11
third call 11 2 2 [0, 1, 2, 3, 4] 13
fourth call 13 3 3 [0, 1, 2, 3, 4] 16
fifth call 16 4 4 [0, 1, 2, 3, 4] 20

这种情况下reduce()返回的值是20

案例

数组里所有值的和

var total = [ 0, 1, 2, 3 ].reduce(
    ( acc, cur ) => acc + cur,
  0
);
// 和为 6

累加对象数组里的值

要累加对象数组中包含的值,必须提供初始值,以便各个item正确通过你的函数。

var initialValue = 0;
var sum = [{x: 1}, {x:2}, {x:3}].reduce(
    (accumulator, currentValue) => accumulator + currentValue.x
    ,initialValue
);

console.log(sum) // logs 6

将二维数组转化为一维

var flattened = [[0, 1], [2, 3], [4, 5]].reduce(
 ( acc, cur ) => acc.concat(cur),
 []
);
// flattened is [0, 1, 2, 3, 4, 5]

计算数组中每个元素出现的次数

var names = ['Alice', 'Bob', 'Tiff', 'Bruce', 'Alice'];

var countedNames = names.reduce(function (allNames, name) { 
  if (name in allNames) {
    allNames[name]++;
  }
  else {
    allNames[name] = 1;
  }
  return allNames;
}, {});
// countedNames is:
// { 'Alice': 2, 'Bob': 1, 'Tiff': 1, 'Bruce': 1 }

按属性对object分类

var people = [
  { name: 'Alice', age: 21 },
  { name: 'Max', age: 20 },
  { name: 'Jane', age: 20 }
];

function groupBy(objectArray, property) {
  return objectArray.reduce(function (acc, obj) {
    var key = obj[property];
    if (!acc[key]) {
      acc[key] = [];
    }
    acc[key].push(obj);
    return acc;
  }, {});
}

var groupedPeople = groupBy(people, 'age');
// groupedPeople is:
// { 
//   20: [
//     { name: 'Max', age: 20 }, 
//     { name: 'Jane', age: 20 }
//   ], 
//   21: [{ name: 'Alice', age: 21 }] 
// }

使用扩展运算符和initialValue绑定包含在对象数组中的数组

// friends - 对象数组
// where object field "books" - list of favorite books 
var friends = [{
  name: 'Anna',
  books: ['Bible', 'Harry Potter'],
  age: 21
}, {
  name: 'Bob',
  books: ['War and peace', 'Romeo and Juliet'],
  age: 26
}, {
  name: 'Alice',
  books: ['The Lord of the Rings', 'The Shining'],
  age: 18
}];

// allbooks - list which will contain all friends' books +  
// additional list contained in initialValue
var allbooks = friends.reduce(function(prev, curr) {
  return [...prev, ...curr.books];
}, ['Alphabet']);

// allbooks = [
//   'Alphabet', 'Bible', 'Harry Potter', 'War and peace', 
//   'Romeo and Juliet', 'The Lord of the Rings',
//   'The Shining'
// ]

数组去重节

let arr = [1,2,1,2,3,5,4,5,3,4,4,4,4];
let result = arr.sort().reduce((init, current)=>{
    if(init.length===0 || init[init.length-1]!==current){
        init.push(current);
    }
    return init;
}, []);
console.log(result); //[1,2,3,4,5]

按顺序运行Promise节

/**
 * Runs promises from array of functions that can return promises
 * in chained manner
 *
 * @param {array} arr - promise arr
 * @return {Object} promise object
 */
function runPromiseInSequence(arr, input) {
  return arr.reduce(
    (promiseChain, currentFunction) => promiseChain.then(currentFunction),
    Promise.resolve(input)
  );
}

// promise function 1
function p1(a) {
  return new Promise((resolve, reject) => {
    resolve(a * 5);
  });
}

// promise function 2
function p2(a) {
  return new Promise((resolve, reject) => {
    resolve(a * 2);
  });
}

// function 3  - will be wrapped in a resolved promise by .then()
function f3(a) {
 return a * 3;
}

// promise function 4
function p4(a) {
  return new Promise((resolve, reject) => {
    resolve(a * 4);
  });
}

const promiseArr = [p1, p2, f3, p4];
runPromiseInSequence(promiseArr, 10)
  .then(console.log);   // 1200

功能型函数管道节

// Building-blocks to use for composition
const double = x => x + x;
const triple = x => 3 * x;
const quadruple = x => 4 * x;

// Function composition enabling pipe functionality
const pipe = (...functions) => input => functions.reduce(
    (acc, fn) => fn(acc),
    input
);

// Composed functions for multiplication of specific values
const multiply6 = pipe(double, triple);
const multiply9 = pipe(triple, triple);
const multiply16 = pipe(quadruple, quadruple);
const multiply24 = pipe(double, triple, quadruple);

// Usage
multiply6(6); // 36
multiply9(9); // 81
multiply16(16); // 256
multiply24(10); // 240

Polyfill

如果您需要兼容不支持Object.definePropertyJavaScript引擎,那么最好不要 polyfill Array.prototype方法,因为你无法使其成为不可枚举的。

// Production steps of ECMA-262, Edition 5, 15.4.4.21
// Reference: http://es5.github.io/#x15.4.4.21
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
if (!Array.prototype.reduce) {
  Object.defineProperty(Array.prototype, 'reduce', {
    value: function(callback /*, initialValue*/) {
      if (this === null) {
        throw new TypeError( 'Array.prototype.reduce ' + 
          'called on null or undefined' );
      }
      if (typeof callback !== 'function') {
        throw new TypeError( callback +
          ' is not a function');
      }

      // 1. Let O be ? ToObject(this value).
      var o = Object(this);

      // 2. Let len be ? ToLength(? Get(O, "length")).
      var len = o.length >>> 0; 

      // Steps 3, 4, 5, 6, 7      
      var k = 0; 
      var value;

      if (arguments.length >= 2) {
        value = arguments[1];
      } else {
        while (k < len && !(k in o)) {
          k++; 
        }

        // 3. If len is 0 and initialValue is not present,
        //    throw a TypeError exception.
        if (k >= len) {
          throw new TypeError( 'Reduce of empty array ' +
            'with no initial value' );
        }
        value = o[k++];
      }

      // 8. Repeat, while k < len
      while (k < len) {
        // a. Let Pk be ! ToString(k).
        // b. Let kPresent be ? HasProperty(O, Pk).
        // c. If kPresent is true, then
        //    i.  Let kValue be ? Get(O, Pk).
        //    ii. Let accumulator be ? Call(
        //          callbackfn, undefined,
        //          « accumulator, kValue, k, O »).
        if (k in o) {
          value = callback(value, o[k], k, o);
        }

        // d. Increase k by 1.      
        k++;
      }

      // 9. Return accumulator.
      return value;
    }
  });
}

Reflect.construct()

基础语法

Reflect.construct(target, argumentsList[, newTarget])

参数说明

target

被运行的目标函数

argumentsList

调用构造函数的数组或者伪数组

newTarget 可选

该参数为构造函数, 参考 new.target 操作符,如果没有newTarget参数, 默认和target一样

返回值描述

由目标对象的自身属性键组成的 Array

如果target或者newTarget不是构造函数,会抛出一个 TypeError

详细描述

Reflect.construct() 方法的行为有点像 new 操作符 构造函数 , 相当于运行 new target(...args).

Reflect.construct允许你使用可变的参数来调用构造函数

var obj = new Foo(...args);
var obj = Reflect.construct(Foo, args);

案例

使用 Reflect.construct()

var d = Reflect.construct(Date, [1776, 6, 4]);
d instanceof Date; // true
d.getFullYear(); // 1776

使用 newTarget 参数节

参考 classes 获取更多有关子类的信息, 和new.target 操作符的信息

function someConstructor() {}
var result = Reflect.construct(Array, [], someConstructor);

Reflect.getPrototypeOf(result); // 输出:someConstructor.prototype
Array.isArray(result); // true

Reflect.deleteProperty()

基础语法

Reflect.deleteProperty(target, propertyKey)

参数说明

target

删除属性的目标对象。

propertyKey

将被删除的属性的名称。

返回值描述

Boolean 值表明该属性是否被成功删除。

如果目标不是 Object,会抛出一个 TypeError

详细描述

静态方法 Reflect.deleteProperty() 允许用于删除属性。它很像 delete operator ,但它是一个函数。

Reflect.deleteProperty 允许你删除一个对象上的属性。返回一个 Boolean 值表示该属性是否被成功删除。它几乎与非严格的 delete operator 相同。

案例

var obj = { x: 1, y: 2 };
Reflect.deleteProperty(obj, "x"); // true
obj; // { y: 2 }

var arr = [1, 2, 3, 4, 5];
Reflect.deleteProperty(arr, "3"); // true
arr; // [1, 2, 3, , 5]

// 如果属性不存在,返回 true
Reflect.deleteProperty({}, "foo"); // true

// 如果属性不可配置,返回 false
Reflect.deleteProperty(Object.freeze({foo: 1}), "foo"); // false

jsLint

配置环境

cnpm install --save-dev eslint babel-eslint eslint-config-alloy

react-control-center

官方仓库

https://github.com/fantasticsoul/react-control-center

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/react-control-center

image

在线运行地址

https://npm.runkit.com/react-control-center

image

基础介绍

次世代的状态管理框架,替换掉了redux 或者dva,编程体验上升一个台阶。

强大,灵活,简单,弱入侵,渐进式,高性能。

核心概念

2个内置模块

$global$default

3种状态

refStatemoduleStateglobalState

cc instance中可以得到3种计算结果

$refComputed$moduleComputed$globalComputed

cc instancecc class中可以设置4种状态键

globalStateKeysharedStateKeystoredStateKeytemporaryStateKey

cc instance中有5种推荐的触发渲染方式

setState$dispatch$invoke$effect$xeffect

核心概念

react classcc class and cc instance 之间的关系

react class、 cc class and cc instance relationship

基础安装

npm install react-control-center --save   # npm
yarn add react-control-center             # Yarn

基础使用

(function (log) {
    const CC = require('react-control-center');

    CC.startup({
      isModuleMode: true,
      store:{
        $global:{
          themeColor:'',
          borderColor:'',
          maskLoading:false,
        },
        fooModule:{
          foo:1,
          bar:2,
        }
      },
      reducer:{
        $global:{
          setMaskLoadingTrue:()=>{
            return {maskLoading: true};
          },
          changeThemeColor:async function({payload:newColor, dispatch}){
            // set maskLoading as true firstly
            await dispatch({type:'setMaskLoadingTrue'});
            // save user choosing color to server
            await api.saveUserThemeColor(newColor);
            // change $global state's themeColor to newColor
            // and maskLoading to false
            return {themeColor:newColor, maskLoading:false};
          },
          changeBorderColor:async function({payload:newColor, dispatch}){
            await dispatch({type:'setMaskLoadingTrue'});
            await api.saveUserBorderColor(newColor);
            return {borderColor:newColor, maskLoading:false};
          }
        },
        fooModule:{
          incFoo:({moduleState})=>{
            const foo = moduleState.foo+1;
            return {foo};
          }
        }
      },
      init:{
        // fetch user stored themeColor from server for $global module
        $global: setState=>{
          api.fetchUserThemeColor(themeColor=>{
            setState({themeColor});
          });
        }
      },
      computed:{
        $global:{
          borderColor(borderColor){
            return `1px solid ${borderColor}`;
          }
        }
      }
    });


})(console.log)

相关网站

Array.prototype.reduceRight()

基础语法

arr.reduceRight(callback[, initialValue])

参数说明

callback

执行数组中每个值的函数,包含四个参数:

- previousValue
 上一次调用回调的返回值,或提供的 `initialValue`(见于下方)。
- currentValue
  数组中正在处理的元素。
- currentIndex
  数组中正在处理的当前元素的索引。 如果提供了`initialValue`,则起始索引号为`0`,否则为`1`。
- array 可选
  调用`reduceRight()`的数组

initialValue 可选

可作为第一次调用回调 callback 的第一个参数

返回值说明

执行之后的返回值

详细说明

reduceRight() 方法接受一个函数作为累加器(accumulator)和数组的每个值(从右到左)将其减少为单个值。

reduceRight 为数组中每个元素调用一次 callback 回调函数,但是数组中被删除的索引或从未被赋值的索引会跳过。

回调函数接受四个参数:初始值(或上次调用回调的返回值)当前元素值当前索引以及调用 reduce 的数组

可以像下面这样调用 reduceRight 的回调函数 callback

array.reduceRight(function(previousValue, currentValue, index, array) {
    // ...
});

首次调用回调函数时,previousValuecurrentValue 可以是两个值之一。如果调用 reduceRight 时提供了 initialValue 参数,则 previousValue 等于 initialValuecurrentValue 等于数组中的最后一个值。如果没有提供 initialValue 参数,则 previousValue 等于数组最后一个值, currentValue 等于数组中倒数第二个值。

如果数组为空,且没有提供 initialValue 参数,将会抛出一个 TypeError 错误。如果数组只有一个元素且没有提供 initialValue 参数,或者提供了 initialValue 参数,但是数组为空将会直接返回数组中的那一个元素或 initialValue 参数,而不会调用 callback

该函数的完整执行过程见下例:

运行说明

假如运行下段reduce()代码:

[0, 1, 2, 3, 4].reduceRight((previousValue, currentValue, index, array) => previousValue + currentValue );

callback 被调用四次,每次调用的参数和返回值如下表:

callback previousValue currentValue index array return value
first call 4 3 3 [0,1,2,3,4] 7
second call 7 2 2 [0,1,2,3,4] 9
third call 9 1 1 [0,1,2,3,4] 10
fourth call 10 0 0 [0,1,2,3,4] 10

reduceRight 返回的值将是上次回调调用的值(10)

如果你打算提供一个初始值作为reduceRight ()方法的第二个参数,以下是运行过程及结果:

[0, 1, 2, 3, 4]..reduceRight((previousValue, currentValue, index, array) => previousValue + currentValue , 10 );
callback previousValue currentValue index array return value
first call 10 4 4 [0,1,2,3,4] 14
second call 14 3 3 [0,1,2,3,4] 17
third call 17 2 2 [0,1,2,3,4] 19
fourth call 19 1 1 [0,1,2,3,4] 20
fifth call 20 0 0 [0,1,2,3,4] 20

这种情况下reduceRight()返回的值是20

案例

求一个数组中所有值的和节

var total = [0, 1, 2, 3].reduceRight(function(a, b) {
    return a + b;
});
// total == 6

扁平化(flatten)一个元素为数组的数组

var flattened = [[0, 1], [2, 3], [4, 5]].reduceRight(function(a, b) {
    return a.concat(b);
}, []);
// flattened is [4, 5, 2, 3, 0, 1]

reducereduceRight 之间的区别

var a = ['1', '2', '3', '4', '5'];
var left  = a.reduce(function(prev, cur)      { return prev + cur; }); 
var right = a.reduceRight(function(prev, cur) { return prev + cur; }); 

console.log(left);  // "12345"
console.log(right); // "54321"

Polyfill

如果您需要兼容不支持Object.definePropertyJavaScript引擎,那么最好不要 polyfill Array.prototype方法,因为你无法使其成为不可枚举的。

// Production steps of ECMA-262, Edition 5, 15.4.4.21
// Reference: http://es5.github.io/#x15.4.4.21
// https://tc39.github.io/ecma262/#sec-array.prototype.reduce
if (!Array.prototype.reduceRight) {
  Object.defineProperty(Array.prototype, 'reduceRight', {
    value: function(callback /*, initialValue*/) {
    'use strict';
    if (null === this || 'undefined' === typeof this) {
      throw new TypeError('Array.prototype.reduceRight called on null or undefined');
    }
    if ('function' !== typeof callback) {
      throw new TypeError(callback + ' is not a function');
    }
    var t = Object(this), len = t.length >>> 0, k = len - 1, value;
    if (arguments.length >= 2) {
      value = arguments[1];
    } else {
      while (k >= 0 && !(k in t)) {
        k--;
      }
      if (k < 0) {
        throw new TypeError('reduceRight of empty array with no initial value');
      }
      value = t[k--];
    }
    for (; k >= 0; k--) {
      if (k in t) {
        value = callback(value, t[k], k, t);
      }
    }
    return value;
  });
}

Array.prototype.findIndex()

基础语法

arr.findIndex(callback[, thisArg])

参数说明

callback

在数组每一项上执行的函数,接收 3 个参数:

- element
   当前遍历到的元素。
- index
   当前遍历到的索引。
- array
   数组本身。

thisArg 可选

可选,指定 callbackthis 参数。

返回值说明

当某个元素通过 callback 的测试时,返回数组中满足提供的测试函数的第一个元素的索引。否则返回-1

详细说明

findIndex()方法返回数组中满足提供的测试函数的第一个元素的索引。否则返回-1

另请参见 find() 方法,它返回数组中找到的元素的,而不是其索引

findIndex方法对数组中的每个数组索引0..length-1(包括)执行一次callback函数,直到找到一个callback函数返回真实值(强制为true)的值。如果找到这样的元素,findIndex会立即返回该元素的索引。如果回调从不返回真值,或者数组的length0,则findIndex返回-1。 与某些其他数组方法(如Array#some)不同,在稀疏数组中,即使对于数组中不存在的条目的索引也会调用回调函数。

回调函数调用时有三个参数:元素的值元素的索引,以及被遍历的数组

如果一个 thisArg 参数被提供给 findIndex, 它将会被当作this使用在每次回调函数被调用的时候。如果没有被提供,将会使用undefined

findIndex不会修改所调用的数组。

在第一次调用callback函数时会确定元素的索引范围,因此在findIndex方法开始执行之后添加到数组的新元素将不会被callback函数访问到。如果数组中一个尚未被callback函数访问到的元素的值被callback函数所改变,那么当callback函数访问到它时,它的值是将是根据它在数组中的索引所访问到的当前值。被删除的元素仍然会被访问到。

案例

查找数组中首个质数元素的索引

以下示例查找数组中素数的元素的索引(如果不存在素数,则返回-1)。

function isPrime(element, index, array) {
  var start = 2;
  while (start <= Math.sqrt(element)) {
    if (element % start++ < 1) {
      return false;
    }
  }
  return element > 1;
}

console.log([4, 6, 8, 12].findIndex(isPrime)); // -1, not found
console.log([4, 6, 7, 12].findIndex(isPrime)); // 2

Polyfill

如果您需要兼容不支持Object.definePropertyJavaScript引擎,那么最好不要对Array.prototype方法进行 polyfill ,因为您无法使其成为不可枚举的。

// https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
if (!Array.prototype.findIndex) {
  Object.defineProperty(Array.prototype, 'findIndex', {
    value: function(predicate) {
     // 1. Let O be ? ToObject(this value).
      if (this == null) {
        throw new TypeError('"this" is null or not defined');
      }

      var o = Object(this);

      // 2. Let len be ? ToLength(? Get(O, "length")).
      var len = o.length >>> 0;

      // 3. If IsCallable(predicate) is false, throw a TypeError exception.
      if (typeof predicate !== 'function') {
        throw new TypeError('predicate must be a function');
      }

      // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
      var thisArg = arguments[1];

      // 5. Let k be 0.
      var k = 0;

      // 6. Repeat, while k < len
      while (k < len) {
        // a. Let Pk be ! ToString(k).
        // b. Let kValue be ? Get(O, Pk).
        // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
        // d. If testResult is true, return k.
        var kValue = o[k];
        if (predicate.call(thisArg, kValue, k, o)) {
          return k;
        }
        // e. Increase k by 1.
        k++;
      }

      // 7. Return -1.
      return -1;
    }
  });
}

vue ETC 规范

vue English to Chinese 翻译规范

翻译基础约定

标点符号

符号 建议使用
逗号、句号、分号、冒号、叹号、问号 统一使用全角字符:
破折号 ——
引号 统一使用“”‘’
括号 统一使用半角括号 ()
非注释部分的代码块符号 保留英文标点符号

内联代码或代码关键字

  • 务必用反引号,即英文输入法下按键盘上 Tab 键上方的那个键输出的反飘号` '```',括起来。
  • 包括代码注释中出现代码或代码关键字时,也要括起来。

空格的使用

  • 英文单词英文单词之间要有一个空格
  • 中文英文单词之间要有一个空格
  • 英文单词标点符号之间没有空格

注意有加粗斜体链接等特殊情况时空格的准确运用

遵守 **JavaScript 编码规范**非常重要
遵守 [JavaScript 编码规范](#foo)非常重要
更多信息详见*中文 MDN* 的介绍页面。
更多信息详见[中文 MDN](#bar) 的介绍页面。

约定翻译的术语

英文 建议翻译
property 属性
attribute 特性
feature/functionality 功能
directive 指令
mixin 混入
listen/listener 监听/监听器
observe/observer 侦听/侦听器
watch/watcher 侦听/侦听器
normalize (HTML code, ...) 规范化
standardize 标准化
emit/fire/trigger (an event) 触发
emit (a value) 抛出?
queue (v.) 把……加入队列
ref 引用
workaround (n.) 变通办法
workaround (v.) 绕过
convention 约定
parse 解析
stringify 字符串化
side effect 副作用
declarative 声明式
imperative 命令式
handler 处理函数
you 你 (而不用“您”)
computed 计算属性
computed property 计算属性
guard 守卫
hook 钩子
selector 选择器

保留不译的名词

前端开发常用的专有名词,在不造成读者理解困难的情况下,尽量保持原汁原味。

英文 建议翻译
getter getter
setter setter
prop prop
truthy, falsy, truthiness 不翻译,保留精准的英文,但要加 MDN 的解释作为译注

译注写法

在原文需要加译者注的位置添加角标:

... <sup>[[1]](#footnote-1)</sup> ... <sup>[[2]](#footnote-2)</sup> ...

在文章最末尾加入译者注的内容,格式如下:

<small>
__译者注__
<a id="footnote-1"></a>[1] ...
<a id="footnote-2"></a>[2] ...
<a id="footnote-3"></a>[3] ...
</small>

小贴士

关于加粗斜体格式的约定

根据 GitHub Flavored Markdown Spec,用成对的星号下划线都可以用来代表加粗斜体,但是使用下划线的时候存在更多的特殊条件限制,例如:

5*6*78 → <p>5<em>6</em>78</p>

https://github.github.com/gfm/#example-346

5_6_78 → <p>5_6_78</p>

https://github.github.com/gfm/#example-351

via: vuejs/v2.cn.vuejs.org#727 (comment)

经过讨论,考虑到 GFM 的规范以及中文的特殊情况,决定中文翻译统一使用星号来标注加粗斜体,而不是使用下划线,同时尊重英文版自身的用法。

ubuntu终端小技巧

vim显示行号

# 进入对应文件夹
cd /etc/vim

# 备份文件,方便修改错误之后还原
cp  vimrc  vimrc.bak

# 使用管理员权限打开文件
sudo vi vimrc

# 按字母i,进入编辑模式,按字母G,注意是大写,跳到最后一行,
# 在文件的最后一行加入指令 set nu
# if filereadable("/etc/vim/vimrc.local")
#   source /etc/vim/vimrc.local
# endif
#
# set nu

# 然后你下次进入vim页面,就可以直接看到行号了

微信开发者 代码管理

https://git.weixin.qq.com/

登录账号

https://git.weixin.qq.com/users/authorize#wechat_redirect

Git帐号初始化

https://git.weixin.qq.com/users/perfect_information

image

设置个人信息

https://git.weixin.qq.com/profile

image

查看所属项目

https://git.weixin.qq.com/

image

查看账号最近的操作日志

https://git.weixin.qq.com/profile/audit_events

image

修改编辑器配置

https://git.weixin.qq.com/profile/preferences

image

查看开源项目

https://git.weixin.qq.com/explore

image

查看团队推荐

https://git.weixin.qq.com/explore/groups

image

创建项目

可以支持私有仓库和公开仓库项目,默认新建的是私有仓库。

https://git.weixin.qq.com/projects/new

设置项目名称和描述

image

设置账号密码,用于拉取和提交项目

https://git.weixin.qq.com/profile/account

image

image

查看项目配置

https://git.weixin.qq.com/melonHero/test/advanced_settings/repository

  • 仓库总大小 :5.0 GB
  • 版本库大小限制:5120.0 MB
  • 单文件大小限制:512.0 MB
  • LFS总存储大小限制:51200.0 MB
  • LFS单文件大小限制:5120.0 MB

image

修改项目的README.md 说明

注意每一次提交文件,都要写日志。

https://git.weixin.qq.com/melonHero/test/new/master?file_name=README.md

image

查看编辑效果

https://git.weixin.qq.com/melonHero/test/blob/master/README.md

image

编辑项目wiki

https://git.weixin.qq.com/melonHero/test/wikis/home

image

开始安排项目任务

  • 注意任务说明,可以直接粘贴图片资源,并且动态生成的图片标识中,主要是数字字母,没有特殊符号,生成的链接路径是短路径,完整路径应该是https://git.weixin.qq.com/{{userName}}/{{projectName}}/uploads/{{imageId|32}}/image.png,生成的imageId32位的,比如我的用户名是melonHero,当前项目名是test,当前图片标识是7DCED25F74A8494188C29C744AC2D629,所以完整路径是https://git.weixin.qq.com/melonHero/test/uploads/7DCED25F74A8494188C29C744AC2D629/image.png
  • 支持编辑和预览两种模式动态切换。

https://git.weixin.qq.com/melonHero/test/issues/new?assignee_id=&milestone_id=

image

image

image

查看安排的项目任务

image

总结

实际项目运行,这边不知晓,没有实践过,不过在线编辑器用的是ace,下拉框也是用的select2,模块引入用的RequireJS,让我很亲切,不过很好奇用的图表库好像是echart,这属于使用竞争对手产品呀。

优势

  • 感觉这个代码评审和缺陷管理的这个,比如gayhub可视化一些,很多东西小白可以用。
  • 而且符合这边云编程的思路,整个页面很像Coding页面,也比较顺手吧。
  • 对于开发微信项目的应该会比较友好。

缺点

  • 感觉云编程是一系列的服务购买,感觉现在很多人不太想把项目放到这种官方仓库,只是个人猜测,特别有竞争项目的,也不太敢放到这边仓库里。
  • 生成的图片链接路径是短路径,这边就必须要发布之后,才知晓完整路径,或者知晓默认前缀,每次手动做路径补充,这个就有点麻烦。gayhub中图片上传路径https://user-images.githubusercontent.com/{{timeStamp}}/{{imageId|45}}.png,和项目不挂钩,感觉不太微信习惯这种分类,而且生成的imageId45位的。
  • 仓库代码迁移,小项目还好,大项目很麻烦,这边好像没有看到同步仓库的功能。
  • 页面一些激活效果和现有习惯的不太一致,要看个人适应情况。
  • 之前阿里云也有在线的仓库管理,但是感觉用的人不多,不知晓这个前车之鉴,tx是否有吸取。

npm-proj4

proj4

官网

https://proj4.org/

image

基础介绍

PROJ是一种通用坐标转换软件,可将地理空间坐标从一个坐标参照系(CRS)转换为另一个坐标参照系。这包括制图投影以及大地测量变换。

PROJ包括命令行应用程序,用于从文本文件或直接从用户输入轻松转换坐标。除了命令行实用程序之外,PROJ还公开了 应用程序编程接口或API。API允许开发人员在自己的软件中使用PROJ的功能,而无需自己实现类似的功能。

PROJ开始纯粹作为制图应用程序,允许用户使用许多不同的制图投影将大地坐标转换为投影坐标。多年来,随着需求的显而易见,对基准位移的支持也逐渐进入PROJ。今天PROJ支持超过一百种不同的地图投影,并且可以使用除了最模糊的大地测量技术之外的所有方法来转换基准点之间的坐标。

Proj4js

https://www.npmjs.com/package/proj4

Proj4js是一个JavaScript库,用于将点坐标从一个坐标系转换为另一个坐标系,包括基准转换。最初是PROJ.4GCTCP C的一个端口,它是MetaCRS项目组的一部分。

image

使用方式

https://npm.runkit.com/proj4

image

  • 基础配置
proj4(fromProjection[, toProjection, coordinates])

var firstProjection = 'PROJCS["NAD83 / Massachusetts Mainland",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.68333333333333],PARAMETER["standard_parallel_2",41.71666666666667],PARAMETER["latitude_of_origin",41],PARAMETER["central_meridian",-71.5],PARAMETER["false_easting",200000],PARAMETER["false_northing",750000],AUTHORITY["EPSG","26986"],AXIS["X",EAST],AXIS["Y",NORTH]]';
var secondProjection = "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs";
//I'm not going to redefine those two in latter examples.
proj4(firstProjection,secondProjection,[2,5]);
// [-2690666.2977344505, 3662659.885459918]


// 如果仅给出1个投影,则假设它是从 WGS84 投影的(来自投影是WGS84)。

proj4(firstProjection,[-71,41]);
// [242075.00535055372, 750123.32090043]

// 如果没有给出坐标,则返回具有两个方法的对象,其方法是`forward`从第一个投影到第二个投影,以及`inverse`从第二个投影到第一个投影。

proj4(firstProjection,secondProjection).forward([2,5]);
// [-2690666.2977344505, 3662659.885459918]
proj4(secondProjection,firstProjection).inverse([2,5]);
// [-2690666.2977344505, 3662659.885459918]

// 如上所述,如果只给出一个投影,则假定它来自wgs84

proj4(firstProjection).forward([-71,41]);
// [242075.00535055372, 750123.32090043]
proj4(firstProjection).inverse([242075.00535055372, 750123.32090043]);
//[-71, 40.99999999999986]
//the floating points to answer your question
  • 命名预测(Named Projections)

如果您希望将投影定义为字符串并以此方式引用它,则可以使用proj4.defs方法,该方法可以通过名称和投影以2种方式调用:

proj4.defs('WGS84', "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees");

或者使用数组

proj4.defs([
  [
    'EPSG:4326',
    '+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees'],
  [
    'EPSG:4269',
    '+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees'
  ]
]);

你可以做

proj4('EPSG:4326');

而不是写出整个proj定义,默认情况下proj4预定义了以下预测:

  • 'EPSG:4326',其中包含以下别名
    • 'WGS84'
  • 'EPSG:4269'
  • 'EPSG:3857',其中包含以下别名
    • 'EPSG:3785'
    • '谷歌'
    • 'EPSG:900913'
      'EPSG:102113'

也可以通过proj4.defs函数(proj4.defs('EPSG:4326'))访问已定义的投影。

proj4.defs也可用于定义命名别名:

proj4.defs('urn:x-ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326'));

Array.prototype.values()

基础语法

arr.values()

返回值说明

values() 方法返回一个新的 Array Iterator 对象,该对象包含数组每个索引的值

详细说明

values() 方法返回一个新的 Array Iterator 对象,该对象包含数组每个索引的值

案例

使用 for...of 循环进行迭代节

let arr = ['w', 'y', 'k', 'o', 'p'];
let eArr = arr.values();
// 您的浏览器必须支持 for..of 循环
// 以及 let —— 将变量作用域限定在 for 循环中
for (let letter of eArr) {
  console.log(letter);
}

另一种迭代方式节

let arr = ['w', 'y', 'k', 'o', 'p'];
let eArr = arr.values();
console.log(eArr.next().value); // w
console.log(eArr.next().value); // y
console.log(eArr.next().value); // k
console.log(eArr.next().value); // o
console.log(eArr.next().value); // p

npm-hat

官方仓库

https://github.com/substack/node-hat

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/hat

image

在线运行地址

https://npm.runkit.com/hat

image

基础介绍

生成随机ID并避免冲突。

基础安装

npm install hat --save   # npm
yarn add hat            # Yarn

基础使用

hat

  • H(baseNum,startNum)Generate a random ID string with bits of data in a base.,根据指定的startNumbaseNum范围个数对应的随机数值,如果不传值,默认是32
  • H(baseNum,startNum)Leading zeros are appended such that all outputs for a given number of bits have equal length.,附加前导零,使得给定位数的所有输出具有相等的长度。
  • 如果传入的baseNum不是一个合法的Number类型值,则会将[]|""|''|null,直接返回"0"
  • 如果传入的baseNumundefined类型值,则会自动忽略,当作形参缺省处理,正常返回随机ID值。
(function (log) {
    const H = require('hat');

    log(H);
    // function()
    // rack: function()
    // Function Prototype
    log(H());// "2a11ba0497cb8c9d61243ab6aad948c8"
    log(H());// "b101d5b44dca0c7be34fe2e32592513b"
    log(H(0));// "0"
    log(H(1));// "0"
    log(H(2));// "2"
    log(H(3));// "5"
    log(H(4));// "d"
    log(H(5));// "04"
    log(H(6));// "10"
    log(H(7));// "3d"
    log(H(8));// "29"
    log(H(9));//"11c"
    log(H(10));// "224"

    log(H(11));// "0bc"
    log(H(12));// "704"
    log(H(13));// "0d0d"
    log(H(14));// "21be"
    log(H(15));// "377d"
    log(H(16));// "e891"
    log(H(17));// "00e20"
    log(H(18));// "117e0"
    log(H(19));// "20839"
    log(H(20));// "ea5f9"

    log(H(128,0));// "468aaf6256d14d329219ea66a5617e17"
    log(H(128,1));// ""
    log(H(128,2));// "11010111010000000111010100000111101000000111001100111001011011011111000110001001111000110111111111001000101110100001001000000111"
    log(H(128,3));// "002212202110101111200220020212111010211001202100201111001011100122200210221211011"
    log(H(128,4));// "1023202012030033000122212132131203133121100020230310323210133131"
    log(H(128,5));// "04343022031344301213044401202131414401421113302101000000"
    log(H(128,6));// "11101444513413120043343153515342535321030341354145"
    log(H(128,7));// "1633056653245315051140151035422133532364552240"
    log(H(128,8));// "3052321255722663165410341715073737345510430"
    log(H(128,9));// "00058884418455810610844078674020404827408"
    log(H(128,10));// "007716621084037155184707023044727723500"

    log(H(128,11));// "0849666425a6aa60a269a177559a4351339835"
    log(H(128,12));// "290349521150209a3125b4b2554a734ba9b3"
    log(H(128,13));// "0939b5bbb38c5625243730cb6a08860c3b2"
    log(H(128,14));// "0a371d9060c5d8d8872547b4397892dab2"
    log(H(128,15));// "7b02a6ee5751abc94eade6a5b48883497"
    log(H(128,16));// "13310d9a99298e22948a73e6bb24bde2"
    log(H(128,17));// "1g3173g17323f91d50bb7c6b059agacb"
    log(H(128,18));// "76d80cdgebb6881he47b4535g091a5f"
    log(H(128,19));// "0fehac26d34i62c1hga0f72185bg30h"
    log(H(128,20));// "412e210aga9bgi07e29cd9ja40312f"

    log(H(678));// "297561f4e5d1c9f643b2c8ef39f5677d7bcb5f8c037a1d3b625653ef2f3c97c2e1281b589b0a4846d9764b0bf43088711b15870c029f935baa8102c91a759633014849633cfe668bc7868a6d994313d6d7a667145a"
    log(H(12,0));// "1d3"
    log(H(12,1));// ""
    log(H(12,2));// "100111010011"
    log(H(12,3));// "00211001"
    log(H(12,4));// "103320"
    log(H(12,5));// "031441"
    log(H(12,6));// "25420"

    log(H([]));// "0"
    log(H({}));// ""
    log(H(undefined));// "18d9cba68ef7328014550b7e240c34c7"

    log(H(""));// "0"
    log(H(''));// "0"
    log(H(null));// "0"
    log(H("123", "hmm"));// ""
    log(H("1234", "hmm"));// ""

})(console.log)

rack

var rack = hat.rack(bits=128, base=16, expandBy)

  • 方法默认返回的是对应存储的唯一标识 rightId
  • 可以通过R.get(rightId),取到之前的存储值
  • 可以通过R.set(rightId,rightValue),重新设置之前的存储值。

Make a new hat rack. Call rack() repeatedly to generate new IDs which are checked for collisions.

If expandBy is specified, increment bits by this amount if too many collisions occur.

If expandBy isn't specified, rack() will throw ,if too many collisions occur during generation.

Optionally call var id = rack(data) to store data at the new ID.

You can get the data out again with rack.get(id) and set the data with rack.set(id, value).

(function (log) {
    const H = require('hat');
    const R1 = H.rack;
    const R2 = R1();

    log(R1);
    // function()
    // name: ""
    // prototype:  {}
    // Function Prototype
    log(R1());
    // function fn()
    // base: 16
    // bits: 128
    // get: function()
    // hats: Object {}
    // set: function()
    // Function Prototype

    log(R2);
    // function fn()
    // base: 16
    // bits: 128
    // get: function()
    // hats: Object {}
    // set: function()
    // Function Prototype
    log(R2());// "915dfe7579419f1a417bfc4dffbe2ffb"

    const rightId = R2();
    log(rightId);// "96f3c79a370b3b29bb32128a580f9506"
    const rightValue = R2.get(rightId);
    log(rightValue);// undefined

    log(R2(0));// "aa9b855e4a75277c528ef66630566eb2"
    log(R2(1));// "647685865791b92a83741e7add0d5968"
    log(R2(2));// "e1838267ab2b8cb30d42e2e1c1725afc"
    log(R2(3));// "0258c5e979357acdbb635289d83136b0"
    log(R2(4));// "0472d180aa33a0702e0b367fd8bf8b00"
    log(R2(5));// "fb1a8b79a58a7e515f23a896b541c699"
    log(R2(6));// "effa788ce7fb8cc249a04ae88e841e68"
    log(R2(7));// "42a26ea4b0b1f00593abda7139257a94"
    log(R2(8));// "ff641ae808c0f48e248925bf2e0286b7"
    log(R2(9));// "879951243b7d65ee4483a1e4766fb475"
    log(R2(10));// "60ae65f401377266e56d4ca5726087e2"

    log(R2(11));// "e7ef0c17f37b97bccfdc301c57aea087"
    log(R2(12));// "6eec7cdfdca57afbf01f2351fd111a71"
    log(R2(13));// "6080ce980a15ea92f60767ae266361bd"
    log(R2(14));// "99f5afbfe8e11283768d62017ebd6177"
    log(R2(15));// "9e3d6d068b9062c45c2337a34dbea7a1"
    log(R2(16));// "3e26615316c7d4902082bc4e004d5dbc"
    log(R2(17));// "a544e68fe907d0cdaaad08cc3e40aec6"
    log(R2(18));// "fee71bcad8f99818294ba033f116b9f7"
    log(R2(19));// "23f0251fb26f83e8afbfd0aca0fce622"
    log(R2(20));// "07f10601200d2b26ab09ee1b05baafdc"

    log(R2(128,0));// "8b42390662bde621eac2a1906bc1d356"
    log(R2(128,1));// "8cc0fd113fe3db1325d6ff13fe294743"
    log(R2(128,2));// "348c0b7cab8ce764b16e8b1d1bda49aa"
    log(R2(128,3));// "4e8ef561ba571d486ec7c45eb87d40a0"
    log(R2(128,4));// "e02294366211cf883d35efdc1ea3d521"
    log(R2(128,5));// "f73081092be46520b6ac276f4806e84a"
    log(R2(128,6));// "ab2aebbe6e9679da4c44b1e6475adec9"
    log(R2(128,7));// "4af80f9e5a5f0bc6e60d05225bc740a5"
    log(R2(128,8));// "33402274f38ee59cc9e4b5190d8966f0"
    log(R2(128,9));// "6000a19ec58a90f12bafc9cdd401ac27"
    log(R2(128,10));// "f833c19abd3ff9f2d10382cbd7aad602"

    log(R2(128,11));// "8cff2080f0d12aabcf1adada2e0b211f"
    log(R2(128,12));// "6035de5490e38c47667e23a44b713fd4"
    log(R2(128,13));// "87839e9d996de1f9b88ab141f06cdf86"
    log(R2(128,14));// "50ecaf07776e7b66d9bccb806c0fbce7"
    log(R2(128,15));// "7e4056399fca3603775518191646387d"
    log(R2(128,16));// "28b907a07a224fa4dcb7435b4842104b"
    log(R2(128,17));// "4ab14a7b150a650249ebf53b5acd14c4"
    log(R2(128,18));// "31fbdfd51f4cc6cc482b8e57a2692570"
    log(R2(128,19));// "616c96a15bb5004df914820576824d38"
    log(R2(128,20));// "818eea78422fd3684aba202feda40c52"

    log(R2(678));// "9a380d85b46e55bcd643901a0a73060d"
    log(R2(12,0));// "b2f4bf683033d1b0a104c8bfd7551053"
    log(R2(12,1));// "2182a5d192b563bc6e9c7b487917acd8"
    log(R2(12,2));// "30ba3945dc79f301c011e3970a1d04db"
    log(R2(12,3));// "9c6b82a2f27a897c61c67fa987296a8e"
    log(R2(12,4));// "87fa18e27a4b1f2401ee66d7ebb76eb0"
    log(R2(12,5));// "29c6a7a024eba1b1f4e380569492c79f"
    log(R2(12,6));// "9f8e4647d26642d3e8fc6b62147c0144"

    log(R2([]));// "6ee2b1dd282e2224043e8cb82ba802f0"
    log(R2({}));// "93b07c07dff5397915eaf2ca8b5a2ac1"
    log(R2(undefined));// "d163a2109e602e8e5744f6e04d109fa2"

    log(R2(""));// "8c0bb7dddf8293898adf771fb18c5709"
    log(R2(''));// "6f0da9b7edfd603e6d0759001140ec1f"
    log(R2(null));// "02ac50802546940c77ff6b0e6bda8e31"
    log(R2("123", "hmm"));// "d36d490ec1779158142006df44d0c540"
    log(R2("1234", "hmm"));// "ec14daf5d4f4a052a16e1902b5d76411"
})(console.log)

Reflect.has()

基础语法

Reflect.has(target, propertyKey)

参数说明

target

目标对象.

propertyKey

属性名,需要检查目标对象是否存在此属性。

返回值描述

Boolean 类型的对象指示是否存在此属性。

如果目标不是 Object,会抛出一个 TypeError

详细描述

Reflect.has 用于检查一个对象是否拥有某个属性, 相当于in 操作符 。

案例

Reflect.has({x: 0}, "x"); // true
Reflect.has({x: 0}, "y"); // false

// 如果该属性存在于原型链中,返回true 
Reflect.has({x: 0}, "toString");

// Proxy 对象的 .has() 句柄方法
obj = new Proxy({}, {
  has(t, k) { return k.startsWith("door"); }
});
Reflect.has(obj, "doorbell"); // true
Reflect.has(obj, "dormitory"); // false

@instructure-uid

官网

https://instructure.design/

image

官方仓库

https://github.com/instructure/instructure-ui

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/@instructure/uid

image

在线运行地址

https://npm.runkit.com/@instructure/uid

image

基础介绍

Instructure Inc.制造的独特(CSS-safe)id生成器。

基础安装

npm i @instructure/uid --save   # npm
yarn add @instructure/uid             # Yarn

基础使用

(function (log) {
    const U = require('@instructure/uid');
    const UID = U.default;
    log(U);// balabala
    // Object
    // default: function()
    // name: "uid"
    // prototype: uid {}
    // Function Prototype
    log(UID);
    // function uid()
    // name: "uid"
    // prototype: uid {}
    // Function Prototype
    log(UID());// "uidULubUPfV2kzy"
    log(UID());// "uid7umxT3VDUxby"

})(console.log)

相关网站

Array.from()

基础语法

Array.from(arrayLike[, mapFn[, thisArg]])

参数说明

arrayLike

想要转换成数组的伪数组对象或可迭代对象。

mapFn (可选参数)

如果指定了该参数,新数组中的每个元素会执行该回调函数。

thisArg (可选参数)

可选参数,执行回调函数 mapFnthis 对象。

返回值说明

一个新的数组实例

详细说明

Array.from() 方法从一个类似数组或可迭代对象中创建一个新的数组实例。

Array.from() 可以通过以下方式来创建数组对象:

  • 伪数组对象(拥有一个 length 属性和若干索引属性的任意对象)
  • 可迭代对象(可以获取对象中的元素,如 MapSet 等)

Array.from() 方法有一个可选参数 mapFn,让你可以在最后生成的数组上再执行一次 map 方法后再返回。也就是说 Array.from(obj, mapFn, thisArg) 就相当于 Array.from(obj).map(mapFn, thisArg), 除非创建的不是可用的中间数组。 这对一些数组的子类,如 typed arrays 来说很重要, 因为中间数组的值在调用 map() 时需要是适当的类型。

from()length 属性为 1 ,即Array.from.length = 1

ES2015 中, Class 语法允许我们为内置类型(比如 Array)和自定义类新建子类(比如叫 SubArray)。这些子类也会继承父类的静态方法,比如 SubArray.from(),调用该方法后会返回子类 SubArray 的一个实例,而不是 Array 的实例。

案例

Array from a String

Array.from('foo'); 
// ["f", "o", "o"]

Array from a Set

let s = new Set(['foo', window]); 
Array.from(s); 
// ["foo", window]

Array from a Map

let m = new Map([[1, 2], [2, 4], [4, 8]]);
Array.from(m); 
// [[1, 2], [2, 4], [4, 8]]

Array from an Array-like object (arguments)

function f() {
  return Array.from(arguments);
}

f(1, 2, 3);

// [1, 2, 3]

在Array.from中使用箭头函数

// Using an arrow function as the map function to
// manipulate the elements
Array.from([1, 2, 3], x => x + x);  
// x => x + x代表这是一个函数,只是省略了其他的定义,这是一种Lambda表达式的写法
// 箭头的意思表示从当前数组中取出一个值,然后自加,并将返回的结果添加到新数组中    
// [2, 4, 6]


// Generate a sequence of numbers
// Since the array is initialized with `undefined` on each position,
// the value of `v` below will be `undefined`
Array.from({length: 5}, (v, i) => i);
// [0, 1, 2, 3, 4]

数组去重合并

function combine(){ 
    let arr = [].concat.apply([], arguments);  //没有去重复的新数组 
    return Array.from(new Set(arr));
} 

var m = [1, 2, 2], n = [2,3,3]; 
console.log(combine(m,n));                     // [1, 2, 3]

Polyfill

ECMA-262 第六版标准添加了 Array.from 。有些实现中可能尚未包括在其中。你可以通过在脚本前添加如下内容作为替代方法,以使用未原生支持的 Array.from 方法。该算法按照 ECMA-262 第六版中的规范实现,并假定 ObjectTypeError 有其本身的值, callback.call 对应 Function.prototype.call 。此外,鉴于无法使用 Polyfill 实现真正的的迭代器,该实现不支持规范中定义的泛型可迭代元素。

// Production steps of ECMA-262, Edition 6, 22.1.2.1
// Reference: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
if (!Array.from) {
  Array.from = (function () {
    var toStr = Object.prototype.toString;
    var isCallable = function (fn) {
      return typeof fn === 'function' || toStr.call(fn) === '[object Function]';
    };
    var toInteger = function (value) {
      var number = Number(value);
      if (isNaN(number)) { return 0; }
      if (number === 0 || !isFinite(number)) { return number; }
      return (number > 0 ? 1 : -1) * Math.floor(Math.abs(number));
    };
    var maxSafeInteger = Math.pow(2, 53) - 1;
    var toLength = function (value) {
      var len = toInteger(value);
      return Math.min(Math.max(len, 0), maxSafeInteger);
    };

    // The length property of the from method is 1.
    return function from(arrayLike/*, mapFn, thisArg */) {
      // 1. Let C be the this value.
      var C = this;

      // 2. Let items be ToObject(arrayLike).
      var items = Object(arrayLike);

      // 3. ReturnIfAbrupt(items).
      if (arrayLike == null) {
        throw new TypeError("Array.from requires an array-like object - not null or undefined");
      }

      // 4. If mapfn is undefined, then let mapping be false.
      var mapFn = arguments.length > 1 ? arguments[1] : void undefined;
      var T;
      if (typeof mapFn !== 'undefined') {
        // 5. else      
        // 5. a If IsCallable(mapfn) is false, throw a TypeError exception.
        if (!isCallable(mapFn)) {
          throw new TypeError('Array.from: when provided, the second argument must be a function');
        }

        // 5. b. If thisArg was supplied, let T be thisArg; else let T be undefined.
        if (arguments.length > 2) {
          T = arguments[2];
        }
      }

      // 10. Let lenValue be Get(items, "length").
      // 11. Let len be ToLength(lenValue).
      var len = toLength(items.length);

      // 13. If IsConstructor(C) is true, then
      // 13. a. Let A be the result of calling the [[Construct]] internal method 
      // of C with an argument list containing the single item len.
      // 14. a. Else, Let A be ArrayCreate(len).
      var A = isCallable(C) ? Object(new C(len)) : new Array(len);

      // 16. Let k be 0.
      var k = 0;
      // 17. Repeat, while k < len… (also steps a - h)
      var kValue;
      while (k < len) {
        kValue = items[k];
        if (mapFn) {
          A[k] = typeof T === 'undefined' ? mapFn(kValue, k) : mapFn.call(T, kValue, k);
        } else {
          A[k] = kValue;
        }
        k += 1;
      }
      // 18. Let putStatus be Put(A, "length", len, true).
      A.length = len;
      // 20. Return A.
      return A;
    };
  }());
}

Reflect.ownKeys()

基础语法

Reflect.ownKeys(target)

参数说明

target

获取自身属性键的目标对象。

返回值描述

由目标对象的自身属性键组成的 Array

如果目标不是 Object,会抛出一个 TypeError

详细描述

静态方法 Reflect.ownKeys() 返回一个由目标对象自身的属性键组成的数组

Reflect.ownKeys 方法返回一个由目标对象自身的属性键组成的数组。它的返回值等同于Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target))

案例

Reflect.ownKeys({z: 3, y: 2, x: 1}); // [ "z", "y", "x" ]
Reflect.ownKeys([]); // ["length"]

var sym = Symbol.for("comet");
var sym2 = Symbol.for("meteor");
var obj = {[sym]: 0, "str": 0, "773": 0, "0": 0,
           [sym2]: 0, "-1": 0, "8": 0, "second str": 0};
Reflect.ownKeys(obj);
// [ "0", "8", "773", "str", "-1", "second str", Symbol(comet), Symbol(meteor) ]
// Indexes in numeric order, 
// strings in insertion order, 
// symbols in insertion order

Array.prototype.find()

基础语法

arr.find(callback[, thisArg])

参数说明

callback

在数组每一项上执行的函数,接收 3 个参数:

- element
   当前遍历到的元素。
- index
   当前遍历到的索引。
- array
   数组本身。

thisArg 可选

可选,指定 callbackthis 参数。

返回值说明

当某个元素通过 callback 的测试时,返回数组中的一个值,否则返回 undefined

详细说明

find() 方法返回数组中满足提供的测试函数的第一个元素的值。否则返回 undefined
另请参见 findIndex() 方法,它返回数组中找到的元素的索引,而不是其值

如果你需要找到一个元素的位置或者一个元素是否存在于数组中,使用Array.prototype.indexOf()Array.prototype.includes()

find 方法对数组中的每一项元素执行一次 callback 函数,直至有一个 callback 返回 true。当找到了这样一个元素后,该方法会立即返回这个元素的值,否则返回 undefined。注意 callback 函数会为数组中的每个索引调用即从 0length - 1,而不仅仅是那些被赋值的索引,这意味着对于稀疏数组来说,该方法的效率要低于那些只遍历有值的索引的方法。

callback 函数带有3个参数:当前元素的值当前元素的索引,以及数组本身

如果提供了 thisArg 参数,那么它将作为每次 callback 函数执行时的上下文对象,否则上下文对象为 undefined

find 方法不会改变数组。

在第一次调用 callback 函数时会确定元素的索引范围,因此在 find 方法开始执行之后添加到数组的新元素将不会被 callback 函数访问到。如果数组中一个尚未被callback函数访问到的元素的值被callback函数所改变,那么当callback函数访问到它时,它的值是将是根据它在数组中的索引所访问到的当前值。被删除的元素仍旧会被访问到。

案例

用对象的属性查找数组里的对象

var inventory = [
    {name: 'apples', quantity: 2},
    {name: 'bananas', quantity: 0},
    {name: 'cherries', quantity: 5}
];

function findCherries(fruit) { 
    return fruit.name === 'cherries';
}

console.log(inventory.find(findCherries)); // { name: 'cherries', quantity: 5 }

寻找数组中的质数

下面的例子展示了如何从一个数组中寻找质数(如果找不到质数则返回undefined

function isPrime(element, index, array) {
  var start = 2;
  while (start <= Math.sqrt(element)) {
    if (element % start++ < 1) {
      return false;
    }
  }
  return element > 1;
}

console.log([4, 6, 8, 12].find(isPrime)); // undefined, not found
console.log([4, 5, 8, 12].find(isPrime)); // 5

当在回调中删除数组中的一个值时,当访问到这个位置时,其传入的值时 undefined:

// Declare array with no element at index 2, 3 and 4
var a = [0,1,,,,5,6];

// Shows all indexes, not just those that have been assigned values
a.find(function(value, index) {
  console.log('Visited index ' + index + ' with value ' + value); 
});

// Shows all indexes, including deleted
a.find(function(value, index) {

  // Delete element 5 on first iteration
  if (index == 0) {
    console.log('Deleting a[5] with value ' + a[5]);
    delete a[5];  // 注:这里只是将a[5]设置为undefined,可以试试用a.pop()删除最后一项,依然会遍历到被删的那一项
  }
  // Element 5 is still visited even though deleted
  console.log('Visited index ' + index + ' with value ' + value);
});

Polyfill

如果您需要兼容不支持Object.definePropertyJavaScript引擎,那么最好不要对Array.prototype方法进行 polyfill ,因为您无法使其成为不可枚举的。

// https://tc39.github.io/ecma262/#sec-array.prototype.find
if (!Array.prototype.find) {
  Object.defineProperty(Array.prototype, 'find', {
    value: function(predicate) {
     // 1. Let O be ? ToObject(this value).
      if (this == null) {
        throw new TypeError('"this" is null or not defined');
      }

      var o = Object(this);

      // 2. Let len be ? ToLength(? Get(O, "length")).
      var len = o.length >>> 0;

      // 3. If IsCallable(predicate) is false, throw a TypeError exception.
      if (typeof predicate !== 'function') {
        throw new TypeError('predicate must be a function');
      }

      // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
      var thisArg = arguments[1];

      // 5. Let k be 0.
      var k = 0;

      // 6. Repeat, while k < len
      while (k < len) {
        // a. Let Pk be ! ToString(k).
        // b. Let kValue be ? Get(O, Pk).
        // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
        // d. If testResult is true, return kValue.
        var kValue = o[k];
        if (predicate.call(thisArg, kValue, k, o)) {
          return kValue;
        }
        // e. Increase k by 1.
        k++;
      }

      // 7. Return undefined.
      return undefined;
    }
  });
}

Reflect.defineProperty()

基础语法

Reflect.defineProperty(target, propertyKey, attributes)

参数说明

target

目标对象。

propertyKey

要定义或修改的属性的名称。

attributes

要定义或修改的属性的描述。

返回值描述

Boolean 值指示了属性是否被成功定义。

如果目标不是 Object,会抛出一个 TypeError

详细描述

静态方法 Reflect.defineProperty() 基本等同于 Object.defineProperty() 方法,唯一不同是返回 Boolean 值。

Reflect.defineProperty 方法允许精确添加或修改对象上的属性。更多的细节请参阅 Object.definePropertyObject.defineProperty 返回一个对象,或者如果属性没有被成功定义,抛出一个 TypeError 。 相比之下Reflect.defineProperty方法,只是简单地返回一个 Boolean 说明该属性是否被成功定义。

案例

使用 Reflect.defineProperty()节

const student = {};
Reflect.defineProperty(student, "name", {value: "Mike"}); // true
student.name; // "Mike"

检查属性是否被成功定义节

Object.defineProperty 方法,如果成功则返回一个对象,否则抛出一个 TypeError 。另外,当定义一个属性时,你也可以使用 try...catch 块去捕获其中任何的错误。而因为 Reflect.defineProperty 返回 Boolean 值作为成功的状态,所以你也可以只使用 if...else

if (Reflect.defineProperty(target, property, attributes)) {
  // 成功
} else {
  // 失败
}

xtend

官方仓库

https://github.com/Raynos/xtend

image

官方npm地址

依赖包地址

https://www.npmjs.com/package/xtend

image

在线运行地址

https://npm.runkit.com/xtend

image

基础介绍

xtend是一个基本的实用程序库,它允许您通过附加列表中每个对象的所有属性来扩展对象。当存在相同的属性时,最右边的属性优先。

基础安装

npm i xtend -S

基础使用

简单合并两个不同对象

(function (log) {
    const X = require('xtend');
    let a = { a: "foo" };
    let b = { b: "bar" };

    log(X(a, b));// Object {a: "foo", b: "bar"}
})(console.log)

合并存在相同属性的对象

(function (log) {
    const X = require('xtend');
    let a = { a: "foo" };
    let b = { a: "bar" };

    log(X(a, b));// Object { a: "bar" })
    log(X(b, a));// Object { a: "foo" })
})(console.log)

简单合并空对象和有值对象

(function (log) {
    const X = require('xtend');
    let record = {};

    log(X(record, { foo: "bar" }));// Object {foo: "bar"}
})(console.log)

简单合并存在undefined属性值的两个对象

(function (log) {
    const X = require('xtend');
    let a = { a: undefined };
    let b = { b: "bar" };

    log(X(a, b));// Object { a: undefined, b: "bar" }
    log(X(b, a));// Object { a: undefined, b: "bar" }
})(console.log)

简单合并存在null属性值的多个对象

就是如果合并的对象中,存在非法对象值,则自动忽略。

(function (log) {
    const X = require('xtend');
    let a = { foo: "bar" };
    let b = null;
    let c = void 0;

    log(X(b, a, c));// Object { foo: "bar" }
})(console.log)

简单合并null prototype对象和有值对象

通过Object.create(xx)的对象属性值设置是有效的,能够正常合并。

(function (log) {
    const X = require('xtend');
    let a = { a: "foo" };
    let b = Object.create(null)
    b.b = "bar";

    log(X(a, b));// Object { a: "foo", b: "bar" }
})(console.log)

简单合并字符串对象和有值对象

字符串对象可能存在原型污染的两个对象。

如果转入的是未作序列化的字符串对象,则按照字符串每一个对应索引生成对应对象

(function (log) {
    const X = require('xtend');
    let a = { a: "foo" };
    log(a);// Object {a: "foo"}

    let maliciousPayload = '{"__proto__":{"oops":"It works!"}}';

    log(X({}, maliciousPayload));
    //Object
    // 0: "{"
    // 1: "\""
    // 2: "_"
    // 3: "_"
    // 4: "p"
    // 5: "r"
    // 6: "o"
    // 7: "t"
    // 8: "o"
    // 9: "_"
    // 10: "_"
    // 11: "\""
    // 12: ":"
    // 13: "{"
    // 14: "\""
    // 15: "o"
    // 16: "o"
    // 17: "p"
    // 18: "s"
    // 19: "\""
    // 20: ":"
    // 21: "\""
    // 22: "I"
    // 23: "t"
    // 24: " "
    // 25: "w"
    // 26: "o"
    // 27: "r"
    // 28: "k"
    // 29: "s"
    // 30: "!"
    // 31: "\""
    // 32: "}"
    // 33: "}"
    log(a);// { a: "foo" }
})(console.log)

相关网站

learn-Nginx-on-window

Nginx功能概述

HTTP基础功能

  • 处理静态文件,索引文件以及自动索引。
  • 反向代理加速(无缓存),简单的负载均衡和容错。
  • FastCGI,简单的负载均衡和容错。
  • 模块化的结构。过滤器包括gzipping, byte ranges, chunked responses, 以及 SSI-filter 。在SSI过滤器中,到同一个 proxy 或者 FastCGI 的多个子请求并发处理。
  • SSLTLS SNI 支持。

IMAP/POP3 代理服务功能

  • 使用外部 HTTP 认证服务器重定向用户到 IMAP/POP3 后端。
  • 使用外部 HTTP 认证服务器认证用户后连接重定向到内部的 SMTP 后端。
  • SSL 支持,在 IMAPPOP3 模式下的 STARTTLSSTLS 支持。

认证方法

  • POP3: POP3 USER/PASS, APOP, AUTH LOGIN PLAIN CRAM-MD5;
  • IMAP: IMAP LOGIN;
  • SMTP: AUTH LOGIN PLAIN CRAM-MD5;

支持的操作系统

  • FreeBSD 3.x, 4.x, 5.x, 6.x i386; FreeBSD 5.x, 6.x amd64;
  • Linux 2.2, 2.4, 2.6 i386; Linux 2.6 amd64;
  • Solaris 8 i386; Solaris 9 i386 and sun4u; Solaris 10 i386;
  • MacOS X (10.4) PPC;

结构与扩展

  • 一个主进程和多个工作进程。工作进程是单线程的,且不需要特殊授权即可运行。
  • kqueue (FreeBSD 4.1+), epoll (Linux 2.6+), rt signals (Linux 2.2.19+), /dev/poll (Solaris 7 11/99+), select, 以及 poll 支持。
  • kqueue支持的不同功能包括 EV_CLEAR, EV_DISABLE (临时禁止事件), NOTE_LOWAT, EV_EOF, 有效数据的数目,错误代码。
  • sendfile (FreeBSD 3.1+), sendfile (Linux 2.2+), sendfile64 (Linux 2.4.21+), 和 sendfilev (Solaris 8 7/01+) 支持。
  • 输入过滤 (FreeBSD 4.1+) 以及 TCP_DEFER_ACCEPT (Linux 2.4+) 支持。
  • 10,000 非活动的 HTTP keep-alive 连接仅需要 2.5M 内存。
  • 最小化的数据拷贝操作。

其他HTTP功能

  • 基于IP 和名称的虚拟主机服务。
  • MemcachedGET 接口。
  • 支持 keep-alive 和管道连接。
  • 灵活简单的配置。
  • 重新配置和在线升级而无须中断客户的工作进程。
  • 可定制的访问日志,日志写入缓存,以及快捷的日志回卷。
  • 4xx-5xx 错误代码重定向。
  • 基于 PCRErewrite 重写模块。
  • 基于客户端 IP 地址和 HTTP 基本认证的访问控制。
  • PUT, DELETE, 和 MKCOL 方法。
  • 支持 FLV (Flash 视频)。
  • 带宽限制。

实验特性

  • 内嵌的perl
  • 通过aio_read() / aio_write()的套接字工作的实验模块,仅在 FreeBSD 下。
  • 对线程的实验化支持,FreeBSD 4.x 的实现基于 rfork()

英语站点

Nginx 主要的英语站点是 http://sysoev.ru/en/

Array.prototype.entries()

基础语法

arr.entries()

返回值说明

一个新的 Array 迭代器对象。Array Iterator是对象,它的原型(__proto__:Array Iterator)上有一个next方法,可用用于遍历迭代器取得原数组的[key,value]

详细说明

entries() 方法返回一个新的Array Iterator对象,该对象包含数组中每个索引的键/值对

案例

筛选排除掉所有的小值

下例使用 filter 创建了一个新数组,该数组的元素由原数组中值大于 10 的元素组成。

Array Iterator

var arr = ["a", "b", "c"];
var iterator = arr.entries();
console.log(iterator);

/*Array Iterator {}
         __proto__:Array Iterator
         next:ƒ next()
         Symbol(Symbol.toStringTag):"Array Iterator"
         __proto__:Object
*/

iterator.next()节

var arr = ["a", "b", "c"]; 
var iterator = arr.entries();
console.log(iterator.next());

/*{value: Array(2), done: false}
          done:false
          value:(2) [0, "a"]
           __proto__: Object
*/
// iterator.next()返回一个对象,对于有元素的数组,
// 是next{ value: Array(2), done: false };
// next.done 用于指示迭代器是否完成:在每次迭代时进行更新而且都是false,
// 直到迭代器结束done才是true。
// next.value是一个["key":"value"]的数组,是返回的迭代器中的元素值。

iterator.next方法运行节

var arr = ["a", "b", "c"];
var iter = arr.entries();
var a = [];

// for(var i=0; i< arr.length; i++){   // 实际使用的是这个 
for(var i=0; i< arr.length+1; i++){    // 注意,是length+1,比数组的长度大
    var tem = iter.next();             // 每次迭代时更新next
    console.log(tem.done);             // 这里可以看到更新后的done都是false
    if(tem.done !== true){             // 遍历迭代器结束done才是true
        console.log(tem.value);
        a[i]=tem.value;
    }
}

console.log(a);                      // 遍历完毕,输出next.value的数组

二维数组按行排序节

function sortArr(arr) {
    var goNext = true;
    var entries = arr.entries();
    while (goNext) {
        var result = entries.next();
        if (result.done !== true) {
            result.value[1].sort((a, b) => a - b);
            goNext = true;
        } else {
            goNext = false;
        }
    }
    return arr;
}

var arr = [[1,34],[456,2,3,44,234],[4567,1,4,5,6],[34,78,23,1]];
sortArr(arr);

/*(4) [Array(2), Array(5), Array(5), Array(4)]
    0:(2) [1, 34]
    1:(5) [2, 3, 44, 234, 456]
    2:(5) [1, 4, 5, 6, 4567]
    3:(4) [1, 23, 34, 78]
    length:4
    __proto__:Array(0)
*/

5、使用for…of 循环节

var arr = ["a", "b", "c"];
var iterator = arr.entries();
// undefined

for (let e of iterator) {
    console.log(e);
}

// [0, "a"]
// [1, "b"]
// [2, "c"]

class 构造类

基础描述

ECMAScript 2015 中引入的 JavaScript 类实质上是 JavaScript 现有的基于原型的继承的语法糖。类语法不会为JavaScript引入新的面向对象的继承模型

类实际上是个特殊的函数,就像你能够定义的函数表达式函数声明一样,类语法有两个组成部分:类表达式类声明

类声明

定义一个类的一种方法是使用一个类声明。要声明一个,你可以使用带有class关键字的类名(这里是Rectangle)。

class Rectangle {
  constructor(height, width) {
    this.height = height;
    this.width = width;
  }
}

作用域提升

函数声明类声明之间的一个重要区别是函数声明提升类声明不会。你首先需要声明你的类,然后访问它,否则像下面的代码会抛出一个ReferenceError

const p = Reflect.construct(Rectangle);
// ReferenceError Rectangle is not defined

class Rectangle {}

类表达式

一个类表达式是定义一个类的另一种方式类表达式可以是被命名的或匿名的。赋予一个命名类表达式的名称是类的主体的本地名称`。

/* 匿名类 */
const Rectangle = class {
  constructor(height, width) {
    this.height = height;
    this.width = width;
  }
};

/* 命名的类 */
const Rectangle = class Rectangle {
  constructor(height, width) {
    this.height = height;
    this.width = width;
  }
};

注意: 类表达式也同样受到类声明中提到的提升问题的困扰


详细说明

一个类的类体是一对花括号/大括号 {} 中的部分。这是你定义类成员的位置,如方法构造函数

类声明类表达式的主体都执行在严格模式下。比如,构造函数静态方法原型方法gettersetter都在严格模式下执行。

定义类属性

constructor方法是一个特殊的方法,其用于创建和初始化使用class创建的一个对象。一个类只能拥有一个名为 constructor的特殊方法。如果类包含多个constructor的方法,则将抛出 一个SyntaxError


定义类方法

定义原型方法

(function(log, assert) {
  class Rectangle {
      // constructor
      constructor(height, width) {
          this.height = height;
          this.width = width;
      }
      // Getter
      get area() {
          return this.calcArea()
      }
      // Method
      calcArea() {
          return this.height * this.width;
      }
  }
  const square = Reflect.construct(Rectangle,[10, 10]);
  log(square.area);// 100
})(console.log, console.assert)

定义静态方法

static 关键字用来定义一个类的一个静态方法。调用静态方法不需要实例化,但不能通过一个类实例调用静态方法静态方法通常用于为一个应用程序创建工具函数。

(function(log, assert) {
  class Point {
      constructor(x, y) {
          this.x = x;
          this.y = y;
      }

      static distance(a, b) {
          const dx = a.x - b.x;
          const dy = a.y - b.y;

          return Math.hypot(dx, dy);
      }
      static log(msg) {
        log(msg)
      }
  }

  const p1 = Reflect.construct(Point,[5, 5]);
  const p2 = Reflect.construct(Point,[10, 10]);

  log(Point.distance(p1, p2));// 7.0710678118654755
  Point.log(0);// 0
  p1.log(1);// TypeError: p1.log is not a function
  p2.log(2);// TypeError: p2.log is not a function
})(console.log, console.assert)

原型静态方法包装

当一个对象调用静态原型方法时,如果该对象没有this值(或this作为布尔字符串数字未定义null) ,那么this值在被调用的函数内部将为 undefined。不会发生自动包装

即使我们以非严格模式编写代码,它的行为也是一样的,因为所有的函数方法构造函数getterssetters都在严格模式下执行。因此如果我们没有指定this的值,this值将为undefined

(function(log, assert) {
  class Animal {
    speak() {
      return this;
    }
    static eat() {
      return this;
    }
  }

  const obj = Reflect.construct(Animal,[]);
  log(obj.speak()); // Animal {}
  const speak = obj.speak;
  log(speak()); // undefined

  log(Animal.eat());
//  输出class的全部代码
//   class Animal {
//       speak() {
//         return this;
//       }
//       static eat() {
//         return this;
//       }
//     }

  const eat = Animal.eat;
  log(eat()); // undefined
})(console.log, console.assert)

如果我们使用传统的基于函数的类来编写上述代码,那么基于调用该函数的this值将发生自动装箱。

(function(log, assert) {
  function Animal() { }

  Animal.prototype.speak = function() {
    return this;
  }

  Animal.eat = function() {
    return this;
  }

  const obj = Reflect.construct(Animal,[]);
  log(obj.speak()); // Animal {}
  log(obj.speak()); // Animal {}
  const speak = obj.speak;
  log(speak()); // Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, parent: Window, …}

  log(Animal.eat());
//  输出Animal方法的全部代码
//   ƒ Animal() { }

  const eat = Animal.eat;
  log(eat()); // Window {postMessage: ƒ, blur: ƒ, focus: ƒ, close: ƒ, parent: Window, …}
})(console.log, console.assert)

子类

基础声明

使用 extends 创建子类extends 关键字在类声明类表达式中用于创建一个类作为另一个的一个子类

(function(log, assert) {
  class Animal {
    constructor(name) {
      this.name = name;
    }

    speak() {
      console.log(this.name + ' makes a noise.');
    }
  }

  class Dog extends Animal {
    speak() {
     log(this.name + ' barks.');
    }
  }

  const d = Reflect.construct(Dog,['Mitzie']);
  
  d.speak();// 'Mitzie barks.'
})(console.log, console.assert)

如果子类中存在构造函数,则需要在使用this之前首先调用 super()

也可以扩展传统的基于函数的

(function(log, assert) {
  function Animal (name) {
    this.name = name;  
  }
  Animal.prototype.speak = function () {
    console.log(this.name + ' makes a noise.');
  }

  class Dog extends Animal {
    speak() {
      super.speak();
      log(this.name + ' barks.');
    }
  }

  const d = Reflect.construct(Dog,['Mitzie']);

  d.speak();// Mitzie makes a noise.\n 'Mitzie barks.'
})(console.log, console.assert)

请注意,不能继承常规(非可构造)对象。如果要继承常规对象,可以改用Object.setPrototypeOf()

(function(log, assert) {
  const Animal = {
    aa:1,
    bb:2,
    speak() {
      log(`${this.name} makes a noise.  ${this.bb}`);
    }
  };

  class Dog {
    constructor(name) {
      log(this.aa);// 1
      this.bb = name;
      this.name = name;
    }
  }

  Object.setPrototypeOf(Dog.prototype, Animal);// If you do not do this you will get a TypeError when you invoke speak

  const d = Reflect.construct(Dog,['Mitzie']);
  d.speak(); // Mitzie makes a noise.  Mitzie
})(console.log, console.assert)

Species

你可能希望在派生数组类 MyArray 中返回 Array对象。这种 species 方式允许你覆盖默认的构造函数。

例如,当使用像map()返回默认构造函数的方法时,您希望这些方法返回一个父Array对象,而不是MyArray对象。Symbol.species 符号可以让你这样做:

(function(log, assert) {
  class MyArray extends Array {
    // Overwrite species to the parent Array constructor
    static get [Symbol.species]() { return Array; }
  }
  const a = Reflect.construct(MyArray,[1,2,3]);
  const mapped = a.map(x => x * x);

  log(mapped instanceof MyArray); 
  // false
  log(mapped instanceof Array);   
  // true
})(console.log, console.assert)

Mix-ins

抽象子类或者 mix-ins模板。 一个 ECMAScript 类只能有一个单超类,所以想要从工具类来多重继承的行为是不可能的。子类继承的只能是父类提供的功能性。因此,例如,从工具类的多重继承是不可能的。该功能必须由超类提供。

一个以超类作为输入的函数和一个继承该超类子类作为输出可以用于在ECMAScript中实现混合:

const calculatorMixin = Base => class extends Base {
  calc() { }
};

const randomizerMixin = Base => class extends Base {
  randomize() { }
};

使用 mix-ins 的类可以像下面这样写:

class Foo { }
class Bar extends calculatorMixin(randomizerMixin(Foo)) { }

子类调用父类方法

直接通过super 关键字来调用一个父类的原型函数

class Cat {
  constructor(name) {
    this.name = name;
  }
  
  speak() {
    console.log(this.name + ' makes a noise.');
  }
}

class Lion extends Cat {
  speak() {
    super.speak();
    console.log(this.name + ' roars.');
  }
}

直接通过super 关键字来调用一个父类的静态函数

class Human {
  constructor() {}
  static ping() {
    return 'ping';
  }
}

class Computer extends Human {
  constructor() {}
  static pingpong() {
    return super.ping() + ' pong';
  }
}
Computer.pingpong(); // 'ping pong'

在调用了super函数之后,通过this调用父类的原型函数

(function(log, assert) {
  class Polygon {
    constructor(height, width) {
      this.name = 'Polygon';
      this.height = height;
      this.width = width;
    }
    sayName() {
      log('Hi, I am a ', this.name + '.');
    }
  }

  class Square extends Polygon {
    constructor(length) {
      /*
      这里,它调用父类的构造函数的 length, 
      作为Polygon 的 width和 height.
      */
      super(length, length);

      /*
      注意: 在派生的类中, 在你可以使用'this'之前, 必须先调用super()。
      忽略这, 这将导致引用错误。
      */
      this.name = 'Square';
    }

    get area() {
      this.sayName();//// Hi, I am a  Square.
      return this.height * this.width;
    }

    set area(value) {
      this.area = value;
    }
  }
  const temp = Reflect.construct(Square,[4]);
  log(temp.area);//16
})(console.log, console.assert)

删除 super 上的属性将抛出异常

你不能使用 deconste 操作符 加 super.prop 或者 super[expr] 去删除父类的属性,这样做会抛出 ReferenceError

(function(log, assert) {
  class Base {
    constructor() {}
    foo() {}
  }
  class Derived extends Base {
    constructor() {}
    delete() {
      delete super.foo;
    }
  }

  // Reflect.construct(Derived()).delete(); // TypeError: Class constructor Derived cannot be invoked without 'new'
  new Derived().delete();
  // ReferenceError: Must call super constructor in derived class before accessing 'this' or returning from derived constructor
})(console.log, console.assert)

Super.prop 不能覆写不可写属性

当使用 Object.defineProperty 定义一个属性为不可写时,super将不能重写这个属性的值。

(function(log, assert) {
  class X {
    constructor() {
      Object.defineProperty(this, "prop", {
        configurable: true,
        writable: false,
        value: 1
      });
    }
    f() {
      super.prop = 2;
    }
  }

  const x = Reflect.construct(X,[]);
  log(x.prop);
  // 1
  x.f();
  // TypeError: Cannot assign to read only property 'prop' of object '#<X>'

})(console.log, console.assert)

对象字面量中使用super.prop

Super也可以在object initializer / literal 符号中使用。在下面的例子中,两个对象各定义了一个方法。在第二个对象中, 我们使用super调用了第一个对象中的方法。

当然,这需要我们先利用 Object.setPrototypeOf()obj2的原型加到obj1上,然后才能够使用super调用 obj1上的method1

(function(log, assert) {
  const obj1 = {
    method1() {
      log("method 1");
    }
  }

  const obj2 = {
    method2() {
     super.method1();
    }
  }

  Object.setPrototypeOf(obj2, obj1);
  obj2.method2(); 
  // logs "method 1"

})(console.log, console.assert)

coding webide

欢迎来到 Cloud Studio

在这里,您可以方便的使用您的专用主机进行开发。

我们为您准备了三种语言的小示例来展现 Cloud Studio 的功能。分别是 Java, PHP 和 Python。

Python Demo

Python2 Demo

Python 目录下有可以获取当前时间与 IP 的代码,我们以此为例展示 python2 的使用。

  1. 请先在终端中输入 cd python 切换到 python 目录。

  2. 直接在下方终端中输入 python hello.py 查看运行效果吧。

Python3 Demo

Python 目录下有贪吃蛇小游戏的代码,我们以此为例展示 python3 的使用。

  1. 请先在终端中输入 cd python 切换到 python 目录,已在该目录下的请忽略。

  2. 在终端中输入 python3 snake.py 开始玩贪吃蛇小游戏吧。

注:如果想要使用 pip3 请运行:

sudo apt-get update
sudo apt-get install python3-pip
sudo python3 -m pip install --upgrade pip
pip3 --version

PHP Demo

PHP 目录下有一个示例代码,我们以此为例展示 PHP 环境的使用。

  1. 请先在终端中输入 cd php 切换到 php 目录。

  2. 运行 php -S 0.0.0.0:8080 启动 PHP 内置的 web server。
    image

  3. 启动之后,在右边的【访问链接】侧边栏中点击 8080 端口号旁边的加号,就可以生成一个访问链接,
    点击访问链接,就可以看到我们的示例页面了。

图片
图片

Java Demo

Java 目录下有一个 spring boot 的 demo 代码,我们以此为例展示 java 环境的使用。

  1. 请先在终端中输入 cd java 切换到 java 目录。

  2. 直接运行 mvn spring-boot:run 启动服务。(第一次运行时需要下载依赖,可能会花较长时间,请耐心等待)

Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/mockito/mockito-core/2.15.0/mockito-core-2.15.0.pom (16 KB at 82.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.pom (12 KB at 63.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-parent/1.7.11/byte-buddy-parent-1.7.11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-parent/1.7.11/byte-buddy-parent-1.7.11.pom (26 KB at 109.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-agent/1.7.11/byte-buddy-agent-1.7.11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-agent/1.7.11/byte-buddy-agent-1.7.11.pom (5 KB at 25.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis/2.6/objenesis-2.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis/2.6/objenesis-2.6.pom (3 KB at 14.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis-parent/2.6/objenesis-parent-2.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis-parent/2.6/objenesis-parent-2.6.pom (17 KB at 90.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom (820 B at 4.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.pom (6 KB at 25.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.pom (3 KB at 13.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-test/5.0.5.RELEASE/spring-test-5.0.5.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-test/5.0.5.RELEASE/spring-test-5.0.5.RELEASE.pom (16 KB at 81.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-core/2.5.1/xmlunit-core-2.5.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-core/2.5.1/xmlunit-core-2.5.1.pom (2 KB at 9.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-parent/2.5.1/xmlunit-parent-2.5.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-parent/2.5.1/xmlunit-parent-2.5.1.pom (16 KB at 80.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-web/2.0.1.RELEASE/spring-boot-starter-web-2.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-web/2.0.1.RELEASE/spring-boot-starter-web-2.0.1.RELEASE.pom (4 KB at 16.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-json/2.0.1.RELEASE/spring-boot-starter-json-2.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-json/2.0.1.RELEASE/spring-boot-starter-json-2.0.1.RELEASE.pom (4 KB at 15.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-web/5.0.5.RELEASE/spring-web-5.0.5.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-web/5.0.5.RELEASE/spring-web-5.0.5.RELEASE.pom (19 KB at 107.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.pom (6 KB at 32.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/jackson-base/2.9.5/jackson-base-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/jackson-base/2.9.5/jackson-base-2.9.5.pom (6 KB at 29.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.pom (2 KB at 9.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/jackson-parent/2.9.0/jackson-parent-2.9.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/jackson-parent/2.9.0/jackson-parent-2.9.0.pom (8 KB at 40.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/oss-parent/28/oss-parent-28.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/oss-parent/28/oss-parent-28.pom (20 KB at 104.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.pom (4 KB at 16.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.5/jackson-datatype-jdk8-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.5/jackson-datatype-jdk8-2.9.5.pom (2 KB at 9.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-modules-java8/2.9.5/jackson-modules-java8-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-modules-java8/2.9.5/jackson-modules-java8-2.9.5.pom (3 KB at 12.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.5/jackson-datatype-jsr310-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.5/jackson-datatype-jsr310-2.9.5.pom (5 KB at 20.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.5/jackson-module-parameter-names-2.9.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.5/jackson-module-parameter-names-2.9.5.pom (4 KB at 20.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-tomcat/2.0.1.RELEASE/spring-boot-starter-tomcat-2.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-tomcat/2.0.1.RELEASE/spring-boot-starter-tomcat-2.0.1.RELEASE.pom (3 KB at 16.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-core/8.5.29/tomcat-embed-core-8.5.29.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-core/8.5.29/tomcat-embed-core-8.5.29.pom (2 KB at 7.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-el/8.5.29/tomcat-embed-el-8.5.29.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-el/8.5.29/tomcat-embed-el-8.5.29.pom (2 KB at 7.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.29/tomcat-embed-websocket-8.5.29.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.29/tomcat-embed-websocket-8.5.29.pom (2 KB at 8.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/tomcat-annotations-api/8.5.29/tomcat-annotations-api-8.5.29.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/tomcat-annotations-api/8.5.29/tomcat-annotations-api-8.5.29.pom (2 KB at 7.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator/6.0.9.Final/hibernate-validator-6.0.9.Final.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator/6.0.9.Final/hibernate-validator-6.0.9.Final.pom (20 KB at 109.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator-parent/6.0.9.Final/hibernate-validator-parent-6.0.9.Final.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator-parent/6.0.9.Final/hibernate-validator-parent-6.0.9.Final.pom (58 KB at 239.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/arquillian/arquillian-bom/1.1.11.Final/arquillian-bom-1.1.11.Final.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/arquillian/arquillian-bom/1.1.11.Final/arquillian-bom-1.1.11.Final.pom (11 KB at 62.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/shrinkwrap-bom/1.2.3/shrinkwrap-bom-1.2.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/shrinkwrap-bom/1.2.3/shrinkwrap-bom-1.2.3.pom (4 KB at 16.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/resolver/shrinkwrap-resolver-bom/2.2.0/shrinkwrap-resolver-bom-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/resolver/shrinkwrap-resolver-bom/2.2.0/shrinkwrap-resolver-bom-2.2.0.pom (6 KB at 30.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-bom/2.0.0-alpha-8/shrinkwrap-descriptors-bom-2.0.0-alpha-8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/shrinkwrap/descriptors/shrinkwrap-descriptors-bom/2.0.0-alpha-8/shrinkwrap-descriptors-bom-2.0.0-alpha-8.pom (6 KB at 31.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.pom (12 KB at 67.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.pom (7 KB at 29.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/jboss-parent/15/jboss-parent-15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/jboss-parent/15/jboss-parent-15.pom (31 KB at 121.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/classmate/1.3.4/classmate-1.3.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/classmate/1.3.4/classmate-1.3.4.pom (6 KB at 27.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/oss-parent/24/oss-parent-24.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/oss-parent/24/oss-parent-24.pom (19 KB at 90.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-webmvc/5.0.5.RELEASE/spring-webmvc-5.0.5.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-webmvc/5.0.5.RELEASE/spring-webmvc-5.0.5.RELEASE.pom (14 KB at 81.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.1.RELEASE/spring-boot-starter-thymeleaf-2.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.1.RELEASE/spring-boot-starter-thymeleaf-2.0.1.RELEASE.pom (3 KB at 14.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.pom (12 KB at 60.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.pom (11 KB at 54.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.pom (10 KB at 46.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.pom (10 KB at 33.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.pom (13 KB at 38.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/ognl/ognl/3.1.12/ognl-3.1.12.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/ognl/ognl/3.1.12/ognl-3.1.12.pom (6 KB at 22.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.pom (10 KB at 39.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter/2.0.1.RELEASE/spring-boot-starter-2.0.1.RELEASE.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot/2.0.1.RELEASE/spring-boot-2.0.1.RELEASE.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-context/5.0.5.RELEASE/spring-context-5.0.5.RELEASE.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-autoconfigure/2.0.1.RELEASE/spring-boot-autoconfigure-2.0.1.RELEASE.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-logging/2.0.1.RELEASE/spring-boot-starter-logging-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter/2.0.1.RELEASE/spring-boot-starter-2.0.1.RELEASE.jar (592 B at 1.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-logging/2.0.1.RELEASE/spring-boot-starter-logging-2.0.1.RELEASE.jar (613 B at 1.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar (284 KB at 284.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot/2.0.1.RELEASE/spring-boot-2.0.1.RELEASE.jar (906 KB at 643.0 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar (461 KB at 328.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-context/5.0.5.RELEASE/spring-context-5.0.5.RELEASE.jar (1066 KB at 733.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-autoconfigure/2.0.1.RELEASE/spring-boot-autoconfigure-2.0.1.RELEASE.jar (1128 KB at 696.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-core/5.0.5.RELEASE/spring-core-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-to-slf4j/2.10.0/log4j-to-slf4j-2.10.0.jar (18 KB at 10.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-jcl/5.0.5.RELEASE/spring-jcl-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar (5 KB at 2.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-jcl/5.0.5.RELEASE/spring-jcl-5.0.5.RELEASE.jar (22 KB at 11.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-test/2.0.1.RELEASE/spring-boot-starter-test-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar (26 KB at 12.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-test/2.0.1.RELEASE/spring-boot-test-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-test/2.0.1.RELEASE/spring-boot-starter-test-2.0.1.RELEASE.jar (636B at 0.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-test-autoconfigure/2.0.1.RELEASE/spring-boot-test-autoconfigure-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-test/2.0.1.RELEASE/spring-boot-test-2.0.1.RELEASE.jar (191 KB at 59.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-test-autoconfigure/2.0.1.RELEASE/spring-boot-test-autoconfigure-2.0.1.RELEASE.jar (153 KB at 28.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/minidev/json-smart/2.3/json-smart-2.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/jayway/jsonpath/json-path/2.4.0/json-path-2.4.0.jar (218 KB at 40.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/minidev/accessors-smart/1.2/accessors-smart-1.2.jar (30 KB at 5.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/logging/log4j/log4j-api/2.10.0/log4j-api-2.10.0.jar (250 KB at 41.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar (41 KB at 6.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/junit/junit/4.12/junit-4.12.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/minidev/json-smart/2.3/json-smart-2.3.jar (118 KB at 17.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/assertj/assertj-core/3.9.1/assertj-core-3.9.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar (53 KB at 7.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/mockito/mockito-core/2.15.0/mockito-core-2.15.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/yaml/snakeyaml/1.19/snakeyaml-1.19.jar (291 KB at 32.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/junit/junit/4.12/junit-4.12.jar (308 KB at 29.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-agent/1.7.11/byte-buddy-agent-1.7.11.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy-agent/1.7.11/byte-buddy-agent-1.7.11.jar (42 KB at 3.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis/2.6/objenesis-2.6.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/objenesis/objenesis/2.6/objenesis-2.6.jar (55 KB at 4.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar (44 KB at 3.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/mockito/mockito-core/2.15.0/mockito-core-2.15.0.jar (530 KB at 37.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.jar (52 KB at 3.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/vaadin/external/google/android-json/0.0.20131108.vaadin1/android-json-0.0.20131108.vaadin1.jar (18 KB at 1.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-test/5.0.5.RELEASE/spring-test-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/skyscreamer/jsonassert/1.5.0/jsonassert-1.5.0.jar (30 KB at 1.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-core/2.5.1/xmlunit-core-2.5.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/xmlunit/xmlunit-core/2.5.1/xmlunit-core-2.5.1.jar (154 KB at 9.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-web/2.0.1.RELEASE/spring-boot-starter-web-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-web/2.0.1.RELEASE/spring-boot-starter-web-2.0.1.RELEASE.jar (588 Bat 0.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-json/2.0.1.RELEASE/spring-boot-starter-json-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-json/2.0.1.RELEASE/spring-boot-starter-json-2.0.1.RELEASE.jar (645B at 0.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-core/5.0.5.RELEASE/spring-core-5.0.5.RELEASE.jar (1198 KB at 66.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-test/5.0.5.RELEASE/spring-test-5.0.5.RELEASE.jar (586 KB at 31.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar (65 KB at 3.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.5/jackson-datatype-jdk8-2.9.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.5/jackson-datatype-jdk8-2.9.5.jar (33 KB at 1.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.5/jackson-datatype-jsr310-2.9.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-core/2.9.5/jackson-core-2.9.5.jar (315 KB at 13.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.5/jackson-module-parameter-names-2.9.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.5/jackson-module-parameter-names-2.9.5.jar (9 KB at 0.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-tomcat/2.0.1.RELEASE/spring-boot-starter-tomcat-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.5/jackson-datatype-jsr310-2.9.5.jar (98 KB at 4.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-core/8.5.29/tomcat-embed-core-8.5.29.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-tomcat/2.0.1.RELEASE/spring-boot-starter-tomcat-2.0.1.RELEASE.jar (591 B at 0.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-el/8.5.29/tomcat-embed-el-8.5.29.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-el/8.5.29/tomcat-embed-el-8.5.29.jar (235 KB at 8.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.29/tomcat-embed-websocket-8.5.29.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-websocket/8.5.29/tomcat-embed-websocket-8.5.29.jar (251 KB at 7.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator/6.0.9.Final/hibernate-validator-6.0.9.Final.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/jackson/core/jackson-databind/2.9.5/jackson-databind-2.9.5.jar (1311 KB at 32.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar (91 KB at 2.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/net/bytebuddy/byte-buddy/1.7.11/byte-buddy-1.7.11.jar (2861 KB at 65.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar (65 KB at 1.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-web/5.0.5.RELEASE/spring-web-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/fasterxml/classmate/1.3.4/classmate-1.3.4.jar (64 KB at 1.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-beans/5.0.5.RELEASE/spring-beans-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/hibernate/validator/hibernate-validator/6.0.9.Final/hibernate-validator-6.0.9.Final.jar (1105 KB at 20.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-webmvc/5.0.5.RELEASE/spring-webmvc-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-web/5.0.5.RELEASE/spring-web-5.0.5.RELEASE.jar (1226 KB at 22.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-aop/5.0.5.RELEASE/spring-aop-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-beans/5.0.5.RELEASE/spring-beans-5.0.5.RELEASE.jar (645 KB at 11.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-expression/5.0.5.RELEASE/spring-expression-5.0.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/assertj/assertj-core/3.9.1/assertj-core-3.9.1.jar (3822 KB at 68.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.1.RELEASE/spring-boot-starter-thymeleaf-2.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-thymeleaf/2.0.1.RELEASE/spring-boot-starter-thymeleaf-2.0.1.RELEASE.jar (612 B at 0.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf-spring5/3.0.9.RELEASE/thymeleaf-spring5-3.0.9.RELEASE.jar (171 KB at 2.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-expression/5.0.5.RELEASE/spring-expression-5.0.5.RELEASE.jar (272 KB at 4.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/thymeleaf/3.0.9.RELEASE/thymeleaf-3.0.9.RELEASE.jar (849 KB at 13.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-aop/5.0.5.RELEASE/spring-aop-5.0.5.RELEASE.jar (358 KB at 5.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/unbescape/unbescape/1.1.5.RELEASE/unbescape-1.1.5.RELEASE.jar (162 KB at 2.5 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/spring-webmvc/5.0.5.RELEASE/spring-webmvc-5.0.5.RELEASE.jar (772 KB at 11.9 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/thymeleaf/extras/thymeleaf-extras-java8time/3.0.1.RELEASE/thymeleaf-extras-java8time-3.0.1.RELEASE.jar (39 KB at 0.6 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/attoparser/attoparser/2.0.4.RELEASE/attoparser-2.0.4.RELEASE.jar (228 KB at 3.5 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/tomcat/embed/tomcat-embed-core/8.5.29/tomcat-embed-core-8.5.29.jar (3029 KB at 45.5 KB/sec)
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ studio-demo ---
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom (3 KB at 14.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.0/maven-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.0/maven-3.0.pom (22 KB at 91.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/15/maven-parent-15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/15/maven-parent-15.pom (24 KB at 119.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/6/apache-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/6/apache-6.pom (13 KB at 82.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.0/maven-model-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.0/maven-model-3.0.pom (4 KB at 20.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.pom (4 KB at 15.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.6/plexus-2.0.6.pom (17 KB at 59.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.pom (2 KB at 8.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.pom (6 KB at 19.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-plexus/1.4.2/guice-plexus-1.4.2.pom (4 KB at 10.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-bean/1.4.2/guice-bean-1.4.2.pom (3 KB at 9.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject/1.4.2/sisu-inject-1.4.2.pom (2 KB at 6.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-parent/1.4.2/sisu-parent-1.4.2.pom (8 KB at 37.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/6/forge-parent-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/6/forge-parent-6.pom (11 KB at 58.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.pom (748 B at 4.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.6/plexus-containers-1.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.6/plexus-containers-1.6.pom (4 KB at 22.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3.2/plexus-3.3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3.2/plexus-3.3.2.pom (22 KB at 93.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/17/spice-parent-17.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/17/spice-parent-17.pom (7 KB at 35.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/10/forge-parent-10.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/10/forge-parent-10.pom (14 KB at 84.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.pom (4 KB at 26.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.pom (4 KB at 21.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.pom (6 KB at 35.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7.pom (11 KB at 70.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.0/maven-core-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.0/maven-core-3.0.pom (7 KB at 43.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.0/maven-settings-3.0.pom (2 KB at 10.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.pom (3 KB at 12.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.pom (910 B at 5.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.1.18/plexus-components-1.1.18.pom (6 KB at 32.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.7/plexus-2.0.7.pom (17 KB at 109.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.pom (3 KB at 17.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/12/spice-parent-12.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/12/spice-parent-12.pom (7 KB at 46.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/4/forge-parent-4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/4/forge-parent-4.pom (9 KB at 55.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.5/plexus-utils-1.5.5.pom (6 KB at 33.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.11/plexus-1.0.11.pom (9 KB at 55.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.pom (3 KB at 13.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.pom (2 KB at 11.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.pom (3 KB at 13.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.pom (3 KB at 14.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-api/1.7/aether-api-1.7.pom (2 KB at 9.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-parent/1.7/aether-parent-1.7.pom (8 KB at 48.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-util/1.7/aether-util-1.7.pom (3 KB at 14.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.pom (4 KB at 22.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.pom (2 KB at 10.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.pom (5 KB at 27.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/4.0/plexus-4.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/4.0/plexus-4.0.pom (21 KB at 73.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.pom (6 KB at 28.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/30/maven-shared-components-30.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/30/maven-shared-components-30.pom (5 KB at 30.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.pom (6 KB at 24.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/21/maven-shared-components-21.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/21/maven-shared-components-21.pom (5 KB at 28.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/25/maven-parent-25.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/25/maven-parent-25.pom (37 KB at 143.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/15/apache-15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/15/apache-15.pom (15 KB at 75.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.4/commons-io-2.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.4/commons-io-2.4.pom (10 KB at 57.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/25/commons-parent-25.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/25/commons-parent-25.pom (48 KB at 180.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/9/apache-9.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/9/apache-9.pom (15 KB at 69.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom (965 B at 5.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.pom (2 KB at 8.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.3.1/plexus-components-1.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.3.1/plexus-components-1.3.1.pom (3 KB at 16.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3.1/plexus-3.3.1.pom (20 KB at 103.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.pom (4 KB at 19.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/15/spice-parent-15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/15/spice-parent-15.pom (9 KB at 51.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/5/forge-parent-5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/forge/forge-parent/5/forge-parent-5.pom (9 KB at 48.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom (8 KB at 48.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom (12 KB at 55.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.0/maven-core-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.jar (48 KB at 125.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.0/maven-settings-builder-3.0.jar (37 KB at 58.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-plexus/1.4.2/sisu-inject-plexus-1.4.2.jar (197 KB at 282.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar (150 KB at 174.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.0/maven-repository-metadata-3.0.jar (30 KB at 33.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.0/maven-model-builder-3.0.jar (145 KB at 141.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.0/maven-aether-provider-3.0.jar (50 KB at 43.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-api/1.7/aether-api-1.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-impl/1.7/aether-impl-1.7.jar (104 KB at 88.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-spi/1.7/aether-spi-1.7.jar (14 KB at 11.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar (461 KB at 382.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.6/plexus-component-annotations-1.6.jar (5 KB at 3.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.3/plexus-classworlds-2.2.3.jar (46 KB at 32.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-api/1.7/aether-api-1.7.jar (73 KB at 51.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar (106 KB at 74.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.0/maven-settings-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar (28 KB at 18.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.0/maven-model-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar (14 KB at 8.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.0/maven-settings-3.0.jar (46 KB at 28.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.0/maven-artifact-3.0.jar (51 KB at 30.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-filtering/3.1.1/maven-filtering-3.1.1.jar (50 KB at 27.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.4/commons-io-2.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.0/maven-model-3.0.jar (161 KB at 86.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.4/commons-io-2.4.jar (181 KB at 85.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.24/plexus-utils-3.0.24.jar (242 KB at 106.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.jar (32 KB at 13.6 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar (9 KB at 3.6 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.22/plexus-interpolation-1.22.jar (76 KB at 29.3 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.0.0/maven-shared-utils-3.0.0.jar (152 KB at 55.8 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.0/maven-core-3.0.jar (515 KB at 80.2 KB/sec)
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ studio-demo ---
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.pom (5 KB at 27.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.5/commons-io-2.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.5/commons-io-2.5.pom (13 KB at 76.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/39/commons-parent-39.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/39/commons-parent-39.pom (61 KB at 207.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/16/apache-16.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/16/apache-16.pom (16 KB at 91.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.pom (5 KB at 27.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/19/maven-shared-components-19.pom (7 KB at 37.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/23/maven-parent-23.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/23/maven-parent-23.pom (32 KB at 156.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/13/apache-13.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/13/apache-13.pom (14 KB at 80.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.2.1/maven-plugin-api-2.2.1.pom (2 KB at 8.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.2.1/maven-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.2.1/maven-2.2.1.pom (22 KB at 138.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/11/maven-parent-11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/11/maven-parent-11.pom (32 KB at 155.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/5/apache-5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/5/apache-5.pom (5 KB at 26.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/2.2.1/maven-core-2.2.1.pom (12 KB at 70.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.2.1/maven-settings-2.2.1.pom (3 KB at 12.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.2.1/maven-model-2.2.1.pom (4 KB at 19.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.5.15/plexus-utils-1.5.15.pom (7 KB at 41.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.pom (889 B at 5.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.1.14/plexus-components-1.1.14.pom (6 KB at 33.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom (2 KB at 7.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-jdk14/1.5.6/slf4j-jdk14-1.5.6.pom (2 KB at 9.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-parent/1.5.6/slf4j-parent-1.5.6.pom (8 KB at 45.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.pom (3 KB at 17.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jcl-over-slf4j/1.5.6/jcl-over-slf4j-1.5.6.pom (3 KB at 13.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.2.1/maven-profile-2.2.1.pom (3 KB at 12.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.2.1/maven-artifact-2.2.1.pom (2 KB at 9.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.2.1/maven-repository-metadata-2.2.1.pom (2 KB at 11.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-error-diagnostics/2.2.1/maven-error-diagnostics-2.2.1.pom (2 KB at 10.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.2.1/maven-project-2.2.1.pom (3 KB at 15.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.2.1/maven-artifact-manager-2.2.1.pom (4 KB at 19.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.pom (880 B at 5.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.2.1/maven-plugin-registry-2.2.1.pom (2 KB at 10.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-descriptor-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-descriptor/2.2.1/maven-plugin-descriptor-2.2.1.pom (3 KB at 13.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-monitor/2.2.1/maven-monitor-2.2.1.pom (2 KB at 7.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.1/maven-shared-utils-0.1.pom (4 KB at 23.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/18/maven-shared-components-18.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/18/maven-shared-components-18.pom (5 KB at 29.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/22/maven-parent-22.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/22/maven-parent-22.pom (30 KB at 151.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/11/apache-11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/11/apache-11.pom (15 KB at 84.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-java/0.9.2/plexus-java-0.9.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-java/0.9.2/plexus-java-0.9.2.pom (3 KB at 14.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-languages/0.9.2/plexus-languages-0.9.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-languages/0.9.2/plexus-languages-0.9.2.pom (3 KB at 13.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.pom (2 KB at 10.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm-parent/6.0_BETA/asm-parent-6.0_BETA.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm-parent/6.0_BETA/asm-parent-6.0_BETA.pom (6 KB at 33.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/thoughtworks/qdox/qdox/2.0-M7/qdox-2.0-M7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/thoughtworks/qdox/qdox/2.0-M7/qdox-2.0-M7.pom (16 KB at 90.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/oss/oss-parent/9/oss-parent-9.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/oss/oss-parent/9/oss-parent-9.pom (7 KB at 41.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-api/2.8.2/plexus-compiler-api-2.8.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-api/2.8.2/plexus-compiler-api-2.8.2.pom (867 B at 4.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler/2.8.2/plexus-compiler-2.8.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler/2.8.2/plexus-compiler-2.8.2.pom (5 KB at 28.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/4.0/plexus-components-4.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/4.0/plexus-components-4.0.pom (3 KB at 17.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.pom (4 KB at 21.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-manager/2.8.2/plexus-compiler-manager-2.8.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-manager/2.8.2/plexus-compiler-manager-2.8.2.pom (692 B at 4.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-javac/2.8.2/plexus-compiler-javac-2.8.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-javac/2.8.2/plexus-compiler-javac-2.8.2.pom (771 B at 4.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compilers/2.8.2/plexus-compilers-2.8.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compilers/2.8.2/plexus-compilers-2.8.2.pom (2 KB at 6.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.5/commons-io-2.5.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-incremental/1.1/maven-shared-incremental-1.1.jar (14 KB at 52.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-java/0.9.2/plexus-java-0.9.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar (60 KB at 133.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-java/0.9.2/plexus-java-0.9.2.jar (31 KB at 66.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/thoughtworks/qdox/qdox/2.0-M7/qdox-2.0-M7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/3.1.0/maven-shared-utils-3.1.0.jar (160 KB at 284.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-api/2.8.2/plexus-compiler-api-2.8.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/2.5/commons-io-2.5.jar (204 KB at 329.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-manager/2.8.2/plexus-compiler-manager-2.8.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.0.4/plexus-utils-2.0.4.jar (217 KB at 318.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-javac/2.8.2/plexus-compiler-javac-2.8.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/ow2/asm/asm/6.0_BETA/asm-6.0_BETA.jar (56 KB at 77.5 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-api/2.8.2/plexus-compiler-api-2.8.2.jar (26 KB at 32.5 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-manager/2.8.2/plexus-compiler-manager-2.8.2.jar (5 KB at 5.6 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-compiler-javac/2.8.2/plexus-compiler-javac-2.8.2.jar (20 KB at 22.2 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/thoughtworks/qdox/qdox/2.0-M7/qdox-2.0-M7.jar (308 KB at 274.7 KB/sec)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/coding/workspace/java/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ studio-demo ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/coding/workspace/java/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ studio-demo ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/coding/workspace/java/target/test-classes
[INFO]
[INFO] <<< spring-boot-maven-plugin:2.0.1.RELEASE:run (default-cli) < test-compile @ studio-demo <<<
[INFO]
[INFO] --- spring-boot-maven-plugin:2.0.1.RELEASE:run (default-cli) @ studio-demo ---
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.0.1.RELEASE/spring-boot-loader-tools-2.0.1.RELEASE.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.0.1.RELEASE/spring-boot-loader-tools-2.0.1.RELEASE.pom (3 KB at 11.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.14/commons-compress-1.14.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.14/commons-compress-1.14.pom (13 KB at 78.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/42/commons-parent-42.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/42/commons-parent-42.pom (67 KB at 222.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.pom (5 KB at 27.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/20/maven-shared-components-20.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/20/maven-shared-components-20.pom (5 KB at 29.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/24/maven-parent-24.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/24/maven-parent-24.pom (37 KB at 177.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/14/apache-14.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/14/apache-14.pom (15 KB at 88.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.pom (4 KB at 22.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.0.3/plexus-containers-1.0.3.pom (492 B at 2.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.4/plexus-1.0.4.pom (6 KB at 33.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.pom (7 KB at 42.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.pom (4 KB at 17.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-jdk14/1.7.25/slf4j-jdk14-1.7.25.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/slf4j-jdk14/1.7.25/slf4j-jdk14-1.7.25.pom (1008 B at 6.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.pom (959 B at 6.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting-api/2.2.1/maven-reporting-api-2.2.1.pom (2 KB at 10.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting/2.2.1/maven-reporting-2.2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/reporting/maven-reporting/2.2.1/maven-reporting-2.2.1.pom (2 KB at 8.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia-sink-api/1.1/doxia-sink-api-1.1.pom (2 KB at 12.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia/1.1/doxia-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia/1.1/doxia-1.1.pom (15 KB at 88.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/doxia/doxia-logging-api/1.1/doxia-logging-api-1.1.pom (2 KB at 7.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.0-alpha-30/plexus-container-default-1.0-alpha-30.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.0-alpha-30/plexus-container-default-1.0-alpha-30.pom (4 KB at 22.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.0-alpha-30/plexus-containers-1.0-alpha-30.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.0-alpha-30/plexus-containers-1.0-alpha-30.pom (2 KB at 11.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.5/plexus-utils-1.4.5.pom (3 KB at 13.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/1.2-alpha-9/plexus-classworlds-1.2-alpha-9.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/1.2-alpha-9/plexus-classworlds-1.2-alpha-9.pom (4 KB at 20.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/1.0.10/plexus-1.0.10.pom (9 KB at 51.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-cli/commons-cli/1.2/commons-cli-1.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-cli/commons-cli/1.2/commons-cli-1.2.pom (8 KB at 41.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/11/commons-parent-11.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/11/commons-parent-11.pom (25 KB at 142.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/4/apache-4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/4/apache-4.pom (5 KB at 26.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.pom (7 KB at 27.3KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/classworlds/classworlds/1.1/classworlds-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/classworlds/classworlds/1.1/classworlds-1.1.pom (4 KB at 19.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.pom (5 KB at 27.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.pom (5 KB at 23.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.3/plexus-components-1.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.3/plexus-components-1.3.pom (3 KB at 18.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3/plexus-3.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.3/plexus-3.3.pom (20 KB at 122.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.20/plexus-utils-3.0.20.pom (4 KB at 21.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.pom (3 KB at 15.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.2/plexus-components-1.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-components/1.2/plexus-components-1.2.pom (3 KB at 17.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/3.2/plexus-3.2.pom (19 KB at 120.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.9/commons-compress-1.9.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.9/commons-compress-1.9.pom (12 KB at 55.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/34/commons-parent-34.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/34/commons-parent-34.pom (55 KB at 240.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.pom (2 KB at 8.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.1.1/maven-artifact-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.1.1/maven-artifact-3.1.1.pom (2 KB at 12.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.1.1/maven-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/3.1.1/maven-3.1.1.pom (22 KB at 126.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/3.0.15/plexus-utils-3.0.15.pom (4 KB at 18.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.1.1/maven-core-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.1.1/maven-core-3.1.1.pom (8 KB at 38.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.1.1/maven-model-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.1.1/maven-model-3.1.1.pom (5 KB at 26.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.1.1/maven-settings-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.1.1/maven-settings-3.1.1.pom (3 KB at 13.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.1.1/maven-settings-builder-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.1.1/maven-settings-builder-3.1.1.pom (3 KB at 14.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.19/plexus-interpolation-1.19.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.19/plexus-interpolation-1.19.pom (2 KB at 5.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.pom (815 B at 4.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.5.5/plexus-containers-1.5.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.5.5/plexus-containers-1.5.5.pom (5 KB at 20.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.1.1/maven-repository-metadata-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.1.1/maven-repository-metadata-3.1.1.pom (3 KB at 12.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.1.1/maven-plugin-api-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.1.1/maven-plugin-api-3.1.1.pom (4 KB at 19.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.0.0.M5/org.eclipse.sisu.plexus-0.0.0.M5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.0.0.M5/org.eclipse.sisu.plexus-0.0.0.M5.pom (5 KB at 23.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-plexus/0.0.0.M5/sisu-plexus-0.0.0.M5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-plexus/0.0.0.M5/sisu-plexus-0.0.0.M5.pom (13 KB at 70.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.pom (2 KB at 7.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-api-parent/1.0/weld-api-parent-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-api-parent/1.0/weld-api-parent-1.0.pom (3 KB at 11.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-api-bom/1.0/weld-api-bom-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-api-bom/1.0/weld-api-bom-1.0.pom (8 KB at 40.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-parent/6/weld-parent-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jboss/weld/weld-parent/6/weld-parent-6.pom (21 KB at 86.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.pom (1023 B at 5.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/inject/javax.inject/1/javax.inject-1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/inject/javax.inject/1/javax.inject-1.pom (612 B at 3.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/10.0.1/guava-10.0.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/10.0.1/guava-10.0.1.pom (6 KB at 30.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava-parent/10.0.1/guava-parent-10.0.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava-parent/10.0.1/guava-parent-10.0.1.pom (2 KB at 10.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.pom (965 B at 5.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0.pom (10 KB at 47.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-parent/3.1.0/guice-parent-3.1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/inject/guice-parent/3.1.0/guice-parent-3.1.0.pom (11 KB at 61.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/aopalliance/aopalliance/1.0/aopalliance-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/aopalliance/aopalliance/1.0/aopalliance-1.0.pom (363 B at 2.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.pom (3 KB at 13.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-inject/0.0.0.M5/sisu-inject-0.0.0.M5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/sisu-inject/0.0.0.M5/sisu-inject-0.0.0.M5.pom (14 KB at 63.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.pom (4 KB at 18.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.pom (4 KB at 20.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/16/spice-parent-16.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/spice/spice-parent/16/spice-parent-16.pom (9 KB at 40.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.1.1/maven-model-builder-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.1.1/maven-model-builder-3.1.1.pom (3 KB at 15.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.1.1/maven-aether-provider-3.1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.1.1/maven-aether-provider-3.1.1.pom (4 KB at 17.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.pom (2 KB at 8.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether/0.9.0.M2/aether-0.9.0.M2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether/0.9.0.M2/aether-0.9.0.M2.pom (28 KB at 118.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-spi/0.9.0.M2/aether-spi-0.9.0.M2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-spi/0.9.0.M2/aether-spi-0.9.0.M2.pom (2 KB at 9.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.pom (2 KB at 8.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-impl/0.9.0.M2/aether-impl-0.9.0.M2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-impl/0.9.0.M2/aether-impl-0.9.0.M2.pom (4 KB at 15.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.pom (5 KB at 22.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.pom (4 KB at 16.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/17/maven-shared-components-17.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-components/17/maven-shared-components-17.pom (9 KB at 36.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/21/maven-parent-21.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/21/maven-parent-21.pom (26 KB at 83.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/10/apache-10.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/apache/10/apache-10.pom (15 KB at 51.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.0.8/maven-artifact-2.0.8.pom (2 KB at 7.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.0.8/maven-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.0.8/maven-2.0.8.pom (12 KB at 41.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/6/maven-parent-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-parent/6/maven-parent-6.pom (20 KB at 107.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.6/plexus-utils-1.4.6.pom (3 KB at 12.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.0.8/maven-model-2.0.8.pom (4 KB at 17.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.pom (3 KB at 14.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.0.8/maven-settings-2.0.8.pom (3 KB at 10.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.pom (2 KB at 10.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.pom (3 KB at 14.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.0.8/maven-repository-metadata-2.0.8.pom (2 KB at 8.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.pom (2 KB at 9.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.pom (2 KB at 7.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.pom (3 KB at 14.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.2/plexus-classworlds-2.2.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.2.2/plexus-classworlds-2.2.2.pom (4 KB at 23.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.3/plexus-2.0.3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.3/plexus-2.0.3.pom (16 KB at 83.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.pom (3 KB at 14.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean/3.4/xbean-3.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean/3.4/xbean-3.4.pom (19 KB at 85.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/log4j/log4j/1.2.12/log4j-1.2.12.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/log4j/log4j/1.2.12/log4j-1.2.12.pom (145 B at 0.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.pom (6 KB at 27.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/collections/google-collections/1.0/google-collections-1.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/collections/google-collections/1.0/google-collections-1.0.pom (3 KB at 11.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/google/1/google-1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/google/1/google-1.pom (2 KB at 8.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.pom (8 KB at 38.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-plugins/24/maven-plugins-24.pom (11 KB at 56.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.4/plexus-component-annotations-1.5.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.4/plexus-component-annotations-1.5.4.pom (815 B at 4.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.5.4/plexus-containers-1.5.4.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-containers/1.5.4/plexus-containers-1.5.4.pom (5 KB at 17.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.5/plexus-2.0.5.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus/2.0.5/plexus-2.0.5.pom (17 KB at 85.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-compat/3.0/maven-compat-3.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-compat/3.0/maven-compat-3.0.pom (4 KB at 19.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.pom (2 KB at 7.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon/1.0-beta-6/wagon-1.0-beta-6.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon/1.0-beta-6/wagon-1.0-beta-6.pom (13 KB at 54.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/1.4.2/plexus-utils-1.4.2.pom (2 KB at 9.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.3.1/asm-3.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.3.1/asm-3.3.1.pom (266 B at 1.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-parent/3.3.1/asm-parent-3.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-parent/3.3.1/asm-parent-3.3.1.pom (5 KB at 24.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.3.1/asm-commons-3.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.3.1/asm-commons-3.3.1.pom (417 B at 2.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.3.1/asm-tree-3.3.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.3.1/asm-tree-3.3.1.pom (406 B at 1.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jdom/jdom/1.1/jdom-1.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jdom/jdom/1.1/jdom-1.1.pom (3 KB at 9.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.pom (7 KB at 28.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.2.0/maven-project-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.2.0/maven-project-2.2.0.pom (3 KB at 12.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.2.0/maven-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven/2.2.0/maven-2.2.0.pom (22 KB at 118.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.2.0/maven-settings-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/2.2.0/maven-settings-2.2.0.pom (3 KB at 12.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.2.0/maven-model-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/2.2.0/maven-model-2.2.0.pom (4 KB at 0.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.2.0/maven-profile-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.2.0/maven-profile-2.2.0.pom (3 KB at 8.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.2.0/maven-artifact-manager-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.2.0/maven-artifact-manager-2.2.0.pom (4 KB at 11.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.2.0/maven-repository-metadata-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/2.2.0/maven-repository-metadata-2.2.0.pom (2 KB at 6.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.2.0/maven-artifact-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/2.2.0/maven-artifact-2.2.0.pom (2 KB at 5.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.2.0/maven-plugin-registry-2.2.0.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.2.0/maven-plugin-registry-2.2.0.pom (2 KB at 6.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/vafer/jdependency/0.7/jdependency-0.7.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/vafer/jdependency/0.7/jdependency-0.7.pom (8 KB at 21.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/1.3.2/commons-io-1.3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/1.3.2/commons-io-1.3.2.pom (10 KB at 28.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/3/commons-parent-3.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-parent/3/commons-parent-3.pom (12 KB at 37.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.2/asm-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.2/asm-3.2.pom (264 B at 1.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-parent/3.2/asm-parent-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-parent/3.2/asm-parent-3.2.pom (5 KB at 15.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-analysis/3.2/asm-analysis-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-analysis/3.2/asm-analysis-3.2.pom (417 B at 1.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.2/asm-tree-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.2/asm-tree-3.2.pom (404 B at 1.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.2/asm-commons-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.2/asm-commons-3.2.pom (415 B at 0.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-util/3.2/asm-util-3.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-util/3.2/asm-util-3.2.pom (409 B at 0.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/11.0.2/guava-11.0.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/11.0.2/guava-11.0.2.pom (6 KB at 25.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava-parent/11.0.2/guava-parent-11.0.2.pom
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava-parent/11.0.2/guava-parent-11.0.2.pom (2 KB at 8.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.0.1.RELEASE/spring-boot-loader-tools-2.0.1.RELEASE.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.14/commons-compress-1.14.jar
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-archiver/2.6/maven-archiver-2.6.jar (23 KB at 61.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.1.1/maven-artifact-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-interpolation/1.21/plexus-interpolation-1.21.jar (61 KB at 108.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.1.1/maven-core-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-loader-tools/2.0.1.RELEASE/spring-boot-loader-tools-2.0.1.RELEASE.jar (145KB at 218.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.1.1/maven-settings-builder-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact/3.1.1/maven-artifact-3.1.1.jar (52 KB at 67.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.1.1/maven-repository-metadata-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-shared-utils/0.7/maven-shared-utils-0.7.jar (167 KB at 218.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.1.1/maven-model-builder-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/commons/commons-compress/1.14/commons-compress-1.14.jar (518 KB at 513.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.1.1/maven-aether-provider-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings-builder/3.1.1/maven-settings-builder-3.1.1.jar (41 KB at 40.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-spi/0.9.0.M2/aether-spi-0.9.0.M2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-repository-metadata/3.1.1/maven-repository-metadata-3.1.1.jar (25 KB at 22.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-impl/0.9.0.M2/aether-impl-0.9.0.M2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model-builder/3.1.1/maven-model-builder-3.1.1.jar (156 KB at 128.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-spi/0.9.0.M2/aether-spi-0.9.0.M2.jar (18 KB at 13.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-aether-provider/3.1.1/maven-aether-provider-3.1.1.jar (59 KB at 43.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.0.0.M5/org.eclipse.sisu.plexus-0.0.0.M5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-core/3.1.1/maven-core-3.1.1.jar (545 KB at 380.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-impl/0.9.0.M2/aether-impl-0.9.0.M2.jar (142 KB at 89.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.jar (131 KB at 80.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/javax/inject/javax.inject/1/javax.inject-1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar (44 KB at 25.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar (131 KB at 70.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.plexus/0.0.0.M5/org.eclipse.sisu.plexus-0.0.0.M5.jar (192 KB at 103.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar (6 KB at 3.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/javax/inject/javax.inject/1/javax.inject-1.jar (3 KB at 1.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/aopalliance/aopalliance/1.0/aopalliance-1.0.jar (5 KB at 2.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.1.1/maven-model-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-classworlds/2.5.1/plexus-classworlds-2.5.1.jar (49 KB at 21.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.1.1/maven-plugin-api-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar (5 KB at 1.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.1.1/maven-settings-3.1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar (350 KB at 153.4 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar (285 KB at 120.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-settings/3.1.1/maven-settings-3.1.1.jar (41 KB at 16.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-profile/2.0.8/maven-profile-2.0.8.jar (35 KB at 12.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar (114 KB at 39.3 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-api/3.1.1/maven-plugin-api-3.1.1.jar (44 KB at 14.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-artifact-manager/2.0.8/maven-artifact-manager-2.0.8.jar (56 KB at 18.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-plugin-registry/2.0.8/maven-plugin-registry-2.0.8.jar (29 KB at 9.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/log4j/log4j/1.2.12/log4j-1.2.12.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar (131 KB at 36.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/log4j/log4j/1.2.12/log4j-1.2.12.jar (350 KB at 94.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/collections/google-collections/1.0/google-collections-1.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar (31 KB at 8.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar (44 KB at 11.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-io/2.3.2/plexus-io-2.3.2.jar (73 KB at 17.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-model/3.1.1/maven-model-3.1.1.jar (151 KB at 28.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-compat/3.0/maven-compat-3.0.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-archiver/2.8.1/plexus-archiver-2.8.1.jar (140 KB at 25.7 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/plugins/maven-shade-plugin/2.2/maven-shade-plugin-2.2.jar (98 KB at 16.9 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.3.1/asm-3.3.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/wagon/wagon-provider-api/1.0-beta-6/wagon-provider-api-1.0-beta-6.jar (52 KB at 8.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.3.1/asm-commons-3.3.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-commons/3.3.1/asm-commons-3.3.1.jar (38 KB at 5.8 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.3.1/asm-tree-3.3.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm/3.3.1/asm-3.3.1.jar (43 KB at 6.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/jdom/jdom/1.1/jdom-1.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-tree/3.3.1/asm-tree-3.3.1.jar (22 KB at 3.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar (59 KB at 8.2 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/org/vafer/jdependency/0.7/jdependency-0.7.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/vafer/jdependency/0.7/jdependency-0.7.jar (12 KB at 1.6 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.jar (212 KB at 28.0 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-analysis/3.2/asm-analysis-3.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar (86 KB at 10.5 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-util/3.2/asm-util-3.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-analysis/3.2/asm-analysis-3.2.jar (18 KB at 2.1 KB/sec)
Downloading: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/11.0.2/guava-11.0.2.jar
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/asm/asm-util/3.2/asm-util-3.2.jar (36 KB at 4.2 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/apache/maven/maven-compat/3.0/maven-compat-3.0.jar (279 KB at 32.0 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/org/jdom/jdom/1.1/jdom-1.1.jar (150 KB at 13.8 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/collections/google-collections/1.0/google-collections-1.0.jar (625 KB at 56.4 KB/sec)
Downloaded: http://maven.aliyun.com/nexus/content/groups/public/com/google/guava/guava/11.0.2/guava-11.0.2.jar (1610 KB at 117.3 KB/sec)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.1.RELEASE)

2018-04-21 15:27:18.091  INFO 678 --- [           main] c.c.studiodemo.StudioDemoApplication     : Starting StudioDemoApplication on coding.ide with PID 678 (/home/coding/workspace/java/target/classes started by coding in /home/coding/workspace/java)
2018-04-21 15:27:18.102  INFO 678 --- [           main] c.c.studiodemo.StudioDemoApplication     : No active profile set, falling back to default profiles: default
2018-04-21 15:27:18.314  INFO 678 --- [           main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6b87a646: startup date [Sat Apr 21 15:27:18 UTC 2018]; root of context hierarchy
2018-04-21 15:27:22.045  INFO 678 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8081 (http)
2018-04-21 15:27:22.137  INFO 678 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-04-21 15:27:22.140  INFO 678 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.29
2018-04-21 15:27:22.185  INFO 678 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
2018-04-21 15:27:22.451  INFO 678 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2018-04-21 15:27:22.457  INFO 678 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 4143 ms
2018-04-21 15:27:22.729  INFO 678 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2018-04-21 15:27:22.740  INFO 678 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-04-21 15:27:22.746  INFO 678 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-04-21 15:27:22.748  INFO 678 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-04-21 15:27:22.751  INFO 678 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2018-04-21 15:27:23.044  INFO 678 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-21 15:27:23.683  INFO 678 --- [           main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@6b87a646: startup date [Sat Apr 21 15:27:18 UTC 2018]; root of context hierarchy
2018-04-21 15:27:23.923  INFO 678 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto public java.lang.String com.coding.studiodemo.StudioDemoApplication.greeting(org.springframework.ui.ModelMap)
2018-04-21 15:27:23.940  INFO 678 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2018-04-21 15:27:23.950  INFO 678 --- [           main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2018-04-21 15:27:24.034  INFO 678 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-21 15:27:24.036  INFO 678 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2018-04-21 15:27:24.340  INFO 678 --- [           main] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index
2018-04-21 15:27:24.633  INFO 678 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2018-04-21 15:27:24.762  INFO 678 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8081 (http) with context path ''
2018-04-21 15:27:24.769  INFO 678 --- [           main] c.c.studiodemo.StudioDemoApplication     : Started StudioDemoApplication in 7.836 seconds (JVM running for 191.292)
  1. 完全启动之后,在右边的【访问链接】侧边栏中将端口号改为 8081 并点击旁边的【+】
    ,生成 8081 端口的访问链接,点击就可以打开示例页面了。

图片

其他语言支持

想要切换其他语言环境,可以在右边的运行环境设置中进行切换。

您也可以自己安装需要的环境,并在运行环境中进行保存。

Happy Coding!

logo

vim介绍

vim 模式介绍

从vi演生出来的Vim具有多种模式,这种独特的设计容易使初学者产生混淆。几乎所有的编辑器都会有插入和执行命令两种模式,并且大多数的编辑器使用了与Vim截然不同的方式:命令目录(鼠标或者键盘驱动),组合键(通常通过control键(CTRL)和alt键(ALT)组成)或者鼠标输入。Vim和vi一样,仅仅通过键盘来在这些模式之中切换。这就使得Vim可以不用进行菜单或者鼠标操作,并且最小化组合键的操作。对文字录入员或者程序员可以大大增强速度和效率。

Vim具有6种基本模式和5种派生模式,我们这里只简单介绍下6种基本模式:

普通模式(Normal mode)

在普通模式中,用的编辑器命令,比如移动光标,删除文本等等。这也是Vim启动后的默认模式。这正好和许多新用户期待的操作方式相反(大多数编辑器默认模式为插入模式)。

Vim强大的编辑能来自于其普通模式命令。普通模式命令往往需要一个操作符结尾。用户学习了各种各样的文本间移动/跳转的命令和其他的普通模式的编辑命令,并且能够灵活组合使用的话,能够比那些没有模式的编辑器更加高效的进行文本编辑。

插入模式(Insert mode)

在这个模式中,大多数按键都会向文本缓冲中插入文本。大多数新用户希望文本编辑器编辑过程中一直保持这个模式。

在插入模式中,可以按ESC键回到普通模式。

可视模式(Visual mode)

这个模式与普通模式比较相似。但是移动命令会扩大高亮的文本区域。高亮区域可以是字符、行或者是一块文本。当执行一个非移动命令时,命令会被执行到这块高亮的区域上。Vim的文本对象也能和移动命令一样用在这个模式中。

选择模式(Select mode)

33这个模式和无模式编辑器的行为比较相似(Windows标准文本控件的方式)。这个模式中,可以用鼠标或者光标键高亮选择文本,不过输入任何字符的话,Vim会用这个字符替换选择的高亮文本块,并且自动进入插入模式。

命令行模式(Command line mode)

在命令行模式中可以输入会被解释成并执行的文本。例如执行命令:键,搜索/和?键或者过滤命令!键。在命令执行之后,Vim返回到命令行模式之前的模式,通常是普通模式

Ex模式(Ex mode)

这和命令行模式比较相似,在使用:visual命令离开Ex模式前,可以一次执行多条命令。

这其中我们常用到就是普通模式插入模式命令行模式

Seneca.js 使用说明

Seneca

Mesh your Seneca.js microservices together - no more service discovery!

seneca-mesh

npm version
Build Status
Gitter

This plugin allows you to wire up Seneca microservices using automatic
meshing. It uses the SWIM gossip algorithm for automatic service
discovery within the microservice network.

To join the network, all a service has to do is contact one other
service already in the network. The network then shares information
about which services respond to which patterns. There is no need to
configure the location of individual services anywhere.

Many thanks to Rui Hu for the excellent
swim module that makes this
work.

If you're using this module, and need help, you can:

If you are new to Seneca in general, please take a look at
senecajs.org. We have everything from tutorials to sample apps to
help get you up and running quickly.

Seneca compatibility

Supports Seneca versions 3.x and above.

Install

To install, use npm

npm install seneca-balance-client
npm install seneca-mesh

The seneca-mesh plugin depends on the seneca-balance-client plugin.

And in your code:

require('seneca')()
  .use('mesh', { ... options ... })

Using Windows? seneca-mesh uses some native modules, so make sure to
configure
msbuild
.

Quick Example

Create a microservice. The service translates color names into
hex values.

// color-service.js
var Seneca = require('seneca')

Seneca()
  // Uncomment to get detailed logs
  // .test('print')
  
  // provide an action for the format:hex pattern
  .add('format:hex', function (msg, reply) {

    // red is the only color supported!
    var color = 'red' === msg.color ? '#FF0000' : '#FFFFFF'

    reply({color: color})
  })

  // load the mesh plugin
  .use('mesh', {

    // this is a base node
    isbase: true,

    // this service will respond to the format:hex pattern
    pin: 'format:hex'
  })

Run the service (and leave it running) using:

$ node color-service.js

Create a client for the service. This client joins the mesh network,
performs an action, and then leaves.

// color-client.js
var Seneca = require('seneca')

Seneca({log: 'test'})

  // load the mesh plugin
  .use('mesh')

  // send a message out into the network
  // the network will know where to send format:hex messages
  .act({format: 'hex', color: 'red'}, function (err, out) {

    // prints #FF0000
    console.log(out.color)
  })

Run the client in a separate terminal using:

$ node color-client.js

The client finds the service using the mesh network. In this simple
case, the color-service is configured as a base node, which means
that it listens on a pre-defined local UDP port. The client checks for
base nodes on this port.

Notice that the client did not need any infomation about the service
location.

To join a network, you do need to know where the base nodes are. Once
you've joined, you don't even need the bases anymore, as the network keeps
you informed of new services.

To find base nodes, seneca-mesh provides support for discovery via
configuration, multicast, service registries, and custom
approaches. Base nodes are not used for service discovery. They
serve only as a convenient means for new nodes to join the network.

In the above example, UDP multicast was used by default. In production
you'll need to choose a discovery mechanism suitable for your network.

The examples folder contains code for this
example, and other scenarios demonstrating more complex network
configurations:

  • local-dev-mesh: local development, including a web service API.
  • multicast-discovery: multicast allows base nodes to discover each other - zero configuration!
  • consul-discovery: base node discovery using a service registry, when multicast is not available.

As a counterpoint to mesh-based configuration, the
local-dev example is a reminder of the
burden of traditional service location.

Development monitor

You can monitor the status of your local development network using the
monitor option:

// monitor.js
Seneca({tag: 'rgb', log: 'silent'})
  .use('mesh', {
    monitor: true
  })

This prints a table of known services to the terminal. Use keys
Ctrl-C to quit, and p to prune failed services. In the case of the
multicast-discovery example, the
monitor will output something like:

Deployment

Seneca-mesh has been tested under the following deployment configurations:

  • Single development machine using localhost (loopback network interface)
  • Multiple machines using VirtualBox (enable host network)
  • Docker containers using host networking (--net="host")
  • Docker swarm using an overlay network (not multicast not supported here by Docker)
  • Amazon Web Services on multiple instances (multicast not supported by Amazon)

See the test and test/docker folders for example code.

See also the [Full system](#Full systems) examples for deployment configurations.

Multicast service discovery is the most desirable from an ease of
deployment perspective, as you don't have to do anything - base nodes
discover each other, and services discover base nodes. Unfortunately
multicast networking is often not supported by the underlying network.

As best-practice deployment model, consider running a least one base
node per machine. This provides considerable redundancy for services
joining the network.

Base discovery

Once a service has joined the SWIM network, it will find all the other
services. SWIM solves that problem for you, which is why it is so
awesome.

But you stil have to join the network initially. You can do so by
pointing a new service at any other service, and it will "just
work". However in practice it is useful to have the concept of a base
node that provides bootstrapping functionality as a its primary
purpose. The problem then reduces to finding base nodes.

Note: not all base nodes need to alive - you can provide a list of
base nodes containing nodes that are down. SWIM will continue anyway
so long as at least one node is up.

Seneca-mesh provides the following strategies:

  • defined: the base nodes are pre-defined and provided to the
    service via configuration or environment variables. This is no
    worse than having other kinds of well-known services in your
    system, such as databases. By following a consistent approach you
    can provide a list of nodes dynamically - e.g. using the AWS CLI
    to list all instances in your VPC (aws ec2 describe-instances).

  • custom: you can provide a custom function that returns a list of
    bases, resolved by your own custom approach.

  • registry: load the list of bases from a key-value registry such
    as Consul. This strategy leverages the
    seneca-registry
    set of plugins, so you can use not only consul, but also etcd,
    ZooKeeper, and so on.

  • multicast: base nodes broadcast their existence via IP
    multicast. New services briefly listen to the broadcast to get the
    list of base nodes, and then drop out. This keeps broadcast
    traffic to a minimum. Note: you need to get the broadcast address
    right for your network - time to run ifconfig -a!

  • guess: If a base node is running locally, then the service can
    find it by searching at the default location: UDP 127.0.0.1:39999.
    If you've specified a different IP for the service to bind to,
    then that IP will also be checked. This is the usual mode for
    local development.

The strategies are executed in the order listed above. By default,
seneca-mesh only moves onto the next strategy if the current one
failed to produce any bases (this is configurable).

Message flows

Each service speficies the messages patterns that it cares about using
the pin setting. As a convenience, you can use pin at the top
level of the options, however the more complete form is an array of
patterns specifications listed in the listen option.

Thus

seneca.use('mesh', {
  pin: 'foo:bar'
})

is equivalent to:

seneca.use('mesh', {
  listen: [
    {pin: 'foo:bar'}
  ]
})

Each entry in the listen array specifies the listening models for a
given pattern. In particular, you can specify that the listening model:

  • consume: assume the message is from a work queue; consume the message, and generate a reply. This is the default.
  • observe: assume the message is published to multiple services; do not generate a reply

As an example, consider a microservice that generates HTML
content. The get:content message expects a reply containing the HTML
content, and is intended for just one instance of the service, to
avoid redundant work. The clear:cache message is published to all
instances of the service to indicate that underlying data for the HTML
content has changed, and the content must be regenerated for the next
get:content message. Define the mesh patterns as follows:

seneca.use('mesh', {
  listen: [
    {pin: 'get:content'}, // model:consume; the default
    {pin: 'clear:cache', model:'observe'}
  ]
})

Seneca-mesh uses the
HTTP transport by default. To
use other transports, you can add additional options to each entry of the listen
array. These options are passed to the transport system as if you have
called seneca.listen directly:

seneca.use('redis-transport')
seneca.use('mesh', {
  listen: [
    {pin: 'get:content'}, // model:consume; the default
    {pin: 'clear:cache', model:'observe', type:'redis'}
  ]
})

Message Patterns

role:mesh,get:members

You can send this message to any node, and the response will be a list
of all known patterns in the network.

Here's a useful little service that lets you submit messages to the network via a REPL:

require('seneca')({
  tag: 'repl',
  log: { level: 'none' }
})
  .use('mesh')
  .repl({
    port: 10001,
    alias: {
      m: 'role:mesh,get:members'
    }
  })

And on the command line:

# telnet localhost 10001

The alias m can be used as a shortcut.

Options

The seneca-mesh plugin accepts the following set of options. Specify these when loading the plugin:

require('seneca')
    .use('mesh', {
      // options go here
    })

The options are:

  • isbase: Make this node a base node. Default: false.

  • bases: An array of pre-defined base nodes. Specify strings in
    the format: 'IP:PORT'. Default: [].

  • pin: the action pattern that this service will respond to. Default: null

  • listen: an array of action patterns that this service will respond to. Default: null

  • stop: base node discovery stops as soon as a discovery
    strategies provides a list of suggested nodes. Default: true

  • discover: define the base node discovery options:

    • defined: use defined base nodes, specified via the bases
      option.

      • active: activate this discovery strategy. Default: true
    • custom: provide a function with signature function (seneca, options, bases, next) that returns an array of base nodes. See
      unit test single-custom for
      an example.

      • active: activate this discovery strategy. Default: true

      • find: the custom function

    • registry: use the role:registry patterns to load the list of
      base nodes. Set to false to disable. Default is a set of
      sub-options - see code for details.

      • active: activate this discovery strategy. Default: true
    • multicast: base nodes broadcast their existence via IP
      multicast. New services briefly listen to the broadcast to get the
      list of base nodes, and then drop out. This keeps broadcast
      traffic to a minimum. Note: you need to get the broadcast address
      right for your network - time to run ifconfig -a!

      • active: activate this discovery strategy. Default: true

      • address: the broadcast address of the network interface used
        for multicast.

    • guess: Guess the location of a base by assuming it is on the
      same host. Default: true.

      • active: activate this discovery strategy. Default: true

Full systems

You can review the source code of these example projects to see seneca-mesh in action:

Test

To run tests, use npm:

npm run test

Contributing

The Seneca.js org encourages open and safe participation.

If you feel you can help in any way, be it with documentation, examples,
extra testing, or new features please get in touch.

License

Copyright (c) 2015-2016, Richard Rodger and other contributors.
Licensed under MIT.

代码整洁之道

变量

变量命名

语义化命名

详细说明

  • 变量名需要和变量实际意义挂钩
  • 变量名需要由有效英文单词构成,不能使用汉语拼音进行命名
  • 变量名最好由完整英文单词构成,不要使用单词缩写
  • 相同作用变量变量名需要保持一致,方便后期排错。
  • 通过一个变量生成了一个新变量,也需要为这个新变量命名,也就是说每个变量当你看到他第一眼,你就知道他是干什么的,请见下面案例一
  • 变量命名前不需要无意义的前缀,请见下面案例二

案例

bad name good name
aaa userName
YHM userName
currName currentName
l location
userInfoArr,userDataArr userArr
(function (log) {
// 案例一
    // bad
    const ADDRESS = 'One Infinite Loop, Cupertino 95014';
    const CITY_ZIP_CODE_REGEX = /^[^,\]+[,\s]+(.+?)s*(d{5})?$/;
    saveCityZipCode(ADDRESS.match(CITY_ZIP_CODE_REGEX)[1],
                    ADDRESS.match(CITY_ZIP_CODE_REGEX)[2]);
    // good
    const ADDRESS = 'One Infinite Loop, Cupertino 95014';
    const CITY_ZIP_CODE_REGEX = /^[^,\]+[,\s]+(.+?)s*(d{5})?$/;
    const [, city, zipCode] = ADDRESS.match(CITY_ZIP_CODE_REGEX) || [];
    saveCityZipCode(city, zipCode);

// 案例二
    // Bad
    const car = {
        carMake: 'Honda',
        carModel: 'Accord',
        carColor: 'Blue'
    };

    function paintCar(car) {
        car.carColor = 'Red';
    }

    // Good
    const car = {
        make: 'Honda',
        model: 'Accord',
        color: 'Blue'
    };

    function paintCar(car) {
        car.color = 'Red';
    }
})(console.log)

常量命名

详细说明

  • 每个常量都应该命名,请见下面案例三
  • 如果是做分支判断变量,可以通过枚举数组缓存起来,请见下面案例四
  • 如果是对多个常量值进行检索,也可以使用正则,请见下面案例五

案例

(function (log) {
// 案例三
    // bad
    if(guestName === 'watermelon'){
        log('right');
    }else{
        log('error');
    }
    // good
    const RIGHT_NAME = 'watermelon';
    const RIGHT_INFO = 'right';
    const ERROR_INFO = 'error';
    if(guestName === RIGHT_NAME){
        log(RIGHT_INFO);
    }else{
        log(ERROR_INFO);
    }

// 案例四
    // bad
    const guestName = 'melon';
    let findIndex = -1;
    switch (guestName) {
        case 'water':
            {
                findIndex = 0;
                break;
            }
        case 'melon':
            {
                findIndex = 1;
                break;
            }
        case 'watermelon':
            {
                findIndex = 2;
                break;
            }
        default:
            {
                findIndex = -1;
                break;
            }
    }
    log(findIndex);// 1

    // good
    const guestName = 'melon';
    const RIGHT_NAME_ARR = [
        'water',
        'melon',
        'watermelon'
    ];
    let findIndex = RIGHT_NAME_ARR.indexOf(guestName);
    log(findIndex);// 1
// 案例五
    // bad
    const findName = 'melon';
    let isRightName = false;
    // 如果通过if来判断,后期需要添加名字极其不方便,而且名字多了之后,代码可读性变低了很多
    if (findName.includes('water') || findName.includes('melon') || findName.includes('watermelon')) {
        isRightName = true;
    }
    // true

    // good
    const findName = 'melon';
    const RIGHT_NAME_ARR = [
        'water',
        'melon',
        'watermelon'
    ];
    const CONNECTION_SYMBOL = '|';
    const WORD_BOUNDARY_SYMBOL = '\\b';
    const JOIN_SYMBOL = WORD_BOUNDARY_SYMBOL + CONNECTION_SYMBOL + WORD_BOUNDARY_SYMBOL;
    const CHECK_RIGHT_NAME_STRING = WORD_BOUNDARY_SYMBOL + RIGHT_NAME_ARR.join(JOIN_SYMBOL) + WORD_BOUNDARY_SYMBOL;
    const RIGHT_NAME_REGEX = new RegExp(CHECK_RIGHT_NAME_STRING);
    let isRightName = findName.search(RIGHT_NAME_REGEX)>-1;
    log(isRightName);// true
})(console.log)

对象声明

详细说明

  • 对象设置默认属性,可以通过Object.assign({}),减少冗余代码块,请见下面案例六

案例

(function (log) {
// 案例六
    // Bad
    const menuConfig = {
        title: null,
        body: 'Bar',
        buttonText: null,
        cancellable: true
    };

    function createMenu(config) {
        config.title = config.title || 'Foo';
        config.body = config.body || 'Bar';
        config.buttonText = config.buttonText || 'Baz';
        config.cancellable = config.cancellable !== undefined ? config.cancellable : true;
    }

    createMenu(menuConfig);
        // Good
        const menuConfig = {
        title: 'Order',
        // 'body' key 缺失
        buttonText: 'Send',
        cancellable: true
    };

    function createMenu(config) {
    config = Object.assign({
        title: 'Foo',
        body: 'Bar',
        buttonText: 'Baz',
        cancellable: true
    }, config);

    // config 就变成了: {title: "Order", body: "Bar", buttonText: "Send", cancellable: true}
    // ...
    }

    createMenu(menuConfig);
})(console.log)

Array.of()

基础语法

Array.of(element0[, element1[, ...[, elementN]]])

参数说明

elementN

任意个参数,将按顺序成为返回数组中的元素。

返回值说明

新的 Array 实例。

详细描述

Array.of() 方法创建一个具有可变数量参数的新数组实例,而不考虑参数的数量或类型。

Array.of()Array 构造函数之间的区别在于处理整数参数:Array.of(7) 创建一个具有单个元素 7 的数组,而 Array(7) 创建一个长度为7的空数组(注意:这是指一个有7个空位的数组,而不是由7个undefined组成的数组)。

Array.of(7);       // [7] 
Array.of(1, 2, 3); // [1, 2, 3]

Array(7);          // [ , , , , , , ]
Array(1, 2, 3);    // [1, 2, 3]

此函数是ECMAScript 2015标准的一部分。详见 Array.ofArray.from proposalArray.of polyfill

案例

Array.of(1);         // [1]
Array.of(1, 2, 3);   // [1, 2, 3]
Array.of(undefined); // [undefined]

polyfill

如果原生不支持的话,在其他代码之前执行以下代码会创建 Array.of()

if (!Array.of) {
  Array.of = function() {
    return Array.prototype.slice.call(arguments);
  };
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.