-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.json
More file actions
1 lines (1 loc) · 15.6 KB
/
Copy pathcontent.json
File metadata and controls
1 lines (1 loc) · 15.6 KB
1
{"meta":{"title":"张小一的博客","subtitle":"胆小认生,不易相处","description":"坚定信念,有追求,专注成果为导向,树立目标,坚持不懈,勇敢,乐观面对工作和生活中的困难和挑战,拒绝抱怨,拒绝懒惰拖延,平庸的人总是抱怨自己不懂的事情。不懊悔过去和幻想未来,实践中总结,树立责任感和责任心,实现自我成长!","author":"非专业程序员","url":"http://yoursite.com"},"pages":[{"title":"about","date":"2018-04-15T12:55:26.000Z","updated":"2018-04-15T13:03:31.922Z","comments":true,"path":"about/index.html","permalink":"http://yoursite.com/about/index.html","excerpt":"","text":""},{"title":"works","date":"2018-04-14T08:17:58.000Z","updated":"2018-04-14T08:18:48.452Z","comments":true,"path":"works/index.html","permalink":"http://yoursite.com/works/index.html","excerpt":"","text":""}],"posts":[{"title":"HTML Entities","slug":"HTML-Entities","date":"2018-04-23T00:18:06.000Z","updated":"2018-04-23T00:23:56.317Z","comments":true,"path":"2018/04/23/HTML-Entities/","link":"","permalink":"http://yoursite.com/2018/04/23/HTML-Entities/","excerpt":"","text":"Some UsefulResult| Description| Entity Name| Entity Number |non-breaking space| |  <| less than| <| < | greater than| >| >&| ampersand| &| &¢| cent| ¢| ¢£| pound| £| £¥| yen| ¥| ¥€| euro| €| €©| copyright| ©| ©®| registered trademark| ®| ® Combining Diacritical MarksMark| Character| Construct| Result ̀| a| à| à ́| a| á| á ̂| a| â| â ̃| a| ã| ã ̀| O| Ò| Ò ́| O| Ó| Ó ̂| O| Ô| Ô ̃| O| Õ| Õ","categories":[{"name":"前端","slug":"前端","permalink":"http://yoursite.com/categories/前端/"}],"tags":[{"name":"html","slug":"html","permalink":"http://yoursite.com/tags/html/"}]},{"title":"webpack","slug":"webpack","date":"2018-04-22T04:14:57.000Z","updated":"2018-04-22T04:42:42.000Z","comments":true,"path":"2018/04/22/webpack/","link":"","permalink":"http://yoursite.com/2018/04/22/webpack/","excerpt":"","text":"前提 nodejs npm or yarn 初始化 mkdir project && cd project yarn init -y yarn add webpack webpack-cli 添加webpack配置文件 修改package.json 文件,添加脚本","categories":[{"name":"前端","slug":"前端","permalink":"http://yoursite.com/categories/前端/"}],"tags":[{"name":"前端","slug":"前端","permalink":"http://yoursite.com/tags/前端/"}]},{"title":"crypto","slug":"crypto","date":"2018-04-21T08:16:42.000Z","updated":"2018-04-21T08:27:21.077Z","comments":true,"path":"2018/04/21/crypto/","link":"","permalink":"http://yoursite.com/2018/04/21/crypto/","excerpt":"","text":"加密 什么是加密 什么是编码 摘要 摘要是干什么的,跟加密有什么区别","categories":[{"name":"java","slug":"java","permalink":"http://yoursite.com/categories/java/"}],"tags":[{"name":"java","slug":"java","permalink":"http://yoursite.com/tags/java/"}]},{"title":"关于编码","slug":"Java编码","date":"2018-04-21T08:16:20.000Z","updated":"2018-04-22T04:13:01.591Z","comments":true,"path":"2018/04/21/Java编码/","link":"","permalink":"http://yoursite.com/2018/04/21/Java编码/","excerpt":"","text":"基本概念 hex也称为base16,意思是使用16个可见字符来表示一个二进制数组,编码后数据大小将翻倍,因为1个字符需要用2个可见字符来表示。 base32,意思是使用32个可见字符来表示一个二进制数组,编码后数据大小变成原来的8/5,也即5个字符用8个可见字符表示,但是最后如果不足8个字符,将用=来补充。 base64,意思是使用64个可见字符来表示一个二进制数组,编码后数据大小变成原来的4/3,也即3个字符用4个可见字符来表示。 使用场景1有很多字符是不可见的,我们需要把这些不可见字符变成可见字符。那为啥要变成可见字符?你是看着乱码舒服还是看着可见字符舒服呢?其实不仅仅舒不舒服的问题,有些时候还必须要用可见字符,例如在网络中传输数据时,不同路由器对于不可见字符的处理是不同的,因此可能出现数据错误,因此还必须使用可见字符。 \bUnicode 只是一个符号集,将世界上所有的符号都纳入其中。 只规定了符号的二进制代码,却没有规定这个二进制代码应该如何存储。 乱码乱码是因为编码、解码方式不一致,因此要知道字符的编码方式,然后按照同样的方式去解码。 编码转换方法 new String("hello".getBytes("ISO-8859-1"), "UTF-8"); DemoHEX 依赖Guava /** * Hex编码, 将byte[]编码为String,默认为ABCDEF为大写字母. */ public static String encodeHex(byte[] input) { return BaseEncoding.base16().encode(input); } /** * Hex解码, 将String解码为byte[]. * * 字符串有异常时抛出IllegalArgumentException. */ public static byte[] decodeHex(CharSequence input) { return BaseEncoding.base16().decode(input); } Base32Base64 依赖Guava /** * Base64编码. */ public static String encodeBase64(byte[] input) { return BaseEncoding.base64().encode(input); } /** * Base64解码. * * 如果字符不合法,抛出IllegalArgumentException */ public static byte[] decodeBase64(CharSequence input) { return BaseEncoding.base64().decode(input); } 区别与联系区别主要就是空间效率的区别,base64是具有比较高的空间效率的。当然,hex编码不区分大小写,但是base32与base64是区分的。联系就是大家都是一种稳定的把二进制数组变成可见字符的编码方式。base32中StdEncoding和HexEncoding所使用的字符不同,但是具体其他区别我也不是很清楚。base64中URLEncoding一般用于编码URL","categories":[{"name":"java","slug":"java","permalink":"http://yoursite.com/categories/java/"}],"tags":[{"name":"java","slug":"java","permalink":"http://yoursite.com/tags/java/"}]},{"title":"exception处理","slug":"exception","date":"2018-04-18T22:51:12.000Z","updated":"2018-04-18T23:15:37.862Z","comments":true,"path":"2018/04/19/exception/","link":"","permalink":"http://yoursite.com/2018/04/19/exception/","excerpt":"","text":"运行时 vs not\bspring统一异常处理异常日志记录异常堆栈信息","categories":[{"name":"java","slug":"java","permalink":"http://yoursite.com/categories/java/"}],"tags":[{"name":"spring","slug":"spring","permalink":"http://yoursite.com/tags/spring/"},{"name":"aop","slug":"aop","permalink":"http://yoursite.com/tags/aop/"},{"name":"util","slug":"util","permalink":"http://yoursite.com/tags/util/"},{"name":"异常","slug":"异常","permalink":"http://yoursite.com/tags/异常/"}]},{"title":"logback","slug":"logback","date":"2018-04-18T22:50:52.000Z","updated":"2018-04-18T23:05:21.245Z","comments":true,"path":"2018/04/19/logback/","link":"","permalink":"http://yoursite.com/2018/04/19/logback/","excerpt":"","text":"","categories":[{"name":"java","slug":"java","permalink":"http://yoursite.com/categories/java/"}],"tags":[{"name":"util","slug":"util","permalink":"http://yoursite.com/tags/util/"},{"name":"springboot","slug":"springboot","permalink":"http://yoursite.com/tags/springboot/"},{"name":"日志","slug":"日志","permalink":"http://yoursite.com/tags/日志/"}]},{"title":"spring-mock","slug":"spring-mock","date":"2018-04-18T22:49:34.000Z","updated":"2018-04-18T23:10:05.242Z","comments":true,"path":"2018/04/19/spring-mock/","link":"","permalink":"http://yoursite.com/2018/04/19/spring-mock/","excerpt":"","text":"","categories":[{"name":"测试","slug":"测试","permalink":"http://yoursite.com/categories/测试/"}],"tags":[{"name":"spring","slug":"spring","permalink":"http://yoursite.com/tags/spring/"},{"name":"测试","slug":"测试","permalink":"http://yoursite.com/tags/测试/"}]},{"title":"springboot-mybatis","slug":"springboot-mybatis","date":"2018-04-18T13:48:40.000Z","updated":"2018-04-18T23:05:04.795Z","comments":true,"path":"2018/04/18/springboot-mybatis/","link":"","permalink":"http://yoursite.com/2018/04/18/springboot-mybatis/","excerpt":"","text":"简介springboot集成mybaits时,有mybatis官方提供的mybatis-spring-boot-starter,但mapper不可通用,开发工作量大,因此使用mapper-spring-boot-starter的通用mapper。 通用Mapper都可以极大的方便开发人员。可以随意的按照自己的需要选择通用方法,还可以很方便的开发自己的通用方法。极其方便的使用MyBatis单表的增删改查。支持单表操作,不支持通用的多表联合查询。 githubwiki pom123456789101112131415161718<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope></dependency><dependency> <groupId>com.alibaba</groupId> <artifactId>druid-spring-boot-starter</artifactId> <version>${druid-starter.version}</version></dependency><!--mapper--><dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>${mapper-starter.version}</version></dependency> 配置 数据源配置 参考druid-\bspring-boot-starter配置即可 \bmybatis配置 config-location与configuration只可配置一项 123456config-location: classpath:mybatis-config.xmlconfiguration: map-underscore-to-camel-case: true log-impl: org.apache.ibatis.logging.stdout.StdOutImpltype-aliases-package:mapper-locations: mapper配置 详见wiki mappers配置项注意 如果只使用通用mapper,可以不配置mappers,如果使用了MysqlMapper等其他mapper,而且自己定义了BaseMapper,要设置mappers。(一般BaseMapper继承Mapper和其他mapper,比如MysqlMapper) 123mapper: mappers: - com.daijk.demo.dao.base.BaseMapper \b开撸关于@MapperScan包名必填,并且mappers配置的\b类不能在包下 对象关系映射 主键 @Id 列 @Column @ColumnType","categories":[{"name":"spring","slug":"spring","permalink":"http://yoursite.com/categories/spring/"}],"tags":[{"name":"springboot","slug":"springboot","permalink":"http://yoursite.com/tags/springboot/"},{"name":"mybatis","slug":"mybatis","permalink":"http://yoursite.com/tags/mybatis/"},{"name":"持久化","slug":"持久化","permalink":"http://yoursite.com/tags/持久化/"},{"name":"数据源","slug":"数据源","permalink":"http://yoursite.com/tags/数据源/"}]},{"title":"springboot web","slug":"springboot-web","date":"2018-04-16T12:55:22.000Z","updated":"2018-04-18T22:57:10.736Z","comments":true,"path":"2018/04/16/springboot-web/","link":"","permalink":"http://yoursite.com/2018/04/16/springboot-web/","excerpt":"","text":"依赖123456789<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId></dependency> config参考[https://docs.spring.io/spring-boot/docs/2.0.1.RELEASE/reference/htmlsingle/#common-application-properties]WEB PROPERTIES 部分 thymeleaf参考[https://www.thymeleaf.org/documentation.html] ModelAndViewjson @RestController 相关注解 @Controller @RestController @GetMapping @PostMapping @PutMapping @DeleteMapping","categories":[{"name":"spring","slug":"spring","permalink":"http://yoursite.com/categories/spring/"}],"tags":[{"name":"springboot","slug":"springboot","permalink":"http://yoursite.com/tags/springboot/"},{"name":"web","slug":"web","permalink":"http://yoursite.com/tags/web/"}]},{"title":"springboot config","slug":"springboot-config","date":"2018-04-16T12:55:22.000Z","updated":"2018-04-18T22:57:33.088Z","comments":true,"path":"2018/04/16/springboot-config/","link":"","permalink":"http://yoursite.com/2018/04/16/springboot-config/","excerpt":"","text":"说明spingboot 可以添加自定义的配置,需要在application.yml文件中添加,并设置对应的Config类解析。当然也可以指定配置文件,及相关的解析前缀。 demoapplication.yml server: servlet: context-path: /patient port: 8080spring: thymeleaf: encoding: UTF-8 mode: HTML Config.java","categories":[{"name":"spring","slug":"spring","permalink":"http://yoursite.com/categories/spring/"}],"tags":[{"name":"util","slug":"util","permalink":"http://yoursite.com/tags/util/"},{"name":"springboot","slug":"springboot","permalink":"http://yoursite.com/tags/springboot/"},{"name":"yml","slug":"yml","permalink":"http://yoursite.com/tags/yml/"}]},{"title":"分布式锁","slug":"分布式锁","date":"2018-04-10T02:30:07.000Z","updated":"2018-04-18T23:03:39.704Z","comments":true,"path":"2018/04/10/分布式锁/","link":"","permalink":"http://yoursite.com/2018/04/10/分布式锁/","excerpt":"","text":"分布式锁的几种实现方式:在分布式架构中,由于多线程和多台服务器,何难保证顺序性。如果需要对某一个资源进行限制,比如票务,比如请求幂等性控制等,这个时候分布式锁就排上用处。什么是分布式锁分布式锁是控制分布式系统或不同系统之间共同访问共享资源的一种锁实现,如果不同的系统或同一个系统的不同主机之间共享了某个资源时,往往需要互斥来防止彼此干扰来保证一致性。分布式锁需要解决的问题互斥性:任意时刻,只能有一个客户端获取锁,不能同时有两个客户端获取到锁。安全性:锁只能被持有该锁的客户端删除,不能由其它客户端删除。死锁:获取锁的客户端因为某些原因(如down机等)而未能释放锁,其它客户端再也无法获取到该锁。容错:当部分节点(redis节点等)down机时,客户端仍然能够获取锁和释放锁。分布式锁的实现方式数据库实现缓存实现,比如rediszookeeper实现未完待续","categories":[{"name":"java","slug":"java","permalink":"http://yoursite.com/categories/java/"}],"tags":[{"name":"分布式","slug":"分布式","permalink":"http://yoursite.com/tags/分布式/"}]},{"title":"MySQL数据库规范及解读","slug":"MySQL数据库规范及解读","date":"2018-04-06T23:35:18.000Z","updated":"2018-04-22T04:43:53.183Z","comments":true,"path":"2018/04/07/MySQL数据库规范及解读/","link":"","permalink":"http://yoursite.com/2018/04/07/MySQL数据库规范及解读/","excerpt":"","text":"转 MySQL数据库规范及解读","categories":[{"name":"数据库","slug":"数据库","permalink":"http://yoursite.com/categories/数据库/"}],"tags":[{"name":"MySQL","slug":"MySQL","permalink":"http://yoursite.com/tags/MySQL/"}]},{"title":"Hexo","slug":"hexo","date":"2018-04-06T06:23:45.000Z","updated":"2018-04-18T23:02:14.757Z","comments":true,"path":"2018/04/06/hexo/","link":"","permalink":"http://yoursite.com/2018/04/06/hexo/","excerpt":"","text":"安装依赖 nodeyarnyarn global add hexo start mkdir blog && cd blogyarn init github pagesadd repo 仓库名必须是github用户名,比如username.github.io config repo settings -> GitHub Pages -> 选择master分支 -> save deploy 安装插件 yarn add hexo-deployer-git 修改配置文件 deploy: type: git repo: git@github.com:username/username.github.io.git branch: master 配置主题 下载后,修改根配置下的主题名称;主题配置中修改相关项。 写作 添加page添加文章(分类、标签) 配置后的动作 hexo clean hexo generate hexo deploy 访问https://yourgithubname.github.io","categories":[{"name":"学习","slug":"学习","permalink":"http://yoursite.com/categories/学习/"}],"tags":[{"name":"other","slug":"other","permalink":"http://yoursite.com/tags/other/"},{"name":"hexo","slug":"hexo","permalink":"http://yoursite.com/tags/hexo/"}]}]}