- 安装
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod a+rx speedtest_cli.py
sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli
sudo chown root:root /usr/local/bin/speedtest-cli
- 使用
speedtest-cli
| git fetch --all | |
| git reset --hard origin/master |
wget https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
chmod a+rx speedtest_cli.py
sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli
sudo chown root:root /usr/local/bin/speedtest-cli
speedtest-cli
原理很简单:人群(list)中每个人依次在该人群中找爹(for嵌套),找到为止(break)。
list 形如 :
|id |pid |name |
|1 | |1 |
|11 |1 |1-1 |
|111 |11 |1-1-1 |
|2 | |2 |
| // Simple JavaScript Templating | |
| // John Resig - http://ejohn.org/ - MIT Licensed | |
| // http://ejohn.org/blog/javascript-micro-templating/ | |
| (function(){ | |
| var cache = {}; | |
| this.tmpl = function tmpl(str, data){ | |
| // Figure out if we're getting a template, or if we need to | |
| // load the template - and be sure to cache the result. | |
| var fn = !/\W/.test(str) ? |
| function cmpVersions (a, b) { var i, l, diff, segmentsA, segmentsB; segmentsA = a.replace(/(\.0+)+$/, '').split('.'); segmentsB = b.replace(/(\.0+)+$/, '').split('.'); l = Math.min(segmentsA.length, segmentsB.length); for (i = 0; i < l; i++) { diff = parseInt(segmentsA[i], 10) - parseInt(segmentsB[i], 10); if (diff !== 0) { return diff; } } return segmentsA.length - segmentsB.length; } |
| <dependency> | |
| <groupId>org.mybatis</groupId> | |
| <artifactId>mybatis</artifactId> | |
| <version>3.2.2</version> | |
| </dependency> | |
| <!-- ***可选***:集成spring需要 --> | |
| <dependency> | |
| <groupId>org.mybatis</groupId> | |
| <artifactId>mybatis-spring</artifactId> |
Alt+Shift+a //矩形选框Alt+Shift+r //批量修改变量| <!-- spring --> | |
| <!--contextConfigLocation在 ContextLoaderListener类中的默认值是 /WEB-INF/applicationContext.xml --> | |
| <context-param> | |
| <param-name>contextConfigLocation</param-name> | |
| <param-value>/WEB-INF/applicationContext.xml</param-value> | |
| <!-- <param-value>classpath:applicationContext*.xml</param-value> --> | |
| </context-param> | |
| <listener> | |
| <listener-class> | |
| org.springframework.web.context.ContextLoaderListener |