├── laboratory ├── paas │ ├── mysql │ │ ├── .gitignore │ │ ├── conf │ │ │ └── my.cnf │ │ ├── init │ │ │ └── init.sql │ │ └── README.md │ └── elk │ │ └── es.md ├── frontend │ ├── projects.md │ ├── nodejs-es6 │ │ ├── foo-es6.js │ │ ├── index-es5.js │ │ ├── index-es6.js │ │ ├── foo-es5.js │ │ ├── package.json │ │ └── README.md │ └── webpack │ │ ├── src │ │ ├── index.js │ │ └── foo.js │ │ ├── webpack.config.js │ │ └── package.json ├── python │ ├── README.md │ ├── images │ │ ├── 1.jpg │ │ ├── 2.jpg │ │ ├── 3.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ └── 6.jpg │ ├── matplot.py │ ├── numpy-resize.py │ ├── numpy-grey.py │ ├── numpy-array.py │ ├── matplot-hist.py │ ├── homography.py │ └── pillow.py ├── java │ ├── java-logging │ │ └── README.md │ ├── springboot-mybatis-h2 │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ └── import.sql │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ ├── App.java │ │ │ │ │ └── person │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ └── PersonController.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── springboot-config │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── App.java │ │ │ │ │ └── HelloWorld.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ ├── README.md │ │ └── pom.xml │ ├── springboot-swagger │ │ ├── images │ │ │ ├── swagger-ui.png │ │ │ └── swagger-try-it-out.png │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ ├── App.java │ │ │ │ │ ├── person │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ └── PersonController.java │ │ │ │ │ └── SwaggerConfig.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── import.sql │ │ │ │ └── mapper │ │ │ │ └── PersonMapper.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── stonie │ │ │ └── AppTest.java │ ├── java-helloworld │ │ ├── HelloWorld.java │ │ └── README.md │ ├── springboot-mybatis-pagehelper │ │ ├── README.md │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ ├── App.java │ │ │ │ │ ├── person │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ └── PersonController.java │ │ │ │ │ └── SwaggerConfig.java │ │ │ └── resources │ │ │ │ ├── import.sql │ │ │ │ ├── application.properties │ │ │ │ └── mapper │ │ │ │ └── PersonMapper.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── stonie │ │ │ └── AppTest.java │ ├── springboot-redis │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.properties │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── App.java │ │ │ │ │ └── HelloWorld.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ ├── README.md │ │ └── pom.xml │ ├── spring-helloworld │ │ ├── auto-scan-by-java │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── beans │ │ │ │ │ ├── HelloWorldService.java │ │ │ │ │ ├── TimeService.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── HelloWorldServiceImpl.java │ │ │ │ │ │ └── TimeServiceImpl.java │ │ │ │ │ ├── configuration │ │ │ │ │ └── AppConfig.java │ │ │ │ │ └── App.java │ │ │ └── pom.xml │ │ ├── auto-scan-by-xml │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ └── java │ │ │ │ │ │ └── com │ │ │ │ │ │ └── stonie │ │ │ │ │ │ ├── beans │ │ │ │ │ │ ├── HelloWorldService.java │ │ │ │ │ │ ├── TimeService.java │ │ │ │ │ │ └── impl │ │ │ │ │ │ │ ├── HelloWorldServiceImpl.java │ │ │ │ │ │ │ └── TimeServiceImpl.java │ │ │ │ │ │ └── App.java │ │ │ │ └── resources │ │ │ │ │ └── app-config.xml │ │ │ └── pom.xml │ │ ├── manual-config-by-java │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── beans │ │ │ │ │ ├── HelloWorldService.java │ │ │ │ │ └── impl │ │ │ │ │ │ └── HelloWorldServiceImpl.java │ │ │ │ │ ├── configuration │ │ │ │ │ └── HelloWorldConfig.java │ │ │ │ │ └── App.java │ │ │ └── pom.xml │ │ ├── manual-config-by-xml │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── stonie │ │ │ │ │ │ ├── beans │ │ │ │ │ │ ├── HelloWorldService.java │ │ │ │ │ │ └── impl │ │ │ │ │ │ │ └── HelloWorldServiceImpl.java │ │ │ │ │ │ └── App.java │ │ │ │ │ └── resources │ │ │ │ │ └── helloworld-config.xml │ │ │ └── pom.xml │ │ └── pom.xml │ ├── springcloud-eureka │ │ ├── springcloud-eureka-server │ │ │ ├── src │ │ │ │ ├── main │ │ │ │ │ ├── resources │ │ │ │ │ │ └── application.yml │ │ │ │ │ └── java │ │ │ │ │ │ └── com │ │ │ │ │ │ └── stonie │ │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ │ └── App.java │ │ │ │ └── test │ │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ └── AppTest.java │ │ │ └── pom.xml │ │ └── springcloud-eureka-client │ │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ └── application.yml │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ └── App.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ │ └── pom.xml │ ├── netty-helloworld │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── App.java │ │ │ │ │ ├── IOClient.java │ │ │ │ │ ├── IOServer.java │ │ │ │ │ ├── NettyClient.java │ │ │ │ │ └── NettyServer.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── README.md │ ├── java-helloworld-gradle │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ └── App.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── build.gradle │ ├── java-helloworld-maven │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ └── App.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── java-httpclient │ │ ├── README.md │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── HttpClientApp.java │ │ └── pom.xml │ ├── springboot-jpa │ │ └── src │ │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application.properties │ │ │ │ └── import.sql │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ ├── HelloWorld.java │ │ │ │ ├── person │ │ │ │ ├── PersonMapper.java │ │ │ │ ├── PersonEntity.java │ │ │ │ └── PersonController.java │ │ │ │ ├── App.java │ │ │ │ └── SwaggerConfig.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── stonie │ │ │ └── AppTest.java │ ├── springboot-mybatis-mysql │ │ ├── src │ │ │ ├── main │ │ │ │ ├── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ └── import.sql │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ ├── App.java │ │ │ │ │ └── person │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ └── PersonController.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── springboot-mybatis-xml │ │ ├── src │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── stonie │ │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ │ ├── App.java │ │ │ │ │ │ └── person │ │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ │ └── PersonController.java │ │ │ │ └── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ ├── import.sql │ │ │ │ │ └── mapper │ │ │ │ │ └── PersonMapper.xml │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ ├── README.md │ │ └── pom.xml │ ├── springboot-restful │ │ ├── src │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── stonie │ │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ │ ├── App.java │ │ │ │ │ │ └── person │ │ │ │ │ │ ├── PersonMapper.java │ │ │ │ │ │ ├── PersonEntity.java │ │ │ │ │ │ └── PersonController.java │ │ │ │ └── resources │ │ │ │ │ ├── application.properties │ │ │ │ │ ├── import.sql │ │ │ │ │ └── mapper │ │ │ │ │ └── PersonMapper.xml │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── springboot-helloworld-web │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── HelloWorld.java │ │ │ │ │ └── App.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── springboot-helloworld-cli │ │ ├── src │ │ │ ├── main │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── stonie │ │ │ │ │ ├── App.java │ │ │ │ │ └── HelloWorld.java │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ └── AppTest.java │ │ └── pom.xml │ ├── spring-boot-rabbitmq │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ ├── Application.java │ │ │ │ ├── hello │ │ │ │ ├── Producer.java │ │ │ │ ├── Consumer.java │ │ │ │ └── AckConsumer.java │ │ │ │ ├── fanout │ │ │ │ ├── Producer.java │ │ │ │ └── Consumer.java │ │ │ │ ├── direct │ │ │ │ ├── Producer.java │ │ │ │ ├── ErrorConsumer.java │ │ │ │ └── AllConsumer.java │ │ │ │ ├── task │ │ │ │ ├── Producer.java │ │ │ │ └── RoundRobinConsumer.java │ │ │ │ ├── task2 │ │ │ │ └── Producer.java │ │ │ │ ├── priority │ │ │ │ ├── Producer.java │ │ │ │ └── Consumer.java │ │ │ │ └── topic │ │ │ │ ├── Producer.java │ │ │ │ ├── ErrorConsumer.java │ │ │ │ └── KernelConsumer.java │ │ └── pom.xml │ ├── spring-boot-zookeeper │ │ ├── src │ │ │ └── main │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── stonie │ │ │ │ ├── groupservice │ │ │ │ ├── CreateGroup.java │ │ │ │ ├── JoinGroup.java │ │ │ │ ├── DeleteGroup.java │ │ │ │ └── ListGroup.java │ │ │ │ ├── ConnectionWatcher.java │ │ │ │ ├── configuration │ │ │ │ ├── ConfigUpdater.java │ │ │ │ ├── ActiveKeyValueStore.java │ │ │ │ └── ConfigWatcher.java │ │ │ │ ├── Simple.java │ │ │ │ ├── Application.java │ │ │ │ ├── configuration2 │ │ │ │ ├── ConfigReader.java │ │ │ │ └── ConfigWriter.java │ │ │ │ └── groupservice2 │ │ │ │ └── GroupMember.java │ │ └── pom.xml │ └── references.md ├── README.md ├── iaas │ └── docker │ │ ├── centos.md │ │ └── README.md ├── linux │ └── readme.md ├── mysql │ └── deadlock.md └── ai │ └── datasets.md ├── library ├── README.md ├── 项目管理.md ├── NodeJS.md ├── 系统架构.md ├── Markdown.md ├── 数据结构和算法.md ├── MySQL.md ├── 图像处理.md ├── WebServer.md ├── Kubernetes.md ├── 中间件.md ├── 前端.md ├── Coding.md ├── 信息安全.md ├── 杂项.md ├── PHP.md ├── Docker.md ├── 操作系统.md ├── 版本控制.md ├── Java.md ├── Python.md ├── 知识库.md ├── 程序员.md ├── 在线资源.md └── 收藏社区.md ├── README.md └── .gitignore /laboratory/paas/mysql/.gitignore: -------------------------------------------------------------------------------- 1 | data 2 | logs -------------------------------------------------------------------------------- /laboratory/frontend/projects.md: -------------------------------------------------------------------------------- 1 | * https://github.com/epicmaxco/vuestic-admin -------------------------------------------------------------------------------- /laboratory/python/README.md: -------------------------------------------------------------------------------- 1 | # imlearn 2 | 3 | image process example codes 4 | -------------------------------------------------------------------------------- /laboratory/java/java-logging/README.md: -------------------------------------------------------------------------------- 1 | https://www.rowkey.me/blog/2019/06/29/log/ -------------------------------------------------------------------------------- /library/README.md: -------------------------------------------------------------------------------- 1 | # library 2 | This is my library for learning new technologies. 3 | -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/foo-es6.js: -------------------------------------------------------------------------------- 1 | export function foo() { 2 | return 'foo' 3 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # lib-n-lab 2 | This is my library & laboratory for learning new technologies. 3 | -------------------------------------------------------------------------------- /laboratory/README.md: -------------------------------------------------------------------------------- 1 | # laboratory 2 | This is my laboratory for learning new technologies. 3 | -------------------------------------------------------------------------------- /laboratory/frontend/webpack/src/index.js: -------------------------------------------------------------------------------- 1 | const foo = require('./foo') 2 | 3 | console.log(foo()) -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/index-es5.js: -------------------------------------------------------------------------------- 1 | const foo = require('./foo-es5') 2 | 3 | console.log(foo()) -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/index-es6.js: -------------------------------------------------------------------------------- 1 | import { foo } from './foo-es6' 2 | 3 | console.log(foo()) -------------------------------------------------------------------------------- /laboratory/paas/mysql/conf/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 3 | -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/foo-es5.js: -------------------------------------------------------------------------------- 1 | function foo() { 2 | return 'foo' 3 | } 4 | 5 | module.exports = foo -------------------------------------------------------------------------------- /laboratory/frontend/webpack/src/foo.js: -------------------------------------------------------------------------------- 1 | function foo() { 2 | return 'foo' 3 | } 4 | 5 | module.exports = foo -------------------------------------------------------------------------------- /laboratory/iaas/docker/centos.md: -------------------------------------------------------------------------------- 1 | docker run -it --network=host --privileged=true hub-mirror.c.163.com/library/centos bash -------------------------------------------------------------------------------- /laboratory/python/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/1.jpg -------------------------------------------------------------------------------- /laboratory/python/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/2.jpg -------------------------------------------------------------------------------- /laboratory/python/images/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/3.jpg -------------------------------------------------------------------------------- /laboratory/python/images/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/4.jpg -------------------------------------------------------------------------------- /laboratory/python/images/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/5.jpg -------------------------------------------------------------------------------- /laboratory/python/images/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/python/images/6.jpg -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.schema=classpath:import.sql -------------------------------------------------------------------------------- /laboratory/java/springboot-config/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | application.appId = 123456 2 | application.userName = zhangsan -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | *.iml 3 | target 4 | .vscode 5 | .classpath 6 | .project 7 | .settings 8 | *.class 9 | node_modules 10 | dist 11 | XDG_CACHE_HOME -------------------------------------------------------------------------------- /library/项目管理.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [Getting Real](https://basecamp.com/books/Getting%20Real.pdf) - [basecamp](https://basecamp.com/books/getting-real) 4 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/images/swagger-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/java/springboot-swagger/images/swagger-ui.png -------------------------------------------------------------------------------- /laboratory/java/java-helloworld/HelloWorld.java: -------------------------------------------------------------------------------- 1 | public class HelloWorld { 2 | public static void main(String[] args) { 3 | System.out.println("Hello"); 4 | } 5 | } -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/README.md: -------------------------------------------------------------------------------- 1 | ## 使用 PageHelper 实现分页 2 | 3 | https://pagehelper.github.io/docs/howtouse/ 4 | https://www.cnblogs.com/qlqwjy/p/8552078.html -------------------------------------------------------------------------------- /library/NodeJS.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [Node入门 » 一本全面的Node.js教程](https://www.nodebeginner.org/index-zh-cn.html) 4 | * [七天学会NodeJS](http://nqdeng.github.io/7-days-nodejs/) 5 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/images/swagger-try-it-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/java/springboot-swagger/images/swagger-try-it-out.png -------------------------------------------------------------------------------- /laboratory/java/springboot-redis/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/lib-n-lab/master/laboratory/java/springboot-redis/src/main/resources/application.properties -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/beans/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | public interface HelloWorldService { 4 | void sayHello(String name); 5 | } 6 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/main/java/com/stonie/beans/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | public interface HelloWorldService { 4 | void sayHello(String name); 5 | } 6 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-java/src/main/java/com/stonie/beans/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | public interface HelloWorldService { 4 | void sayHello(String name); 5 | } 6 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-xml/src/main/java/com/stonie/beans/HelloWorldService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | public interface HelloWorldService { 4 | void sayHello(String name); 5 | } 6 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/beans/TimeService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | import java.util.Date; 4 | 5 | public interface TimeService { 6 | Date getCurrentTime(); 7 | } 8 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/main/java/com/stonie/beans/TimeService.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans; 2 | 3 | import java.util.Date; 4 | 5 | public interface TimeService { 6 | Date getCurrentTime(); 7 | } 8 | -------------------------------------------------------------------------------- /library/系统架构.md: -------------------------------------------------------------------------------- 1 | ### 分布式 2 | 3 | * [分布式系统原理介绍](http://guanzhou.pub/2018/06/04/Distributed/) 4 | 5 | ### 系统架构 6 | 7 | * [davideuler/architecture.of.internet-product: 互联网公司技术架构](https://github.com/davideuler/architecture.of.internet-product) 8 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld/README.md: -------------------------------------------------------------------------------- 1 | ### Hello World 2 | 3 | 这里是一个最简单的 Java 程序示例。首先通过 `javac` 将 Java 代码编译成 class 文件: 4 | 5 | ``` 6 | $ javac HelloWorld.java 7 | ``` 8 | 9 | 然后使用 `java` 运行: 10 | 11 | ``` 12 | $ java HelloWorld 13 | ``` -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8761 3 | 4 | eureka: 5 | client: 6 | registerWithEureka: false 7 | fetchRegistry: false 8 | server: 9 | waitTimeInMsWhenSyncEmpty: 0 -------------------------------------------------------------------------------- /laboratory/frontend/webpack/webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | module.exports = { 4 | mode: 'production', 5 | entry: './src/index.js', 6 | output: { 7 | path: path.resolve(__dirname, 'dist'), 8 | filename: 'bundle.js' 9 | } 10 | } -------------------------------------------------------------------------------- /library/Markdown.md: -------------------------------------------------------------------------------- 1 | ### Markdown 2 | 3 | * [Mastering Markdown](https://guides.github.com/features/mastering-markdown/) 4 | * [Cmd Markdown 编辑阅读器 - 作业部落出品](https://www.zybuluo.com/mdeditor) 5 | 6 | ### Read The Docs 7 | 8 | * [Read The Docs 使用文档](https://readthedocs.readthedocs.io/zh_CN/latest/) 9 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-gradle/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-maven/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | /** 4 | * Hello world! 5 | * 6 | */ 7 | public class App 8 | { 9 | public static void main( String[] args ) 10 | { 11 | System.out.println( "Hello World!" ); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-client/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 30001 3 | 4 | spring: 5 | application: 6 | name: springcloud-euraka-client 7 | 8 | eureka: 9 | client: 10 | serviceUrl: 11 | defaultZone: http://localhost:8761/eureka/ -------------------------------------------------------------------------------- /laboratory/python/matplot.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from pylab import * 3 | 4 | # 加载图像 5 | im = array(Image.open('./images/1.jpg')) 6 | imshow(im) 7 | 8 | # 标记点 9 | x = [30, 40, 40, 60] 10 | y = [30, 40, 50, 40] 11 | plot(x, y, 'r*') 12 | 13 | # 线连接 14 | plot(x[:3], y[:3]) 15 | 16 | # 标题 17 | title('Captcha Image') 18 | show() 19 | -------------------------------------------------------------------------------- /laboratory/python/numpy-resize.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from numpy import uint8 3 | from pylab import * 4 | 5 | 6 | def resize(arr, size): 7 | im = Image.fromarray(uint8(arr)) 8 | return array(im.resize(size)) 9 | 10 | im = array(Image.open('./images/1.jpg').convert('L')) 11 | rim = resize(im, (50,10)) 12 | 13 | imshow(rim) 14 | show() -------------------------------------------------------------------------------- /laboratory/frontend/webpack/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "webpack", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "build": "webpack" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "webpack": "^4.35.0", 13 | "webpack-cli": "^3.3.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /laboratory/java/java-httpclient/README.md: -------------------------------------------------------------------------------- 1 | ## 实战 Apache HttpClient 2 | 3 | https://www.aneasystone.com/archives/2015/12/java-and-http-one.html 4 | https://www.aneasystone.com/archives/2015/12/java-and-http-using-proxy.html 5 | https://www.aneasystone.com/archives/2016/03/java-and-http-authentication.html 6 | https://www.aneasystone.com/archives/2016/04/java-and-https.html 7 | 8 | -------------------------------------------------------------------------------- /library/数据结构和算法.md: -------------------------------------------------------------------------------- 1 | * [编程之法:面试和算法心得](https://github.com/julycoding/The-Art-Of-Programming-by-July) 2 | * [OI Wiki](https://oi-wiki.org/) 3 | * [把《编程珠玑》读薄](http://hawstein.com/2013/08/11/make-thiner-programming-pearls/) 4 | * [动态规划:从新手到专家](http://hawstein.com/2013/03/26/dp-novice-to-advanced/) 5 | * [算法/NLP/深度学习/机器学习面试笔记](https://github.com/imhuay/Algorithm_Interview_Notes-Chinese) 6 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-xml/src/main/java/com/stonie/beans/impl/HelloWorldServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | 5 | public class HelloWorldServiceImpl implements HelloWorldService { 6 | public void sayHello(String name) { 7 | System.out.println("Hello " + name); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-gradle/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | mavenCentral() 5 | } 6 | 7 | dependencies { 8 | testCompile "junit:junit:3.8.1" 9 | } 10 | 11 | jar { 12 | baseName = 'java-helloworld-gradle' 13 | version = '1.0-SNAPSHOT' 14 | manifest { 15 | attributes 'Main-Class': 'com.stonie.App' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/configuration/AppConfig.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan(basePackages = "com.stonie.beans") 8 | public class AppConfig { 9 | } 10 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-java/src/main/java/com/stonie/beans/impl/HelloWorldServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | 5 | public class HelloWorldServiceImpl implements HelloWorldService { 6 | public void sayHello(String name) { 7 | System.out.println("Hello " + name); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /laboratory/java/springboot-config/README.md: -------------------------------------------------------------------------------- 1 | ## Spring Boot 和 配置文件 2 | 3 | java -jar target\springboot-config-1.0-SNAPSHOT.jar --spring.config.location=classpath:/application.properties,target\application.properties 4 | java -jar springboot-config-1.0-SNAPSHOT.jar --spring.profiles.active=dev 5 | 6 | https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/python/numpy-grey.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from numpy import array 3 | from pylab import * 4 | 5 | im = array(Image.open('./images/1.jpg').convert('L')) 6 | 7 | # 灰度值反相 8 | im2 = 255 - im 9 | 10 | # 将灰度值变换到 100...200 之间 11 | im3 = 100.0 * im / 255.0 + 100 12 | 13 | im4 = 255.0 * (im/255.0)**2 14 | 15 | imshow(im2) 16 | figure() 17 | imshow(im3) 18 | figure() 19 | imshow(im4) 20 | show() 21 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-web/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/paas/mysql/init/init.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE `test` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; 2 | 3 | CREATE TABLE `test`.`user`( 4 | `id` INT NOT NULL AUTO_INCREMENT , 5 | `name` VARCHAR(200) , 6 | `age` INT , 7 | PRIMARY KEY (`id`) 8 | ); 9 | 10 | INSERT INTO `test`.`user`(`id`, `name`, `age`) VALUES(1, 'zhangsan', 30), (2, 'lisi', 32), (3, 'wanger', 32), (4, 'mazi', 31); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | import org.springframework.data.repository.CrudRepository; 5 | 6 | import java.util.Optional; 7 | 8 | public interface PersonMapper extends JpaRepository { 9 | 10 | Optional findByName(String name); 11 | } 12 | -------------------------------------------------------------------------------- /library/MySQL.md: -------------------------------------------------------------------------------- 1 | ### 文档和手册 2 | 3 | * [MySQL 8.0 Reference Manual](https://dev.mysql.com/doc/refman/8.0/en/) 4 | * [MySQL 教程](https://www.runoob.com/mysql/mysql-tutorial.html) 5 | * [21分钟 MySQL 入门教程](https://www.cnblogs.com/mr-wid/archive/2013/05/09/3068229.html) 6 | * [MySQL索引背后的数据结构及算法原理](http://blog.codinglabs.org/articles/theory-of-mysql-index.html) 7 | * [Mysql设计与优化专题 · 看云](https://www.kancloud.cn/thinkphp/mysql-design-optimalize) 8 | -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs-es6", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index-es5.js", 6 | "scripts": { 7 | "es5": "node index-es5.js", 8 | "es6": "babel-node index-es6.js --presets env" 9 | }, 10 | "author": "", 11 | "license": "ISC", 12 | "devDependencies": { 13 | "babel-cli": "^6.26.0", 14 | "babel-preset-env": "^1.3.2" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /library/图像处理.md: -------------------------------------------------------------------------------- 1 | ### GIMP 2 | 3 | * [GIMP Documentation](https://docs.gimp.org/index.html) 4 | 5 | ### OpenCV 6 | 7 | * [OpenCV tutorial](https://docs.opencv.org/master/d9/df8/tutorial_root.html) 8 | * [OpenCV 官方文档](https://www.w3cschool.cn/opencv/) 9 | * [OpenCV 中文网站](http://wiki.opencv.org.cn/index.php/%E9%A6%96%E9%A1%B5) 10 | * [OpenCV-Python Tutorials](https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_tutorials.html) -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-client/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/hello") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-server/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.web.bind.annotation.RequestMapping; 4 | import org.springframework.web.bind.annotation.RestController; 5 | 6 | @RestController 7 | public class HelloWorld { 8 | 9 | @RequestMapping("/hello") 10 | public String index() { 11 | return "Hello World!"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/python/numpy-array.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from numpy import array 3 | 4 | im = array(Image.open('./images/1.jpg')) 5 | print(im.shape, im.dtype) 6 | 7 | # im[i,j,k] 表示位于 i 行 j 列 第 k 个颜色通道的像素值 8 | print(im[0,0,0], im[0,0,1], im[0,0,2]) 9 | 10 | # 第 1 行所有像素 11 | print(im[0,:]) 12 | 13 | # 第 1 列所有像素 14 | print(im[:,0]) 15 | 16 | # 第 5-10 行,5-10 列 17 | print(im[4:9,4:9]) 18 | 19 | # 倒数第 2 行 20 | print(im[-2,:]) 21 | # print(im[-2]) 22 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-xml/src/main/resources/helloworld-config.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-redis/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | 9 | mybatis.mapperLocations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | 9 | mybatis.mapperLocations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/beans/impl/HelloWorldServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service("helloWorldService") 7 | public class HelloWorldServiceImpl implements HelloWorldService { 8 | public void sayHello(String name) { 9 | System.out.println("Hello " + name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/beans/impl/TimeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.TimeService; 4 | import org.springframework.stereotype.Service; 5 | 6 | import java.util.Date; 7 | 8 | @Service("timeService") 9 | public class TimeServiceImpl implements TimeService { 10 | @Override 11 | public Date getCurrentTime() { 12 | return new Date(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/main/java/com/stonie/beans/impl/HelloWorldServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import org.springframework.stereotype.Service; 5 | 6 | @Service("helloWorldService") 7 | public class HelloWorldServiceImpl implements HelloWorldService { 8 | public void sayHello(String name) { 9 | System.out.println("Hello " + name); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/main/java/com/stonie/beans/impl/TimeServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.stonie.beans.impl; 2 | 3 | import com.stonie.beans.TimeService; 4 | import org.springframework.stereotype.Service; 5 | 6 | import java.util.Date; 7 | 8 | @Service("timeService") 9 | public class TimeServiceImpl implements TimeService { 10 | @Override 11 | public Date getCurrentTime() { 12 | return new Date(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-cli/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-web/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | 9 | mybatis.mapperLocations=classpath:mapper/*.xml -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /library/WebServer.md: -------------------------------------------------------------------------------- 1 | ### Ngnix 2 | 3 | * [nginx documentation](http://nginx.org/en/docs/) 4 | * [Nginx 入门指南](https://www.w3cschool.cn/nginx/) 5 | * [Nginx 使用手册](https://www.w3cschool.cn/nginxsysc/) 6 | 7 | ### Apache 8 | 9 | * [Apache HTTP 服务器 2.4 文档](http://httpd.apache.org/docs/2.4/zh-cn/) 10 | 11 | ### Tomcat 12 | 13 | * [Apache Tomcat 8 Documentation](http://tomcat.apache.org/tomcat-8.0-doc/index.html) 14 | * [Tomcat 8 权威指南](https://www.w3cschool.cn/tomcat/?) 15 | -------------------------------------------------------------------------------- /laboratory/java/springboot-config/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Hello world! 8 | * 9 | */ 10 | @SpringBootApplication 11 | public class App 12 | { 13 | public static void main( String[] args ) 14 | { 15 | SpringApplication.run(App.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/resources/import.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS person; 2 | 3 | CREATE TABLE `person` ( 4 | `id` int(13) NOT NULL AUTO_INCREMENT COMMENT '主键', 5 | `name` varchar(33) DEFAULT NULL COMMENT '姓名', 6 | `age` int(3) DEFAULT NULL COMMENT '年龄', 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 9 | 10 | INSERT INTO `person` (`name`, `age`) VALUES 11 | ('zhangsan', 30), 12 | ('lisi', 31), 13 | ('wanger', 32), 14 | ('mazi', 33); -------------------------------------------------------------------------------- /laboratory/python/matplot-hist.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | from pylab import * 3 | 4 | im = array(Image.open('./images/1.jpg').convert('L')) 5 | 6 | # 轮廓 7 | figure() 8 | gray() 9 | contour(im, origin='image') 10 | 11 | # 直方图 12 | # im 是一个二维数组,im.flatten() 将其转换为一维数组 13 | # 128 表示直方图上 bin 的数目 14 | figure() 15 | hist(im.flatten(), 128) 16 | 17 | # 手工标记 18 | figure() 19 | imshow(im) 20 | print('please click 2 points') 21 | x = ginput(2) 22 | print('you clicked: ' + str(x)) 23 | 24 | show() -------------------------------------------------------------------------------- /library/Kubernetes.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [Kubernetes指南](https://kubernetes.feisky.xyz/) 4 | * [Kubernetes Handbook - Kubernetes中文指南/云原生应用架构实践手册](https://jimmysong.io/kubernetes-handbook/) 5 | * [和我一步步部署 kubernetes 集群](https://github.com/opsnull/follow-me-install-kubernetes-cluster) 6 | 7 | ### CNCF 8 | 9 | * [CNCF - 云原生计算基金会简介 - 宋净超的博客|Cloud Native|云原生布道师](https://jimmysong.io/posts/cncf-introduction/) 10 | * [cncf/landscape: Static Cloud Native Landscapes and Interactive Landscape](https://github.com/cncf/landscape) 11 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/src/main/java/com/stonie/IOClient.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import java.net.Socket; 4 | import java.util.Date; 5 | 6 | public class IOClient { 7 | public static void main(String[] args) throws Exception { 8 | Socket socket = new Socket("127.0.0.1", 8000); 9 | while (true) { 10 | socket.getOutputStream().write((new Date() + ": hello world").getBytes()); 11 | socket.getOutputStream().flush(); 12 | Thread.sleep(2000); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /laboratory/python/homography.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # Created by aneasystone 4 | from numpy import vstack 5 | from numpy import ones 6 | from numpy import array 7 | 8 | 9 | def normalize(points): 10 | """ 归一化 """ 11 | for row in points: 12 | row /= points[-1] 13 | return points 14 | 15 | 16 | def make_homog(points): 17 | """ 转换为齐次坐标表示 """ 18 | return vstack((points, ones((1, points.shape[1])))) 19 | 20 | 21 | ps = array([[1,2],[3,4]]) 22 | print(make_homog(ps)) 23 | print(normalize(ps)) -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface PersonMapper { 10 | 11 | List list(); 12 | 13 | PersonEntity detail(@Param("id") Integer id); 14 | 15 | int insert(PersonEntity person); 16 | 17 | int delete(@Param("id") Integer id); 18 | 19 | int update(PersonEntity person); 20 | } 21 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface PersonMapper { 10 | 11 | List list(); 12 | 13 | PersonEntity detail(@Param("id") Integer id); 14 | 15 | int insert(PersonEntity person); 16 | 17 | int delete(@Param("id") Integer id); 18 | 19 | int update(PersonEntity person); 20 | } 21 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-cli/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class HelloWorld implements CommandLineRunner { 8 | 9 | @Override 10 | public void run(String... args) { 11 | if (args.length > 0) { 12 | System.out.println("Hello " + args[0] + "."); 13 | } else { 14 | System.out.println("Hello noone."); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | import org.apache.ibatis.annotations.Select; 6 | 7 | import java.util.List; 8 | 9 | @Mapper 10 | public interface PersonMapper { 11 | 12 | @Select("SELECT * FROM person") 13 | List list(); 14 | 15 | @Select("SELECT * FROM person WHERE id = #{id}") 16 | PersonEntity detail(@Param("id") Integer id); 17 | } 18 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface PersonMapper { 10 | 11 | List list(); 12 | 13 | PersonEntity detail(@Param("id") Integer id); 14 | 15 | int insert(PersonEntity person); 16 | 17 | int delete(@Param("id") Integer id); 18 | 19 | int update(PersonEntity person); 20 | } 21 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Mapper; 4 | import org.apache.ibatis.annotations.Param; 5 | 6 | import java.util.List; 7 | 8 | @Mapper 9 | public interface PersonMapper { 10 | 11 | List list(); 12 | 13 | PersonEntity detail(@Param("id") Integer id); 14 | 15 | int insert(PersonEntity person); 16 | 17 | int delete(@Param("id") Integer id); 18 | 19 | int update(PersonEntity person); 20 | } 21 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-java/src/main/java/com/stonie/configuration/HelloWorldConfig.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import com.stonie.beans.impl.HelloWorldServiceImpl; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.context.annotation.Configuration; 7 | 8 | @Configuration 9 | public class HelloWorldConfig { 10 | @Bean 11 | public HelloWorldService helloWorldService() { 12 | return new HelloWorldServiceImpl(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-client/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.EnableEurekaClient; 6 | 7 | /** 8 | * Hello world! 9 | * 10 | */ 11 | @SpringBootApplication 12 | @EnableEurekaClient 13 | public class App 14 | { 15 | public static void main( String[] args ) 16 | { 17 | SpringApplication.run(App.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/resources/app-config.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-server/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | /** 8 | * Hello world! 9 | * 10 | */ 11 | @SpringBootApplication 12 | @EnableEurekaServer 13 | public class App 14 | { 15 | public static void main( String[] args ) 16 | { 17 | SpringApplication.run(App.class, args); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-xml/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import org.springframework.context.support.ClassPathXmlApplicationContext; 5 | 6 | public class App { 7 | public static void main( String[] args ) { 8 | ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("helloworld-config.xml"); 9 | HelloWorldService bean = (HelloWorldService) context.getBean("helloWorldService"); 10 | bean.sayHello("World"); 11 | context.close(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.datasource.initialization-mode=always 2 | spring.datasource.schema=classpath:import.sql 3 | 4 | spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false 5 | spring.datasource.username=root 6 | spring.datasource.password=123456 7 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 8 | 9 | mybatis.mapperLocations=classpath:mapper/*.xml 10 | 11 | pagehelper.helperDialect=mysql 12 | pagehelper.reasonable=true 13 | pagehelper.supportMethodsArguments=true 14 | pagehelper.params=count=countSql 15 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/Application.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.boot.CommandLineRunner; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | 7 | @SpringBootApplication 8 | public class Application implements CommandLineRunner { 9 | 10 | public static void main(String[] args) { 11 | SpringApplication.run(Application.class, args); 12 | } 13 | 14 | @Override 15 | public void run(String... args) throws Exception { 16 | System.out.println("Hello world"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /laboratory/iaas/docker/README.md: -------------------------------------------------------------------------------- 1 | # 安装 2 | 3 | ## 在 Ubuntu 下安装 4 | 5 | ``` 6 | sudo apt remove docker docker-engine docker.io 7 | sudo apt install apt-transport-https ca-certificates curl software-properties-common 8 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add – 9 | sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" 10 | sudo apt update 11 | sudo apt install docker-ce 12 | sudo usermod -aG docker $USER #将当前用户加入到Docker组 13 | sudo echo "DOCKER_OPTS=\"--registry-mirror=https://registry.docker-cn.com\"" >> /etc/default/docker #更改为国内源 14 | sudo service docker restart 15 | ``` -------------------------------------------------------------------------------- /library/中间件.md: -------------------------------------------------------------------------------- 1 | ### 数据库 2 | 3 | * [Redis 命令参考](http://redisdoc.com/) 4 | * [SSDB - 文档](http://ssdb.io/docs/zh_cn/index.html) 5 | * [MongoDB 中文网](https://www.mongodb.org.cn/) 6 | * [HBase官方文档](http://abloz.com/hbase/book.html) 7 | * [Druid 说明文档](http://druidio.cn/docs/0.9.0/design/index.html) 8 | 9 | ### 消息中间件 10 | 11 | * [Apache ActiveMQ](http://activemq.apache.org/index.html) 12 | * [Apache Kafka](http://kafka.apache.org/quickstart) 13 | 14 | ### 监控 15 | 16 | * [open-falcon v0.1中文文档](https://www.bookstack.cn/read/open-falcon/SUMMARY.md) 17 | * [Zipkin 中文文档](https://dyingbleed.gitbooks.io/zipkin/content/) 18 | * [Pinpoint学习笔记](https://skyao.gitbooks.io/learning-pinpoint/content/) -------------------------------------------------------------------------------- /library/前端.md: -------------------------------------------------------------------------------- 1 | ### Vue.js 2 | 3 | * [Vue.js 中文文档](https://cn.vuejs.org/v2/guide/index.html) 4 | * [Vue.js 教程](https://www.runoob.com/vue2/vue-tutorial.html) 5 | 6 | ### React 7 | 8 | * [React 教程](https://www.runoob.com/react/react-tutorial.html) 9 | * [React启蒙(译)](https://zhangwang1990.gitbooks.io/reactenlightenment/content/) 10 | 11 | ### Webpack 12 | 13 | * [webpack 中文文档](https://www.webpackjs.com/guides/getting-started/) 14 | * [Webpack 入门教程](https://www.runoob.com/w3cnote/webpack-tutorial.html) - 菜鸟教程 15 | * [webpack 实战](https://segmentfault.com/a/1190000015020658) - [whjin](https://segmentfault.com/u/whjin) 16 | 17 | ### Bootstrap 18 | 19 | * [Bootstrap v3 中文文档](https://v3.bootcss.com/getting-started/) 20 | -------------------------------------------------------------------------------- /library/Coding.md: -------------------------------------------------------------------------------- 1 | ### 代码托管 2 | 3 | * [GitHub](https://github.com/) 4 | * [Bitbucket](https://bitbucket.org/) 5 | * [码云 Gitee](https://gitee.com/) 6 | * [CODING](https://coding.net/) 7 | 8 | ### 在线编程 9 | 10 | * [freeCodeCamp](https://learn.freecodecamp.org/) 11 | * [力扣 LeetCode](https://leetcode-cn.com/) 12 | * [挑战 Python](http://www.pythontip.com/coding/code_oj) 13 | * [牛客网](https://www.nowcoder.com/contestRoom) 14 | 15 | ### 开发者平台 16 | 17 | * [腾讯云开发者平台](https://dev.tencent.com/) 18 | 19 | ### 开发工具 20 | 21 | * [Visual Studio Code](https://code.visualstudio.com/docs) 22 | - [viatsko/awesome-vscode](https://github.com/viatsko/awesome-vscode) 23 | * [EditorConfig](https://editorconfig.org/) 24 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/python/pillow.py: -------------------------------------------------------------------------------- 1 | from PIL import Image 2 | 3 | im = Image.open('./images/1.jpg') 4 | im.show() # 调用系统默认程序打开图片 5 | 6 | # 灰度 7 | im = Image.open('./images/1.jpg') 8 | gray = im.convert('L') 9 | gray.save('./images/2.jpg') 10 | 11 | # 缩略图 12 | im = Image.open('./images/3.jpg') 13 | im.thumbnail((128, 128)) 14 | im.save('./images/4.jpg') 15 | 16 | # 裁剪和粘贴 17 | im1 = Image.open('./images/1.jpg') 18 | region = im1.crop((32, 5, 67, 27)) 19 | region = region.transpose(Image.ROTATE_90) 20 | im3 = Image.open('./images/3.jpg') 21 | im3.paste(region, (500,500)) 22 | im3.save('./images/5.jpg') 23 | 24 | # 尺寸和旋转 25 | Image.open('./images/1.jpg')\ 26 | .resize((160,60))\ 27 | .rotate(45)\ 28 | .save('./images/6.jpg') 29 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/linux/readme.md: -------------------------------------------------------------------------------- 1 | ## TODO 2 | 3 | * [28个Unix/Linux的命令行神器 | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/7829.html#more-7829) 4 | * [jlevy/the-art-of-command-line](https://github.com/jlevy/the-art-of-command-line/blob/master/README-zh.md) 5 | * [FengShangWuQi/to-vim-tmux-zsh: 如何让 vim,tmux,zsh 成为我们的神器](https://github.com/FengShangWuQi/to-vim-tmux-zsh) 6 | * [Linux命令五分钟 | Linux大棚](http://roclinux.cn/?page_id=3759) 7 | * [rsync 的核心算法 | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/7425.html) 8 | * [将vim变得简单:如何在vim中得到你最喜爱的IDE特性 | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/894.html) 9 | * [tmux: Productive Mouse-Free Development](https://aquaregia.gitbooks.io/tmux-productive-mouse-free-development_zh/content/index.html) 10 | -------------------------------------------------------------------------------- /library/信息安全.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [OWASP 测试指南 4.0 中文](https://kennel209.gitbooks.io/owasp-testing-guide-v4/content/zh/) 4 | * [OWASP 测试指南 4.0 英文](https://www.owasp.org/index.php/OWASP_Testing_Guide_v4_Table_of_Contents) 5 | * [大学霸 Kali Linux 安全渗透教程](https://legacy.gitbook.com/book/wizardforcel/daxueba-kali-linux-tutorial/details) 6 | * [Kali Linux Web 渗透测试秘籍](https://legacy.gitbook.com/book/wizardforcel/kali-linux-web-pentest-cookbook/details) 7 | 8 | ### Security Tools 9 | 10 | * [SecTools.Org Top Network Security Tools](http://sectools.org/) 11 | 12 | ### CTF 13 | 14 | * [Challenges - Jarvis OJ](https://www.jarvisoj.com/challenges) 15 | * [实验吧-让实验更简单!](http://www.shiyanbar.com/) 16 | * [攻防世界](https://adworld.xctf.org.cn/) 17 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | public class PersonEntity { 4 | 5 | private Integer id; 6 | private String name; 7 | private Integer age; 8 | 9 | public Integer getId() { 10 | return id; 11 | } 12 | 13 | public void setId(Integer id) { 14 | this.id = id; 15 | } 16 | 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | public Integer getAge() { 26 | return age; 27 | } 28 | 29 | public void setAge(Integer age) { 30 | this.age = age; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /library/杂项.md: -------------------------------------------------------------------------------- 1 | ## 科技 2 | 3 | * http://cn.engadget.com/ 4 | * http://www.guokr.com/ 5 | * http://songshuhui.net/ 6 | * http://www.solidot.org/ 7 | * http://www.qdaily.com/ 8 | * http://www.pingwest.com/ 9 | * http://blog.sciencenet.cn/blog.php 10 | * https://kexue.fm/ 11 | 12 | ## 魔方 13 | 14 | * http://bbs.rubik.com.cn/forum.php 15 | * http://www.mf100.org/2-2-2/index_cll.htm 16 | * http://algdb.net/ 17 | * http://cubefreak.net/ 18 | * http://www.cubezone.be/ 19 | * http://meep.cubing.net/poll.html 20 | * https://alg.cubing.net/ 21 | * https://fewestmov.es/ 22 | * http://fmcsolves.cubing.net/ 23 | * http://cubesolv.es/ 24 | * http://www.mofangshe.com/ 25 | * http://www.mofangshe.com/mofang/3X3M2R2YYZQ.html 26 | * http://www.mofangshe.com/mofang/3x3Blindfolded-chichu.html -------------------------------------------------------------------------------- /library/PHP.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [TIPI: 深入理解PHP内核](http://www.php-internals.com/book/) 4 | * [PHP 之道](http://wulijun.github.io/php-the-right-way/) - [wulijun](http://wulijun.github.io/) 5 | * [PHP 之道](http://laravel-china.github.io/php-the-right-way/) - LARAVEL CHINA 社区 6 | 7 | ### PHP Standards 8 | 9 | * [PHP Standards Recommendations](https://www.php-fig.org/psr/) - [PHP-FIG](https://github.com/php-fig) 10 | * [PHP编码规范(中文版)](https://github.com/PizzaLiu/PHP-FIG) 11 | 12 | ### Composer 13 | 14 | * [Composer 英文文档](https://getcomposer.org/doc/) 15 | * [Composer 中文文档](https://docs.phpcomposer.com/) 16 | 17 | ### 常用框架 18 | 19 | * [CodeIgniter 用户指南](https://codeigniter.org.cn/user_guide/index.html) 20 | * [Laravel 5.8 中文文档](https://learnku.com/docs/laravel/5.8) 21 | -------------------------------------------------------------------------------- /laboratory/mysql/deadlock.md: -------------------------------------------------------------------------------- 1 | ## 死锁案例 2 | 3 | * [MySQL--index merge死锁案例详细分析 - 知乎](https://zhuanlan.zhihu.com/p/64435240) 4 | * [Mysql死锁如何排查:insert on duplicate死锁一次排查分析过程 - Jay_huaxiao - 博客园](https://www.cnblogs.com/jay-huaxiao/p/11456921.html) 5 | * [当并发insert on duplicate key update遇见死锁:更新丢失-阿里云开发者社区](https://developer.aliyun.com/article/727076) 6 | * [MySQL优化--INSERT ON DUPLICATE UPDATE死锁 - 笑东风 - 博客园](https://www.cnblogs.com/TeyGao/p/9183754.html) 7 | * [一个 MySQL 死锁案例分析 --Index merge when update · Ruby China](https://ruby-china.org/topics/38429) 8 | * [关于MySQL insert into ... select 的锁情况 - jyzhou - 博客园](https://www.cnblogs.com/zhoujinyi/archive/2013/04/28/3049382.html) 9 | 10 | ## 死锁原理 11 | 12 | * [MySQL · 引擎特性 · InnoDB 事务锁简介 - zengkefu - 博客园](https://www.cnblogs.com/zengkefu/p/5682034.html) 13 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import com.stonie.beans.TimeService; 5 | import org.springframework.context.support.ClassPathXmlApplicationContext; 6 | 7 | public class App { 8 | public static void main( String[] args ) { 9 | ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("app-config.xml"); 10 | 11 | HelloWorldService helloWorldService = (HelloWorldService) context.getBean("helloWorldService"); 12 | helloWorldService.sayHello("World"); 13 | 14 | TimeService timeService = (TimeService) context.getBean("timeService"); 15 | System.out.println(timeService.getCurrentTime()); 16 | 17 | context.close(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /library/Docker.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [Docker —— 从入门到实践 · GitBook](https://legacy.gitbook.com/book/yeasy/docker_practice/details) 4 | * [Docker入门实战 - DocKOne.io](https://yuedu.baidu.com/ebook/d817967416fc700abb68fca1) 5 | 6 | ### Docker 原理 7 | 8 | * [Docker基础技术:Linux CGroup | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/17049.html) 9 | * [Docker基础技术:Linux Namespace(上) | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/17010.html) 10 | * [Docker基础技术:Linux Namespace(下) | 酷 壳 - CoolShell.cn](http://coolshell.cn/articles/17029.html) 11 | * [Docker Getting Start: Related Knowledge](http://tiewei.github.io/cloud/Docker-Getting-Start/) 12 | 13 | ### 快速入门 14 | 15 | * [Docker 学习笔记 - Kumu's Blog](https://blog.opskumu.com/docker.html) 16 | * [Docker 学习新手笔记:从入门到放弃 - Joe’s Blog](https://hijiangtao.github.io/2018/04/17/Docker-in-Action/) 17 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/README.md: -------------------------------------------------------------------------------- 1 | ## 实战 Netty 2 | 3 | ### 传统的 IO 编程 4 | 5 | 服务端通过 `serverSocket.accept()` 以阻塞的方式获取新的连接,每个连接需要一个单独的线程来维护,同一时刻有大量的线程处于阻塞状态是非常严重的资源浪费,另外,数据读写是以字节流为单位,效率不高。 6 | 7 | ### NIO 编程 8 | 9 | NIO 编程模型中,新来一个连接不再创建一个新的线程,而是把这条连接直接绑定到某个固定的线程,然后这条连接所有的读写都由这个线程来负责。这是通过 NIO 中的 `selector` 实现的。另外,NIO 通过以字节块为单位,读写效率高。但是使用 JDK 原生 NIO 的 API 非常复杂。 10 | 11 | 1. JDK 的 NIO 编程需要了解很多的概念,编程复杂,对 NIO 入门非常不友好,编程模型不友好,ByteBuffer 的 API 简直反人类 12 | 2. 对 NIO 编程来说,一个比较合适的线程模型能充分发挥它的优势,而 JDK 没有给你实现,你需要自己实现,就连简单的自定义协议拆包都要你自己实现 13 | 3. JDK 的 NIO 底层由 epoll 实现,该实现饱受诟病的空轮训 bug 会导致 cpu 飙升 100% 14 | 4. 项目庞大之后,自行实现的 NIO 很容易出现各类 bug,维护成本较高 15 | 16 | ### Netty 入门 17 | 18 | * ServerBootstrap 19 | * NioEventLoopGroup:boss、worker 20 | * Channel:NioServerSocketChannel、NioSocketChannel 21 | 22 | ### 参考 23 | 24 | * https://www.jianshu.com/p/a4e03835921a 25 | -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-redis/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-gradle/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-maven/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-cli/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-web/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-config/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /library/操作系统.md: -------------------------------------------------------------------------------- 1 | ### Linux 2 | 3 | * [快乐的 Linux 命令行](https://github.com/billie66/TLCL) - billie66 4 | * [Bash Reference Manual](http://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html) 5 | 6 | ### Vim 7 | 8 | * [Learning the vi Editor](https://en.wikibooks.org/wiki/Learning_the_vi_Editor) 9 | * [Vim Book](ftp://ftp.vim.org/pub/vim/doc/book/vimbook-OPL.pdf) 10 | * [中文翻译](https://mrlongx.com/index.php/2018/04/09/vim-core-list/) 11 | * [笨方法学Vimscript · 看云](https://www.kancloud.cn/kancloud/learn-vimscript-the-hard-way) 12 | 13 | ### AWK 14 | 15 | * [AWK 程序设计语言 中文版](https://github.com/wuzhouhui/awk) 16 | * [AWK 实战指南](https://book.saubcy.com/AwkInAction/) 17 | 18 | ### 计算机网络 19 | 20 | * [网络基本功系列](https://legacy.gitbook.com/book/wizardforcel/network-basic/details) - wizardforcel 21 | * [SDN 网络指南](https://github.com/feiskyer/sdn-handbook) 22 | 23 | ### 虚拟化 24 | 25 | * [Vagrant Documentation](https://www.vagrantup.com/docs/) -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-client/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springcloud-eureka/springcloud-eureka-server/src/test/java/com/stonie/AppTest.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import junit.framework.Test; 4 | import junit.framework.TestCase; 5 | import junit.framework.TestSuite; 6 | 7 | /** 8 | * Unit test for simple App. 9 | */ 10 | public class AppTest 11 | extends TestCase 12 | { 13 | /** 14 | * Create the test case 15 | * 16 | * @param testName name of the test case 17 | */ 18 | public AppTest( String testName ) 19 | { 20 | super( testName ); 21 | } 22 | 23 | /** 24 | * @return the suite of tests being tested 25 | */ 26 | public static Test suite() 27 | { 28 | return new TestSuite( AppTest.class ); 29 | } 30 | 31 | /** 32 | * Rigourous Test :-) 33 | */ 34 | public void testApp() 35 | { 36 | assertTrue( true ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-h2/src/main/java/com/stonie/person/PersonController.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.PathVariable; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | import java.util.List; 9 | 10 | @RestController 11 | @RequestMapping(value = "person") 12 | public class PersonController { 13 | 14 | @Autowired 15 | private PersonMapper personMapper; 16 | 17 | @RequestMapping(value = "/list", method = RequestMethod.GET) 18 | public List list() { 19 | return personMapper.list(); 20 | } 21 | 22 | @RequestMapping(value = "/detail/{id}", method = RequestMethod.GET) 23 | public PersonEntity detail(@PathVariable Integer id) { 24 | return personMapper.detail(id); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /laboratory/paas/mysql/README.md: -------------------------------------------------------------------------------- 1 | ## MySQL 2 | 3 | ### 最简单的运行方式 4 | 5 | ``` 6 | $ docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 7 | ``` 8 | 9 | ### 自定义配置文件 10 | 11 | ``` 12 | $ docker run -p 3306:3306 --name mysql \ 13 | -v $PWD/conf:/etc/mysql/conf.d \ 14 | -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 15 | ``` 16 | 17 | ### 挂载数据和日志目录 18 | 19 | ``` 20 | $ docker run -p 3306:3306 --name mysql \ 21 | -v $PWD/conf:/etc/mysql/conf.d \ 22 | -v $PWD/logs:/logs \ 23 | -v $PWD/data:/var/lib/mysql \ 24 | -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 25 | ``` 26 | 27 | ### 初始化脚本 28 | 29 | ``` 30 | $ docker run -p 3306:3306 --name mysql \ 31 | -v $PWD/conf:/etc/mysql/conf.d \ 32 | -v $PWD/logs:/logs \ 33 | -v $PWD/data:/var/lib/mysql \ 34 | -v $PWD/init:/docker-entrypoint-initdb.d \ 35 | -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.6 36 | ``` 37 | 38 | https://www.runoob.com/docker/docker-install-mysql.html -------------------------------------------------------------------------------- /laboratory/ai/datasets.md: -------------------------------------------------------------------------------- 1 | ## 数据集 2 | 3 | * https://github.com/HKUSTCV/FSS-1000 4 | 5 | FSS-1000, A 1000-class Dataset For Few-shot Segmentation 6 | 7 | * https://github.com/switchablenorms/CelebAMask-HQ 8 | 9 | A large-scale face dataset for face parsing, recognition, generation and editing. 10 | 11 | ### 图像 12 | 13 | * [ImageNet](http://image-net.org/) 14 | * [Tencent ML-Images](https://github.com/Tencent/tencent-ml-images) 15 | * [Open Images Dataset](https://storage.googleapis.com/openimages/web/index.html) 16 | 17 | ### 文本 18 | 19 | * [搜狗实验室数据](http://www.sogou.com/labs/resource/list_pingce.php) 20 | * [The bAbI project](https://research.fb.com/downloads/babi/) 21 | 22 | ### 汇总 23 | 24 | * [这是一份非常全面的开源数据集,你,真的不想要吗?](https://www.jiqizhixin.com/articles/2018-09-05-2) 25 | * [nlp/常用数据集简介](https://github.com/duoergun0729/nlp/blob/master/%E5%B8%B8%E7%94%A8%E6%95%B0%E6%8D%AE%E9%9B%86%E7%AE%80%E4%BB%8B.md) 26 | * [自然语言处理之语料库资源](https://blog.just4fun.site/NLP-corpus.html) -------------------------------------------------------------------------------- /library/版本控制.md: -------------------------------------------------------------------------------- 1 | ## Git 2 | 3 | ### Online Books 4 | 5 | * [Pro Git 2nd Edition 中文版](https://git-scm.com/book/zh/v2) 6 | * [Git Community Book 中文版](http://gitbook.liuhui998.com/index.html) 7 | * [Git 教程](https://www.liaoxuefeng.com/wiki/896043488029600) - 廖雪峰的官方网站 8 | * [图解 Git](http://marklodato.github.io/visual-git-guide/index-zh-cn.html) 9 | * [Git 菜单 | git-recipes](https://geeeeeeeeek.github.io/git-recipes/) 10 | * [GitHub Git 备忘单 - On Demand Training](https://github.github.com/training-kit/downloads/zh_CN/github-git-cheat-sheet/) 11 | * [Git Tutorials and Training | Atlassian Git Tutorial](https://www.atlassian.com/git/tutorials) 12 | 13 | ### 工具 14 | 15 | * [Git Documentation](https://git-scm.com/doc) 16 | * [TortoiseGit Documentation](https://tortoisegit.org/docs/) 17 | * [Gitolite](https://gitolite.com/gitolite/) 18 | * [Gitea](https://gitea.io/zh-cn/) 19 | * [Gogs](https://gogs.io/) 20 | 21 | ## Subversion 22 | 23 | ### Online Books 24 | 25 | * [Subversion 与版本控制](http://svnbook.red-bean.com/) 26 | -------------------------------------------------------------------------------- /laboratory/java/springboot-config/src/main/java/com/stonie/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | @RestController 11 | public class HelloWorld { 12 | 13 | @Value("${application.userName}") 14 | private String userName; 15 | 16 | @Value("${application.appId}") 17 | private String appId; 18 | 19 | @RequestMapping("/") 20 | public String index() { 21 | return "Hello World!"; 22 | } 23 | 24 | @RequestMapping("/config") 25 | public Map config() { 26 | Map configMap = new HashMap<>(); 27 | configMap.put("appId", this.appId); 28 | configMap.put("userName", this.userName); 29 | return configMap; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/groupservice/CreateGroup.java: -------------------------------------------------------------------------------- 1 | package com.stonie.groupservice; 2 | 3 | import com.stonie.ConnectionWatcher; 4 | import org.apache.zookeeper.CreateMode; 5 | import org.apache.zookeeper.KeeperException; 6 | import org.apache.zookeeper.ZooDefs; 7 | 8 | /** 9 | * Created by aneasystone on 2018/8/4. 10 | */ 11 | public class CreateGroup extends ConnectionWatcher { 12 | public void create(String groupName) throws KeeperException, 13 | InterruptedException { 14 | String path = "/" + groupName; 15 | String createdPath = zk.create(path, null/*data*/, ZooDefs.Ids.OPEN_ACL_UNSAFE, 16 | CreateMode.PERSISTENT); 17 | System.out.println("Created " + createdPath); 18 | } 19 | public static void main(String[] args) throws Exception { 20 | CreateGroup createGroup = new CreateGroup(); 21 | createGroup.connect(args[0]); 22 | createGroup.create(args[1]); 23 | createGroup.close(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/java/com/stonie/person/PersonEntity.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | 9 | @Entity 10 | @Table(name = "person") 11 | public class PersonEntity { 12 | 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.IDENTITY) 15 | private Long id; 16 | private String name; 17 | private Integer age; 18 | 19 | public Long getId() { 20 | return id; 21 | } 22 | 23 | public void setId(Long id) { 24 | this.id = id; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setName(String name) { 32 | this.name = name; 33 | } 34 | 35 | public Integer getAge() { 36 | return age; 37 | } 38 | 39 | public void setAge(Integer age) { 40 | this.age = age; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-java/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import com.stonie.configuration.HelloWorldConfig; 5 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 6 | 7 | public class App { 8 | public static void main( String[] args ) { 9 | // 10 | // 方式一:使用 AnnotationConfigApplicationContext 构造函数直接注册 11 | // 12 | //AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfig.class); 13 | 14 | // 15 | // 方式二:使用 register() + refresh() 方法注册 16 | // 17 | AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); 18 | context.register(HelloWorldConfig.class); 19 | context.refresh(); 20 | 21 | HelloWorldService bean = (HelloWorldService) context.getBean("helloWorldService"); 22 | bean.sayHello("World"); 23 | context.close(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/hello/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.hello; 2 | 3 | import com.rabbitmq.client.Channel; 4 | import com.rabbitmq.client.Connection; 5 | import com.rabbitmq.client.ConnectionFactory; 6 | 7 | import java.io.IOException; 8 | import java.util.concurrent.TimeoutException; 9 | 10 | /** 11 | * Created by aneasystone on 2018/8/11. 12 | */ 13 | public class Producer { 14 | 15 | public static void main(String[] args) throws IOException, TimeoutException { 16 | ConnectionFactory factory = new ConnectionFactory(); 17 | factory.setUsername("guest"); 18 | factory.setPassword("guest"); 19 | factory.setHost("localhost"); 20 | Connection conn = factory.newConnection(); 21 | Channel channel = conn.createChannel(); 22 | 23 | channel.queueDeclare("hello-queue", false, false, false, null); 24 | channel.basicPublish("", "hello-queue", null, "Hello World".getBytes()); 25 | 26 | channel.close(); 27 | conn.close(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-mysql/src/main/java/com/stonie/person/PersonMapper.java: -------------------------------------------------------------------------------- 1 | package com.stonie.person; 2 | 3 | import org.apache.ibatis.annotations.Delete; 4 | import org.apache.ibatis.annotations.Insert; 5 | import org.apache.ibatis.annotations.Mapper; 6 | import org.apache.ibatis.annotations.Param; 7 | import org.apache.ibatis.annotations.Select; 8 | import org.apache.ibatis.annotations.Update; 9 | 10 | import java.util.List; 11 | 12 | @Mapper 13 | public interface PersonMapper { 14 | 15 | @Select("SELECT * FROM `person`") 16 | List list(); 17 | 18 | @Select("SELECT * FROM `person` WHERE `id` = #{id}") 19 | PersonEntity detail(@Param("id") Integer id); 20 | 21 | @Insert("INSERT INTO `person` (`name`, `age`) VALUES (#{name}, #{age})") 22 | int insert(PersonEntity person); 23 | 24 | @Delete("DELETE FROM `person` WHERE `id` = #{id}") 25 | int delete(@Param("id") Integer id); 26 | 27 | @Update("UPDATE `person` SET `name` = #{name}, `age` = #{age} WHERE `id` = #{id}") 28 | int update(PersonEntity person); 29 | } 30 | -------------------------------------------------------------------------------- /library/Java.md: -------------------------------------------------------------------------------- 1 | ### Online Books 2 | 3 | * [高效 Java 第三版](https://sjsdfg.github.io/effective-java-3rd-chinese/#/README) 4 | * [《On Java 8》中文版](https://lingcoder.github.io/OnJava8/#/README) 5 | 6 | ### Online Resources 7 | 8 | * [Java Practices](http://www.javapractices.com/home/HomeAction.do) 9 | * [Patterns - Java Design Patterns](https://java-design-patterns.com/patterns/) 10 | 11 | ### 提升 12 | 13 | * [crossoverJie/JCSprout: Java Core Sprout : basic, concurrent, algorithm](https://github.com/crossoverJie/JCSprout) 14 | * [doocs/advanced-java: 😮 互联网 Java 工程师进阶知识完全扫盲](https://github.com/doocs/advanced-java) 15 | * [jobbole/awesome-java-cn: Java资源大全中文版](https://github.com/jobbole/awesome-java-cn) 16 | * [giantray/stackoverflow-java-top-qa: stackoverflow上Java相关回答整理翻译](https://github.com/giantray/stackoverflow-java-top-qa) 17 | * [Byron4j/CookBook: 🎉JAVA高级架构师技术栈](https://github.com/Byron4j/CookBook) 18 | * [kanwangzjm/funiture: Java并发编程与高并发解决方案](https://github.com/kanwangzjm/funiture) 19 | * [xingshaocheng/architect-awesome: 后端架构师技术图谱](https://github.com/xingshaocheng/architect-awesome) 20 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.stonie 6 | spring-helloworld 7 | 1.0.0 8 | pom 9 | spring-helloworld 10 | spring helloworld example 11 | 12 | 13 | 1.8 14 | UTF-8 15 | UTF-8 16 | 17 | 18 | 19 | manual-config-by-java 20 | manual-config-by-xml 21 | auto-scan-by-java 22 | auto-scan-by-xml 23 | 24 | 25 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/ConnectionWatcher.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.apache.zookeeper.WatchedEvent; 4 | import org.apache.zookeeper.Watcher; 5 | import org.apache.zookeeper.ZooKeeper; 6 | 7 | import java.io.IOException; 8 | import java.util.concurrent.CountDownLatch; 9 | 10 | /** 11 | * Created by aneasystone on 2018/8/4. 12 | */ 13 | public class ConnectionWatcher implements Watcher { 14 | private static final int SESSION_TIMEOUT = 5000; 15 | protected ZooKeeper zk; 16 | private CountDownLatch connectedSignal = new CountDownLatch(1); 17 | public void connect(String hosts) throws IOException, InterruptedException { 18 | zk = new ZooKeeper(hosts, SESSION_TIMEOUT, this); 19 | connectedSignal.await(); 20 | } 21 | @Override 22 | public void process(WatchedEvent event) { 23 | if (event.getState() == Watcher.Event.KeeperState.SyncConnected) { 24 | connectedSignal.countDown(); 25 | } 26 | } 27 | public void close() throws InterruptedException { 28 | zk.close(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/groupservice/JoinGroup.java: -------------------------------------------------------------------------------- 1 | package com.stonie.groupservice; 2 | 3 | import com.stonie.ConnectionWatcher; 4 | import org.apache.zookeeper.CreateMode; 5 | import org.apache.zookeeper.KeeperException; 6 | import org.apache.zookeeper.ZooDefs; 7 | 8 | /** 9 | * Created by aneasystone on 2018/8/4. 10 | */ 11 | public class JoinGroup extends ConnectionWatcher { 12 | public void join(String groupName, String memberName) throws KeeperException, 13 | InterruptedException { 14 | String path = "/" + groupName + "/" + memberName; 15 | String createdPath = zk.create(path, null/*data*/, ZooDefs.Ids.OPEN_ACL_UNSAFE, 16 | CreateMode.EPHEMERAL); 17 | System.out.println("Created " + createdPath); 18 | } 19 | public static void main(String[] args) throws Exception { 20 | JoinGroup joinGroup = new JoinGroup(); 21 | joinGroup.connect(args[0]); 22 | joinGroup.join(args[1], args[2]); 23 | // stay alive until process is killed or thread is interrupted 24 | Thread.sleep(Long.MAX_VALUE); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /laboratory/java/java-httpclient/src/main/java/com/stonie/HttpClientApp.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.apache.http.impl.client.CloseableHttpClient; 4 | import org.apache.http.impl.client.HttpClients; 5 | import org.apache.http.client.methods.HttpGet; 6 | import org.apache.http.client.methods.CloseableHttpResponse; 7 | import org.apache.http.util.EntityUtils; 8 | 9 | public class HttpClientApp 10 | { 11 | public static void main( String[] args ) 12 | { 13 | try { 14 | doGet(); 15 | } catch (Exception e) { 16 | System.out.println(e.getMessage()); 17 | } 18 | } 19 | 20 | private static void doGet () throws Exception { 21 | String url = "https://www.crx4chrome.com/crx/152953/"; 22 | CloseableHttpClient httpclient = HttpClients.createDefault(); 23 | HttpGet request = new HttpGet(url); 24 | request.setHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) ..."); 25 | CloseableHttpResponse response = httpclient.execute(request); 26 | String responseBody = EntityUtils.toString(response.getEntity()); 27 | System.out.println(responseBody); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/src/main/java/com/stonie/IOServer.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.net.ServerSocket; 6 | import java.net.Socket; 7 | 8 | public class IOServer { 9 | public static void main(String[] args) throws Exception { 10 | ServerSocket serverSocket = new ServerSocket(8000); 11 | while (true) { 12 | // 阻塞方法获取新的连接 13 | Socket socket = serverSocket.accept(); 14 | // 每一个新的连接都创建一个线程,负责读取数据 15 | new Thread(() -> { 16 | try { 17 | byte[] data = new byte[1024]; 18 | InputStream inputStream = socket.getInputStream(); 19 | while (true) { 20 | int len; 21 | // 按字节流方式读取数据 22 | while ((len = inputStream.read(data)) != -1) { 23 | System.out.println(new String(data, 0, len)); 24 | } 25 | } 26 | } catch (IOException e) { 27 | } 28 | }).start(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/groupservice/DeleteGroup.java: -------------------------------------------------------------------------------- 1 | package com.stonie.groupservice; 2 | 3 | import com.stonie.ConnectionWatcher; 4 | import org.apache.zookeeper.KeeperException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by aneasystone on 2018/8/4. 10 | */ 11 | public class DeleteGroup extends ConnectionWatcher { 12 | public void delete(String groupName) throws KeeperException, 13 | InterruptedException { 14 | String path = "/" + groupName; 15 | try { 16 | List children = zk.getChildren(path, false); 17 | for (String child : children) { 18 | zk.delete(path + "/" + child, -1); 19 | } 20 | zk.delete(path, -1); 21 | } catch (KeeperException.NoNodeException e) { 22 | System.out.printf("Group %s does not exist\n", groupName); 23 | System.exit(1); 24 | } 25 | } 26 | public static void main(String[] args) throws Exception { 27 | DeleteGroup deleteGroup = new DeleteGroup(); 28 | deleteGroup.connect(args[0]); 29 | deleteGroup.delete(args[1]); 30 | deleteGroup.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/configuration/ConfigUpdater.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration; 2 | 3 | import org.apache.zookeeper.KeeperException; 4 | 5 | import java.io.IOException; 6 | import java.util.Random; 7 | import java.util.concurrent.TimeUnit; 8 | 9 | /** 10 | * Created by aneasystone on 2018/8/5. 11 | */ 12 | public class ConfigUpdater { 13 | public static final String PATH = "/config"; 14 | private ActiveKeyValueStore store; 15 | private Random random = new Random(); 16 | public ConfigUpdater(String hosts) throws IOException, InterruptedException { 17 | store = new ActiveKeyValueStore(); 18 | store.connect(hosts); 19 | } 20 | public void run() throws InterruptedException, KeeperException { 21 | while (true) { 22 | String value = random.nextInt(100) + ""; 23 | store.write(PATH, value); 24 | System.out.printf("Set %s to %s\n", PATH, value); 25 | TimeUnit.SECONDS.sleep(random.nextInt(10)); 26 | } 27 | } 28 | public static void main(String[] args) throws Exception { 29 | ConfigUpdater configUpdater = new ConfigUpdater(args[0]); 30 | configUpdater.run(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/netty-helloworld/src/main/java/com/stonie/NettyClient.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import io.netty.bootstrap.Bootstrap; 4 | import io.netty.channel.Channel; 5 | import io.netty.channel.ChannelInitializer; 6 | import io.netty.channel.nio.NioEventLoopGroup; 7 | import io.netty.channel.socket.nio.NioSocketChannel; 8 | import io.netty.handler.codec.string.StringEncoder; 9 | 10 | import java.util.Date; 11 | 12 | public class NettyClient { 13 | public static void main(String[] args) throws InterruptedException { 14 | Bootstrap bootstrap = new Bootstrap(); 15 | NioEventLoopGroup group = new NioEventLoopGroup(); 16 | bootstrap.group(group) 17 | .channel(NioSocketChannel.class) 18 | .handler(new ChannelInitializer() { 19 | @Override 20 | protected void initChannel(Channel ch) { 21 | ch.pipeline().addLast(new StringEncoder()); 22 | } 23 | }); 24 | 25 | Channel channel = bootstrap.connect("127.0.0.1", 8000).channel(); 26 | while (true) { 27 | channel.writeAndFlush(new Date() + ": hello world!"); 28 | Thread.sleep(2000); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/fanout/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.fanout; 2 | 3 | import com.rabbitmq.client.BuiltinExchangeType; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | 8 | import java.io.IOException; 9 | import java.util.concurrent.TimeoutException; 10 | 11 | /** 12 | * Created by aneasystone on 2018/8/11. 13 | */ 14 | public class Producer { 15 | 16 | public static void main(String[] args) throws IOException, TimeoutException { 17 | ConnectionFactory factory = new ConnectionFactory(); 18 | factory.setUsername("guest"); 19 | factory.setPassword("guest"); 20 | factory.setHost("localhost"); 21 | Connection conn = factory.newConnection(); 22 | Channel channel = conn.createChannel(); 23 | 24 | channel.exchangeDeclare("logs.fanout", BuiltinExchangeType.FANOUT); 25 | channel.basicPublish("logs.fanout", "", null, "first log".getBytes()); 26 | channel.basicPublish("logs.fanout", "", null, "second log".getBytes()); 27 | channel.basicPublish("logs.fanout", "", null, "third log".getBytes()); 28 | 29 | channel.close(); 30 | conn.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/Simple.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.apache.zookeeper.CreateMode; 4 | import org.apache.zookeeper.WatchedEvent; 5 | import org.apache.zookeeper.Watcher; 6 | import org.apache.zookeeper.ZooDefs; 7 | import org.apache.zookeeper.ZooKeeper; 8 | 9 | import java.util.concurrent.CountDownLatch; 10 | 11 | /** 12 | * Created by aneasystone on 2018/8/4. 13 | */ 14 | public class Simple implements Watcher { 15 | 16 | private CountDownLatch connectedSignal = new CountDownLatch(1); 17 | 18 | @Override 19 | public void process(WatchedEvent watchedEvent) { 20 | if (watchedEvent.getState() == Watcher.Event.KeeperState.SyncConnected) { 21 | connectedSignal.countDown(); 22 | } 23 | } 24 | 25 | public void createNode() throws Exception { 26 | ZooKeeper zookeeper = new ZooKeeper("localhost:2181", 1000, this); 27 | connectedSignal.await(); 28 | zookeeper.create("/data", "Hello world".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); 29 | zookeeper.close(); 30 | } 31 | 32 | public static void main(String[] args) throws Exception { 33 | Simple simple = new Simple(); 34 | simple.createNode(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /library/Python.md: -------------------------------------------------------------------------------- 1 | ## Online Books 2 | 3 | * [Python 之旅](https://funhacks.gitbooks.io/explore-python/) - [funhacks](http://funhacks.net/) 4 | * [Python 2.7 教程](https://www.liaoxuefeng.com/wiki/897692888725344) - 廖雪峰的官方网站 5 | * [Python 入门指南](http://www.pythondoc.com/pythontutorial3/) 6 | * [笨办法学 Python (Learn Python The Hard Way)](https://paper.seebug.org/papers/old_sebug_paper/books/LearnPythonTheHardWay/index.html) 7 | * [草根学Python](https://www.readwithu.com/) 8 | * [Python HOWTOs](https://docs.python.org/2/howto/index.html) 9 | * [The Hitchhiker’s Guide to Python!](https://docs.python-guide.org/) 10 | 11 | ## 常用框架 12 | 13 | * [Requests 2.18.1 文档](http://cn.python-requests.org/zh_CN/latest/user/quickstart.html) 14 | * [Scrapy 入门教程](https://scrapy-chs.readthedocs.io/zh_CN/1.0/intro/tutorial.html) 15 | 16 | ### Django 17 | 18 | * [Django 中文文档](https://docs.djangoproject.com/zh-hans/2.2/) 19 | * [Django 英文文档](https://docs.djangoproject.com/en/2.2/) 20 | * [Django 搭建简易博客教程](https://andrew-liu.gitbooks.io/django-blog/content/) 21 | 22 | ### Flask 23 | 24 | * [Flask 中文文档](https://dormousehole.readthedocs.io/en/latest/) 25 | * [Flask 英文文档](http://flask.pocoo.org/docs/1.0/) 26 | 27 | ## 资源 28 | 29 | * [jobbole/awesome-python-cn - Python 资源大全中文版](https://github.com/jobbole/awesome-python-cn) -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/direct/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.direct; 2 | 3 | import com.rabbitmq.client.BuiltinExchangeType; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | 8 | import java.io.IOException; 9 | import java.util.concurrent.TimeoutException; 10 | 11 | /** 12 | * Created by aneasystone on 2018/8/11. 13 | */ 14 | public class Producer { 15 | 16 | public static void main(String[] args) throws IOException, TimeoutException { 17 | ConnectionFactory factory = new ConnectionFactory(); 18 | factory.setUsername("guest"); 19 | factory.setPassword("guest"); 20 | factory.setHost("localhost"); 21 | Connection conn = factory.newConnection(); 22 | Channel channel = conn.createChannel(); 23 | 24 | channel.exchangeDeclare("logs.direct", BuiltinExchangeType.DIRECT); 25 | channel.basicPublish("logs.direct", "info", null, "info log".getBytes()); 26 | channel.basicPublish("logs.direct", "warn", null, "warn log".getBytes()); 27 | channel.basicPublish("logs.direct", "error", null, "error log".getBytes()); 28 | 29 | channel.close(); 30 | conn.close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/references.md: -------------------------------------------------------------------------------- 1 | ### a list of references 2 | 3 | #### Spring 4 | 5 | * https://github.com/wuyouzhuguli/SpringAll 6 | * https://spring.io/guides 7 | 8 | #### Spring Boot 9 | 10 | * https://github.com/JeffLi1993/springboot-learning-example 11 | * https://github.com/ityouknow/spring-boot-examples 12 | * https://github.com/liaozihong/SpringBoot-Learning 13 | * https://github.com/527515025/springBoot 14 | * https://github.com/YuKongEr/SpringBoot-Study 15 | * https://github.com/cicadasmile/middle-ware-parent 16 | * https://github.com/lianggzone/springboot-action 17 | * https://github.com/xkcoding/spring-boot-demo 18 | * https://github.com/wyh-spring-ecosystem-student/spring-boot-student 19 | 20 | #### Spring Security & Shiro 21 | 22 | * [Spring Security Tutorial](https://github.com/waylau/spring-security-tutorial) 23 | * https://github.com/zhangkaitao/shiro-example 24 | 25 | #### Projects 26 | 27 | * https://github.com/ueboot/ueboot 28 | * https://github.com/paascloud/paascloud-master 29 | * https://github.com/hs-web/hsweb-framework 30 | * https://github.com/linlinjava/litemall 31 | * https://github.com/shuzheng/zheng 32 | * https://github.com/macrozheng/mall 33 | * https://github.com/spawpaw/mybatis-generator-gui-extension 34 | * https://github.com/lenve/vhr -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/task/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.task; 2 | 3 | import com.rabbitmq.client.Channel; 4 | import com.rabbitmq.client.Connection; 5 | import com.rabbitmq.client.ConnectionFactory; 6 | import org.apache.commons.lang3.StringUtils; 7 | 8 | import java.io.IOException; 9 | import java.util.concurrent.TimeoutException; 10 | 11 | /** 12 | * Created by aneasystone on 2018/8/11. 13 | */ 14 | public class Producer { 15 | 16 | public static void main(String[] args) throws IOException, TimeoutException { 17 | ConnectionFactory factory = new ConnectionFactory(); 18 | factory.setUsername("guest"); 19 | factory.setPassword("guest"); 20 | factory.setHost("localhost"); 21 | Connection conn = factory.newConnection(); 22 | Channel channel = conn.createChannel(); 23 | 24 | channel.queueDeclare("hello-queue", false, false, false, null); 25 | for (int i = 1; i <= 10; i++) { 26 | String message = "Hello World" + StringUtils.repeat(".", i); 27 | channel.basicPublish("", "hello-queue", null, message.getBytes()); 28 | System.out.println("Message Sent: " + message); 29 | } 30 | 31 | channel.close(); 32 | conn.close(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/groupservice/ListGroup.java: -------------------------------------------------------------------------------- 1 | package com.stonie.groupservice; 2 | 3 | import com.stonie.ConnectionWatcher; 4 | import org.apache.zookeeper.KeeperException; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Created by aneasystone on 2018/8/4. 10 | */ 11 | public class ListGroup extends ConnectionWatcher { 12 | public void list(String groupName) throws KeeperException, 13 | InterruptedException { 14 | String path = "/" + groupName; 15 | try { 16 | List children = zk.getChildren(path, false); 17 | if (children.isEmpty()) { 18 | System.out.printf("No members in group %s\n", groupName); 19 | System.exit(1); 20 | } 21 | for (String child : children) { 22 | System.out.println(child); 23 | } 24 | } catch (KeeperException.NoNodeException e) { 25 | System.out.printf("Group %s does not exist\n", groupName); 26 | System.exit(1); 27 | } 28 | } 29 | public static void main(String[] args) throws Exception { 30 | ListGroup listGroup = new ListGroup(); 31 | listGroup.connect(args[0]); 32 | listGroup.list(args[1]); 33 | listGroup.close(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/configuration/ActiveKeyValueStore.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration; 2 | 3 | import com.stonie.ConnectionWatcher; 4 | import org.apache.zookeeper.CreateMode; 5 | import org.apache.zookeeper.KeeperException; 6 | import org.apache.zookeeper.Watcher; 7 | import org.apache.zookeeper.ZooDefs; 8 | import org.apache.zookeeper.data.Stat; 9 | 10 | import java.nio.charset.Charset; 11 | 12 | /** 13 | * Created by aneasystone on 2018/8/5. 14 | */ 15 | public class ActiveKeyValueStore extends ConnectionWatcher { 16 | private static final Charset CHARSET = Charset.forName("UTF-8"); 17 | public void write(String path, String value) throws InterruptedException, 18 | KeeperException { 19 | Stat stat = zk.exists(path, false); 20 | if (stat == null) { 21 | zk.create(path, value.getBytes(CHARSET), ZooDefs.Ids.OPEN_ACL_UNSAFE, 22 | CreateMode.PERSISTENT); 23 | } else { 24 | zk.setData(path, value.getBytes(CHARSET), -1); 25 | } 26 | } 27 | public String read(String path, Watcher watcher) throws InterruptedException, 28 | KeeperException { 29 | byte[] data = zk.getData(path, watcher, null/*stat*/); 30 | return new String(data, CHARSET); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-restful/src/main/resources/mapper/PersonMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 19 | INSERT INTO `person` (`name`, `age`) VALUES (#{name}, #{age}) 20 | 21 | 22 | 23 | DELETE FROM `person` WHERE `id` = #{id} 24 | 25 | 26 | 27 | UPDATE `person` SET `name` = #{name}, `age` = #{age} WHERE `id` = #{id} 28 | 29 | 30 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/resources/mapper/PersonMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 19 | INSERT INTO `person` (`name`, `age`) VALUES (#{name}, #{age}) 20 | 21 | 22 | 23 | DELETE FROM `person` WHERE `id` = #{id} 24 | 25 | 26 | 27 | UPDATE `person` SET `name` = #{name}, `age` = #{age} WHERE `id` = #{id} 28 | 29 | 30 | -------------------------------------------------------------------------------- /library/知识库.md: -------------------------------------------------------------------------------- 1 | ### 书单 2 | 3 | * [程序员最应该读的图书(中译版)](http://www.douban.com/doulist/995755/) - 豆瓣豆列 4 | * [程序员必读书单 1.0](http://lucida.me/blog/developer-reading-list/) - Lucida 5 | * [Netkiller 系列电子书](http://netkiller.github.io/) 6 | * [国外程序员推荐:每个程序员都应该读的非编程书](http://blog.jobbole.com/72365/) 7 | * [List of Free Learning Resources](https://github.com/EbookFoundation/free-programming-books) 8 | * [免费的编程中文书籍索引](https://github.com/justjavac/free-programming-books-zh_CN) 9 | * [计算机开放电子书汇总](https://github.com/it-ebooks/it-ebooks-archive) 10 | 11 | ### 知识库 12 | 13 | * [w3cschool 极客教程](https://www.w3cschool.cn/tutorial) 14 | * [菜鸟教程](https://www.runoob.com/) 15 | * [看云](https://www.kancloud.cn/explore) 16 | * [书伴](https://bookfere.com/ebook) 17 | * [Love2](https://love2.io/) 18 | * [GitChat](https://gitbook.cn/gitchat/columns) 19 | * [优达学城(Udacity)](https://cn.udacity.com/) 20 | * [云雀](https://www.yuque.com/) 21 | * [极客学院Wiki - IT 技术图文教程库](http://wiki.jikexueyuan.com/) 22 | * [易百教程 - 专注于IT教程和实例](https://www.yiibai.com/) 23 | * [书栈网 · BookStack](https://www.bookstack.cn/) 24 | * [ApacheCN 布客](https://www.ibooker.org.cn/docs/) 25 | 26 | ### 订阅 & 精选 27 | 28 | * [Feedly](https://feedly.com/i/latest) 29 | * [Inoreader](https://www.inoreader.com/dashboard) 30 | * [推酷](https://www.tuicool.com/ah) 31 | * [码农文库](https://tool.lu/article/) 32 | * [开发者头条](https://toutiao.io/) 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/src/main/resources/mapper/PersonMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 19 | INSERT INTO `person` (`name`, `age`) VALUES (#{name}, #{age}) 20 | 21 | 22 | 23 | DELETE FROM `person` WHERE `id` = #{id} 24 | 25 | 26 | 27 | UPDATE `person` SET `name` = #{name}, `age` = #{age} WHERE `id` = #{id} 28 | 29 | 30 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/resources/mapper/PersonMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 19 | INSERT INTO `person` (`name`, `age`) VALUES (#{name}, #{age}) 20 | 21 | 22 | 23 | DELETE FROM `person` WHERE `id` = #{id} 24 | 25 | 26 | 27 | UPDATE `person` SET `name` = #{name}, `age` = #{age} WHERE `id` = #{id} 28 | 29 | 30 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/task2/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.task2; 2 | 3 | import com.rabbitmq.client.BuiltinExchangeType; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | import org.apache.commons.lang3.StringUtils; 8 | 9 | import java.io.IOException; 10 | import java.util.concurrent.TimeoutException; 11 | 12 | /** 13 | * Created by aneasystone on 2018/8/11. 14 | */ 15 | public class Producer { 16 | 17 | public static void main(String[] args) throws IOException, TimeoutException { 18 | ConnectionFactory factory = new ConnectionFactory(); 19 | factory.setUsername("guest"); 20 | factory.setPassword("guest"); 21 | factory.setHost("localhost"); 22 | Connection conn = factory.newConnection(); 23 | Channel channel = conn.createChannel(); 24 | 25 | channel.exchangeDeclare("hello-exchange", BuiltinExchangeType.DIRECT); 26 | for (int i = 1; i <= 10; i++) { 27 | String message = "Hello World" + StringUtils.repeat(".", i); 28 | channel.basicPublish("hello-exchange", "hello-key", null, message.getBytes()); 29 | System.out.println("Message Sent: " + message); 30 | } 31 | 32 | channel.close(); 33 | conn.close(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | spring-helloworld-auto-scan-by-java 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | spring-helloworld-auto-scan-by-java 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | org.springframework 20 | spring-context 21 | 4.0.6.RELEASE 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-compiler-plugin 30 | 3.2 31 | 32 | 1.8 33 | 1.8 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-xml/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | spring-helloworld-auto-scan-by-xml 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | spring-helloworld-auto-scan-by-xml 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | org.springframework 20 | spring-context 21 | 4.0.6.RELEASE 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-compiler-plugin 30 | 3.2 31 | 32 | 1.8 33 | 1.8 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-jpa/src/main/java/com/stonie/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class SwaggerConfig { 17 | 18 | @Bean 19 | public Docket docket() { 20 | ApiInfo apiInfo = new ApiInfoBuilder() 21 | .title("Person API") 22 | .contact(new Contact("aneasystone", "https://www.aneasytone.com", "aneasystone@163.com")) 23 | .version("1.0-SNAPSHOT") 24 | .build(); 25 | return new Docket(DocumentationType.SWAGGER_2) 26 | .apiInfo(apiInfo) 27 | .select() 28 | .apis(RequestHandlerSelectors.basePackage("com.stonie")) 29 | .paths(PathSelectors.any()) 30 | .build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/springboot-swagger/src/main/java/com/stonie/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class SwaggerConfig { 17 | 18 | @Bean 19 | public Docket docket() { 20 | ApiInfo apiInfo = new ApiInfoBuilder() 21 | .title("Person API") 22 | .contact(new Contact("aneasystone", "https://www.aneasytone.com", "aneasystone@163.com")) 23 | .version("1.0-SNAPSHOT") 24 | .build(); 25 | return new Docket(DocumentationType.SWAGGER_2) 26 | .apiInfo(apiInfo) 27 | .select() 28 | .apis(RequestHandlerSelectors.basePackage("com.stonie")) 29 | .paths(PathSelectors.any()) 30 | .build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-java/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | spring-helloworld-manual-config-by-java 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | spring-helloworld-manual-config-by-java 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | org.springframework 20 | spring-context 21 | 4.0.6.RELEASE 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-compiler-plugin 30 | 3.2 31 | 32 | 1.8 33 | 1.8 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/manual-config-by-xml/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | spring-helloworld-manual-config-by-xml 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | spring-helloworld-manual-config-by-xml 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | org.springframework 20 | spring-context 21 | 4.0.6.RELEASE 22 | 23 | 24 | 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-compiler-plugin 30 | 3.2 31 | 32 | 1.8 33 | 1.8 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-pagehelper/src/main/java/com/stonie/SwaggerConfig.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import springfox.documentation.builders.ApiInfoBuilder; 6 | import springfox.documentation.builders.PathSelectors; 7 | import springfox.documentation.builders.RequestHandlerSelectors; 8 | import springfox.documentation.service.ApiInfo; 9 | import springfox.documentation.service.Contact; 10 | import springfox.documentation.spi.DocumentationType; 11 | import springfox.documentation.spring.web.plugins.Docket; 12 | import springfox.documentation.swagger2.annotations.EnableSwagger2; 13 | 14 | @Configuration 15 | @EnableSwagger2 16 | public class SwaggerConfig { 17 | 18 | @Bean 19 | public Docket docket() { 20 | ApiInfo apiInfo = new ApiInfoBuilder() 21 | .title("Person API") 22 | .contact(new Contact("aneasystone", "https://www.aneasytone.com", "aneasystone@163.com")) 23 | .version("1.0-SNAPSHOT") 24 | .build(); 25 | return new Docket(DocumentationType.SWAGGER_2) 26 | .apiInfo(apiInfo) 27 | .select() 28 | .apis(RequestHandlerSelectors.basePackage("com.stonie")) 29 | .paths(PathSelectors.any()) 30 | .build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/Application.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import org.apache.zookeeper.CreateMode; 4 | import org.apache.zookeeper.Watcher; 5 | import org.apache.zookeeper.ZooDefs; 6 | import org.apache.zookeeper.ZooKeeper; 7 | import org.springframework.boot.CommandLineRunner; 8 | import org.springframework.boot.SpringApplication; 9 | import org.springframework.boot.autoconfigure.SpringBootApplication; 10 | 11 | @SpringBootApplication 12 | public class Application implements CommandLineRunner { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(Application.class, args); 16 | } 17 | 18 | @Override 19 | public void run(String... args) throws Exception { 20 | Watcher watcher = event -> System.out.println("receive event:" + event); 21 | // sessionTimeout 设置的很长,是为了避免出现:KeeperErrorCode = ConnectionLoss for node 错误 22 | final ZooKeeper zookeeper = new ZooKeeper("192.168.0.107:2181", 99999999, watcher); 23 | String dataPath = "/data"; 24 | if (zookeeper.exists(dataPath, false) == null) { 25 | zookeeper.create(dataPath, "Hello world".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); 26 | } 27 | String value = new String(zookeeper.getData(dataPath, watcher, null)); 28 | zookeeper.close(); 29 | System.out.println(value); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /laboratory/frontend/nodejs-es6/README.md: -------------------------------------------------------------------------------- 1 | ## Nodejs 支持 ES6 2 | 3 | Nodejs 默认不支持 ES6 的大多数语法,比如 import/export 等,在运行时会报错: 4 | 5 | ``` 6 | SyntaxError: Unexpected token import 7 | at createScript (vm.js:80:10) 8 | at Object.runInThisContext (vm.js:139:10) 9 | at Module._compile (module.js:616:28) 10 | at Object.Module._extensions..js (module.js:663:10) 11 | at Module.load (module.js:565:32) 12 | at tryModuleLoad (module.js:505:12) 13 | at Function.Module._load (module.js:497:3) 14 | at Function.Module.runMain (module.js:693:10) 15 | at startup (bootstrap_node.js:188:16) 16 | at bootstrap_node.js:609:3 17 | ``` 18 | 19 | ### import/export 替代写法 20 | 21 | 一种解决方法是使用 `import` 和 `export` 替代写法:`require` 和 `module.exports`。 22 | 23 | ``` 24 | import { foo } from './foo' 25 | ``` 26 | 27 | 可以写成: 28 | 29 | ``` 30 | const foo = require('./foo-es5') 31 | ``` 32 | 33 | ``` 34 | export function foo() { 35 | } 36 | ``` 37 | 38 | 可以写成: 39 | 40 | ``` 41 | module.exports = foo 42 | ``` 43 | 44 | ### babel 45 | 46 | 另一种解决方法是使用 `babel` 将 ES6 语法转换为 ES5 语法。 47 | 48 | 在 `package.json` 的 devDependencies 中添加依赖: 49 | 50 | ``` 51 | "devDependencies": { 52 | "babel-cli": "^6.26.0", 53 | "babel-preset-env": "^1.3.2" 54 | } 55 | ``` 56 | 57 | 并添加一个脚本,用于启动 `babel-node`: 58 | 59 | ``` 60 | "scripts": { 61 | "es6": "babel-node index-es6.js --presets env" 62 | } 63 | ``` 64 | 65 | 然后运行 `npm run es6`。 -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/configuration2/ConfigReader.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration2; 2 | 3 | import org.apache.zookeeper.WatchedEvent; 4 | import org.apache.zookeeper.Watcher; 5 | import org.apache.zookeeper.ZooKeeper; 6 | 7 | /** 8 | * Created by aneasystone on 2018/8/4. 9 | */ 10 | public class ConfigReader implements Watcher { 11 | private ZooKeeper zookeeper; 12 | private String configPath; 13 | public ConfigReader(ZooKeeper zookeeper, String configPath) { 14 | this.zookeeper = zookeeper; 15 | this.configPath = configPath; 16 | } 17 | @Override 18 | public void process(WatchedEvent watchedEvent) { 19 | if (watchedEvent.getType() == Watcher.Event.EventType.NodeDataChanged) { 20 | readConfig(); 21 | } 22 | } 23 | public void readConfig() { 24 | try { 25 | byte[] data = zookeeper.getData(configPath, this, null/*stat*/); 26 | System.out.println(new String(data)); 27 | } catch (Exception e) { 28 | e.printStackTrace(); 29 | } 30 | } 31 | public static void main(String[] args) throws Exception { 32 | ZooKeeper zookeeper = new ZooKeeper("localhost:2181", 30000, null); 33 | ConfigReader reader = new ConfigReader(zookeeper, "/configuration"); 34 | reader.readConfig(); 35 | Thread.sleep(Long.MAX_VALUE); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/src/main/java/com/stonie/configuration2/ConfigWriter.java: -------------------------------------------------------------------------------- 1 | package com.stonie.configuration2; 2 | 3 | import org.apache.zookeeper.CreateMode; 4 | import org.apache.zookeeper.KeeperException; 5 | import org.apache.zookeeper.ZooDefs; 6 | import org.apache.zookeeper.ZooKeeper; 7 | import org.apache.zookeeper.data.Stat; 8 | 9 | /** 10 | * Created by aneasystone on 2018/8/5. 11 | */ 12 | public class ConfigWriter { 13 | private ZooKeeper zookeeper; 14 | private String configPath; 15 | public ConfigWriter(ZooKeeper zookeeper, String configPath) { 16 | this.zookeeper = zookeeper; 17 | this.configPath = configPath; 18 | } 19 | public void writeConfig(String configData) throws KeeperException, InterruptedException { 20 | Stat stat = zookeeper.exists(configPath, false); 21 | if (stat == null) { 22 | zookeeper.create(configPath, configData.getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); 23 | } else { 24 | zookeeper.setData(configPath, configData.getBytes(), -1); 25 | } 26 | } 27 | public static void main(String[] args) throws Exception { 28 | ZooKeeper zookeeper = new ZooKeeper("localhost:2181", 30000, null); 29 | ConfigWriter writer = new ConfigWriter(zookeeper, "/configuration"); 30 | writer.writeConfig("Hello"); 31 | zookeeper.close(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-zookeeper/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | com.stonie 7 | spring-boot-zookeeper 8 | 1.0-SNAPSHOT 9 | 10 | org.springframework.boot 11 | spring-boot-starter-parent 12 | 2.0.2.RELEASE 13 | 14 | 15 | 16 | org.springframework.boot 17 | spring-boot-starter 18 | 19 | 20 | org.apache.zookeeper 21 | zookeeper 22 | 3.3.6 23 | 24 | 25 | 26 | 1.8 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-maven-plugin 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /library/程序员.md: -------------------------------------------------------------------------------- 1 | ### 全栈 2 | 3 | * [程序员的自我修养](https://www.kancloud.cn/kancloud/a-programmer-prepares) 4 | * [Growth: 全栈增长工程师指南](https://growth.phodal.com/) 5 | * [[译文]程序员能力矩阵 Programmer Competency Matrix](http://static.icybear.net/%5BCN%5DProgrammer%20competency%20matrix.htm) 6 | * [图说设计模式 — Graphic Design Patterns](https://design-patterns.readthedocs.io/zh_CN/latest/index.html) 7 | * [程序员你为什么这么累](https://xwjie.github.io/rule/) 8 | * [stanzhai/be-a-professional-programmer: 成为专业程序员路上用到的各种优秀资料、神器及框架](https://github.com/stanzhai/be-a-professional-programmer) 9 | * [程序员技能图谱](https://github.com/TeamStuQ/skill-map) 10 | 11 | ### 架构师 12 | 13 | * [toutiaoio/awesome-architecture: 架构师技术图谱,助你早日成为架构师](https://github.com/toutiaoio/awesome-architecture) 14 | 15 | ### 求职面试 16 | 17 | * [牛客网 - 互联网求职神器和备考学习平台](https://www.nowcoder.com/) 18 | * [InterviewMap - 打造最好的面试图谱](https://yuchengkai.cn/docs/) 19 | * [Advanced-Frontend/Daily-Interview-Question](https://github.com/Advanced-Frontend/Daily-Interview-Question) 20 | * [Android校招面试指南](https://lrh1993.gitbooks.io/android_interview_guide/content/) 21 | * [CyC2018/CS-Notes: 技术面试必备基础知识、Leetcode 题解、后端面试、Java 面试、春招、秋招、操作系统、计算机网络、系统设计](https://github.com/CyC2018/CS-Notes) 22 | * [CyC2018/Job-Recommend: 🔎 互联网内推信息(社招、校招、实习)](https://github.com/CyC2018/Job-Recommend) 23 | * [kdn251/interviews: Everything you need to know to get the job.](https://github.com/kdn251/interviews) 24 | 25 | ### 技能 26 | 27 | * [科学上网](https://github.com/haoel/haoel.github.io) 28 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/priority/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.priority; 2 | 3 | import com.rabbitmq.client.AMQP; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | 8 | import java.io.IOException; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | import java.util.concurrent.TimeoutException; 12 | 13 | /** 14 | * Created by aneasystone on 2018/8/11. 15 | */ 16 | public class Producer { 17 | 18 | public static void main(String[] args) throws IOException, TimeoutException { 19 | ConnectionFactory factory = new ConnectionFactory(); 20 | factory.setUsername("guest"); 21 | factory.setPassword("guest"); 22 | factory.setHost("localhost"); 23 | Connection conn = factory.newConnection(); 24 | Channel channel = conn.createChannel(); 25 | 26 | Map arguments = new HashMap(); 27 | arguments.put("x-max-priority", 3); 28 | channel.queueDeclare("priority-queue", false, false, false, arguments); 29 | for (int i = 1; i <= 5; i++) { 30 | AMQP.BasicProperties.Builder properties = new AMQP.BasicProperties().builder().priority(i-5); 31 | channel.basicPublish("", "priority-queue", properties.build(), ("Hello World" + i).getBytes()); 32 | } 33 | 34 | channel.close(); 35 | conn.close(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-cli/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | springboot-helloworld-cli 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | springboot-helloworld-cli 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.0.2.RELEASE 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter 27 | 28 | 29 | junit 30 | junit 31 | 3.8.1 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-maven-plugin 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /laboratory/java/springboot-helloworld-web/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | springboot-helloworld-web 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | springboot-helloworld-web 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.0.2.RELEASE 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | junit 30 | junit 31 | 3.8.1 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-maven-plugin 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /laboratory/java/spring-helloworld/auto-scan-by-java/src/main/java/com/stonie/App.java: -------------------------------------------------------------------------------- 1 | package com.stonie; 2 | 3 | import com.stonie.beans.HelloWorldService; 4 | import com.stonie.beans.TimeService; 5 | import com.stonie.configuration.AppConfig; 6 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 7 | 8 | public class App { 9 | public static void main( String[] args ) { 10 | 11 | // 12 | // 方式一:使用 AnnotationConfigApplicationContext 构造函数直接注册 13 | // 14 | //AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class); 15 | 16 | // 17 | // 方式二:使用 register() + refresh() 方法注册 18 | // 19 | //AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); 20 | //context.register(AppConfig.class); 21 | //context.refresh(); 22 | 23 | // 24 | // 方式三:使用 scan() 方法扫描自动注册 25 | // 26 | AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(); 27 | context.scan("com.stonie.beans"); 28 | context.refresh(); 29 | 30 | HelloWorldService helloWorldService = (HelloWorldService) context.getBean("helloWorldService"); 31 | helloWorldService.sayHello("World"); 32 | 33 | TimeService timeService = (TimeService) context.getBean("timeService"); 34 | System.out.println(timeService.getCurrentTime()); 35 | 36 | context.close(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /laboratory/java/springboot-config/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | springboot-config 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | springboot-config 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.0.2.RELEASE 21 | 22 | 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-web 27 | 28 | 29 | junit 30 | junit 31 | 3.8.1 32 | test 33 | 34 | 35 | 36 | 37 | 38 | 39 | org.springframework.boot 40 | spring-boot-maven-plugin 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /library/在线资源.md: -------------------------------------------------------------------------------- 1 | ### 在线资源 2 | 3 | * [虫部落-让搜索更简单!](https://www.chongbuluo.com/) 4 | - [电子书搜索](https://ebook.chongbuluo.com/) 5 | - [快搜](https://search.chongbuluo.com/) 6 | - [数据搜索](http://data.chongbuluo.com/) 7 | - [学术搜索](https://scholar.chongbuluo.com/) 8 | - [设计素材搜索](http://image.chongbuluo.com/) 9 | - [资源搜索](http://magnet.chongbuluo.com/) 10 | * [搜磁力 - 搜一搜,发现精彩世界](https://www.soucili.net/) 11 | * [Jiumo Search 鸠摩搜索 - 文档搜索引擎](https://www.jiumodiary.com/) 12 | * [linuxidc资源(用户名密码为www.linuxidc.com)](https://linux.linuxidc.com/index.php) 13 | * [爱盘,最新的在线破解工具包](http://down.52pojie.cn/) 14 | * [网盘搜索,就上盘搜搜 - 最好用的百度云搜索引擎](http://www.pansoso.com/) 15 | * [MySlide - 专注PPT分享,追随SlideShare和SpeakerDeck的脚步](https://myslide.cn/) 16 | 17 | ### 设计素材 18 | 19 | * [千图网_专注免费设计素材下载的网站_免费设计图片素材中国](https://www.58pic.com/) 20 | * [求字体网](http://www.qiuziti.com/) 21 | * [Iconfont-阿里巴巴矢量图标库](http://iconfont.cn/) 22 | 23 | ### 网盘 24 | 25 | * [百度网盘](http://pan.baidu.com/disk/home) 26 | * [115 网盘](https://115.com/) 27 | * [Google 云端硬盘](https://drive.google.com/drive/my-drive) 28 | * [Seafile - 开源的企业私有网盘 私有云存储软件](https://www.seafile.com/home/) 29 | * [ownCloud.org](https://owncloud.org/) 30 | 31 | ### 代理 32 | 33 | * [站大爷 - 专业Http代理IP/Socks5代理IP供应平台/免费代理IP](http://ip.zdaye.com/) 34 | * [爬虫代理哪家强?十大付费代理详细对比评测出炉! | 静觅](https://cuiqingcai.com/5094.html) 35 | 36 | ### VPS 37 | 38 | * [老左常用国内/国外VPS推荐 | 老左博客](http://www.laozuo.org/myvps) 39 | * [2018年最好的国外VPS推荐 —— 购买指南 - 十佳评测](https://www.10besty.com/best-vps-hosting-services/) 40 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/hello/Consumer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.hello; 2 | 3 | import com.rabbitmq.client.AMQP; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | import com.rabbitmq.client.DefaultConsumer; 8 | import com.rabbitmq.client.Envelope; 9 | 10 | import java.io.IOException; 11 | import java.util.concurrent.TimeoutException; 12 | 13 | /** 14 | * Created by aneasystone on 2018/8/11. 15 | */ 16 | public class Consumer { 17 | 18 | public static void main(String[] args) throws IOException, TimeoutException { 19 | ConnectionFactory factory = new ConnectionFactory(); 20 | factory.setUsername("guest"); 21 | factory.setPassword("guest"); 22 | factory.setHost("localhost"); 23 | Connection conn = factory.newConnection(); 24 | final Channel channel = conn.createChannel(); 25 | 26 | System.out.println(" [*] Waiting for messages. To exit press CTRL+C"); 27 | channel.queueDeclare("hello-queue", false, false, false, null); 28 | channel.basicConsume("hello-queue", true, new DefaultConsumer(channel) { 29 | @Override 30 | public void handleDelivery( 31 | String consumerTag, 32 | Envelope envelope, 33 | AMQP.BasicProperties properties, 34 | byte[] body) throws IOException { 35 | System.out.println("Message Recv: " + new String(body, "UTF-8")); 36 | } 37 | }); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /laboratory/java/spring-boot-rabbitmq/src/main/java/com/stonie/topic/Producer.java: -------------------------------------------------------------------------------- 1 | package com.stonie.topic; 2 | 3 | import com.rabbitmq.client.BuiltinExchangeType; 4 | import com.rabbitmq.client.Channel; 5 | import com.rabbitmq.client.Connection; 6 | import com.rabbitmq.client.ConnectionFactory; 7 | 8 | import java.io.IOException; 9 | import java.util.concurrent.TimeoutException; 10 | 11 | /** 12 | * Created by aneasystone on 2018/8/11. 13 | */ 14 | public class Producer { 15 | 16 | public static void main(String[] args) throws IOException, TimeoutException { 17 | ConnectionFactory factory = new ConnectionFactory(); 18 | factory.setUsername("guest"); 19 | factory.setPassword("guest"); 20 | factory.setHost("localhost"); 21 | Connection conn = factory.newConnection(); 22 | Channel channel = conn.createChannel(); 23 | 24 | channel.exchangeDeclare("logs.topic", BuiltinExchangeType.TOPIC); 25 | channel.basicPublish("logs.topic", "cron.info", null, "cron info log".getBytes()); 26 | channel.basicPublish("logs.topic", "cron.warn", null, "cron warn log".getBytes()); 27 | channel.basicPublish("logs.topic", "cron.error", null, "cron error log".getBytes()); 28 | channel.basicPublish("logs.topic", "kernel.info", null, "kernel info log".getBytes()); 29 | channel.basicPublish("logs.topic", "kernel.warn", null, "kernel warn log".getBytes()); 30 | channel.basicPublish("logs.topic", "kernel.error", null, "kernel error log".getBytes()); 31 | 32 | channel.close(); 33 | conn.close(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /laboratory/java/java-helloworld-maven/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | com.stonie 6 | java-helloworld-maven 7 | 1.0-SNAPSHOT 8 | jar 9 | 10 | java-helloworld-maven 11 | http://maven.apache.org 12 | 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | junit 20 | junit 21 | 3.8.1 22 | test 23 | 24 | 25 | 26 | 27 | 28 | 29 | org.apache.maven.plugins 30 | maven-shade-plugin 31 | 1.2.1 32 | 33 | 34 | package 35 | 36 | shade 37 | 38 | 39 | 40 | 41 | com.stonie.App 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /laboratory/java/springboot-mybatis-xml/README.md: -------------------------------------------------------------------------------- 1 | ## 实战 Spring Boot 和 MyBatis 2 | 3 | 在 `springboot-mybatis-mysql` 例子中,我们使用 MyBatis 对数据库进行了简单的增删改查,这里用的是 MyBatis 的注解形式,直接将 SQL 语句写在 `PersonMapper` 接口的各个方法的注解上。这在 SQL 语句很简单时没有太大的问题,代码看起来也很紧凑,但是如果涉及到的 SQL 比较复杂,将 SQL 写在注解里可能会导致代码非常臃肿,这时,推荐使用 MyBatis 的 XML 配置方式。 4 | 5 | 首先我们在 resources 下创建一个 mapper 目录,这个目录用于存放我们的 XML 配置,MyBatis XML 文件的格式大抵如下: 6 | 7 | ``` 8 | 9 | 10 | 11 | 12 | 13 | 14 |