diff --git a/.gitignore b/.gitignore
index 19ea2b3e..23579dcd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,6 @@ _site
.idea
.DS_Store
nohup.out
+.npmbundle
+node_modules
+install-0.13.0.tgz
diff --git a/Gemfile b/Gemfile
index ff8dbbc7..04609283 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,7 @@
-source 'https://rubygems.org'
+source 'https://gems.ruby-china.com'
gem 'github-pages'
gem 'jekyll-feed'
gem 'jekyll-seo-tag'
gem 'jekyll-redirect-from'
+gem 'jekyll-include-cache'
+gem "webrick", "~> 1.7"
diff --git a/Gemfile.lock b/Gemfile.lock
index 53a47cd3..fd071bf6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,241 +1,264 @@
GEM
- remote: https://rubygems.org/
+ remote: https://gems.ruby-china.com/
specs:
- activesupport (4.2.9)
- i18n (~> 0.7)
- minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
- tzinfo (~> 1.1)
- addressable (2.5.2)
- public_suffix (>= 2.0.2, < 4.0)
+ activesupport (7.0.4.2)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ addressable (2.8.1)
+ public_suffix (>= 2.0.2, < 6.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.11.1)
colorator (1.1.0)
- commonmarker (0.17.7.1)
- ruby-enum (~> 0.5)
- concurrent-ruby (1.0.5)
- ethon (0.11.0)
- ffi (>= 1.3.0)
- execjs (2.7.0)
- faraday (0.13.1)
- multipart-post (>= 1.2, < 3)
- ffi (1.9.18)
+ commonmarker (0.23.8)
+ concurrent-ruby (1.2.0)
+ dnsruby (1.61.9)
+ simpleidn (~> 0.1)
+ em-websocket (0.5.3)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0)
+ ethon (0.16.0)
+ ffi (>= 1.15.0)
+ eventmachine (1.2.7)
+ execjs (2.8.1)
+ faraday (2.7.4)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.2)
+ ffi (1.15.5)
forwardable-extended (2.6.0)
- gemoji (3.0.0)
- github-pages (172)
- activesupport (= 4.2.9)
- github-pages-health-check (= 1.3.5)
- jekyll (= 3.6.2)
- jekyll-avatar (= 0.5.0)
- jekyll-coffeescript (= 1.0.2)
- jekyll-commonmark-ghpages (= 0.1.3)
+ gemoji (3.0.1)
+ github-pages (228)
+ github-pages-health-check (= 1.17.9)
+ jekyll (= 3.9.3)
+ jekyll-avatar (= 0.7.0)
+ jekyll-coffeescript (= 1.1.1)
+ jekyll-commonmark-ghpages (= 0.4.0)
jekyll-default-layout (= 0.1.4)
- jekyll-feed (= 0.9.2)
- jekyll-gist (= 1.4.1)
- jekyll-github-metadata (= 2.9.3)
- jekyll-mentions (= 1.2.0)
- jekyll-optional-front-matter (= 0.3.0)
+ jekyll-feed (= 0.15.1)
+ jekyll-gist (= 1.5.0)
+ jekyll-github-metadata (= 2.13.0)
+ jekyll-include-cache (= 0.2.1)
+ jekyll-mentions (= 1.6.0)
+ jekyll-optional-front-matter (= 0.3.2)
jekyll-paginate (= 1.1.0)
- jekyll-readme-index (= 0.2.0)
- jekyll-redirect-from (= 0.12.1)
- jekyll-relative-links (= 0.5.2)
- jekyll-remote-theme (= 0.2.3)
- jekyll-sass-converter (= 1.5.0)
- jekyll-seo-tag (= 2.3.0)
- jekyll-sitemap (= 1.1.1)
- jekyll-swiss (= 0.4.0)
- jekyll-theme-architect (= 0.1.0)
- jekyll-theme-cayman (= 0.1.0)
- jekyll-theme-dinky (= 0.1.0)
- jekyll-theme-hacker (= 0.1.0)
- jekyll-theme-leap-day (= 0.1.0)
- jekyll-theme-merlot (= 0.1.0)
- jekyll-theme-midnight (= 0.1.0)
- jekyll-theme-minimal (= 0.1.0)
- jekyll-theme-modernist (= 0.1.0)
- jekyll-theme-primer (= 0.5.2)
- jekyll-theme-slate (= 0.1.0)
- jekyll-theme-tactile (= 0.1.0)
- jekyll-theme-time-machine (= 0.1.0)
- jekyll-titles-from-headings (= 0.5.0)
- jemoji (= 0.8.1)
- kramdown (= 1.14.0)
- liquid (= 4.0.0)
- listen (= 3.0.6)
+ jekyll-readme-index (= 0.3.0)
+ jekyll-redirect-from (= 0.16.0)
+ jekyll-relative-links (= 0.6.1)
+ jekyll-remote-theme (= 0.4.3)
+ jekyll-sass-converter (= 1.5.2)
+ jekyll-seo-tag (= 2.8.0)
+ jekyll-sitemap (= 1.4.0)
+ jekyll-swiss (= 1.0.0)
+ jekyll-theme-architect (= 0.2.0)
+ jekyll-theme-cayman (= 0.2.0)
+ jekyll-theme-dinky (= 0.2.0)
+ jekyll-theme-hacker (= 0.2.0)
+ jekyll-theme-leap-day (= 0.2.0)
+ jekyll-theme-merlot (= 0.2.0)
+ jekyll-theme-midnight (= 0.2.0)
+ jekyll-theme-minimal (= 0.2.0)
+ jekyll-theme-modernist (= 0.2.0)
+ jekyll-theme-primer (= 0.6.0)
+ jekyll-theme-slate (= 0.2.0)
+ jekyll-theme-tactile (= 0.2.0)
+ jekyll-theme-time-machine (= 0.2.0)
+ jekyll-titles-from-headings (= 0.5.3)
+ jemoji (= 0.12.0)
+ kramdown (= 2.3.2)
+ kramdown-parser-gfm (= 1.1.0)
+ liquid (= 4.0.4)
mercenary (~> 0.3)
- minima (= 2.1.1)
- rouge (= 2.2.1)
+ minima (= 2.5.1)
+ nokogiri (>= 1.13.6, < 2.0)
+ rouge (= 3.26.0)
terminal-table (~> 1.4)
- github-pages-health-check (1.3.5)
+ github-pages-health-check (1.17.9)
addressable (~> 2.3)
- net-dns (~> 0.8)
+ dnsruby (~> 1.60)
octokit (~> 4.0)
- public_suffix (~> 2.0)
- typhoeus (~> 0.7)
- html-pipeline (2.7.1)
+ public_suffix (>= 3.0, < 5.0)
+ typhoeus (~> 1.3)
+ html-pipeline (2.14.3)
activesupport (>= 2)
nokogiri (>= 1.4)
- i18n (0.9.1)
+ http_parser.rb (0.8.0)
+ i18n (1.12.0)
concurrent-ruby (~> 1.0)
- jekyll (3.6.2)
+ jekyll (3.9.3)
addressable (~> 2.4)
colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (>= 0.7, < 2)
jekyll-sass-converter (~> 1.0)
- jekyll-watch (~> 1.1)
- kramdown (~> 1.14)
+ jekyll-watch (~> 2.0)
+ kramdown (>= 1.17, < 3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
- rouge (>= 1.7, < 3)
+ rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
- jekyll-avatar (0.5.0)
- jekyll (~> 3.0)
- jekyll-coffeescript (1.0.2)
+ jekyll-avatar (0.7.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
- jekyll-commonmark (1.1.0)
- commonmarker (~> 0.14)
- jekyll (>= 3.0, < 4.0)
- jekyll-commonmark-ghpages (0.1.3)
- commonmarker (~> 0.17.6)
- jekyll-commonmark (~> 1)
- rouge (~> 2)
+ jekyll-commonmark (1.4.0)
+ commonmarker (~> 0.22)
+ jekyll-commonmark-ghpages (0.4.0)
+ commonmarker (~> 0.23.7)
+ jekyll (~> 3.9.0)
+ jekyll-commonmark (~> 1.4.0)
+ rouge (>= 2.0, < 5.0)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
- jekyll-feed (0.9.2)
- jekyll (~> 3.3)
- jekyll-gist (1.4.1)
+ jekyll-feed (0.15.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-gist (1.5.0)
octokit (~> 4.2)
- jekyll-github-metadata (2.9.3)
- jekyll (~> 3.1)
+ jekyll-github-metadata (2.13.0)
+ jekyll (>= 3.4, < 5.0)
octokit (~> 4.0, != 4.4.0)
- jekyll-mentions (1.2.0)
- activesupport (~> 4.0)
+ jekyll-include-cache (0.2.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-mentions (1.6.0)
html-pipeline (~> 2.3)
- jekyll (~> 3.0)
- jekyll-optional-front-matter (0.3.0)
- jekyll (~> 3.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-optional-front-matter (0.3.2)
+ jekyll (>= 3.0, < 5.0)
jekyll-paginate (1.1.0)
- jekyll-readme-index (0.2.0)
- jekyll (~> 3.0)
- jekyll-redirect-from (0.12.1)
- jekyll (~> 3.3)
- jekyll-relative-links (0.5.2)
- jekyll (~> 3.3)
- jekyll-remote-theme (0.2.3)
- jekyll (~> 3.5)
- rubyzip (>= 1.2.1, < 3.0)
- typhoeus (>= 0.7, < 2.0)
- jekyll-sass-converter (1.5.0)
+ jekyll-readme-index (0.3.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-redirect-from (0.16.0)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-relative-links (0.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-remote-theme (0.4.3)
+ addressable (~> 2.0)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
+ rubyzip (>= 1.3.0, < 3.0)
+ jekyll-sass-converter (1.5.2)
sass (~> 3.4)
- jekyll-seo-tag (2.3.0)
- jekyll (~> 3.3)
- jekyll-sitemap (1.1.1)
- jekyll (~> 3.3)
- jekyll-swiss (0.4.0)
- jekyll-theme-architect (0.1.0)
- jekyll (~> 3.5)
+ jekyll-seo-tag (2.8.0)
+ jekyll (>= 3.8, < 5.0)
+ jekyll-sitemap (1.4.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-swiss (1.0.0)
+ jekyll-theme-architect (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-cayman (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-cayman (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-dinky (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-dinky (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-hacker (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-hacker (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-leap-day (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-leap-day (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-merlot (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-merlot (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-midnight (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-midnight (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-minimal (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-minimal (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-modernist (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-modernist (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-primer (0.5.2)
- jekyll (~> 3.5)
+ jekyll-theme-primer (0.6.0)
+ jekyll (> 3.5, < 5.0)
jekyll-github-metadata (~> 2.9)
- jekyll-seo-tag (~> 2.2)
- jekyll-theme-slate (0.1.0)
- jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-tactile (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-slate (0.2.0)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-tactile (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-theme-time-machine (0.1.0)
- jekyll (~> 3.5)
+ jekyll-theme-time-machine (0.2.0)
+ jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
- jekyll-titles-from-headings (0.5.0)
- jekyll (~> 3.3)
- jekyll-watch (1.5.1)
+ jekyll-titles-from-headings (0.5.3)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-watch (2.2.1)
listen (~> 3.0)
- jemoji (0.8.1)
- activesupport (~> 4.0, >= 4.2.9)
+ jemoji (0.12.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
- jekyll (>= 3.0)
- kramdown (1.14.0)
- liquid (4.0.0)
- listen (3.0.6)
- rb-fsevent (>= 0.9.3)
- rb-inotify (>= 0.9.7)
+ jekyll (>= 3.0, < 5.0)
+ kramdown (2.3.2)
+ rexml
+ kramdown-parser-gfm (1.1.0)
+ kramdown (~> 2.0)
+ liquid (4.0.4)
+ listen (3.8.0)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
- mini_portile2 (2.3.0)
- minima (2.1.1)
- jekyll (~> 3.3)
- minitest (5.10.3)
- multipart-post (2.0.0)
- net-dns (0.8.0)
- nokogiri (1.8.1)
- mini_portile2 (~> 2.3.0)
- octokit (4.7.0)
- sawyer (~> 0.8.0, >= 0.5.3)
- pathutil (0.16.1)
+ minima (2.5.1)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ minitest (5.17.0)
+ nokogiri (1.14.1-x86_64-linux)
+ racc (~> 1.4)
+ octokit (4.25.1)
+ faraday (>= 1, < 3)
+ sawyer (~> 0.9)
+ pathutil (0.16.2)
forwardable-extended (~> 2.6)
- public_suffix (2.0.5)
- rb-fsevent (0.10.2)
- rb-inotify (0.9.10)
- ffi (>= 0.5.0, < 2)
- rouge (2.2.1)
- ruby-enum (0.7.1)
- i18n
- rubyzip (1.2.1)
- safe_yaml (1.0.4)
- sass (3.5.4)
+ public_suffix (4.0.7)
+ racc (1.6.0)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rexml (3.2.5)
+ rouge (3.26.0)
+ ruby2_keywords (0.0.5)
+ rubyzip (2.3.2)
+ safe_yaml (1.0.5)
+ sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
- sawyer (0.8.1)
- addressable (>= 2.3.5, < 2.6)
- faraday (~> 0.8, < 1.0)
+ sawyer (0.9.2)
+ addressable (>= 2.3.5)
+ faraday (>= 0.17.3, < 3)
+ simpleidn (0.2.1)
+ unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
- thread_safe (0.3.6)
- typhoeus (0.8.0)
- ethon (>= 0.8.0)
- tzinfo (1.2.4)
- thread_safe (~> 0.1)
- unicode-display_width (1.3.0)
+ typhoeus (1.4.0)
+ ethon (>= 0.9.0)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
+ unf (0.1.4)
+ unf_ext
+ unf_ext (0.0.8.2)
+ unicode-display_width (1.8.0)
+ webrick (1.8.1)
PLATFORMS
- ruby
+ x86_64-linux
DEPENDENCIES
github-pages
jekyll-feed
+ jekyll-include-cache
jekyll-redirect-from
jekyll-seo-tag
+ webrick (~> 1.7)
BUNDLED WITH
- 1.15.4
+ 2.4.6
diff --git a/_config.yml b/_config.yml
index 5a95d739..689f34a0 100644
--- a/_config.yml
+++ b/_config.yml
@@ -3,7 +3,7 @@ description: 能立能达,不怨不尤
url: http://www.codingted.com
blog_url: http://www.codingted.com
author: Ted
-email: teddzhaoo@gmail.com
+email: zhaoliang12214@gmail.com
img_server: /assets/img/blog
github: https://github.com/codingted
logo: assets/img/favicon.ico
@@ -54,12 +54,13 @@ defaults:
values:
layout: "blog"
-gems:
+plugins:
- jekyll-sitemap
- jekyll-feed
- jekyll-paginate
- jekyll-seo-tag
- jekyll-redirect-from
+ - jemoji
whitelist:
- jekyll-redirect-from
diff --git a/_drafts/2018-01-04-spring_transaction.md b/_drafts/2018-01-04-spring_transaction.md
index 6d3ffabd..10353abf 100644
--- a/_drafts/2018-01-04-spring_transaction.md
+++ b/_drafts/2018-01-04-spring_transaction.md
@@ -9,3 +9,4 @@ comments: true
* content
{:toc}
+[Spring编程式事务管理及声明式事务管理](https://blog.csdn.net/zhj870975587/article/details/75152604)
diff --git a/_drafts/2019-01-04-2019.md b/_drafts/2019-01-04-2019.md
new file mode 100644
index 00000000..ad7d388b
--- /dev/null
+++ b/_drafts/2019-01-04-2019.md
@@ -0,0 +1,21 @@
+# 2019
+
+> 无志之人,常立志,有志之人,立长志
+
+站在现在看自己过去的:
+* 小时候的零星记忆只有回到自己出生的那个村庄才能够鲜活起来,但是时间也不会太长
+* 高中及之前的学习经历完全是按部就班,只是争取一时的荣誉,谈不上长远的规划
+* 大学的学习与之前的学习没有本质的差别,多的是自由,少了对于学习荣誉的争取(只是追求"60分万岁!")
+* 工作了将近7年谈自己的收获...,难以启齿
+
+也会有打鸡血的时候,但是总是没能达到自己期望("求乎上,得之中,求乎中,得之下",但是我总是得之下),在自己的而立之年,忽然感到自己的生命,轻飘飘的,找不到自己的意义,也不知道自己的下一步要去到哪里,一阵迷茫.
+罗振宇的[时间的朋友2018跨年演讲](https://www.youtube.com/watch?v=ugDu_T9wUGs)算是一个契机,我要规划自己的2019,要有耐心,认清趋势,面向未来.
+
+# 启发
+
+## 我的时间够用吗?
+
+1. 时间的碎片化
+> "摸机率"可以衡量会议的质量,什么是"摸机率",就是整个会议过程查看手机的次数
+2. 信息过载
+> 战国时期的思想家,庄子说过:"吾生也有涯,而知也无涯,以有涯随无涯,殆已",
diff --git a/_drafts/2019-05-06-arts_week_5.md b/_drafts/2019-05-06-arts_week_5.md
new file mode 100644
index 00000000..35913a63
--- /dev/null
+++ b/_drafts/2019-05-06-arts_week_5.md
@@ -0,0 +1,62 @@
+---
+title: ARTS(第5周)
+category: ARTS
+tags: arts
+---
+
+> **本周提纲:**
+>
+> 1. Algorithm: 最长公共前缀
+> 2. Review: 一个谷歌工程师编码解决问题的过程
+> 3. Tip: Jenkins REST API 触发任务执行
+> 4. Share: 关于负载均衡的一切(58沈剑)
+
+
+
+## Algorithm
+
+[14.最长公共前缀](https://leetcode-cn.com/problems/longest-common-prefix/)
+
+### 描述
+
+> 编写一个函数来查找字符串数组中的最长公共前缀。
+>
+> 如果不存在公共前缀,返回空字符串 ""。
+> 示例 1:
+>
+> 输入: ["flower","flow","flight"]
+> 输出: "fl"
+>
+> 示例 2:
+>
+> 输入: ["dog","racecar","car"]
+> 输出: ""
+> 解释: 输入不存在公共前缀。
+> 说明:
+>
+> 所有输入只包含小写字母 a-z 。
+
+### 代码
+
+```python
+class Solution:
+ def longestCommonPrefix(self, strs: List[str]) -> str:
+ """
+ :type strs :List[str]
+ :rtype str
+ """
+ if len(strs) == 0: return ""
+ # 按照字母表顺序获取最大值和最小值(进行了简单的排序)
+ s1, s2 = min(strs), max(strs)
+ zobj = zip(s1,s2)
+ rstr = ""
+ for i,j in list(zobj):
+ if i != j:
+ return rstr
+ rstr += i
+ return rstr
+```
+
+## Review
+
+[rework](https://rework.withgoogle.com/print/guides/5721312655835136/)
diff --git "a/_drafts/API\350\256\276\350\256\241\345\216\237\345\210\231.md" "b/_drafts/API\350\256\276\350\256\241\345\216\237\345\210\231.md"
new file mode 100644
index 00000000..654b2f48
--- /dev/null
+++ "b/_drafts/API\350\256\276\350\256\241\345\216\237\345\210\231.md"
@@ -0,0 +1,33 @@
+# API 设计评审清单
+
+* URI 命名是否通过聚合根和实体统一
+* URI 命名是否采用名词复数和连接线
+* URI 命名是否都是单词小写
+* URI 是否暴露了不必要的信息,例如/cgi-bin
+* URI 规则是否统一
+* 资源提供的能力是否彼此独立
+* URI 是否存在需要编码的字符
+* 请求和返回的参数是否不多不少
+* 资源的 ID 参数是否通过 PATH 参数传递
+* 认证和授权信息是否暴露到 query 参数中
+* 参数是否使用奇怪的缩写
+* 参数和响应数据中的字段命名统一
+* 是否存在无意义的对象包装 例如{"data":{}'}
+* 出错时是否破坏约定的数据结构
+* 是否使用合适的状态码
+* 是否使用合适的媒体类型
+* 响应数据的单复是否和数据内容一致
+* 响应头中是否有缓存信息
+* 是否进行了版本管理
+* 版本信息是否作为 URI 的前缀存在
+* 是否提供 API 服务期限
+* 是否提供了 API 返回所有 API 的索引
+* 是否进行了认证和授权
+* 是否采用 HTTPS
+* 是否检查了非法参数
+* 是否增加安全性的头部
+* 是否有限流策略
+* 是否支持 CORS
+* 响应中的时间格式是否采用ISO 8601标准
+* 是否存在越权访问
+
diff --git a/_drafts/arch_desktop.md b/_drafts/arch_desktop.md
new file mode 100644
index 00000000..f74274b1
--- /dev/null
+++ b/_drafts/arch_desktop.md
@@ -0,0 +1,16 @@
+## 问题
+1. 桌面环境怎么找到对应的应用程序
+2. chrome打开下载文件使用的默认应用程序
+
+## Arch Wiki
+
+### Desktop Entries
+
+[地址](https://wiki.archlinux.org/title/Desktop_entries)
+
+
+### autostart
+
+[地址](https://wiki.archlinux.org/title/XDG_Autostart)
+
+###
diff --git a/_drafts/arch_font.md b/_drafts/arch_font.md
new file mode 100644
index 00000000..b975f5b0
--- /dev/null
+++ b/_drafts/arch_font.md
@@ -0,0 +1,3 @@
+## 字体的路径
+
+/usr/share/fonts/, ~/.local/share/fonts
diff --git a/_drafts/arts/2022-07-07-arts_week_5.md b/_drafts/arts/2022-07-07-arts_week_5.md
new file mode 100644
index 00000000..26a245db
--- /dev/null
+++ b/_drafts/arts/2022-07-07-arts_week_5.md
@@ -0,0 +1,114 @@
+---
+title: ARTS(第5周)
+category: ARTS
+tags: arts
+---
+
+> **本周提纲:**
+>
+> 1. **Algorithm:** 383.赎金信
+> 2. **Review:** How to control the metacognition process of programming?
+> 3. **Tip:**
+> 4. **Share:** SSH 配置端口转发
+
+
+
+## Algorithm
+
+[383.赎金信](https://leetcode.cn/problems/ransom-note/)
+
+### 描述
+
+给你两个字符串:`ransomNote`和`magazine`,判断`ransomNote` 能不能由`magazine`里面的字符构成。
+如果可以,返回`true`;否则返回`false`。
+`magazine`中的每个字符只能在`ransomNote`中使用一次。
+
+示例 1:
+> 输入:ransomNote = "a", magazine = "b"
+> 输出:false
+
+示例 2:
+> 输入:ransomNote = "aa", magazine = "ab"
+> 输出:false
+
+示例 3:
+> 输入:ransomNote = "aa", magazine = "aab"
+> 输出:true
+
+提示:
+> 1 <= ransomNote.length, magazine.length <= 105
+> ransomNote 和 magazine 由小写英文字母组成
+
+### 代码
+
+```python
+# 个人实现版,看起来不够清晰
+class Solution:
+
+ def canConstruct(self, ransomNote: str, magazine: str) -> bool:
+ """统计字符串的个数"""
+ charDict = {} # 存储统计结果的字典
+ for k in set(ransomNote):
+ charDict[k] = ransomNote.count(k)
+
+ for m in magazine:
+ if(m in charDict):
+ charDict[m] = charDict[m]-1
+ if(charDict[m] <= 0):
+ charDict.pop(m)
+ if(len(charDict) == 0):
+ return True
+ return False
+# 使用python 内置的函数进行字符统计,代码实现简洁
+
+```
+
+## Review
+
+[How to control the metacognition process of programming?](https://lambdaisland.com/blog/2022-02-17-the-fg-command)
+
+“如何控制编程的元认知”这篇文章提到‘编程是思考而不是敲代码’,虽然‘敲代码’也需要思考但是这种程度的思考还是不够的,对于思考我们应该投入的更多。
+
+在日常的工作和生和中有部分是通过‘潜意识’进行决定的,这样我们的‘前景思维’(`foreground thinking`)就能更专注的处理手头的问题。但是有些问题是‘潜意识’不适用的,这种情况下我们如果‘前景思维’系统才是合适的(作者还使用了linux的`fg`命令来做了类比),那么我们怎么知道什么时候应该由‘前景思维’来接管呢?作者提出了下边的两种方法:
+
+1. 向别人解释代码的含义(Rubber Duck 方法)
+ * 由于远程工作不方便沟通,所以需要通过尽可能详尽的描述问题来寻求别人的帮助
+2. 问自己一些提前准备好的问题(Drucker 方法)
+ * 正确的方法就像大脑的`fg`命令,让你用‘前景思维’来思考问题
+
+作者还举了以下几种场景下自己准备的问题:
+
+**遇到bug时我会问**
+
+1. 我是不是在用科学的方法解决这个问题?
+2. 我是不是在用准确的系统视角来审视这个问题?
+3. 我是不是有测量这个问题的趁手?
+
+**定义一个方法我会问**
+
+1. 我应该将命令和查询分开吗?
+2. 我是否为程序的异常做了额外的处理比如:`try/cache`或者`log`?
+3. 我是否为可能的错误做了防御性的设计比如:提前的判断或`assert`?
+4. 方法名称是否是‘自说明’的?
+5. 我是否添加了合适的方法说明?
+
+**设计一个模块我会问**
+
+1. 我是不是需要为该模块单独编写API文档,使API独立于内部方法?
+2. 是不是移除了了所有的无用代码?
+3. 我是否设计或使用合适的Clojure记录来建模一些不变的域问题概念?
+
+**整合和部署我会问**
+
+1. 我是不是为领域方法设计了合适的测试?
+2. 我是不是为脚本设计了合适的反馈消息?
+3. 一些人工执行的脚本是否能够自动化?
+
+
+todo## Tip
+
+[Arthas:Alibaba开源的Java诊断工具](https://alibaba.github.io/arthas/)
+
+## Share
+
+[SSH 配置端口转发](https://harttle.land/2022/05/02/ssh-port-forwarding.html)
diff --git a/_drafts/arts/2022-08-04-arts_week_6.md b/_drafts/arts/2022-08-04-arts_week_6.md
new file mode 100644
index 00000000..27ae69cd
--- /dev/null
+++ b/_drafts/arts/2022-08-04-arts_week_6.md
@@ -0,0 +1,82 @@
+---
+title: ARTS(第6周)
+category: ARTS
+tags: arts
+---
+
+> **本周提纲:**
+>
+> 1. **Algorithm:**
+> 2. **Review:**
+> 3. **Tip:**
+> 4. **Share:**
+
+
+
+## Algorithm
+
+[383.赎金信](https://leetcode.cn/problems/ransom-note/)
+
+### 描述
+
+给你两个字符串:`ransomNote`和`magazine`,判断`ransomNote` 能不能由`magazine`里面的字符构成。
+如果可以,返回`true`;否则返回`false`。
+`magazine`中的每个字符只能在`ransomNote`中使用一次。
+
+示例 1:
+> 输入:ransomNote = "a", magazine = "b"
+> 输出:false
+
+示例 2:
+> 输入:ransomNote = "aa", magazine = "ab"
+> 输出:false
+
+示例 3:
+> 输入:ransomNote = "aa", magazine = "aab"
+> 输出:true
+
+提示:
+> 1 <= ransomNote.length, magazine.length <= 105
+> ransomNote 和 magazine 由小写英文字母组成
+
+### 代码
+
+```python
+# 个人实现版,看起来不够清晰
+class Solution:
+
+ def canConstruct(self, ransomNote: str, magazine: str) -> bool:
+ """统计字符串的个数"""
+ charDict = {} # 存储统计结果的字典
+ for k in set(ransomNote):
+ charDict[k] = ransomNote.count(k)
+
+ for m in magazine:
+ if(m in charDict):
+ charDict[m] = charDict[m]-1
+ if(charDict[m] <= 0):
+ charDict.pop(m)
+ if(len(charDict) == 0):
+ return True
+ return False
+# 使用python 内置的函数进行字符统计,代码实现简洁
+
+```
+
+## Review
+
+[Professional Programming: The First 10 Years](https://thorstenball.com/blog/2022/05/17/professional-programming-the-first-10-years/)
+
+作者描述了自己作为职业编程的头十年
+在做自己工作的时候是有选择的,充分的了解自己
+
+
+
+
+todo## Tip
+
+[Arthas:Alibaba开源的Java诊断工具](https://alibaba.github.io/arthas/)
+
+## Share
+
+[SSH 配置端口转发](https://harttle.land/2022/05/02/ssh-port-forwarding.html)
diff --git a/_drafts/cas.md b/_drafts/cas.md
new file mode 100644
index 00000000..8f5daa2f
--- /dev/null
+++ b/_drafts/cas.md
@@ -0,0 +1,2 @@
+CAS(Compare And Swap):
+[https://zh.wikipedia.org/wiki/%E6%AF%94%E8%BE%83%E5%B9%B6%E4%BA%A4%E6%8D%A2](https://zh.wikipedia.org/wiki/%E6%AF%94%E8%BE%83%E5%B9%B6%E4%BA%A4%E6%8D%A2)
diff --git a/_drafts/chrome/search_in_google_com.md b/_drafts/chrome/search_in_google_com.md
deleted file mode 100644
index 08dcf4a0..00000000
--- a/_drafts/chrome/search_in_google_com.md
+++ /dev/null
@@ -1,7 +0,0 @@
-找到如下文件:
-Windows 路径:%LOCALAPPDATA%\Google\Chrome\User Data\Default\Preferences
-Linux 路径:~/.config/google-chrome/Default/Preferences
-Mac 路径:/Users/yourname/Library/Application Support/Google/Chrome/Default/Preferences
-文本编辑器打开后
-替换全文终的 google.co.jp 为 google.com 即可。
-重新整理一下发上来,完美了
diff --git "a/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/indexing_updating_deleting.md" "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/indexing_updating_deleting.md"
new file mode 100644
index 00000000..a512f3b4
--- /dev/null
+++ "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/indexing_updating_deleting.md"
@@ -0,0 +1,103 @@
+## Using mappings to define kinds of documents
+
+Each document belongs to a type, which in turn belongs to an index. As a logical divi-
+sion of data, you can think of *indices as databases and types as tables*.
+
+
+> **Types provide only logical separation**
+With Elasticsearch, there’s no physical separation of documents that have different types. All documents within the same Elasticsearch index, regardless of type, end up in the same set of files belonging to the same shards. In a shard, which is a Lucene index, the name of the type is a field, and all fields from all mappings come together as fields in the Lucene index.
+
+The concept of a type is a layer of abstraction specific to Elasticsearch but not Lucene, which makes it easy for you to have different kinds of documents in the same index. Elasticsearch takes care of separating those documents; for example, by filtering documents belonging to a certain type when you search in that type only.
+
+This approach creates a problem when the same field name occurs in multiple types. To avoid unpredictable results, two fields with the same name should have the same settings; otherwise Elasticsearch might have a hard time figuring out which of the two fields you’re referring to. In the end, both those fields belong to the same Lucene index. For example, if you have a name field in both group and event documents, both should be strings, not one a string and one an integer. This is rarely a problem in real life, but it’s worth remembering to avoid surprises.
+
+
+
+### Retrieving and defining mappings
+
+* GETTING THE CURRENT MAPPING
+
+```bash
+$ curl 'localhost:9200/get-together/group/_mapping?pretty'
+```
+
+* Getting an automatically generated mapping
+
+```bash
+$ curl -XPUT 'localhost:9200/get-together/new-events/1' -d '{
+ "name": "Late Night with Elasticsearch",
+ "date": "2013-10-25T19:00"
+}'
+
+$ curl 'localhost:9200/get-together/_mapping/new-events?pretty'
+
+```
+
+> mapping info
+
+```json
+{
+ "get-together" : {
+ "mappings" : {
+ "new-events" : {
+ "properties" : {
+ "date" : {
+ "type" : "date"
+ },
+ "name" : {
+ "type" : "text",
+ "fields" : {
+ "keyword" : {
+ "type" : "keyword",
+ "ignore_above" : 256
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+```
+
+* DEFINING A NEW MAPPING
+
+```bash
+$ curl -XPUT 'localhost:9200/get-together/new-events/1' -d '{
+ "name": "Late Night with Elasticsearch",
+ "date": "2013-10-25T19:00"
+ }'
+
+```
+如果重新定义已经存在的mapping中的字段的类型, 是会报错的, 因为如果改变字段的数据类型需要进行:
+1. 移除type所有的数据
+2. 加入新的mapping
+3. 重新为数据索引
+
+To understand why re-indexing might be required, imagine you’ve already indexed an event with a string in the host field. If you want the host field to be long now, Elasticsearch would have to change the way host is indexed in the existing document. As you’ll explore later in this chapter, editing an existing document implies deleting and indexing again. To define correct mappings that hopefully will only need additions, not changes, let’s look at the core types you can choose for your fields in Elasticsearch and what you can do with them.
+
+## 数据类型
+
+string/numeric/date/boolean
+
+### mapping的properties设置index属性
+
+```bash
+ curl -XPUT 'localhost:9200/get-together/_mapping/new-events' -d '{
+ "new-events" : {
+ "properties" : {
+ "name": {
+ "type" : "string",
+ "index" : "not_analyzed"
+ }
+ }
+ }
+ }'
+```
+> index的三种参数
+
+* analyzed:解析该字段按照分词规则生成多个term(默认)
+* not_analyzed:不解析该字段, 以该字段整体为一个term
+* no : 跳过分词没有term产生
+
diff --git "a/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/intro.md" "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/intro.md"
index bc9bf975..416f627d 100644
--- "a/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/intro.md"
+++ "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/intro.md"
@@ -33,3 +33,15 @@ An Elasticsearch index is an independent chunk of documents, much like a databas
> An Elasticsearch index is broken down into chunks: shards. A shard is a Lucene index, so an Elasticsearch index is made up of multiple Lucene indices. This makes sense because Elasticsearch uses Apache Lucene as its core library to index your data and search through it.
+### Distributed indexing and searching
+
+* indexing
+
+The Elasticsearch node that receives your indexing request first selects the shard to index the document to. By default, documents are distributed evenly between shards: for each document, the shard is determined by **hashing its ID string**. Each shard has an equal **hash range**, with equal chances of receiving the new document. Once the target shard is determined, the current node forwards the document to the node holding that shard. Subsequently, that indexing operation is replayed by all the replicas of that shard. The indexing command successfully returns after all the available replicas finish indexing the document.
+
+
+
+* searching
+
+With searching, the node that receives the request forwards it to a set of shards containing all your data. Using a round-robin(轮询调度算法), Elasticsearch selects an available shard (which can be primary or replica) and forwards the search request to it. Elasticsearch then gathers results from those shards, aggregates them into a single reply, and forwards the reply back to the client application.
+By default, primary and replica shards get hit by searches in round-robin, assuming all nodes in your cluster are equally fast (identical hardware and software configurations). If that’s not the case, you can organize your data or configure your shards to prevent the slower nodes from becoming a bottleneck.
diff --git "a/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/distribute_indexing_searching.png" "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/distribute_indexing_searching.png"
new file mode 100644
index 00000000..2ff564e0
Binary files /dev/null and "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/distribute_indexing_searching.png" differ
diff --git "a/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/type_divide_in_index.png" "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/type_divide_in_index.png"
new file mode 100644
index 00000000..ff88ee27
Binary files /dev/null and "b/_drafts/elk\346\227\245\345\277\227\347\263\273\347\273\237\346\220\255\345\273\272/pic/type_divide_in_index.png" differ
diff --git "a/_drafts/enum\347\232\204\347\233\270\345\205\263\347\237\245\350\257\206.md" "b/_drafts/enum\347\232\204\347\233\270\345\205\263\347\237\245\350\257\206.md"
new file mode 100644
index 00000000..31124e99
--- /dev/null
+++ "b/_drafts/enum\347\232\204\347\233\270\345\205\263\347\237\245\350\257\206.md"
@@ -0,0 +1 @@
+(参考链接)[https://blog.csdn.net/javazejian/article/details/71333103]
diff --git a/_drafts/google_code_review.md b/_drafts/google_code_review.md
new file mode 100644
index 00000000..f072e041
--- /dev/null
+++ b/_drafts/google_code_review.md
@@ -0,0 +1,95 @@
+# 谷歌工程实践-Code Review
+
+## 代码审核的标准
+
+代码审核是为了保证代码的质量,保持良好的结构和一致的风格,不因为时间的推移而变得难以维护.
+
+* 摒弃不需要的功能,即使该功能设计良好
+* 没有最好的代码,只有不断改进的代码,所以不应该追求完美,而应该追求持续的改进,权衡是否接受CL
+* Review应该保持开放的态度进行回复,可以轻松的指出有些东西可以更好或者一些补充的回复
+* 代码的指导(包括代码质量,代码的规范,关于软件的设计思想)
+* 不断改善代码库
+
+### 原则
+
+* 事实大于个人偏好
+* 代码风格请遵循作者的指导
+* 软件设计的各个方面几乎从来不是纯粹的风格问题,也不只是个人偏好。它们是建立在基本原则的基础上的,应该在这些原则的基础上加以衡量,而不仅仅是个人意见。有时有一些有效的选择。如果作者能够证明(通过数据或基于可靠的工程原理)几种方法是同样有效的,那么审稿人应该接受作者的偏好。否则,选择取决于软件设计的标准原则.
+* 如果没有其他规则适用,那么审查员可能会要求作者与当前代码库中的内容保持一致,只要这不会恶化系统的整体代码健康状况.
+
+### 解决分歧
+
+双方基于现有的系统文档和第三方文档如:[CL作者代码评审指南](https://google.github.io/eng-practices/review/developer/)和[代码评审指南](https://google.github.io/eng-practices/review/reviewer/).如果还不能解决就需要面对面的讨论交流,团队会议...
+
+## Code Review评审的是什么内容
+
+* 代码设计得很好.
+* 该功能对代码的用户很好
+* 任何UI更改都是合理的,看起来也不错.
+* 任何并行编程都是安全的.
+* 代码并不比它需要的复杂.
+* 开发人员没有实现他们将来可能需要但不知道现在需要的东西.
+* 代码有适当的单元测试.
+* 测试是精心设计的.
+* 开发人员对所有东西都使用了清晰的名称.
+* 注释清晰有用,主要解释为什么而不是什么.
+* 代码被适当地文档化(通常在g3doc中).
+* 代码符合我们的样式指南.
+
+## 检查CL
+
+### 第一步:更广的视角看待变化
+
+检查变更是否必要,如果变更不必要要马上回复,并解释为什么不需要变化,并且提出自己针对该变化的建议(保持态度亲和).
+
+### 第二步:检查CL变化的主要逻辑
+
+定位CL描述的主要的变化逻辑,如果CL涉及的逻辑比较多,需要询问开发人员主要逻辑,或者请求将本次提交进行[拆分](https://google.github.io/eng-practices/review/developer/small-cls.html).
+
+如果发现主要设计或主要逻辑的错误,需要尽快通知开发者,对于未review的部分可以略过,因为如果是设计出现错误或者主要逻辑错误,那很可能意味着其它部分的修改也需要相应的调整,所以对这部分代码的review很可能是无意义的.
+
+### 第三步:以适当的顺序review剩下的代码
+
+## 加速review
+
+review不及时带来的问题:
+
+* 整个团队的速度降低
+* 开发人员对code review处理进度的抱怨
+* 代码整体的质量降低(堆积的大量的review处理的不够慎重)
+
+### Code Review 速度
+
+* 如果不是在紧急的任务中需要对新的Review进行简单的处理
+* 最长不超过一个工作日
+
+当然在保证自己的工作不被搅乱的情况下有序的处理Review,选择合理的时机:编码工作告一段落、饭后、会议结束后...
+
+如果当前不能review可以告知开发者什么时间可以开始review,避免心理等待时间过长.如果最近确实没有时间可以建议其他人进行review.
+
+**注意**:不要为了加速Review而降低[review的标准](https://google.github.io/eng-practices/review/reviewer/standard.html).
+
+## 如何撰写code review的评论
+
+* 和气
+* 阐述你的原因
+* 指出问题,避免明确的指示,应该由开发者决定如何处理问题
+* 建议开发人员使用简明清晰的代码和注释替代对复杂实现的解释
+
+## 处理对Code Review结论的质疑
+
+面对Code Review的驳回有时候会有得不到开发人员的认同,这时候该怎么办?
+
+### 谁是正确的
+
+面对质疑首先要想到,是不是他们(开发者)是正确的?因为开发者更了解他们的代码,如果是这样就撤销问题.
+
+如果认为review没有问题需要耐心的听取开发人员的意见,并予以解释,必要的情况下需要准备恰当的示例.
+
+重要的是双方要互相的倾听,认真的思考对方的理由.
+
+不接受"稍后修改",因为"稍后修改"可能被别的工作打扰,然后被遗忘.
+
+## 引用
+
+[eng-practices](https://google.github.io/eng-practices)
diff --git a/_drafts/java_specification/chapter_2_not.md b/_drafts/java_specification/chapter_2_not.md
new file mode 100644
index 00000000..eab19688
--- /dev/null
+++ b/_drafts/java_specification/chapter_2_not.md
@@ -0,0 +1,6 @@
+2.4. Reference Types and Values
+
+There are three kinds of reference types: class types, array types, and interface types
+
+
+
diff --git a/_drafts/linux/2018-12-19-linux_cpu_optimize.md b/_drafts/linux/2018-12-19-linux_cpu_optimize.md
new file mode 100644
index 00000000..ef09781b
--- /dev/null
+++ b/_drafts/linux/2018-12-19-linux_cpu_optimize.md
@@ -0,0 +1,111 @@
+# CPU篇
+
+## 理解"平均负载"
+
+```shell
+$uptime
+ 16:05:37 up 1 day, 29 min, 20 users, load average: 1.44, 1.55, 1.57
+ ```
+> 16:05:37 // 当前系统时间
+> up 1 day, 29 min, // 系统运行时间
+> 20 users, // 登录的用户数
+> load average: 1.44, 1.55, 1.57 // 1分钟,5分钟,15分钟的平均负载
+
+平均负载:是系统处于可运行状态和不可中断状态的平均进程数,也就是平均进程数
+
+> 可运行状态:对应ps的R状态的进程;
+> 不可中断状态: 对应ps的D状态的进程;
+
+```shell
+# 查看cpu信息
+$ lscpu
+or
+$ cat /proc/cupinfo
+```
+
+```shell
+# 模拟cpu密集型
+$stress --cpu 1 --timeout 60
+# 模拟io密集型
+$ stress -i 1 --timeout 60
+# 大量进程的场景
+$ stress -c 8 --timeout 60
+
+# 查看平均负载
+$ watch -d uptime
+# 查看cpu使用率
+$ mpstat -P ALL 5
+# 查看进程情况
+$ pidstat -u 5 1
+```
+
+## CPU 上下文切换
+
+CPU 上下文切换的场景:
+* 进程
+* 线程
+* 中断处理程序调用
+
+
+### 进程上下文切换
+
+CPU的特权等级Ring 0 ~ Ring 3, 其中Ring 0 是内核态, 可以访问任何资源, 用户空间 Ring 3 用户态只能访问受限的资源,不能直接访问内存等硬件设备,必须通过系统调用陷入到内核中,才能访问特权资源.
+在这个过程中就发生了CPU的上下文切换.
+
+> 系统调用和进程上下文切换到区别:
+> 首先,进程是由内核来管理和调度的,进程的切换只能发生在内核态.所以进程的上下文不仅包含了虚拟内存,栈,全局变量等用户空间的资源,还包括了内核堆栈,寄存器等用户空间的资源,还包括了内核堆栈,寄存器等内核空间的状态.
+> 因此,进程的上下文切换比系统调用多了一步:在保存当前进程的内核状态和CPU寄存器之前,需要先把该进程的虚拟内存,栈等保存下来;而加在了下一进程的内核太后,还需要刷新进程的虚拟内存和用户栈.
+> 所以在进程频繁切换上下文导致CPU將大量的时间耗费在寄存器,内核栈一级虚拟内存等资源的保存和恢复上,进而缩短真正运行进程的时间.
+
+> 进程被调度到CPU执行的时机?
+> 1, 某个进程的时间片耗尽,被系统挂起;
+> 2, 进程系统资源不足(如内存不足),等到资源满足后才可以运行,进程被挂起;
+> 3, 进程通过sleep主动挂起;
+> 4, 高优先级进程运行时;
+> 5, 发生硬件中断,CPU上的进程会被中断挂起,转而执行内核中的中断服务程序;
+
+### 线程上下文切换
+
+**线程是基本的调度单位,而进程则是资源拥有的基本单位**
+即:
+* 当进程只有一个线程时,进程等于线程;
+* 当进程拥有多个线程时,线程共享虚拟内存和全局变量等资源,这些资源在上下文切换(线程)时,不需要修改;
+* 线程有自己的私有数据,如栈和寄存器等,这些在上下文切换需要保存.
+
+进程间的线程切换要比进程内的线程切换消耗更多的资源.
+
+### 中断上下文切换
+
+中断处理会打断进程的正常调度和执行,转而调用中断处理程序,响应设备事件.被打断的进程需要将其当前的状态保存下来,这样在中断结束后,进程仍然可以从原来的状态恢复运行.
+跟进程的上下文不同,中断上下文切换并不涉及到进程的用户态.所以即使中断打断了一个用户态的进程也不需要保存和恢复虚拟内存,全局变量等用户态资源.
+对同一个CPU来说,中断处理比进程拥有更高的优先级.所以中断上下文切换不会与进程上下文切换同时发生.同样道理,由于中断会打断正常运行的进程的调度和执行,所以大部分的中断处理程序都短小精悍,以便尽快执行完毕.
+
+## 查看上下文切换
+
+```shell
+# 查看CPU的上下文切换和中断次数
+$ vmstat 5
+```
+
+> cs (context swith) 每秒钟上下文切换的次数
+> in (interrupt) 每秒中断的次数
+> r 就绪队列的长度(正在运行的和等待CPU的进程数)
+> b (Blocked) 处于不可中断睡眠转台的进程数
+
+
+## CPU的使用率
+
+user(通常缩写为 us),代表用户态 CPU 时间。注意,它不包括下面的 nice 时间,但包括了 guest 时间。
+
+nice(通常缩写为 ni),代表低优先级用户态 CPU 时间,也就是进程的 nice 值被调整为 1-19 之间时的 CPU 时间。这里注意,nice 可取值范围是 -20 到 19,数值越大,优先级反而越低。
+
+> system(通常缩写为 sys),代表内核态 CPU 时间。
+idle(通常缩写为 id),代表空闲时间。注意,它不包括等待 I/O 的时间(iowait)。
+iowait(通常缩写为 wa),代表等待 I/O 的 CPU 时间。
+irq(通常缩写为 hi),代表处理硬中断的 CPU 时间。
+softirq(通常缩写为 si),代表处理软中断的 CPU 时间。
+steal(通常缩写为 st),代表当系统运行在虚拟机中的时候,被其他虚拟机占用的 CPU 时间。
+guest(通常缩写为 guest),代表通过虚拟化运行其他操作系统的时间,也就是运行虚拟机的 CPU 时间。
+guest_nice(通常缩写为 gnice),代表以低优先级运行虚拟机的时间。
+
+
diff --git a/_drafts/linux/2019-01-05-open_world_travel.md b/_drafts/linux/2019-01-05-open_world_travel.md
new file mode 100644
index 00000000..58337870
--- /dev/null
+++ b/_drafts/linux/2019-01-05-open_world_travel.md
@@ -0,0 +1 @@
+资料[开源世界旅行手册](https://i.linuxtoy.org/docs/guide/index.html)
diff --git a/_drafts/linux/2021-03-18-linux_swappiness_setting.md b/_drafts/linux/2021-03-18-linux_swappiness_setting.md
new file mode 100644
index 00000000..c1f3e815
--- /dev/null
+++ b/_drafts/linux/2021-03-18-linux_swappiness_setting.md
@@ -0,0 +1,3 @@
+这个交换参数控制内核从物理内存移出进程,移到交换空间。该参数从0到100,当该参数=0,表示只要有可能就尽力避免交换进程移出物理内存;该参数=100,这告诉内核疯狂的将数据移出物理内存移到swap缓存中。
+文件地址:
+/proc/sys/vm/swappiness
diff --git a/_drafts/linux/2021-04-15-linux_mime_file_default_application.md b/_drafts/linux/2021-04-15-linux_mime_file_default_application.md
new file mode 100644
index 00000000..bf4a9176
--- /dev/null
+++ b/_drafts/linux/2021-04-15-linux_mime_file_default_application.md
@@ -0,0 +1,39 @@
+---
+title: 设置Linux文件默认桌面程序
+category: Linux
+tags: linux mime
+---
+
+## mimeapps.list
+
+Path | Usage
+------------------------|----------
+~/.config/mimeapps.list |user overrides
+/etc/xdg/mimeapps.list |system-wide overrides
+~/.local/share/applications/mimeapps.list |(deprecated) user overrides
+/usr/local/share/applications/mimeapps.list |distribution-provided defaults
+/usr/share/applications/mimeapps.list |distribution-provided defaults
+
+## 查看现在桌面程序应用的desktop文件
+
+> desktop 文件的位置:~/.local/share/applications /usr/share/applications
+
+## 查看文件类型
+
+```shell
+$ xdg-mime query filetype <文件路径>
+```
+
+## 设置文件类型
+
+```shell
+$ xdg-mime default 转载请注明来源: http://www.codingted.com{{page.url}}
{{ content }}
- 欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论(可能需要在能访问 disqus 服务的网络),也可以邮件至 {{site.email}}。
Look ma, I'm HTML!+ if *x>3 { ysW( if ( x>3 ) { + my $str = *whee!; vlllls' my $str = 'whee!'; +Yo!*dst Yo! +Yo!*cst
Yo!
+ +# *代表当前光标位置,添加替换时使用后半括号)]},添加的括号和内容间就没有空格(如第2个示例),反之会在内容前后添加一个空格(如第4个实例) +``` + +## 命令列表 + +```vim +Normal mode +----------- +ds - delete a surrounding +cs - change a surrounding +ys - add a surrounding +yS - add a surrounding and place the surrounded text on a new line + indent it +yss - add a surrounding to the whole line +ySs - add a surrounding to the whole line, place it on a new line + indent it +ySS - same as ySs + +Visual mode +----------- +s - in visual mode, add a surrounding +S - in visual mode, add a surrounding but place text on new line + indent it + +Insert mode +----------- +- in insert mode, add a surrounding + - in insert mode, add a new line + surrounding + indent + s - same as + S - same as +``` + +## Vim基于surrounding的文本编辑 +提到了surround插件,不得不提一下Vim中广为人知的对surrounding内文本的编辑功能,其实surround插件就是对Vim这部分功能的增强。原理和细节请参照vim中的[text-object motion](http://vimdoc.sourceforge.net/htmldoc/motion.html),这里只列举一些常见用法。可以不夸张的说,任何习惯了vim中[operation+motion](https://blog.carbonfive.com/vim-text-objects-the-definitive-guide/)操作的人都会上瘾的,其他编辑器都是个渣了。 + +以修改surrounding内文本为例: +```vim +ci[ ci( ci< ci{ 删除一对 [], (), <>, 或{} 中的所有字符并进入插入模式 +ci” ci’ ci` 删除一对引号字符 ” ‘ 或 ` 中所有字符并进入插入模式 +cit 删除一对 HTML/XML 的标签内部的所有字符并进入插入模式 +``` +其他常见operation + +```vim +ci: 例如,ci(,或者ci),将会修改()之间的文本; +di: 剪切配对符号之间文本; +yi: 复制; +ca: 同ci,但修改内容包括配对符号本身; +da: 同di,但剪切内容包括配对符号本身; +ya: 同yi,但复制内容包括配对符号本身。 +PS. dib等同于di(。diB等同于di{。 +``` +## 转自 +[http://zuyunfei.com/2013/04/17/killer-plugin-of-vim-surround/](http://zuyunfei.com/2013/04/17/killer-plugin-of-vim-surround/) diff --git a/a.svg b/a.svg new file mode 100644 index 00000000..dde633d2 --- /dev/null +++ b/a.svg @@ -0,0 +1 @@ + diff --git a/about.html b/about.html index a531768d..7e8a98d0 100644 --- a/about.html +++ b/about.html @@ -1,4 +1,5 @@ --- +layout: default title: 关于 --- diff --git a/anchor.svg b/anchor.svg new file mode 100644 index 00000000..a15abc05 --- /dev/null +++ b/anchor.svg @@ -0,0 +1 @@ + diff --git a/assets/img/avatar-320x320.png b/assets/img/avatar-320x320.png index 929fa178..d3d58fbb 100644 Binary files a/assets/img/avatar-320x320.png and b/assets/img/avatar-320x320.png differ diff --git a/assets/img/avatar-320x320_ori.png b/assets/img/avatar-320x320_ori.png new file mode 100644 index 00000000..929fa178 Binary files /dev/null and b/assets/img/avatar-320x320_ori.png differ diff --git a/assets/img/avatar.png b/assets/img/avatar.png index 929fa178..20a54514 100644 Binary files a/assets/img/avatar.png and b/assets/img/avatar.png differ diff --git a/assets/img/avatar_org.png b/assets/img/avatar_org.png new file mode 100644 index 00000000..929fa178 Binary files /dev/null and b/assets/img/avatar_org.png differ diff --git a/assets/img/blog/arts/mysql_design.png b/assets/img/blog/arts/mysql_design.png new file mode 100644 index 00000000..3b0d9e64 Binary files /dev/null and b/assets/img/blog/arts/mysql_design.png differ diff --git a/assets/img/blog/arts/mysql_index_b-tree.png b/assets/img/blog/arts/mysql_index_b-tree.png new file mode 100644 index 00000000..7387678d Binary files /dev/null and b/assets/img/blog/arts/mysql_index_b-tree.png differ diff --git a/assets/img/blog/arts/mysql_search_seq.png b/assets/img/blog/arts/mysql_search_seq.png new file mode 100644 index 00000000..19acc9bc Binary files /dev/null and b/assets/img/blog/arts/mysql_search_seq.png differ diff --git a/assets/img/blog/db/mysql_undo_log.png b/assets/img/blog/db/mysql_undo_log.png new file mode 100644 index 00000000..82231fa2 Binary files /dev/null and b/assets/img/blog/db/mysql_undo_log.png differ diff --git a/assets/img/blog/db/row_trx_id.png b/assets/img/blog/db/row_trx_id.png new file mode 100644 index 00000000..616a6d25 Binary files /dev/null and b/assets/img/blog/db/row_trx_id.png differ diff --git a/assets/img/blog/linux/tmux_example.jpg b/assets/img/blog/linux/tmux_example.jpg index 5c953c01..224e0b35 100644 Binary files a/assets/img/blog/linux/tmux_example.jpg and b/assets/img/blog/linux/tmux_example.jpg differ diff --git a/bookmarks.html b/bookmarks.html new file mode 100644 index 00000000..4cdd9b55 --- /dev/null +++ b/bookmarks.html @@ -0,0 +1,127 @@ + + + + Bookmarks +Bookmarks
+
+
Bookmarks bar
+
+
Book
+
+
- 古诗文网-古诗文经典传承 +
- 汉典古籍 - gj.zdic.net- +
- 论坛 - 汉典论坛 - 汉典旗下网站 +
- 国学网 +
- 常用國字標準字體筆順學習網 +
- 汉典 zdic.net +
- 中國哲學書電子化計劃 +
- Kindle伴侣 - 为静心阅读而生 +
- kindle推|kindle推送|kindle图书推送|kindlepush|kindle电子书推送|kindle网站 +
- Linux - Free Computer, Programming, Mathematics, Technical Books, Lecture Notes and Tutorials +
- 中国国家图书馆•中国国家数字图书馆 +
- 七月 – 2018 – 我的小书屋-最新最全电子书免费下载 +
- 周读:提供免费电子书下载、分享。包括mobi、epud、pdf、txt格式,kindle电子书下载 - 周读 +
- kindle——珍藏的优质电子书网站 - 简书 +
+
MyBlog
+
+
代理
+
+
- 科学上网:ubuntu 16.04服务器上搭建Shadowsocks服务 | 令狐葱@前端笔记 +
- ubuntu shadowsocks polipo 全局代理 | dearmadman-王奇的博客 +
- SSH隧道翻墙的原理和实现 +
- 国外主机测评-国外VPS,国外服务器,国外主机,测评及优惠码 +
- 解决Linux关闭终端(关闭SSH等)后运行的程序或者服务自动停止【后台运行程序】 - bohaoist - 博客园 +
- 使用shadowsocks科学上网 +
- shadowsocks配合SwitchyOmega科学上网 | fazero +
- linux screen 命令详解 - David_Tang - 博客园 +
- Squid Linux 代理服务器 - WangXiaoQiang - 博客园 +
- Squid服务全攻略 | 独自等待-信息安全博客 +
- Linux下配置Squid代理服务器_服务器应用_Linux公社-Linux系统门户网站 +
+
推广相关
+
+
- 酷壳 – CoolShell.cn +
- 代码之谜(五)- 浮点数(谁偷了你的精度?) - justjavac(迷渡) +
- ilanyu's Blog +
- VIM替换 压箱底的技巧 | 夕阳下的奔跑 +
- 张志敏的技术专栏 +
- Welcome | 刘彦玮的技术博客 +
- vi/vim使用进阶: 自动补全 – 易水博客 +
- Linux下查看系统硬件信息的命令和脚本 – 笑遍世界 +
- metaboy's blog +
- OneCoder & Y & W +
- Wuyuan's Blog +
- HTTP 代理原理及实现(一) | JerryQu 的小站 +
- Spring的@PropertySource和@Value注解例子 - 9leg +
- huangz/blog — huangz/blog +
- Wscrlhs +
+
- Google Analytics(分析) +
- 主页 - 百度统计 +
- Typecho Official Site +
- 😍iEmoji.com - 👀Lookup, ✨Convert, and 💁Tweet with Emoji! 🔥 +
- 如何提升网站在搜索引擎的收录量 - stma - 博客园 +
- 框架的思考 - CSDN博客 +
- Manage 45.32.37.68 - Vultr.com +
- 丁亮的个人博客 +
- 优雅地使用命令行:Tmux 终端复用 | Harttle Land +
- Manage 45.32.37.68 - Vultr.com +
- 泰晓科技 - 聚焦嵌入式 Linux - 追本溯源,见微知著! +
+
Papers
+
+
- 2007-cpwl.pdf +
- 二叉查找树、平衡二叉树、红黑树、B-/B+树性能对比 - CSDN博客 +
- The Pathologies of Big Data - ACM Queue +
- Profile - LeetCode +
- Raft 一致性算法论文译文 +
- StackEdit – Editor +
- 由 B-/B+树看 MySQL索引结构 - ygmyth - SegmentFault 思否 +
- 为什么实用B-Tree(B+Tree) · MySQL索引背后的数据结构及算法原理 · 看云 +
+
磨铁
+
+
- 【新消息】 - 赵亮 - 北京磨铁数盟信息技术有限公司 - 磨铁文档管理系统(专业版) +
- 石墨文档 +
- 阿里云code +
- Jenkins +
- Home +
- 控制台快捷入口 +
- 用户信息: 赵亮 - JIRA +
- 磨铁后台 - 磨铁后台 - Confluence +
- Welcome! - Confluence +
- 各环境配置 - 磨铁后台 - Confluence +
- 如何编写 Commit Message | Harttle Land +
- 员工关爱平台 +
+
Work
+
+
- 知名互联网公司 Java 开发岗面试知识点解析 +
- Java面试----2018年MyBatis常见实用面试题整理-云栖社区 +
- 阿里专家与你分享:你必须注意的Java编程细节-博客-云栖社区-阿里云 +
- Linux OOM-killer机制(out of memory)-弦断指间-51CTO博客 +
- 个人简历 +
- 浅析Spring编程式事务管理及声明式事务管理 - CSDN博客 +
- https://mp.weixin.qq.com/s?__biz=MzIzOTU0NTQ0MA==&mid=2247487544&idx=1&sn=a15c8762edf234e843e11061def8931a&chksm=e9292d37de5ea42115530d2e8a59cf456388068b8e8aa382e2bdeccc7b218e7a10f1aea07c2f&mpshare=1&scene=1&srcid=0528V6LdmlNoviLuBrsjwPSA&pass_ticket=CWD5ICMAAIvkyaG%2FQrICDzOxA%2BBc8VtzMuFH2U1cTExujn9YBwKGfLVqbk0M8I0W#rd +
- 架构师之路 +
- git rebase - Git 中文开发手册 - 开发者手册 - 云+社区 - 腾讯云 +
- 深入理解Java类型信息(Class对象)与反射机制 - CSDN博客 +
- 深入理解Java枚举类型(enum) - CSDN博客 +
- 偏向锁,轻量级锁,自旋锁,重量级锁的详细介绍 - wade&luffy - 博客园 +
- Tcpdump Examples - 22 Tactical Commands | HackerTarget.com +
- 阿里技术 +
+
- CodingTed +
- +
- +
- 阮一峰 +
- +
- +
- 掘金 +
+
- 关于跑步那些事 | 如何挑选合适的跑鞋_正确的跑步姿势_跑前拉伸动作_什么值得买 +
- fsck error on boot: /dev/sda6: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY - Ask Ubuntu +
diff --git a/index.html b/index.html index 5b2488bd..72d28ae0 100644 --- a/index.html +++ b/index.html @@ -44,7 +44,7 @@