├── .gitignore ├── _sass ├── _mixins │ ├── Mist.scss │ ├── Muse.scss │ ├── custom.scss │ ├── Pisces.scss │ └── base.scss ├── _variables │ ├── Muse.scss │ ├── custom.scss │ └── Mist.scss ├── _schemes │ ├── Mist │ │ ├── _logo.scss │ │ ├── outline │ │ │ └── outline.scss │ │ ├── sidebar │ │ │ └── sidebar-blogroll.scss │ │ ├── _search.scss │ │ ├── _base.scss │ │ ├── _menu.scss │ │ ├── _header.scss │ │ ├── _posts-expanded.scss │ │ └── index.scss │ ├── Pisces │ │ ├── _posts.scss │ │ ├── index.scss │ │ ├── _brand.scss │ │ └── _menu.scss │ └── Muse │ │ ├── sidebar │ │ └── sidebar-blogroll.scss │ │ ├── _search.scss │ │ ├── index.scss │ │ ├── _layout.scss │ │ ├── _logo.scss │ │ └── _menu.scss ├── _common │ ├── components │ │ ├── comments.scss │ │ ├── third-party │ │ │ ├── han.scss │ │ │ ├── jiathis.scss │ │ │ ├── baidushare.scss │ │ │ ├── gentie.scss │ │ │ ├── third-party.scss │ │ │ ├── disqus.scss │ │ │ └── busuanzi-counter.scss │ │ ├── .DS_Store │ │ ├── header │ │ │ ├── headerband.scss │ │ │ ├── header.scss │ │ │ ├── site-nav.scss │ │ │ ├── menu.scss │ │ │ └── site-meta.scss │ │ ├── post │ │ │ ├── post-wordcount.scss │ │ │ ├── post-tags.scss │ │ │ ├── post-type.scss │ │ │ ├── post-eof.scss │ │ │ ├── post-copyright.scss │ │ │ ├── post-button.scss │ │ │ ├── post-gallery.scss │ │ │ ├── post-widgets.scss │ │ │ ├── post-title.scss │ │ │ ├── post-meta.scss │ │ │ ├── post-nav.scss │ │ │ ├── post-expand.scss │ │ │ ├── post-reward.scss │ │ │ └── post.scss │ │ ├── tag-cloud.scss │ │ ├── pages │ │ │ ├── pages.scss │ │ │ ├── post-detail.scss │ │ │ ├── categories.scss │ │ │ └── archive.scss │ │ ├── tags │ │ │ ├── tags.scss │ │ │ ├── full-image.scss │ │ │ ├── exturl.scss │ │ │ ├── group-pictures.scss │ │ │ ├── blockquote-center.scss │ │ │ └── note.scss │ │ ├── highlight │ │ │ └── diff.scss │ │ ├── sidebar │ │ │ ├── sidebar-blogroll.scss │ │ │ ├── sidebar-feed-link.scss │ │ │ ├── sidebar-author-links.scss │ │ │ ├── sidebar-author.scss │ │ │ ├── sidebar-toggle.scss │ │ │ ├── site-state.scss │ │ │ ├── sidebar-nav.scss │ │ │ ├── sidebar.scss │ │ │ └── sidebar-toc.scss │ │ ├── components.scss │ │ ├── back-to-top-sidebar.scss │ │ ├── footer │ │ │ └── footer.scss │ │ ├── buttons.scss │ │ ├── back-to-top.scss │ │ └── pagination.scss │ ├── .DS_Store │ ├── scaffolding │ │ ├── scaffolding.scss │ │ ├── tables.scss │ │ └── helpers.scss │ └── outline │ │ └── outline.scss ├── .DS_Store └── _custom │ └── custom.scss ├── assets ├── fonts │ └── .gitkeep ├── .DS_Store ├── favicon.ico ├── images │ ├── avatar.gif │ ├── loading.gif │ ├── placeholder.gif │ ├── searchicon.png │ ├── button │ │ └── fa-pencil-square-o.png │ ├── quote-r.svg │ └── quote-l.svg ├── lib │ ├── Han │ │ └── dist │ │ │ └── font │ │ │ ├── han.otf │ │ │ ├── han.woff │ │ │ ├── han-space.otf │ │ │ └── han-space.woff │ ├── fancybox │ │ ├── source │ │ │ ├── blank.gif │ │ │ ├── fancybox_sprite.png │ │ │ ├── fancybox_loading.gif │ │ │ ├── fancybox_overlay.png │ │ │ ├── fancybox_sprite@2x.png │ │ │ ├── fancybox_loading@2x.gif │ │ │ └── helpers │ │ │ │ ├── fancybox_buttons.png │ │ │ │ └── jquery.fancybox-thumbs.css │ │ ├── .gitattributes │ │ └── .bower.json │ ├── font-awesome │ │ ├── fonts │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ │ ├── HELP-US-OUT.txt │ │ ├── .gitignore │ │ ├── bower.json │ │ ├── .npmignore │ │ └── .bower.json │ ├── fastclick │ │ ├── bower.json │ │ ├── .bower.json │ │ └── LICENSE │ ├── pace │ │ ├── pace-theme-minimal.min.css │ │ ├── pace-theme-fill-left.min.css │ │ ├── pace-theme-big-counter.min.css │ │ ├── pace-theme-center-simple.min.css │ │ ├── pace-theme-center-radar.min.css │ │ ├── pace-theme-corner-indicator.min.css │ │ ├── pace-theme-flash.min.css │ │ └── pace-theme-center-circle.min.css │ ├── jquery │ │ └── .bower.json │ ├── jquery_lazyload │ │ ├── bower.json │ │ ├── .bower.json │ │ └── CONTRIBUTING.md │ ├── velocity │ │ ├── bower.json │ │ └── .bower.json │ ├── canvas-nest │ │ └── canvas-nest.min.js │ └── canvas-ribbon │ │ └── canvas-ribbon.js └── js │ └── src │ ├── schemes │ └── pisces.js │ ├── scroll-cookie.js │ ├── bootstrap.js │ └── exturl.js ├── _includes ├── _custom │ ├── header.html │ └── sidebar.html ├── _scripts │ ├── schemes │ │ ├── mist.html │ │ ├── muse.html │ │ └── pisces.html │ ├── boostrap.html │ ├── commons.html │ └── pages │ │ └── post-details.html ├── .DS_Store ├── _partials │ ├── head │ │ └── custom-head.html │ ├── search │ │ ├── tinysou.html │ │ ├── swiftype.html │ │ └── localsearch.html │ ├── share │ │ ├── add-this.html │ │ ├── duoshuo_share.html │ │ └── jiathis.html │ ├── pagination.html │ ├── search.html │ ├── footer.html │ ├── page-header.html │ └── comments.html ├── schedule.html ├── _third-party │ ├── exturl.html │ ├── search │ │ ├── index.html │ │ ├── algolia-search │ │ │ ├── dom.html │ │ │ └── assets.html │ │ └── tinysou.html │ ├── duoshuo-hot-articles.html │ ├── analytics │ │ ├── cnzz-analytics.html │ │ ├── tencent-analytics.html │ │ ├── baidu-analytics.html │ │ ├── tencent-mta.html │ │ ├── index.html │ │ ├── google-analytics.html │ │ ├── facebook-sdk.html │ │ ├── busuanzi-counter.html │ │ ├── vkontakte-api.html │ │ └── application-insights.html │ ├── scroll-cookie.html │ ├── comments │ │ ├── index.html │ │ ├── youyan.html │ │ ├── gentie.html │ │ ├── livere.html │ │ ├── hypercomments.html │ │ ├── changyan.html │ │ └── duoshuo.html │ ├── seo │ │ └── baidu-push.html │ ├── rating.html │ └── mathjax.html ├── index.html ├── _macro │ ├── wechat-subscriber.html │ ├── post-copyright.html │ ├── reward.html │ └── post-collapse.html ├── _blocks │ ├── page_class.html │ ├── script_extra.html │ ├── sidebar.html │ └── title.html ├── post.html ├── _helper │ └── list_categories.html ├── tag.html ├── category.html └── page.html ├── index.html ├── tag └── index.html ├── archives └── index.html ├── category └── index.html ├── tags └── index.html ├── .DS_Store ├── categories └── index.html ├── about └── index.md ├── _layouts ├── layout.html ├── page.html ├── post.html ├── tag.html ├── index.html ├── archive.html └── category.html ├── nguSeckill └── Placeholder.java ├── Java Basis ├── 005 Java的类的实例化顺序.md ├── 012 继承和聚合的区别.md ├── 001 JAVA有哪些数据类型?基本数据类型各占多少个字节.md ├── 011 抽象类和接口的区别.md ├── 015 反射中的 Class.forName() 与 ClassLoader.loadClass() 的区别.md ├── 018 final 关键字的用途.md ├── 010 有顺序的Map的实现类:TreeMap和LinkedHashMap.md ├── 009 java中堆和栈的区别.md ├── 003 Java中String、StringBuffer、StringBuilder的区别.md ├── 008 如何用java语言实现C Sharp中的ref关键字(按引用传递参数)的效果.md ├── 013 BIO、NIO、AIO的区别.md ├── 002 Java中的String类能否被继承?为什么?.md └── 019 单例模式的5种写法.md ├── _posts ├── 2017-04-05-005 Java的类的实例化顺序.md ├── 2018-04-04-《心经》.md ├── 2017-04-01-001 JAVA有哪些数据类型?基本数据类型各占多少个字节.md ├── 2017-04-12-012 继承和聚合的区别.md ├── 2018-03-23-《致橡树》.md ├── 2017-04-11-011 抽象类和接口的区别.md ├── 2017-04-15-015 反射中的 Class.forName() 与 ClassLoader.loadClass() 的区别.md ├── 2017-04-18-018 final 关键字的用途.md ├── 2017-04-25-01 Maven构建的项目中,把.xml等配置文件添加到编译目录.md ├── 2017-04-10-010 有顺序的Map的实现类:TreeMap和LinkedHashMap.md ├── 2017-04-09-009 java中堆和栈的区别.md ├── 2018-03-17-划分一个整形数组,把负数放在左边,零放在中间,正数放在右边.md ├── 2017-04-03-003 Java中String、StringBuffer、StringBuilder的区别.md ├── 2017-05-09-02 React State(状态).md ├── 2017-04-08-008 如何用java语言实现C Sharp中的ref关键字(按引用传递参数)的效果.md ├── 2017-04-13-013 BIO、NIO、AIO的区别.md └── 2017-04-02-002 Java中的String类能否被继承?为什么?.md ├── search.xml ├── 404.html ├── Maven └── 01 Maven构建的项目中,把.xml等配置文件添加到编译目录.md ├── _data └── languages │ ├── ja.yml │ ├── ko.yml │ ├── zh-Hans.yml │ ├── zh-hk.yml │ ├── zh-tw.yml │ ├── id.yml │ ├── pt-BR.yml │ ├── fr-FR.yml │ ├── pt.yml │ └── de.yml ├── React └── 02 React State(状态).md └── Algorithm └── 算法05 五大查找之:顺序查找.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | -------------------------------------------------------------------------------- /_sass/_mixins/Mist.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_sass/_mixins/Muse.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/fonts/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_sass/_mixins/custom.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_sass/_variables/Muse.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_sass/_variables/custom.scss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/_custom/header.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/_custom/sidebar.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /_includes/_scripts/schemes/mist.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /_includes/_scripts/schemes/muse.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: index 3 | --- 4 | -------------------------------------------------------------------------------- /tag/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: tag 3 | --- 4 | -------------------------------------------------------------------------------- /archives/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: archive 3 | --- 4 | -------------------------------------------------------------------------------- /category/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: category 3 | --- 4 | -------------------------------------------------------------------------------- /tags/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | type: tags 4 | --- 5 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_logo.scss: -------------------------------------------------------------------------------- 1 | .site-subtitle { display: none; } 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/.DS_Store -------------------------------------------------------------------------------- /_sass/_common/components/comments.scss: -------------------------------------------------------------------------------- 1 | .comments { margin: 60px 20px 0; } 2 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/outline/outline.scss: -------------------------------------------------------------------------------- 1 | .main-inner { margin-top: 80px; } 2 | -------------------------------------------------------------------------------- /categories/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | type: categories 4 | --- 5 | -------------------------------------------------------------------------------- /_sass/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/_sass/.DS_Store -------------------------------------------------------------------------------- /about/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: page 3 | type: about 4 | --- 5 | 6 | Building... 7 | -------------------------------------------------------------------------------- /assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/.DS_Store -------------------------------------------------------------------------------- /_includes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/_includes/.DS_Store -------------------------------------------------------------------------------- /assets/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/favicon.ico -------------------------------------------------------------------------------- /_includes/_partials/head/custom-head.html: -------------------------------------------------------------------------------- 1 | {% comment %} 2 | Custom head. 3 | {% endcomment %} 4 | -------------------------------------------------------------------------------- /_sass/_common/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/_sass/_common/.DS_Store -------------------------------------------------------------------------------- /_sass/_common/components/third-party/han.scss: -------------------------------------------------------------------------------- 1 | .fa { 2 | font-family: FontAwesome!important; 3 | } 4 | -------------------------------------------------------------------------------- /assets/images/avatar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/images/avatar.gif -------------------------------------------------------------------------------- /_includes/schedule.html: -------------------------------------------------------------------------------- 1 |
2 | 4 |
5 | -------------------------------------------------------------------------------- /assets/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/images/loading.gif -------------------------------------------------------------------------------- /assets/images/placeholder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/images/placeholder.gif -------------------------------------------------------------------------------- /assets/images/searchicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/images/searchicon.png -------------------------------------------------------------------------------- /_sass/_common/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/_sass/_common/components/.DS_Store -------------------------------------------------------------------------------- /_sass/_schemes/Pisces/_posts.scss: -------------------------------------------------------------------------------- 1 | .post-body { 2 | @include mobile() { 3 | text-align: justify; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /assets/lib/Han/dist/font/han.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/Han/dist/font/han.otf -------------------------------------------------------------------------------- /assets/lib/Han/dist/font/han.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/Han/dist/font/han.woff -------------------------------------------------------------------------------- /assets/lib/fancybox/source/blank.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/blank.gif -------------------------------------------------------------------------------- /_layouts/layout.html: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | {% assign __ = site.data.languages[site.language] %} 5 | {% include _layout.html %} 6 | -------------------------------------------------------------------------------- /_sass/_common/components/header/headerband.scss: -------------------------------------------------------------------------------- 1 | .headband { 2 | height: $headband-height; 3 | background: $headband-bg; 4 | } 5 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/sidebar/sidebar-blogroll.scss: -------------------------------------------------------------------------------- 1 | .links-of-blogroll-inline .links-of-blogroll-item { display: inline-block; } 2 | -------------------------------------------------------------------------------- /_sass/_schemes/Muse/sidebar/sidebar-blogroll.scss: -------------------------------------------------------------------------------- 1 | .links-of-blogroll-inline .links-of-blogroll-item { display: inline-block; } 2 | -------------------------------------------------------------------------------- /assets/lib/Han/dist/font/han-space.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/Han/dist/font/han-space.otf -------------------------------------------------------------------------------- /assets/lib/Han/dist/font/han-space.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/Han/dist/font/han-space.woff -------------------------------------------------------------------------------- /nguSeckill/Placeholder.java: -------------------------------------------------------------------------------- 1 | public class Placeholder { 2 | public static void main(String[] args) { 3 | 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include page.html %} 7 | -------------------------------------------------------------------------------- /_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include post.html %} 7 | -------------------------------------------------------------------------------- /_layouts/tag.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include tag.html %} 7 | -------------------------------------------------------------------------------- /assets/images/button/fa-pencil-square-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/images/button/fa-pencil-square-o.png -------------------------------------------------------------------------------- /_layouts/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include index.html %} 7 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-wordcount.scss: -------------------------------------------------------------------------------- 1 | @mixin post-wordcount { 2 | .post-wordcount { 3 | display: inline-block; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /_sass/_schemes/Pisces/index.scss: -------------------------------------------------------------------------------- 1 | @import "_layout"; 2 | @import "_brand"; 3 | @import "_menu"; 4 | @import "_sidebar"; 5 | @import "_posts"; 6 | -------------------------------------------------------------------------------- /assets/lib/fancybox/source/fancybox_sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/fancybox_sprite.png -------------------------------------------------------------------------------- /assets/lib/font-awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/font-awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /_layouts/archive.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include archive.html %} 7 | -------------------------------------------------------------------------------- /_layouts/category.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: layout 3 | --- 4 | 5 | {% assign __ = site.data.languages[site.language] %} 6 | {% include category.html %} 7 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_search.scss: -------------------------------------------------------------------------------- 1 | // Search 2 | // -------------------------------------------------- 3 | .site-search form { 4 | display: none; 5 | } -------------------------------------------------------------------------------- /_sass/_schemes/Muse/_search.scss: -------------------------------------------------------------------------------- 1 | // Search 2 | // -------------------------------------------------- 3 | .site-search form { 4 | display: none; 5 | } -------------------------------------------------------------------------------- /assets/lib/fancybox/source/fancybox_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/fancybox_loading.gif -------------------------------------------------------------------------------- /assets/lib/fancybox/source/fancybox_overlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/fancybox_overlay.png -------------------------------------------------------------------------------- /assets/lib/fancybox/source/fancybox_sprite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/fancybox_sprite@2x.png -------------------------------------------------------------------------------- /_sass/_schemes/Muse/index.scss: -------------------------------------------------------------------------------- 1 | @import "_layout"; 2 | @import "_logo"; 3 | @import "_menu"; 4 | @import "_search"; 5 | @import "sidebar/sidebar-blogroll"; 6 | -------------------------------------------------------------------------------- /assets/lib/fancybox/source/fancybox_loading@2x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/fancybox_loading@2x.gif -------------------------------------------------------------------------------- /_includes/_partials/search/tinysou.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /_sass/_common/components/tag-cloud.scss: -------------------------------------------------------------------------------- 1 | .tag-cloud { 2 | text-align: center; 3 | 4 | a { 5 | display: inline-block; 6 | margin: 10px; 7 | } 8 | } -------------------------------------------------------------------------------- /assets/lib/font-awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/font-awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /assets/lib/font-awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/font-awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /assets/lib/font-awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/font-awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /assets/lib/fancybox/source/helpers/fancybox_buttons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/fancybox/source/helpers/fancybox_buttons.png -------------------------------------------------------------------------------- /assets/lib/font-awesome/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nnngu/LearningNotes/HEAD/assets/lib/font-awesome/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /_sass/_common/components/pages/pages.scss: -------------------------------------------------------------------------------- 1 | // Page specific styles 2 | 3 | @import "archive"; 4 | @import "categories"; 5 | @import "schedule"; 6 | @import "post-detail"; 7 | -------------------------------------------------------------------------------- /_sass/_common/components/pages/post-detail.scss: -------------------------------------------------------------------------------- 1 | .page-post-detail { 2 | 3 | .sidebar-toggle-line { background: $sidebar-highlight; } 4 | 5 | .comments { overflow: hidden; } 6 | } 7 | -------------------------------------------------------------------------------- /_includes/_third-party/exturl.html: -------------------------------------------------------------------------------- 1 | {% if site.exturl %} 2 | 3 | {% endif %} 4 | -------------------------------------------------------------------------------- /_includes/_third-party/search/index.html: -------------------------------------------------------------------------------- 1 | {% include _third-party/search/tinysou.html %} 2 | {% include _third-party/search/localsearch.html %} 3 | {% include _third-party/search/algolia-search/assets.html %} 4 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/jiathis.scss: -------------------------------------------------------------------------------- 1 | .post-spread { 2 | margin-top: 20px; 3 | text-align: center; 4 | } 5 | 6 | .jiathis_style { 7 | display: inline-block; 8 | 9 | a { border: none; } 10 | } -------------------------------------------------------------------------------- /_sass/_common/scaffolding/scaffolding.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Scaffolding 3 | // ================================================= 4 | 5 | @import "normalize"; 6 | @import "base"; 7 | @import "helpers"; 8 | @import "tables"; 9 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/tags.scss: -------------------------------------------------------------------------------- 1 | @import "full-image"; 2 | @import "blockquote-center"; 3 | @import "group-pictures"; 4 | @import "note"; 5 | @import "exturl"; 6 | @if jekyll-config('exturl') { 7 | @include exturl; 8 | } 9 | -------------------------------------------------------------------------------- /assets/lib/fancybox/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Denote all files that are truly binary and should not be modified. 5 | *.png binary 6 | *.jpg binary 7 | *.gif binary -------------------------------------------------------------------------------- /_sass/_common/components/header/header.scss: -------------------------------------------------------------------------------- 1 | .header { background: $head-bg; } 2 | 3 | .header-inner { position: relative; } 4 | 5 | 6 | @import "headerband"; 7 | @import "site-meta"; 8 | @import "site-nav"; 9 | @import "menu"; 10 | -------------------------------------------------------------------------------- /_sass/_schemes/Muse/_layout.scss: -------------------------------------------------------------------------------- 1 | .header-inner, .container .main-inner, .footer-inner { 2 | @include mobile() { width: auto; } 3 | } 4 | 5 | // embed tag 6 | embed { 7 | display: block; 8 | margin: 0px auto 25px auto; 9 | } 10 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-tags.scss: -------------------------------------------------------------------------------- 1 | .posts-expand .post-tags { 2 | margin-top: 40px; 3 | text-align: center; 4 | 5 | a { 6 | display: inline-block; 7 | margin-right: 10px; 8 | font-size: 13px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /_includes/_third-party/duoshuo-hot-articles.html: -------------------------------------------------------------------------------- 1 | {% comment %} 多说热评文章 {% endcomment %} 2 | {% if site.duoshuo_hotartical and page.title %} 3 |

热评文章

4 |
5 | {% endif %} 6 | -------------------------------------------------------------------------------- /_includes/_scripts/boostrap.html: -------------------------------------------------------------------------------- 1 | {% assign boot_scripts = 'src/bootstrap.js' | split: ", " %} 2 | 3 | {% for bs in boot_scripts %} 4 | 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /assets/lib/fastclick/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fastclick", 3 | "main": "lib/fastclick.js", 4 | "ignore": [ 5 | "**/.*", 6 | "component.json", 7 | "package.json", 8 | "Makefile", 9 | "tests", 10 | "examples" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /_includes/_scripts/commons.html: -------------------------------------------------------------------------------- 1 | {% assign js_commons = 'src/utils.js, src/motion.js' | split: ", " %} 2 | 3 | {% for common in js_commons %} 4 | 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /_includes/_scripts/pages/post-details.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Java Basis/005 Java的类的实例化顺序.md: -------------------------------------------------------------------------------- 1 | # Java的类的实例化顺序 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 父类的静态数据 8 | 9 | 子类的静态数据 10 | 11 | 父类的成员变量 12 | 13 | 父类的构造方法 14 | 15 | 子类的成员变量 16 | 17 | 子类的构造方法 18 | 19 | -------------------------------------------------------------------------------- /_includes/_scripts/schemes/pisces.html: -------------------------------------------------------------------------------- 1 | {% assign scripts = 'src/affix.js, src/schemes/pisces.js' | split: ", " %} 2 | 3 | {% for script in scripts %} 4 | 5 | {% endfor %} 6 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/cnzz-analytics.html: -------------------------------------------------------------------------------- 1 | {% if site.cnzz_siteid %} 2 | 3 |
4 | 5 |
6 | 7 | {% endif %} 8 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/baidushare.scss: -------------------------------------------------------------------------------- 1 | .post-spread { 2 | margin-top: 20px; 3 | text-align: center; 4 | } 5 | 6 | .bdshare-slide-button-box a { border: none; } 7 | 8 | .bdsharebuttonbox { 9 | display: inline-block; 10 | 11 | a { border: none; } 12 | } 13 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-minimal.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#29d;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px} -------------------------------------------------------------------------------- /_includes/_partials/share/add-this.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-type.scss: -------------------------------------------------------------------------------- 1 | // TODO: Refactor. 2 | 3 | .page-home, .page-post-detail { 4 | .post-type-quote { 5 | .post-header, 6 | .post-tags { 7 | display: none; 8 | } 9 | 10 | blockquote { 11 | @extend .blockquote-center 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_base.scss: -------------------------------------------------------------------------------- 1 | // Tags 2 | // -------------------------------------------------- 3 | h1, h2, h3, h4, h5, h6 { margin: 20px 0 10px; } 4 | 5 | p { margin: 0 0 25px 0; } 6 | 7 | a { border-bottom-color: $grey-light; } 8 | 9 | hr { 10 | margin: 20px 0; 11 | height: 2px; 12 | } 13 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-fill-left.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background-color:rgba(34,153,221,.19999999999999996);position:fixed;z-index:-1;top:0;right:100%;bottom:0;width:100%} -------------------------------------------------------------------------------- /_includes/_third-party/scroll-cookie.html: -------------------------------------------------------------------------------- 1 | {% if site.save_scroll %} 2 | 3 | 4 | {% endif %} 5 | -------------------------------------------------------------------------------- /_posts/2017-04-05-005 Java的类的实例化顺序.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 实例化顺序 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | 父类的静态数据 11 | 12 | 子类的静态数据 13 | 14 | 父类的成员变量 15 | 16 | 父类的构造方法 17 | 18 | 子类的成员变量 19 | 20 | 子类的构造方法 21 | 22 | -------------------------------------------------------------------------------- /_sass/_custom/custom.scss: -------------------------------------------------------------------------------- 1 | // Custom styles. 2 | .post-body h2 { 3 | border-bottom: 1px solid #ddd; 4 | padding-bottom: 0.3em; 5 | } 6 | .post-body h3 { 7 | background: #eee; 8 | border-radius: 8px; 9 | padding: 8px; 10 | } 11 | .post-body p a { 12 | color: #4183c4; 13 | } 14 | #sidebar .nav-number { 15 | display: none; 16 | } 17 | -------------------------------------------------------------------------------- /_includes/_partials/pagination.html: -------------------------------------------------------------------------------- 1 | {% if paginator.previous_page or paginator.next_page %} 2 | 8 | {% endif %} 9 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/gentie.scss: -------------------------------------------------------------------------------- 1 | .cloud-tie-wrapper { 2 | img { 3 | display: inline-block; 4 | } 5 | 6 | .total-txt { 7 | font-size: 1em !important; 8 | } 9 | } 10 | 11 | .cloud-tie-join-count .join-count { 12 | color: #555 !important; 13 | font-size: inherit !important; 14 | margin: 0 !important; 15 | } 16 | -------------------------------------------------------------------------------- /_sass/_common/components/highlight/diff.scss: -------------------------------------------------------------------------------- 1 | $highlight_theme : jekyll-config("highlight_theme"); 2 | 3 | @if $highlight_theme == "normal" { 4 | $highlight-deletion : #fdd !global; 5 | $highlight-addition : #dfd !global; 6 | } 7 | @else { 8 | $highlight-deletion : #008000 !global; 9 | $highlight-addition : #800000 !global; 10 | } 11 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/third-party.scss: -------------------------------------------------------------------------------- 1 | @import "duoshuo"; 2 | @import "gentie"; 3 | @import "jiathis"; 4 | @import "han"; 5 | @import "baidushare"; 6 | @import "localsearch"; 7 | @import "busuanzi-counter"; 8 | @import "algolia-search"; 9 | @import "disqus"; 10 | @if jekyll-config('algolia_search.enable') { 11 | @include algolia-search; 12 | } 13 | -------------------------------------------------------------------------------- /_includes/index.html: -------------------------------------------------------------------------------- 1 | {% assign posts = site.posts %} 2 | {% if site.paginate > 0 %}{% assign posts = paginator.posts %}{% endif %} 3 | 4 |
5 | {% for post in posts %} 6 | {% assign is_index = true %} 7 | {% include _macro/post.html %} 8 | {% endfor %} 9 |
10 | 11 | {% include _partials/pagination.html %} 12 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-blogroll.scss: -------------------------------------------------------------------------------- 1 | .links-of-blogroll { font-size: 13px; } 2 | 3 | .links-of-blogroll-title { 4 | margin-top: 20px; 5 | font-size: 14px; 6 | font-weight: $font-weight-bold; 7 | } 8 | .links-of-blogroll-list { 9 | margin: 0; 10 | padding: 0; 11 | list-style: none; 12 | } 13 | 14 | .links-of-blogroll-item { padding: 2px 10px; } 15 | -------------------------------------------------------------------------------- /assets/lib/font-awesome/HELP-US-OUT.txt: -------------------------------------------------------------------------------- 1 | I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, 2 | Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, 3 | comprehensive icon sets or copy and paste your own. 4 | 5 | Please. Check it out. 6 | 7 | -Dave Gandy 8 | -------------------------------------------------------------------------------- /_sass/_mixins/Pisces.scss: -------------------------------------------------------------------------------- 1 | @mixin sidebar-inline-links-item() { 2 | float: left; 3 | margin: 5px 0 0; 4 | width: 50%; 5 | 6 | & a { 7 | box-sizing: border-box; 8 | display: inline-block; 9 | margin-right: 0; 10 | margin-bottom: 0; 11 | padding: 0 5px; 12 | overflow: hidden; 13 | white-space: nowrap; 14 | text-overflow: ellipsis; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-eof.scss: -------------------------------------------------------------------------------- 1 | .posts-expand { 2 | .post-eof { 3 | display: block; 4 | margin: $post-eof-margin-top auto $post-eof-margin-bottom; 5 | width: 8%; 6 | height: 1px; 7 | background: $grey-light; 8 | text-align: center; 9 | } 10 | } 11 | 12 | 13 | .post:last-child { 14 | .post-eof.post-eof.post-eof { 15 | display: none; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/index.html: -------------------------------------------------------------------------------- 1 | {% include _third-party/comments/duoshuo.html %} 2 | {% include _third-party/comments/disqus.html %} 3 | {% include _third-party/comments/hypercomments.html %} 4 | {% include _third-party/comments/gentie.html %} 5 | {% include _third-party/comments/youyan.html %} 6 | {% include _third-party/comments/livere.html %} 7 | {% include _third-party/comments/changyan.html %} 8 | -------------------------------------------------------------------------------- /_includes/_partials/search.html: -------------------------------------------------------------------------------- 1 | {% if site.algolia_search.enable %} 2 | {% include _third-party/search/algolia-search/dom.html %} 3 | {% elsif site.swiftype_key %} 4 | {% include _partials/search/swiftype.html %} 5 | {% elsif site.tinysou_Key %} 6 | {% include _partials/search/tinysou.html %} 7 | {% elsif site.local_search.enable %} 8 | {% include _partials/search/localsearch.html %} 9 | {% endif %} 10 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/full-image.scss: -------------------------------------------------------------------------------- 1 | // Expand image to 126% with nagative margin-left/right on Desktop. 2 | .full-image.full-image.full-image { 3 | border: none; 4 | max-width: 100%; 5 | width: auto; 6 | margin: 20px auto; 7 | @include desktop() { 8 | max-width: none; 9 | width: $full-image-width; 10 | margin: $full-image-margin-vertical $full-image-margin-horizontal; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /_sass/_variables/Mist.scss: -------------------------------------------------------------------------------- 1 | // Variables of Mist scheme 2 | // ================================================= 3 | 4 | $font-size-headings-base : 26px; 5 | 6 | $brand-color : $black-deep; 7 | $brand-hover-color : $brand-color; 8 | 9 | $site-meta-text-align : left; 10 | $posts-collapse-left : 0; 11 | 12 | $read-more-color : $link-color; 13 | $read-more-bg-color : transparent; 14 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/tencent-analytics.html: -------------------------------------------------------------------------------- 1 | {% if site.tencent_analytics %} 2 | 10 | {% endif %} 11 | -------------------------------------------------------------------------------- /_sass/_schemes/Muse/_logo.scss: -------------------------------------------------------------------------------- 1 | .custom-logo { 2 | .site-meta-headline { text-align: center; } 3 | 4 | .brand { background: none; } 5 | 6 | .site-title { 7 | margin: 10px auto 0; 8 | font-size: 24px; 9 | color: $black-deep; 10 | a { border: none; } 11 | } 12 | 13 | 14 | } 15 | 16 | .custom-logo-image { 17 | margin: 0 auto; 18 | padding: 5px; 19 | max-width: 150px; 20 | background: white; 21 | } 22 | -------------------------------------------------------------------------------- /_includes/_macro/wechat-subscriber.html: -------------------------------------------------------------------------------- 1 | {% if site.wechat_subscriber.enabled %} 2 |
3 | {{ site.author }} wechat 4 |
{{ site.wechat_subscriber.description }}
5 |
6 | {% endif %} 7 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/baidu-analytics.html: -------------------------------------------------------------------------------- 1 | {% if site.baidu_analytics %} 2 | 11 | {% endif %} 12 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-copyright.scss: -------------------------------------------------------------------------------- 1 | @mixin post-copyright { 2 | .post-copyright { 3 | margin: map-get($post-copyright, margin); 4 | padding: map-get($post-copyright, padding); 5 | border-left: map-get(map-get($post-copyright, border), width) map-get(map-get($post-copyright, border), style) map-get(map-get($post-copyright, border), color); 6 | background-color: map-get($post-copyright, bg); 7 | list-style: none; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /assets/lib/fancybox/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fancybox", 3 | "homepage": "https://github.com/fancyapps/fancyBox", 4 | "version": "2.1.5", 5 | "_release": "2.1.5", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v2.1.5", 9 | "commit": "18d171278d21ca59067aace6d52a1adeb6462219" 10 | }, 11 | "_source": "git://github.com/fancyapps/fancyBox.git", 12 | "_target": "~2.1.5", 13 | "_originalSource": "fancybox", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /_sass/_common/components/post/post-button.scss: -------------------------------------------------------------------------------- 1 | .post-button { 2 | margin-top: 50px; 3 | 4 | .btn { 5 | color: $read-more-color; 6 | font-size: $read-more-font-size; 7 | background: $read-more-bg-color; 8 | border-radius: $read-more-border-radius; 9 | line-height: 2; 10 | margin: 0 4px 8px 4px; 11 | } 12 | .btn:hover { 13 | @extend %btn-hover; 14 | } 15 | .fa-fw { 16 | width: (18em / 14); 17 | text-align: left; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /assets/lib/font-awesome/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | *.db 4 | *.db.old 5 | *.swp 6 | *.db-journal 7 | 8 | .coverage 9 | .DS_Store 10 | .installed.cfg 11 | _gh_pages/* 12 | 13 | .idea/* 14 | .svn/* 15 | src/website/static/* 16 | src/website/media/* 17 | 18 | bin 19 | cfcache 20 | develop-eggs 21 | dist 22 | downloads 23 | eggs 24 | parts 25 | tmp 26 | .sass-cache 27 | node_modules 28 | 29 | src/website/settingslocal.py 30 | stunnel.log 31 | 32 | .ruby-version 33 | .bundle 34 | -------------------------------------------------------------------------------- /_posts/2018-04-04-《心经》.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: 经文 3 | description: 《心经》 4 | --- 5 | 6 | 般若波罗蜜多心经 7 | 8 | 观自在菩萨,行深般若波罗蜜多时,照见五蕴皆空,度一切苦厄。 9 | 舍利子,色不异空,空不异色,色即是空,空即是色,受想行识,亦复如是。 10 | 舍利子,是诸法空相,不生不灭,不垢不净,不增不减。 11 | 是故空中无色,无受想行识,无眼耳鼻舌身意,无色声香味触法,无眼界,乃至无意识界。 12 | 无无明,亦无无明尽,乃至无老死,亦无老死尽。 13 | 无苦集灭道,无智亦无得。 14 | 以无所得故,菩提萨埵,依般若波罗蜜多故,心无挂碍,无挂碍故,无有恐怖,远离颠倒梦想,究竟涅槃。 15 | 三世诸佛,依般若波罗蜜多故,得阿耨多罗三藐三菩提。 16 | 故知般若波罗蜜多,是大神咒,是大明咒,是无上咒,是无等等咒,能除一切苦,真实不虚。 17 | 故说般若波罗蜜多咒,即说咒曰:揭谛揭谛,波罗揭谛,波罗僧揭谛,菩提萨婆诃。 18 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/tencent-mta.html: -------------------------------------------------------------------------------- 1 | {% if site.tencent_mta %} 2 | 14 | {% endif %} 15 | -------------------------------------------------------------------------------- /_includes/_blocks/page_class.html: -------------------------------------------------------------------------------- 1 | {% case page.layout %} 2 | {% when 'index' %} 3 | {% capture page_class %}page-home{% endcapture %} 4 | {% when 'post' %} 5 | {% capture page_class %}page-post-detail{% endcapture %} 6 | {% when 'page' %} 7 | {% capture page_class %}page-post-detail{% endcapture %} 8 | {% when 'archive' %} 9 | {% capture page_class %}page-archive{% endcapture %} 10 | {% when 'schedule' %} 11 | {% capture page_class %}page-post-detail page-calendar{% endcapture %} 12 | {% endcase %} 13 | -------------------------------------------------------------------------------- /assets/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "_cacheHeaders": { 4 | "ETag": "\"5492efef-14960\"", 5 | "Last-Modified": "Thu, 18 Dec 2014 15:17:03 GMT", 6 | "Content-Length": "84320", 7 | "Content-Type": "application/x-javascript" 8 | }, 9 | "_release": "e-tag:5492efef-", 10 | "main": "index.js", 11 | "_source": "http://code.jquery.com/jquery-2.1.3.min.js", 12 | "_target": "*", 13 | "_originalSource": "http://code.jquery.com/jquery-2.1.3.min.js", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /_includes/_third-party/analytics/index.html: -------------------------------------------------------------------------------- 1 | {% include _third-party/analytics/facebook-sdk.html %} 2 | {% include _third-party/analytics/vkontakte-api.html %} 3 | {% include _third-party/analytics/google-analytics.html %} 4 | {% include _third-party/analytics/baidu-analytics.html %} 5 | {% include _third-party/analytics/tencent-analytics.html %} 6 | {% include _third-party/analytics/tencent-mta.html %} 7 | {% include _third-party/analytics/cnzz-analytics.html %} 8 | {% include _third-party/analytics/application-insights.html %} 9 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-feed-link.scss: -------------------------------------------------------------------------------- 1 | .feed-link { 2 | margin-top: 20px; 3 | 4 | a { 5 | display: inline-block; 6 | padding: 0 15px; 7 | color: rgb(252, 100, 35); 8 | border: 1px solid rgb(252, 100, 35); 9 | border-radius: 4px; 10 | 11 | i { 12 | color: rgb(252, 100, 35); 13 | font-size: 14px; 14 | } 15 | 16 | &:hover { 17 | color:white; 18 | background: rgb(252, 100, 35); 19 | 20 | i { color: white; } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /assets/lib/font-awesome/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "font-awesome", 3 | "description": "Font Awesome", 4 | "keywords": [], 5 | "homepage": "http://fontawesome.io", 6 | "dependencies": {}, 7 | "devDependencies": {}, 8 | "license": ["OFL-1.1", "MIT", "CC-BY-3.0"], 9 | "main": [ 10 | "less/font-awesome.less", 11 | "scss/font-awesome.scss" 12 | ], 13 | "ignore": [ 14 | "*/.*", 15 | "*.json", 16 | "src", 17 | "*.yml", 18 | "Gemfile", 19 | "Gemfile.lock", 20 | "*.md" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/exturl.scss: -------------------------------------------------------------------------------- 1 | @mixin exturl { 2 | .exturl { 3 | // Remove the gray background color from active links in IE 10. 4 | background-color: transparent; 5 | 6 | cursor: pointer; 7 | border-bottom: 1px solid #999; 8 | 9 | .fa { 10 | font-size: 14px; 11 | } 12 | } 13 | 14 | // Improve readability when focused and also mouse hovered in all browsers. 15 | .exturl:active, .exturl:hover { 16 | outline: 0; 17 | color: $black-deep; 18 | border-bottom-color: $black-deep; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/youyan.html: -------------------------------------------------------------------------------- 1 | {% unless site.duoshuo_shortname 2 | or site.disqus_shortname 3 | or site.hypercomments_id 4 | or site.gentie_productKey 5 | or site.duoshuo and site.duoshuo.shortname %} 6 | 7 | {% if site.youyan_uid %} 8 | {% assign uid = site.youyan_uid %} 9 | 10 | {% if page.comments %} 11 | 12 | 13 | 14 | {% endif %} 15 | {% endif %} 16 | 17 | {% endunless %} 18 | -------------------------------------------------------------------------------- /_includes/_third-party/seo/baidu-push.html: -------------------------------------------------------------------------------- 1 | {% if site.baidu_push %} 2 | 16 | {% endif %} 17 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-gallery.scss: -------------------------------------------------------------------------------- 1 | .post-gallery { 2 | display: table; 3 | table-layout: fixed; 4 | width: 100%; 5 | border-collapse: separate; 6 | } 7 | 8 | .post-gallery-row { display: table-row; } 9 | 10 | .post-gallery .post-gallery-img { 11 | display: table-cell; 12 | text-align: center; 13 | vertical-align: middle; 14 | border: none; 15 | } 16 | 17 | .post-gallery .post-gallery-img img { 18 | max-width: 100%; 19 | max-height: 100%; 20 | border: none; 21 | } 22 | 23 | .fancybox-close, .fancybox-close:hover { border: none; } 24 | -------------------------------------------------------------------------------- /Java Basis/012 继承和聚合的区别.md: -------------------------------------------------------------------------------- 1 | # 012 继承和聚合的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | ## 继承 8 | 9 | 指的是一个类继承另外的一个类的功能,并可以增加它自己的新功能的能力,继承是类与类或者接口与接口之间最常见的关系;在Java中此类关系通过关键字extends明确标识。 10 | 11 | ![][1] 12 | 13 | ## 聚合 14 | 15 | 聚合体现的是整体与部分、拥有的关系,此时整体与部分之间是可分离的,他们可以具有各自的生命周期;比如计算机与CPU、公司与员工的关系等; 16 | 17 | ![][2] 18 | 19 | 20 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/24/1516808461696.jpg 21 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/24/1516808836569.jpg -------------------------------------------------------------------------------- /_includes/_third-party/analytics/google-analytics.html: -------------------------------------------------------------------------------- 1 | {% if site.google_analytics %} 2 | 10 | {% endif %} 11 | -------------------------------------------------------------------------------- /_sass/_common/components/components.scss: -------------------------------------------------------------------------------- 1 | @import "highlight/highlight"; 2 | @import "tags/tags"; 3 | 4 | @import "buttons"; 5 | @import "pagination"; 6 | @import "comments"; 7 | @import "tag-cloud"; 8 | 9 | @import "back-to-top-sidebar"; 10 | @import "back-to-top"; 11 | @if jekyll-config('sidebar.b2t') { 12 | @include back-to-top-sidebar; 13 | } 14 | @else { 15 | @include back-to-top; 16 | } 17 | 18 | @import "header/header"; 19 | @import "post/post"; 20 | @import "sidebar/sidebar"; 21 | @import "footer/footer"; 22 | @import "third-party/third-party"; 23 | 24 | @import "pages/pages"; 25 | -------------------------------------------------------------------------------- /_includes/post.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | {% assign post = page %} 4 | {% include _macro/post.html %} 5 |
6 | {% if site.jiathis %} 7 | {% include _partials/share/jiathis.html %} 8 | {% elsif site.baidushare %} 9 | {% include _partials/share/baidushare.html %} 10 | {% elsif site.add_this_id %} 11 | {% include _partials/share/add-this.html %} 12 | {% elsif site.duoshuo_shortname and site.duoshuo_share %} 13 | {% include _partials/share/duoshuo_share.html %} 14 | {% endif %} 15 |
16 |
17 | -------------------------------------------------------------------------------- /_sass/_schemes/Pisces/_brand.scss: -------------------------------------------------------------------------------- 1 | .site-brand-wrapper { 2 | position: relative; 3 | } 4 | 5 | .site-meta { 6 | padding: 20px 0; 7 | color: white; 8 | background: $black-deep; 9 | 10 | @include tablet() { 11 | box-shadow: 0 0 16px rgba(0,0,0,0.5); 12 | } 13 | @include mobile() { 14 | box-shadow: 0 0 16px rgba(0,0,0,0.5); 15 | } 16 | } 17 | 18 | .brand { 19 | padding: 0; 20 | background: none; 21 | 22 | &:hover { color: white; } 23 | } 24 | 25 | .site-subtitle { 26 | margin: 10px 10px 0; 27 | font-weight: initial; 28 | } 29 | 30 | .site-search form { display: none; } 31 | -------------------------------------------------------------------------------- /_includes/_partials/search/swiftype.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 | 13 | -------------------------------------------------------------------------------- /_sass/_common/components/pages/categories.scss: -------------------------------------------------------------------------------- 1 | .category-all-page { 2 | .category-all-title { text-align: center; } 3 | 4 | .category-all { margin-top: 20px; } 5 | 6 | .category-list { 7 | margin: 0; 8 | padding: 0; 9 | list-style: none; 10 | } 11 | 12 | .category-list-item { margin: 5px 10px; } 13 | 14 | .category-list-count { 15 | color: $grey; 16 | &:before { 17 | display: inline; 18 | content: " (" 19 | } 20 | &:after { 21 | display: inline; 22 | content: ") " 23 | } 24 | } 25 | 26 | .category-list-child { padding-left: 10px; } 27 | } 28 | -------------------------------------------------------------------------------- /assets/js/src/schemes/pisces.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function () { 2 | var $headerInner = $('.header-inner'); 3 | var $sidebar = $('#sidebar'); 4 | var getSidebarTop = function(){ 5 | return $headerInner.height() + CONFIG.sidebar.offset; 6 | }; 7 | var setSidebarMarginTop = function(sidebarTop){ 8 | return $sidebar.css({ 'margin-top': sidebarTop }); 9 | }; 10 | var mql = window.matchMedia('(min-width: 991px)'); 11 | setSidebarMarginTop(getSidebarTop()).show(); 12 | mql.addListener(function(e){ 13 | if(e.matches){ 14 | setSidebarMarginTop(getSidebarTop()); 15 | } 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /_includes/_partials/search/localsearch.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-author-links.scss: -------------------------------------------------------------------------------- 1 | .links-of-author { margin-top: 20px; } 2 | 3 | .links-of-author a { 4 | display: inline-block; 5 | vertical-align: middle; 6 | margin-right: 10px; 7 | margin-bottom: 10px; 8 | border-bottom-color: $black-light; 9 | font-size: 13px; 10 | 11 | &:before { 12 | display: inline-block; 13 | vertical-align: middle; 14 | margin-right: 3px; 15 | content: " "; 16 | width: 4px; 17 | height: 4px; 18 | border-radius: 50%; 19 | background: rgb(random-color(0, 255) - 50%, random-color(0, 255) - 50%, random-color(0, 255) - 50%); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/gentie.html: -------------------------------------------------------------------------------- 1 | {% unless site.disqus_shortname or site.hypercomments_id or site.duoshuo_shortname or site.duoshuo and site.duoshuo.shortname %} 2 | 3 | {% if site.gentie_productKey %} 4 | {% assign gentie_productKey = site.gentie_productKey %} 5 | 13 | 14 | {% endif %} 15 | 16 | {% endunless %} 17 | -------------------------------------------------------------------------------- /Java Basis/001 JAVA有哪些数据类型?基本数据类型各占多少个字节.md: -------------------------------------------------------------------------------- 1 | # JAVA有哪些数据类型?基本数据类型各占多少个字节 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | **java的数据类型分为:基本数据类型和引用数据类型。** 8 | 9 | ![][1] 10 | 11 | **基本数据类型各占多少个字节:** 12 | 13 | ![][2] 14 | 15 | 关于boolean占几个字节,众说纷纭,虽然boolean表现出非0即1的“位”特性,但是存储空间的基本计量单位是字节,不是位。所以boolean至少占1个字节。  16 | JVM规范中,boolean变量当作int处理,也就是4字节;而boolean数组当做byte数组处理,即boolean类型的数组里面的每一个元素占1个字节。 17 | 18 | 19 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516469967556.jpg 20 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/20/1516444153746.jpg -------------------------------------------------------------------------------- /assets/lib/font-awesome/.npmignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.egg-info 3 | *.db 4 | *.db.old 5 | *.swp 6 | *.db-journal 7 | 8 | .coverage 9 | .DS_Store 10 | .installed.cfg 11 | _gh_pages/* 12 | 13 | .idea/* 14 | .svn/* 15 | src/website/static/* 16 | src/website/media/* 17 | 18 | bin 19 | cfcache 20 | develop-eggs 21 | dist 22 | downloads 23 | eggs 24 | parts 25 | tmp 26 | .sass-cache 27 | node_modules 28 | 29 | src/website/settingslocal.py 30 | stunnel.log 31 | 32 | .ruby-version 33 | 34 | # don't need these in the npm package. 35 | src/ 36 | _config.yml 37 | bower.json 38 | component.json 39 | composer.json 40 | CONTRIBUTING.md 41 | Gemfile 42 | Gemfile.lock 43 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/disqus.scss: -------------------------------------------------------------------------------- 1 | .comments-button { 2 | background-color: #b7b7b7; 3 | background-image: url(/assets/images/button/fa-pencil-square-o.png); /* 16px x 16px */ 4 | background-repeat: no-repeat; /* make the background image appear only once */ 5 | background-position: 5% 50%; /* first value is horizontal; second is vertical */ 6 | border: none; 7 | border-radius: .313em; 8 | color: white; /* color of text */ 9 | text-align: center; 10 | padding-left: 25px; /* space between text and left-border; here taken the icon into account*/ 11 | margin: auto; 12 | margin-top: 30px; /* space to the top element */ 13 | } -------------------------------------------------------------------------------- /assets/lib/fastclick/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fastclick", 3 | "main": "lib/fastclick.js", 4 | "ignore": [ 5 | "**/.*", 6 | "component.json", 7 | "package.json", 8 | "Makefile", 9 | "tests", 10 | "examples" 11 | ], 12 | "homepage": "https://github.com/ftlabs/fastclick", 13 | "version": "1.0.6", 14 | "_release": "1.0.6", 15 | "_resolution": { 16 | "type": "version", 17 | "tag": "v1.0.6", 18 | "commit": "2ac7258407619398005ca720596f0d36ce66a6c8" 19 | }, 20 | "_source": "git://github.com/ftlabs/fastclick.git", 21 | "_target": "~1.0.6", 22 | "_originalSource": "fastclick", 23 | "_direct": true 24 | } -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-big-counter.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace.pace-inactive .pace-progress{display:none}.pace .pace-progress{position:fixed;z-index:2000;top:0;right:0;height:5rem;width:5rem;-webkit-transform:translate3d(0,0,0)!important;-ms-transform:translate3d(0,0,0)!important;transform:translate3d(0,0,0)!important}.pace .pace-progress:after{display:block;position:absolute;top:0;right:.5rem;content:attr(data-progress-text);font-family:"Helvetica Neue",sans-serif;font-weight:100;font-size:5rem;line-height:1;text-align:right;color:rgba(34,153,221,.19999999999999996)} -------------------------------------------------------------------------------- /_sass/_common/components/pages/archive.scss: -------------------------------------------------------------------------------- 1 | .use-motion { 2 | .post { opacity: 0; } 3 | } 4 | 5 | .page-archive { 6 | 7 | .archive-page-counter { 8 | position: relative; 9 | top: 3px; 10 | left: 20px; 11 | 12 | @include mobile() { 13 | top: 5px; 14 | } 15 | } 16 | 17 | .posts-collapse { 18 | 19 | .archive-move-on { 20 | position: absolute; 21 | top: 11px; 22 | left: 0; 23 | margin-left: -6px; 24 | width: 10px; 25 | height: 10px; 26 | opacity: 0.5; 27 | background: $black-light; 28 | border: 1px solid white; 29 | 30 | @include circle(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /_sass/_common/components/header/site-nav.scss: -------------------------------------------------------------------------------- 1 | .site-nav-toggle { 2 | display: none; 3 | position: absolute; 4 | top: 10px; 5 | left: 10px; 6 | @include mobile() { 7 | display: block; 8 | } 9 | 10 | button { 11 | margin-top: 2px; 12 | padding: 9px 10px; 13 | background: transparent; 14 | border: none; 15 | } 16 | } 17 | 18 | .site-nav { 19 | @include mobile() { 20 | display: none; 21 | margin: 0 -10px; 22 | padding: 0 10px; 23 | clear: both; 24 | border-top: 1px solid $gray-lighter; 25 | } 26 | @include tablet() { display: block !important; } 27 | @include desktop() { display: block !important; } 28 | } 29 | -------------------------------------------------------------------------------- /_sass/_common/components/third-party/busuanzi-counter.scss: -------------------------------------------------------------------------------- 1 | @if jekyll-config("scheme") == Pisces { 2 | .busuanzi-count { 3 | @include tablet() { 4 | width: auto; 5 | } 6 | @include mobile() { 7 | width: auto; 8 | } 9 | } 10 | } 11 | 12 | .site-uv, 13 | .site-pv, 14 | .page-pv { 15 | display: inline-block; 16 | 17 | .busuanzi-value { 18 | margin: 0 5px; 19 | } 20 | } 21 | 22 | 23 | @if jekyll-config("busuanzi_count.site_pv") and jekyll-config("busuanzi_count.site_uv") { 24 | .site-uv 25 | { 26 | margin-right: 10px; 27 | 28 | &::after { 29 | content: "|"; 30 | padding-left: 10px; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/facebook-sdk.html: -------------------------------------------------------------------------------- 1 | {% if site.facebook_sdk.enable %} 2 | 19 | {% endif %} 20 | -------------------------------------------------------------------------------- /_sass/_common/components/back-to-top-sidebar.scss: -------------------------------------------------------------------------------- 1 | @mixin back-to-top-sidebar { 2 | .back-to-top { 3 | display: none; 4 | margin: 15px -10px -20px; 5 | background: $body-bg-color; 6 | font-size: $b2t-font-size; 7 | opacity: $b2t-opacity; 8 | cursor: pointer; 9 | text-align: center; 10 | -webkit-transform: translateZ(0); 11 | transition-property: bottom; 12 | @include the-transition(); 13 | &:hover { opacity: 0.8; } 14 | 15 | @include mobile() { 16 | display: none; 17 | } 18 | @include tablet() { 19 | display: none; 20 | } 21 | 22 | &.back-to-top-on { 23 | display: block; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /_includes/_helper/list_categories.html: -------------------------------------------------------------------------------- 1 | {% comment %} list_categories(paginator, prev_text, next_text) {% endcomment %} 2 | {% capture list_categories %} 3 | 14 | {% endcapture %} 15 | -------------------------------------------------------------------------------- /_sass/_schemes/Muse/_menu.scss: -------------------------------------------------------------------------------- 1 | .site-nav { 2 | @include mobile() { 3 | position: absolute; 4 | left: 0; 5 | top: 52px; 6 | margin: 0; 7 | width: 100%; 8 | padding: 0; 9 | background: white; 10 | border-bottom: 1px solid $gray-lighter; 11 | z-index: 1; 12 | } 13 | } 14 | 15 | .menu { 16 | @include mobile() { text-align: left; } 17 | } 18 | .menu .menu-item { 19 | @include mobile() { 20 | display: block; 21 | margin: 0 10px; 22 | vertical-align: top; 23 | } 24 | 25 | br { 26 | @include mobile() { display: none; } 27 | } 28 | 29 | a { 30 | @include mobile() { padding: 5px 10px; } 31 | } 32 | .fa { margin-right: 0; } 33 | } 34 | -------------------------------------------------------------------------------- /assets/lib/jquery_lazyload/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery_lazyload", 3 | "version": "1.9.4", 4 | "homepage": "http://www.appelsiini.net/projects/lazyload", 5 | "authors": [ 6 | "Mika Tuupola " 7 | ], 8 | "description": "jQuery plugin for lazy loading images", 9 | "main": [ 10 | "jquery.lazyload.js", 11 | "jquery.scrollstop.js" 12 | ], 13 | "license": "MIT", 14 | "ignore": [ 15 | "**/.*", 16 | "**/*.min.js", 17 | "**/*.html", 18 | "**/*.textile", 19 | "Gruntfile.js", 20 | "lazyload.jquery.json", 21 | "package.json", 22 | "node_modules", 23 | "bower_components", 24 | "test", 25 | "img" 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /_posts/2017-04-01-001 JAVA有哪些数据类型?基本数据类型各占多少个字节.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: java的数据类型分为:基本数据类型和引用数据类型。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | **java的数据类型分为:基本数据类型和引用数据类型。** 11 | 12 | ![][1] 13 | 14 | **基本数据类型各占多少个字节:** 15 | 16 | ![][2] 17 | 18 | 关于boolean占几个字节,众说纷纭,虽然boolean表现出非0即1的“位”特性,但是存储空间的基本计量单位是字节,不是位。所以boolean至少占1个字节。  19 | JVM规范中,boolean变量当作int处理,也就是4字节;而boolean数组当做byte数组处理,即boolean类型的数组里面的每一个元素占1个字节。 20 | 21 | 22 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516469967556.jpg 23 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/20/1516444153746.jpg -------------------------------------------------------------------------------- /_posts/2017-04-12-012 继承和聚合的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 继承指的是一个类继承另外的一个类的功能,并可以增加它自己的新功能的能力,继承是类与类或者接口与接口之间最常见的关系;在Java中此类关系通过关键字extends明确标识。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | ## 继承 11 | 12 | 指的是一个类继承另外的一个类的功能,并可以增加它自己的新功能的能力,继承是类与类或者接口与接口之间最常见的关系;在Java中此类关系通过关键字extends明确标识。 13 | 14 | ![][1] 15 | 16 | ## 聚合 17 | 18 | 聚合体现的是整体与部分、拥有的关系,此时整体与部分之间是可分离的,他们可以具有各自的生命周期;比如计算机与CPU、公司与员工的关系等; 19 | 20 | ![][2] 21 | 22 | 23 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/24/1516808461696.jpg 24 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/24/1516808836569.jpg -------------------------------------------------------------------------------- /_posts/2018-03-23-《致橡树》.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: 诗集 3 | description: 《致橡树》——作者:舒婷 4 | --- 5 | 6 | **《致橡树》** 7 | 8 | 作者:舒婷 9 | 10 | 我如果爱你—— 11 | 绝不像攀援的凌霄花, 12 | 借你的高枝炫耀自己; 13 | 我如果爱你—— 14 | 绝不学痴情的鸟儿, 15 | 为绿荫重复单调的歌曲; 16 | 也不止像泉源, 17 | 常年送来清凉的慰藉; 18 | 也不止像险峰, 19 | 增加你的高度,衬托你的威仪。 20 | 甚至日光, 21 | 甚至春雨。 22 | 不,这些都还不够! 23 | 我必须是你近旁的一株木棉, 24 | 作为树的形象和你站在一起。 25 | 根,紧握在地下; 26 | 叶,相触在云里。 27 | 每一阵风过, 28 | 我们都互相致意, 29 | 但没有人, 30 | 听懂我们的言语。 31 | 你有你的铜枝铁干, 32 | 像刀,像剑,也像戟; 33 | 我有我红硕的花朵, 34 | 像沉重的叹息, 35 | 又像英勇的火炬。 36 | 我们分担寒潮、风雷、霹雳; 37 | 我们共享雾霭、流岚、虹霓。 38 | 仿佛永远分离, 39 | 却又终身相依。 40 | 这才是伟大的爱情, 41 | 坚贞就在这里: 42 | 爱—— 43 | 不仅爱你伟岸的身躯, 44 | 也爱你坚持的位置, 45 | 足下的土地。 46 | -------------------------------------------------------------------------------- /_includes/_third-party/search/algolia-search/dom.html: -------------------------------------------------------------------------------- 1 | {% if site.algolia_search.enable %} 2 | 20 | {% endif %} 21 | -------------------------------------------------------------------------------- /_sass/_common/components/footer/footer.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | font-size: 14px; 3 | color: $grey-dark; 4 | 5 | img { border: none; } 6 | } 7 | 8 | .footer-inner { text-align: center; } 9 | 10 | .with-love { 11 | display: inline-block; 12 | margin: 0 5px; 13 | } 14 | 15 | .powered-by, 16 | .theme-info { display: inline-block; } 17 | 18 | .powered-by { 19 | margin-right: 10px; 20 | 21 | /*&::after { 22 | content: ""; 23 | padding-left: 10px; 24 | }*/ 25 | } 26 | 27 | .cc-license { 28 | margin-top: 10px; 29 | text-align: center; 30 | 31 | .cc-opacity { 32 | opacity: 0.7; 33 | border-bottom: none; 34 | 35 | &:hover { opacity: 0.9; } 36 | } 37 | 38 | img { display: inline-block; } 39 | } 40 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-author.scss: -------------------------------------------------------------------------------- 1 | .site-author-image { 2 | display: block; 3 | margin: 0 auto; 4 | padding: $site-author-image-padding; 5 | max-width: $site-author-image-width; 6 | height: $site-author-image-height; 7 | border: $site-author-image-border-width solid $site-author-image-border-color; 8 | } 9 | 10 | .site-author-name { 11 | margin: $site-author-name-margin; 12 | text-align: $site-author-name-align; 13 | color: $site-author-name-color; 14 | font-weight: $site-author-name-weight; 15 | } 16 | 17 | .site-description { 18 | margin-top: $site-description-margin-top; 19 | text-align: $site-description-align; 20 | font-size: $site-description-font-size; 21 | color: $site-description-color; 22 | } 23 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-toggle.scss: -------------------------------------------------------------------------------- 1 | .sidebar-toggle { 2 | position: fixed; 3 | right: $b2t-position-right; 4 | bottom: 45px; 5 | width: 14px; 6 | height: 14px; 7 | padding: 5px; 8 | background: $black-deep; 9 | line-height: 0; 10 | z-index: $zindex-5; 11 | cursor: pointer; 12 | -webkit-transform: translateZ(0); 13 | 14 | @include tablet() { 15 | display: none; 16 | } 17 | @include mobile() { 18 | display: none; 19 | } 20 | } 21 | 22 | 23 | 24 | .sidebar-toggle-line { 25 | position: relative; 26 | display: inline-block; 27 | vertical-align: top; 28 | height: 2px; 29 | width: 100%; 30 | background: white; 31 | margin-top: 3px; 32 | 33 | &:first-child { margin-top: 0; } 34 | } 35 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-center-simple.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;z-index:2000;position:fixed;margin:auto;top:0;left:0;right:0;bottom:0;height:5px;width:200px;background:#fff;border:1px solid #29d;overflow:hidden}.pace .pace-progress{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);max-width:200px;z-index:2000;display:block;position:absolute;top:0;right:100%;height:100%;width:100%;background:#29d}.pace.pace-inactive{display:none} -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/site-state.scss: -------------------------------------------------------------------------------- 1 | .site-state { 2 | overflow: hidden; 3 | line-height: 1.4; 4 | white-space: nowrap; 5 | text-align: $site-state-align; 6 | } 7 | 8 | .site-state-item { 9 | display: inline-block; 10 | padding: 0 15px; 11 | border-left: 1px solid $site-state-item-border-color; 12 | 13 | &:first-child { border-left: none; } 14 | 15 | a { border-bottom: none; } 16 | } 17 | .site-state-item-count { 18 | display: block; 19 | text-align: center; 20 | color: $site-state-item-count-color; 21 | font-weight: $font-weight-bold; 22 | font-size: $site-state-item-count-font-size; 23 | } 24 | 25 | .site-state-item-name { 26 | font-size: $site-state-item-name-font-size; 27 | color: $site-state-item-name-color; 28 | } 29 | -------------------------------------------------------------------------------- /assets/js/src/scroll-cookie.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | 3 | // Set relative link path (without domain) 4 | var rpath = window.location.href.replace(window.location.origin, ""); 5 | 6 | // Write position in cookie 7 | var timeout; 8 | $(window).on("scroll", function() { 9 | clearTimeout(timeout); 10 | timeout = setTimeout(function () { 11 | Cookies.set("scroll-cookie", ($(window).scrollTop() + "|" + rpath), { expires: 365, path: '' }); 12 | }, 250); 13 | }); 14 | 15 | // Read position from cookie 16 | if (Cookies.get("scroll-cookie") !== undefined) { 17 | var cvalues = Cookies.get("scroll-cookie").split('|'); 18 | if (cvalues[1] == rpath) { 19 | $(window).scrollTop(cvalues[0]); 20 | } 21 | } 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/livere.html: -------------------------------------------------------------------------------- 1 | {% unless site.duoshuo and site.duoshuo.shortname %} 2 | {% unless site.hypercomments_id or site.gentie_productKey or site.duoshuo_shortname or site.disqus.enable and site.disqus.shortname %} 3 | 4 | {% if page.comments and site.livere_uid %} 5 | 15 | {% endif %} 16 | 17 | {% endunless %} 18 | {% endunless %} 19 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-nav.scss: -------------------------------------------------------------------------------- 1 | // Sidebar Navigation 2 | 3 | .sidebar-nav { 4 | margin: 0 0 20px; 5 | padding-left: 0; 6 | } 7 | .sidebar-nav li { 8 | display: inline-block; 9 | cursor: pointer; 10 | border-bottom: 1px solid transparent; 11 | font-size: 14px; 12 | color: $sidebar-nav-color; 13 | 14 | &:hover { color: $sidebar-nav-hover-color; } 15 | } 16 | 17 | .page-post-detail .sidebar-nav-toc { padding: 0 5px; } 18 | 19 | .page-post-detail .sidebar-nav-overview { margin-left: 10px; } 20 | 21 | .sidebar-nav .sidebar-nav-active { 22 | color: $sidebar-highlight; 23 | border-bottom-color: $sidebar-highlight; 24 | 25 | &:hover { color: $sidebar-highlight; } 26 | } 27 | 28 | .sidebar-panel { display: none; } 29 | .sidebar-panel-active { display: block; } 30 | -------------------------------------------------------------------------------- /_includes/_third-party/search/tinysou.html: -------------------------------------------------------------------------------- 1 | {% if site.tinysou_Key %} 2 | 23 | {% endif %} 24 | -------------------------------------------------------------------------------- /search.xml: -------------------------------------------------------------------------------- 1 | --- 2 | layout: null 3 | sitemap: false 4 | --- 5 | 6 | 7 | {% for post in site.posts %} 8 | 9 | {{ post.title | strip_html | xml_escape }} 10 | {{ post.url | relative_url }} 11 | {{ post.content | strip_html | xml_escape }} 12 | 13 | {% for category in post.categories %} 14 | {{ category | strip_html | xml_escape }} 15 | {% endfor %} 16 | 17 | 18 | {% for tag in post.tags %} 19 | {{ tag | strip_html | xml_escape }} 20 | {% endfor %} 21 | 22 | 23 | 24 | {% endfor %} 25 | 26 | -------------------------------------------------------------------------------- /_includes/_third-party/rating.html: -------------------------------------------------------------------------------- 1 | {% unless page.home %} 2 | {% if site.rating.enable and page.layout == 'post' %} 3 | 19 | {% endif %} 20 | {% endunless %} 21 | -------------------------------------------------------------------------------- /_includes/_partials/footer.html: -------------------------------------------------------------------------------- 1 | 11 | 12 | {% if site.copyright %} 13 |
14 | 笔记仓库: 15 | 20 |
21 | {% endif %} 22 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/busuanzi-counter.html: -------------------------------------------------------------------------------- 1 | {% if site.busuanzi_count.enable %} 2 |
3 | 4 | 5 | {% if site.busuanzi_count.site_uv %} 6 | 7 | {{ site.busuanzi_count.site_uv_header }} 8 | 9 | {{ site.busuanzi_count.site_uv_footer }} 10 | 11 | {% endif %} 12 | 13 | {% if site.busuanzi_count.site_pv %} 14 | 15 | {{ site.busuanzi_count.site_pv_header }} 16 | 17 | {{ site.busuanzi_count.site_pv_footer }} 18 | 19 | {% endif %} 20 |
21 | {% endif %} 22 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-widgets.scss: -------------------------------------------------------------------------------- 1 | @mixin post-widgets { 2 | .post-widgets { 3 | border-top: 1px solid #eee; 4 | padding-top: 9px; 5 | margin-top: 45px; 6 | display: flex; 7 | justify-content: center; 8 | flex-wrap: wrap; 9 | align-items: center; 10 | } 11 | 12 | .wp_rating { 13 | height: 20px; 14 | margin-right: 10px; 15 | text-align: center; 16 | line-height: 20px; 17 | padding-top: 6px; 18 | } 19 | 20 | .social-like { 21 | font-size: 14px; 22 | text-align: center; 23 | display: flex; 24 | justify-content: center; 25 | } 26 | 27 | .vk_like { 28 | width: 85px; 29 | height: 21px; 30 | padding-top: 7px; 31 | align-self: center; 32 | } 33 | 34 | .fb_like { 35 | height: 30px; 36 | align-self: center; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/group-pictures.scss: -------------------------------------------------------------------------------- 1 | .post .post-body .group-picture { 2 | img { 3 | box-sizing: border-box; 4 | padding: 0 3px; 5 | border: none; 6 | } 7 | } 8 | 9 | .post .group-picture-row { 10 | overflow: hidden; 11 | margin-top: 6px; 12 | &:first-child { margin-top: 0; } 13 | } 14 | 15 | .post .group-picture-column { float: left; } 16 | 17 | .page-post-detail .post-body .group-picture-column { 18 | float: none; 19 | margin-top: 10px; 20 | width: auto !important; 21 | img { margin: 0 auto; } 22 | } 23 | 24 | .page-archive { 25 | .group-picture-container { overflow: hidden; } 26 | .group-picture-row { 27 | float: left; 28 | &:first-child { margin-top: 6px; } 29 | } 30 | 31 | .group-picture-column { 32 | max-width: 150px; 33 | max-height: 150px; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /_includes/_macro/post-copyright.html: -------------------------------------------------------------------------------- 1 | {% if site.post_copyright.enable %} 2 | 16 | {% endif %} 17 | -------------------------------------------------------------------------------- /_sass/_common/components/buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | display: inline-block; 3 | padding: 0 20px; 4 | font-size: $btn-default-font-size; 5 | color: $btn-default-color; 6 | background: $btn-default-bg; 7 | border: $btn-default-border-width solid $btn-default-border-color; 8 | text-decoration: none; 9 | border-radius: $btn-default-radius; 10 | transition-property: background-color; 11 | @include the-transition(); 12 | 13 | @at-root %btn-hover{ 14 | border-color: $btn-default-hover-border-color; 15 | color: $btn-default-hover-color; 16 | background: $btn-default-hover-bg; 17 | } 18 | 19 | &:hover { @extend %btn-hover; } 20 | } 21 | 22 | .btn-bar { 23 | display: block; 24 | width: 22px; 25 | height: 2px; 26 | background: $text-color; 27 | border-radius: 1px; 28 | 29 | &+.btn-bar { margin-top: 4px; } 30 | } 31 | -------------------------------------------------------------------------------- /_sass/_common/components/header/menu.scss: -------------------------------------------------------------------------------- 1 | // Menu 2 | // -------------------------------------------------- 3 | .menu { 4 | margin-top: 20px; 5 | padding-left: 0; 6 | text-align: center; 7 | } 8 | 9 | .menu .menu-item { 10 | display: inline-block; 11 | margin: 0 10px; 12 | list-style: none; 13 | 14 | @media screen and (max-width: 767px) { 15 | margin-top: 10px; 16 | } 17 | 18 | a { 19 | display: block; 20 | font-size: 13px; 21 | line-height: inherit; 22 | border-bottom: 1px solid $menu-link-border; 23 | transition-property: border-color; 24 | @include the-transition(); 25 | 26 | @at-root %menu-a-hover { border-bottom-color: $menu-link-hover-border; } 27 | &:hover { @extend %menu-a-hover; } 28 | } 29 | 30 | .fa { margin-right: 5px; } 31 | } 32 | 33 | .use-motion .menu-item { opacity: 0; } 34 | -------------------------------------------------------------------------------- /_sass/_common/components/back-to-top.scss: -------------------------------------------------------------------------------- 1 | @mixin back-to-top { 2 | .back-to-top { 3 | box-sizing: border-box; 4 | position: fixed; 5 | bottom: $b2t-position-bottom; 6 | right: $b2t-position-right; 7 | z-index: $zindex-5; 8 | padding: 0 6px; 9 | width: if(jekyll-config('sidebar.scrollpercent'), initial, 24px); 10 | background: $b2t-bg-color; 11 | font-size: $b2t-font-size; 12 | opacity: $b2t-opacity; 13 | color: $b2t-color; 14 | cursor: pointer; 15 | text-align: center; 16 | -webkit-transform: translateZ(0); 17 | transition-property: bottom; 18 | @include the-transition(); 19 | 20 | @include mobile() { 21 | display: none; 22 | } 23 | @include tablet() { 24 | display: none; 25 | } 26 | 27 | &.back-to-top-on { 28 | bottom: $b2t-position-bottom-on; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /assets/lib/font-awesome/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "font-awesome", 3 | "description": "Font Awesome", 4 | "keywords": [], 5 | "homepage": "http://fontawesome.io", 6 | "dependencies": {}, 7 | "devDependencies": {}, 8 | "license": [ 9 | "OFL-1.1", 10 | "MIT", 11 | "CC-BY-3.0" 12 | ], 13 | "main": [ 14 | "less/font-awesome.less", 15 | "scss/font-awesome.scss" 16 | ], 17 | "ignore": [ 18 | "*/.*", 19 | "*.json", 20 | "src", 21 | "*.yml", 22 | "Gemfile", 23 | "Gemfile.lock", 24 | "*.md" 25 | ], 26 | "version": "4.7.0", 27 | "_release": "4.7.0", 28 | "_resolution": { 29 | "type": "version", 30 | "tag": "v4.7.0", 31 | "commit": "a3fe90fa5f6fac55d197f9cbd18e3f57dafb716c" 32 | }, 33 | "_source": "https://github.com/FortAwesome/Font-Awesome.git", 34 | "_target": "*", 35 | "_originalSource": "fontawesome" 36 | } -------------------------------------------------------------------------------- /assets/lib/velocity/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "velocity", 3 | "version": "1.2.2", 4 | "homepage": "http://velocityjs.org", 5 | "authors": [ 6 | { "name" : "Julian Shapiro", 7 | "homepage" : "http://julian.com/" 8 | } 9 | ], 10 | "description": "Accelerated JavaScript animation.", 11 | "main": [ "./velocity.js", "./velocity.ui.js"], 12 | "keywords": [ 13 | "animation", 14 | "jquery", 15 | "animate", 16 | "lightweight", 17 | "smooth", 18 | "ui", 19 | "velocity.js", 20 | "velocityjs", 21 | "javascript" 22 | ], 23 | "license": "MIT", 24 | "ignore": [ 25 | "*.json", 26 | "!/bower.json", 27 | "LICENSE", 28 | "*.md" 29 | ], 30 | "dependencies": { 31 | "jquery": "*" 32 | }, 33 | "repository" : 34 | { 35 | "type" : "git", 36 | "url" : "http://github.com/julianshapiro/velocity.git" 37 | } 38 | } -------------------------------------------------------------------------------- /_includes/_partials/share/duoshuo_share.html: -------------------------------------------------------------------------------- 1 |
5 |
6 | 15 |
16 |
17 |
18 |
19 | -------------------------------------------------------------------------------- /_includes/_blocks/script_extra.html: -------------------------------------------------------------------------------- 1 | {% case page.layout %} 2 | {% when 'post' %} 3 | {% capture script_extra %}{% include _scripts/pages/post-details.html %}{% endcapture %} 4 | {% when 'archive' %} 5 | {% capture script_extra %} 6 | {% if site.use_motion %} 7 | 10 | {% endif %} 11 | {% include _scripts/pages/pagination.html %} 12 | {% endcapture %} 13 | {% when 'category' %} 14 | {% capture script_extra %} 15 | {% include _scripts/pages/pagination.html %} 16 | {% endcapture %} 17 | {% when 'tag' %} 18 | {% capture script_extra %} 19 | {% include _scripts/pages/pagination.html %} 20 | {% endcapture %} 21 | {% else %} 22 | {% capture script_extra %}{% include _scripts/pages/post-details.html %}{% endcapture %} 23 | {% endcase %} 24 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/blockquote-center.scss: -------------------------------------------------------------------------------- 1 | // Blockquote with all children centered. 2 | .blockquote-center { 3 | position: relative; 4 | margin: 40px 0; 5 | padding: 0; 6 | border-left: none; 7 | text-align: center; 8 | 9 | &::before, &::after { 10 | position: absolute; 11 | content: ' '; 12 | display: block; 13 | width: 100%; 14 | height: 24px; 15 | opacity: 0.2; 16 | background-repeat: no-repeat; 17 | background-position: 0 -6px; 18 | background-size: 22px 22px; 19 | } 20 | &::before { 21 | top: -20px; 22 | background-image: url($center-quote-left); 23 | border-top: 1px solid $grey-light; 24 | } 25 | &::after { 26 | bottom: -20px; 27 | background-image: url($center-quote-right); 28 | border-bottom: 1px solid $grey-light; 29 | background-position: 100% 8px; 30 | } 31 | 32 | p, div { text-align: center; } 33 | } 34 | -------------------------------------------------------------------------------- /_includes/_partials/share/jiathis.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-title.scss: -------------------------------------------------------------------------------- 1 | .posts-expand .post-title { 2 | font-size: 26px; 3 | text-align: center; 4 | word-break: break-word; 5 | font-weight: $posts-expand-title-font-weight; 6 | 7 | @include mobile() { 8 | font-size: 22px; 9 | } 10 | } 11 | .posts-expand .post-title-link { 12 | display: inline-block; 13 | position: relative; 14 | color: $black-light; 15 | border-bottom: none; 16 | line-height: 1.2; 17 | vertical-align: top; 18 | 19 | &::before { 20 | content: ""; 21 | position: absolute; 22 | width: 100%; 23 | height: 2px; 24 | bottom: 0; 25 | left: 0; 26 | background-color: #000; 27 | visibility: hidden; 28 | @include transform(scaleX(0)); 29 | @include the-transition(); 30 | } 31 | 32 | &:hover::before { 33 | visibility: visible; 34 | @include transform(scaleX(1)); 35 | } 36 | 37 | .fa { font-size: 16px; } 38 | } 39 | -------------------------------------------------------------------------------- /_includes/_third-party/mathjax.html: -------------------------------------------------------------------------------- 1 | {% if site.mathjax.enable %} 2 | {% if page.layout == 'index' or page.mathjax or site.mathjax.per_page == nil or site.mathjax.per_page == false %} 3 | 12 | 13 | 21 | 22 | {% endif %} 23 | {% endif %} 24 | -------------------------------------------------------------------------------- /assets/images/quote-r.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /_sass/_common/scaffolding/tables.scss: -------------------------------------------------------------------------------- 1 | table { 2 | margin: 20px 0; 3 | width: $table-width; 4 | border-collapse: collapse; 5 | border-spacing: 0; 6 | border: 1px solid $table-border-color; 7 | font-size: $table-font-size; 8 | table-layout: fixed; 9 | word-wrap: break-all; 10 | } 11 | table>tbody>tr { 12 | &:nth-of-type(odd) { background-color: $table-row-odd-bg-color; } 13 | &:hover { background-color: $table-row-hover-bg-color; } 14 | } 15 | 16 | caption, th, td { 17 | padding: $table-cell-padding; 18 | text-align: $table-content-alignment; 19 | vertical-align: $table-content-vertical; 20 | font-weight: normal; 21 | } 22 | 23 | th, td { 24 | border-bottom: 3px solid $table-cell-border-bottom-color; 25 | border-right: 1px solid $table-cell-border-right-color; 26 | } 27 | 28 | th { 29 | padding-bottom: 10px; 30 | font-weight: $table-th-font-weight; 31 | } 32 | 33 | td { border-bottom-width: 1px; } 34 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_menu.scss: -------------------------------------------------------------------------------- 1 | // Menu 2 | // -------------------------------------------------- 3 | .site-nav-toggle { 4 | position: static; 5 | float: right; 6 | } 7 | 8 | 9 | .menu { 10 | float: right; 11 | margin: 8px 0 0 0; 12 | 13 | @include mobile() { 14 | margin: 20px 0 0 0; 15 | padding: 0; 16 | } 17 | 18 | br { display: none; } 19 | 20 | .menu-item { 21 | margin: 0; 22 | @include mobile() { display: block; } 23 | } 24 | 25 | .menu-item a { 26 | padding: 0 10px; 27 | background: none; 28 | border: none; 29 | border-radius: 2px; 30 | transition-property: background; 31 | 32 | @include mobile() { 33 | text-align: left; 34 | } 35 | 36 | &:hover { background: #e1e1e1; } 37 | } 38 | 39 | a::before { 40 | display: none; 41 | 42 | @include mobile() { display: block; } 43 | } 44 | 45 | @include mobile() { float: none; } 46 | } 47 | -------------------------------------------------------------------------------- /assets/images/quote-l.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /_includes/_partials/page-header.html: -------------------------------------------------------------------------------- 1 |
2 | {% case page.layout %} 3 | {% when 'page' %} 4 | {% capture post_title %} 5 | {% if page.type == "categories" and page.title == nil %} 6 | {{ __.title.categories }} 7 | {% elsif page.type == "tags" and page.title == nil %} 8 | {{ __.title.tags }} 9 | {% elsif page.type == "about" and page.title == nil %} 10 | {{ __.title.about }} 11 | {% else %} 12 | {{ page.title }} 13 | {% endif %} 14 | {% endcapture %} 15 | {% when 'schedule' %} 16 | {% capture post_title %}{{ __.title.schedule }}{% endcapture %} 17 | {% endcase %} 18 | <{% if site.seo %}h2{% else %}h1{% endif %} class="post-title" itemprop="name headline">{{ post_title }} 19 | 20 | {% if page.description %} 21 | 24 | {% endif %} 25 | 26 |
27 | -------------------------------------------------------------------------------- /Java Basis/011 抽象类和接口的区别.md: -------------------------------------------------------------------------------- 1 | # 011 抽象类和接口的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 1、抽象类和接口都不能直接实例化,如果要实例化,抽象类变量必须指向实现所有抽象方法的子类对象,接口变量必须指向实现所有接口方法的类对象。 8 | 9 | 2、抽象类要被子类继承,接口要被类实现。 10 | 11 | 3、接口只能做方法声明,抽象类中可以做方法声明,也可以做方法实现 12 | 13 | 4、接口里定义的变量只能是公共的静态的常量,抽象类中的变量是普通变量。 14 | 15 | 5、抽象类里的抽象方法必须全部被子类所实现,如果子类不能全部实现父类抽象方法,那么该子类只能是抽象类。同样,一个实现接口的时候,如不能全部实现接口方法,那么该类也只能为抽象类。 16 | 17 | 6、抽象方法只能申明,不能实现。abstract void abc(); 不能写成abstract void abc(){} 18 | 19 | 7、抽象类里可以没有抽象方法 20 | 21 | 8、如果一个类里有抽象方法,那么这个类只能是抽象类 22 | 23 | 9、抽象方法要被实现,所以不能是静态的,也不能是私有的。 24 | 25 | 10、接口可继承接口,并可多继承接口。但类只能单继承类。 26 | 27 | --- 28 | 29 | 类不允许多继承的主要原因是,如果A同时继承B和C,而B和C都有一个d方法,A如何决定该继承那一个呢? 30 | 31 | 但接口不存在这样的问题,接口全是抽象方法继承谁都无所谓,所以接口可以继承多个接口。 32 | 33 | 注意:一个类如果实现了一个接口,则要实现该接口的所有方法。 34 | 35 | --- 36 | 37 | 从哲学的角度:抽象类是对一类事物的抽象,例如男人和女人可以抽象出一个Person类。而接口是对一种行为的抽象,例如游泳接口,实现了游泳接口的人就会游泳,没有实现该接口的人就不会游泳。 38 | 39 | 类只能继承一个父类,但可以实现多个接口。 -------------------------------------------------------------------------------- /_includes/_third-party/analytics/vkontakte-api.html: -------------------------------------------------------------------------------- 1 | {% if site.vkontakte_api.enable %} 2 | 3 |
4 | 28 | 29 | {% endif %} 30 | -------------------------------------------------------------------------------- /_includes/_blocks/sidebar.html: -------------------------------------------------------------------------------- 1 | {% case page.layout %} 2 | {% when 'index' %} 3 | {% assign is_post = false %} 4 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 5 | {% when 'post' %} 6 | {% assign is_post = true %} 7 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 8 | {% when 'page' %} 9 | {% assign is_post = false %} 10 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 11 | {% when 'archive' %} 12 | {% assign is_post = false %} 13 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 14 | {% when 'category' %} 15 | {% assign is_post = false %} 16 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 17 | {% when 'tag' %} 18 | {% assign is_post = false %} 19 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 20 | {% when 'schedule' %} 21 | {% assign is_post = false %} 22 | {% capture sidebar %}{% include _macro/sidebar.html %}{% endcapture %} 23 | {% endcase %} 24 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-center-radar.min.css: -------------------------------------------------------------------------------- 1 | .pace,.pace .pace-activity{z-index:2000;height:90px;width:90px}.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;position:fixed;margin:auto;top:0;left:0;right:0;bottom:0}.pace.pace-inactive .pace-activity{display:none}.pace .pace-activity,.pace .pace-activity:before{position:absolute;display:block;border-color:#29d transparent transparent;border-radius:50%}.pace .pace-activity{left:-30px;top:-30px;border-width:30px;border-style:double;-webkit-animation:spin 1s linear infinite;-moz-animation:spin 1s linear infinite;-o-animation:spin 1s linear infinite;animation:spin 1s linear infinite}.pace .pace-activity:before{content:' ';top:10px;left:10px;height:50px;width:50px;border-width:10px;border-style:solid}@-webkit-keyframes spin{100%{-webkit-transform:rotate(359deg)}}@-moz-keyframes spin{100%{-moz-transform:rotate(359deg)}}@-o-keyframes spin{100%{-moz-transform:rotate(359deg)}}@keyframes spin{100%{transform:rotate(359deg)}} -------------------------------------------------------------------------------- /assets/lib/jquery_lazyload/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery_lazyload", 3 | "version": "1.9.7", 4 | "homepage": "http://www.appelsiini.net/projects/lazyload", 5 | "authors": [ 6 | "Mika Tuupola " 7 | ], 8 | "description": "jQuery plugin for lazy loading images", 9 | "main": [ 10 | "jquery.lazyload.js", 11 | "jquery.scrollstop.js" 12 | ], 13 | "license": "MIT", 14 | "ignore": [ 15 | "**/.*", 16 | "**/*.min.js", 17 | "**/*.html", 18 | "**/*.textile", 19 | "Gruntfile.js", 20 | "lazyload.jquery.json", 21 | "package.json", 22 | "node_modules", 23 | "bower_components", 24 | "test", 25 | "img" 26 | ], 27 | "_release": "1.9.7", 28 | "_resolution": { 29 | "type": "version", 30 | "tag": "1.9.7", 31 | "commit": "218e50eb4999fe59ac94b939a65c8c988d1d420b" 32 | }, 33 | "_source": "git://github.com/tuupola/jquery_lazyload.git", 34 | "_target": "~1.9.7", 35 | "_originalSource": "jquery.lazyload", 36 | "_direct": true 37 | } -------------------------------------------------------------------------------- /_includes/_macro/reward.html: -------------------------------------------------------------------------------- 1 | {% if site.alipay or site.wechatpay %} 2 |
3 |
{{ site.reward_comment }}
4 | 7 | 21 |
22 | {% endif %} 23 | -------------------------------------------------------------------------------- /assets/lib/fancybox/source/helpers/jquery.fancybox-thumbs.css: -------------------------------------------------------------------------------- 1 | #fancybox-thumbs { 2 | position: fixed; 3 | left: 0; 4 | width: 100%; 5 | overflow: hidden; 6 | z-index: 8050; 7 | } 8 | 9 | #fancybox-thumbs.bottom { 10 | bottom: 2px; 11 | } 12 | 13 | #fancybox-thumbs.top { 14 | top: 2px; 15 | } 16 | 17 | #fancybox-thumbs ul { 18 | position: relative; 19 | list-style: none; 20 | margin: 0; 21 | padding: 0; 22 | } 23 | 24 | #fancybox-thumbs ul li { 25 | float: left; 26 | padding: 1px; 27 | opacity: 0.5; 28 | } 29 | 30 | #fancybox-thumbs ul li.active { 31 | opacity: 0.75; 32 | padding: 0; 33 | border: 1px solid #fff; 34 | } 35 | 36 | #fancybox-thumbs ul li:hover { 37 | opacity: 1; 38 | } 39 | 40 | #fancybox-thumbs ul li a { 41 | display: block; 42 | position: relative; 43 | overflow: hidden; 44 | border: 1px solid #222; 45 | background: #111; 46 | outline: none; 47 | } 48 | 49 | #fancybox-thumbs ul li img { 50 | display: block; 51 | position: relative; 52 | border: 0; 53 | padding: 0; 54 | max-width: none; 55 | } -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 17 | 18 |
404,页面不存在!
19 |
返回首页
20 | 21 | 22 | -------------------------------------------------------------------------------- /_includes/_third-party/search/algolia-search/assets.html: -------------------------------------------------------------------------------- 1 | {% if site.algolia_search.enable %} 2 | 3 | {% comment %} S: Include Algolia instantsearch.js library {% endcomment %} 4 | {% assign algolia_instant_css = site.vendors._internal | append: '/algolia-instant-search/instantsearch.min.css' | relative_url %} 5 | {% if site.vendors.algolia_instant_css %} 6 | {% assign algolia_instant_css = site.vendors.algolia_instant_css %} 7 | {% endif %} 8 | 9 | 10 | {% assign algolia_instant_js = site.vendors._internal | append: '/algolia-instant-search/instantsearch.min.js' | relative_url %} 11 | {% if site.vendors.algolia_instant_js %} 12 | {% assign algolia_instant_js = site.vendors.algolia_instant_js %} 13 | {% endif %} 14 | 15 | {% comment %} E: Include Algolia instantsearch.js library {% endcomment %} 16 | 17 | 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-meta.scss: -------------------------------------------------------------------------------- 1 | .posts-expand .post-meta { 2 | margin: 3px 0 60px 0; 3 | color: $grey-dark; 4 | font-family: $font-family-posts; 5 | font-size: 12px; 6 | text-align: center; 7 | 8 | .post-category-list { 9 | display: inline-block; 10 | margin: 0; 11 | padding: 3px; 12 | } 13 | .post-category-list-link { color: $grey-dark; } 14 | 15 | .post-description { 16 | font-size: 14px; 17 | margin-top: 2px; 18 | } 19 | } 20 | 21 | .post-wordcount { 22 | display: inline-block; 23 | } 24 | 25 | .post-meta-divider { 26 | margin: 0 .5em; 27 | } 28 | 29 | .post-meta-item-icon { 30 | margin-right: 3px; 31 | @include tablet() { 32 | display: inline-block; 33 | } 34 | @include mobile() { 35 | display: inline-block; 36 | } 37 | } 38 | .post-meta-item-text { 39 | @include tablet() { 40 | display: none; 41 | } 42 | @include mobile() { 43 | display: none; 44 | } 45 | } 46 | 47 | .posts-expand .post-comments-count { 48 | @include mobile() { display: none; } 49 | } 50 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar.scss: -------------------------------------------------------------------------------- 1 | .sidebar { 2 | position: fixed; 3 | right: 0; 4 | top: 0; 5 | bottom: 0; 6 | 7 | width: 0; 8 | z-index: $zindex-4; 9 | box-shadow: inset 0 2px 6px black; 10 | background: $black-deep; 11 | -webkit-transform: translateZ(0); // http://stackoverflow.com/questions/17079857/position-fixed-broken-in-chrome-with-flash-behind 12 | 13 | a { 14 | color: $grey-dark; 15 | border-bottom-color: $black-light; 16 | &:hover { color: $gainsboro; } 17 | } 18 | 19 | @include tablet() { 20 | display: none !important; 21 | } 22 | @include mobile() { 23 | display: none !important; 24 | } 25 | } 26 | 27 | .sidebar-inner { 28 | position: relative; 29 | padding: 20px 10px; 30 | color: $grey-dark; 31 | text-align: center; 32 | } 33 | 34 | @import "sidebar-toggle"; 35 | @import "sidebar-author"; 36 | @import "site-state"; 37 | @import "sidebar-feed-link"; 38 | @import "sidebar-author-links"; 39 | @import "sidebar-blogroll"; 40 | @import "sidebar-nav"; 41 | @import "sidebar-toc"; 42 | -------------------------------------------------------------------------------- /_sass/_common/components/header/site-meta.scss: -------------------------------------------------------------------------------- 1 | .site-meta { 2 | margin: 0; 3 | text-align: $site-meta-text-align; 4 | 5 | @include mobile() { text-align: center; } 6 | } 7 | 8 | .brand { 9 | position: relative; 10 | display: inline-block; 11 | padding: 0 40px; 12 | color: $brand-color; 13 | background: $brand-bg; 14 | border-bottom: none; 15 | &:hover { color: $brand-hover-color; } 16 | } 17 | 18 | .logo { 19 | display: inline-block; 20 | margin-right: 5px; 21 | line-height: 36px; 22 | vertical-align: top; 23 | } 24 | 25 | .site-title { 26 | display: inline-block; 27 | vertical-align: top; 28 | line-height: 36px; 29 | font-size: $logo-font-size; 30 | font-weight: normal; 31 | font-family: $font-family-logo; 32 | } 33 | 34 | .site-subtitle { 35 | margin-top: 10px; 36 | font-size: $subtitle-font-size; 37 | color: $subtitle-color; 38 | } 39 | 40 | .use-motion { 41 | .brand { opacity: 0; } 42 | 43 | .logo, .site-title, .site-subtitle { 44 | opacity: 0; 45 | position: relative; 46 | top: -10px; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-nav.scss: -------------------------------------------------------------------------------- 1 | .post-nav { 2 | display: table; 3 | margin-top: 15px; 4 | width: 100%; 5 | border-top: 1px solid $gainsboro; 6 | } 7 | 8 | .post-nav-divider { 9 | display: table-cell; 10 | width: 10%; 11 | } 12 | 13 | .post-nav-item { 14 | display: table-cell; 15 | padding: 10px 0 0 0; 16 | width: 45%; 17 | vertical-align: top; 18 | 19 | a { 20 | position: relative; 21 | display: block; 22 | line-height: 25px; 23 | font-size: 14px; 24 | color: $link-color; 25 | border-bottom: none; 26 | 27 | &:hover { 28 | color: $link-hover-color; 29 | border-bottom: none; 30 | } 31 | 32 | &:active { top: 2px; } 33 | } 34 | 35 | .fa { 36 | position: absolute; 37 | top: 8px; 38 | left: 0; 39 | font-size: 12px; 40 | } 41 | 42 | } 43 | 44 | .post-nav-next { 45 | a { padding-left: 15px; } 46 | } 47 | 48 | .post-nav-prev { 49 | text-align: right; 50 | 51 | a { padding-right: 15px; } 52 | 53 | .fa { 54 | right: 0; 55 | left: auto; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /_posts/2017-04-11-011 抽象类和接口的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 抽象类和接口都不能直接实例化,如果要实例化,抽象类变量必须指向实现所有抽象方法的子类对象,接口变量必须指向实现所有接口方法的类对象。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | 1、抽象类和接口都不能直接实例化,如果要实例化,抽象类变量必须指向实现所有抽象方法的子类对象,接口变量必须指向实现所有接口方法的类对象。 11 | 12 | 2、抽象类要被子类继承,接口要被类实现。 13 | 14 | 3、接口只能做方法声明,抽象类中可以做方法声明,也可以做方法实现 15 | 16 | 4、接口里定义的变量只能是公共的静态的常量,抽象类中的变量是普通变量。 17 | 18 | 5、抽象类里的抽象方法必须全部被子类所实现,如果子类不能全部实现父类抽象方法,那么该子类只能是抽象类。同样,一个实现接口的时候,如不能全部实现接口方法,那么该类也只能为抽象类。 19 | 20 | 6、抽象方法只能申明,不能实现。abstract void abc(); 不能写成abstract void abc(){} 21 | 22 | 7、抽象类里可以没有抽象方法 23 | 24 | 8、如果一个类里有抽象方法,那么这个类只能是抽象类 25 | 26 | 9、抽象方法要被实现,所以不能是静态的,也不能是私有的。 27 | 28 | 10、接口可继承接口,并可多继承接口。但类只能单继承类。 29 | 30 | --- 31 | 32 | 类不允许多继承的主要原因是,如果A同时继承B和C,而B和C都有一个d方法,A如何决定该继承那一个呢? 33 | 34 | 但接口不存在这样的问题,接口全是抽象方法继承谁都无所谓,所以接口可以继承多个接口。 35 | 36 | 注意:一个类如果实现了一个接口,则要实现该接口的所有方法。 37 | 38 | --- 39 | 40 | 从哲学的角度:抽象类是对一类事物的抽象,例如男人和女人可以抽象出一个Person类。而接口是对一种行为的抽象,例如游泳接口,实现了游泳接口的人就会游泳,没有实现该接口的人就不会游泳。 41 | 42 | 类只能继承一个父类,但可以实现多个接口。 -------------------------------------------------------------------------------- /_includes/tag.html: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /_includes/_third-party/analytics/application-insights.html: -------------------------------------------------------------------------------- 1 | {% if site.application_insights %} 2 | 11 | {% endif %} 12 | -------------------------------------------------------------------------------- /assets/lib/fastclick/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 The Financial Times Ltd. 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /_includes/category.html: -------------------------------------------------------------------------------- 1 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Java Basis/015 反射中的 Class.forName() 与 ClassLoader.loadClass() 的区别.md: -------------------------------------------------------------------------------- 1 | # 015 反射中的 Class.forName() 与 ClassLoader.loadClass() 的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | Class.forName() 与 ClassLoader.loadClass() 大家都知道是反射用来构造类的方法,但是他们的用法还是有一定区别的。 8 | 9 | 在讲区别之前,我觉得很有必要把类的加载过程在此整理一下。 10 | 11 | 在Java中,类加载器把一个类加载进Java虚拟机中,要经过三个步骤来完成:加载、链接和初始化,其中链接又可以分成验证、准备和解析三步,除了解析外,其它步骤是严格按照顺序完成的,各个步骤的主要工作如下: 12 | 13 | * 加载:查找和导入类或接口的二进制数据; 14 | 15 | * 链接:执行下面的校验、准备和解析步骤,其中解析步骤是可以选择的; 16 | 17 | * 验证:检查导入类或接口的二进制数据的正确性; 18 | 19 | * 准备:给类的静态变量分配并初始化存储空间; 20 | 21 | * 解析:将符号引用转成直接引用; 22 | 23 | * 初始化:激活类的静态变量的初始化Java代码和静态Java代码块。 24 | 25 | ![][1] 26 | 27 | 于是乎我们可以开始看2者的区别了。 28 | 29 | Class.forName(className) 方法,其实调用的方法是`Class.forName(className,true,classloader);` 注意看第2个boolean参数,它表示的意思,在加载之后必须初始化。在执行过此方法后,目标对象的静态块代码已经被执行,静态参数也已经被初始化。 30 | 31 | 再看ClassLoader.loadClass(className) 方法,其实他调用的方法是`ClassLoader.loadClass(className,false);` 注意看第2个 boolean 参数,该参数表示目标对象被加载后不进行链接,这就意味着不会去执行该类静态块中的内容。因此两者的区别就显而易见了。 32 | 33 | 34 | 35 | 36 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/26/1516908236033.jpg -------------------------------------------------------------------------------- /Java Basis/018 final 关键字的用途.md: -------------------------------------------------------------------------------- 1 | # 018 final 关键字的用途 2 | 3 | ## final关键字的含义 4 | 5 | `final`在`Java`中是一个保留的关键字,可以声明成员变量、方法、类以及本地变量。一旦你将引用声明作`final`,你将不能改变这个引用了,编译器会检查代码,如果你试图将变量再次初始化的话,编译器会报编译错误。 6 | 7 | ## final变量 8 | 9 | 凡是对成员变量或者本地变量(在方法中的或者代码块中的变量称为本地变量)声明为`final`的都叫作`final`变量。`final`变量经常和`static`关键字一起使用,作为常量。`final`变量是只读的。 10 | 11 | ## final方法 12 | 13 | `final`也可以声明方法。方法前面加上`final`关键字,代表这个方法不可以被子类的方法重写。如果你认为一个方法的功能已经足够完整了,在子类中不需要改变的话,你可以声明此方法为`final`。`final`方法比`非final`方法要快,因为在编译的时候已经静态绑定了,不需要在运行时再动态绑定。 14 | 15 | ## final类 16 | 17 | 使用`final`来修饰的类叫做`final类`。`final类`通常功能是完整的,它们不能被继承。`Java`中有许多类是`final`的,比如`String`、`Interger`以及其他包装类。 18 | 19 | ## 使用 final关键字的好处 20 | 21 | 1. `final`关键字提高了性能。`JVM`和`Java应用`都会缓存`final变量`。 22 | 2. `final变量`可以安全的在多线程环境下进行共享,而不需要额外的同步开销。 23 | 3. 使用`final关键字`,`JVM`会对变量、方法以及类进行优化。 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | --- 42 | 43 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/018%20final%20%E5%85%B3%E9%94%AE%E5%AD%97%E7%9A%84%E7%94%A8%E9%80%94.md](https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/018%20final%20%E5%85%B3%E9%94%AE%E5%AD%97%E7%9A%84%E7%94%A8%E9%80%94.md) -------------------------------------------------------------------------------- /assets/lib/velocity/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "velocity", 3 | "version": "1.2.2", 4 | "homepage": "http://velocityjs.org", 5 | "authors": [ 6 | { 7 | "name": "Julian Shapiro", 8 | "homepage": "http://julian.com/" 9 | } 10 | ], 11 | "description": "Accelerated JavaScript animation.", 12 | "main": [ 13 | "./velocity.js", 14 | "./velocity.ui.js" 15 | ], 16 | "keywords": [ 17 | "animation", 18 | "jquery", 19 | "animate", 20 | "lightweight", 21 | "smooth", 22 | "ui", 23 | "velocity.js", 24 | "velocityjs", 25 | "javascript" 26 | ], 27 | "license": "MIT", 28 | "ignore": [ 29 | "*.json", 30 | "!/bower.json", 31 | "LICENSE", 32 | "*.md" 33 | ], 34 | "dependencies": { 35 | "jquery": "*" 36 | }, 37 | "repository": { 38 | "type": "git", 39 | "url": "http://github.com/julianshapiro/velocity.git" 40 | }, 41 | "_release": "1.2.2", 42 | "_resolution": { 43 | "type": "version", 44 | "tag": "1.2.2", 45 | "commit": "6b227928631aab5694255df3c219736c4c02449d" 46 | }, 47 | "_source": "git://github.com/julianshapiro/velocity.git", 48 | "_target": "~1.2.1", 49 | "_originalSource": "velocity" 50 | } -------------------------------------------------------------------------------- /_includes/_third-party/comments/hypercomments.html: -------------------------------------------------------------------------------- 1 | {% unless site.disqus_shortname or site.duoshuo_shortname or site.duoshuo and site.duoshuo.shortname %} 2 | 3 | {% if site.hypercomments_id %} 4 | 5 | 24 | 25 | {% endif %} 26 | 27 | {% endunless %} 28 | -------------------------------------------------------------------------------- /_posts/2017-04-15-015 反射中的 Class.forName() 与 ClassLoader.loadClass() 的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: Class.forName() 与 ClassLoader.loadClass() 大家都知道是反射用来构造类的方法,但是他们的用法还是有一定区别的。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | Class.forName() 与 ClassLoader.loadClass() 大家都知道是反射用来构造类的方法,但是他们的用法还是有一定区别的。 11 | 12 | 在讲区别之前,我觉得很有必要把类的加载过程在此整理一下。 13 | 14 | 在Java中,类加载器把一个类加载进Java虚拟机中,要经过三个步骤来完成:加载、链接和初始化,其中链接又可以分成验证、准备和解析三步,除了解析外,其它步骤是严格按照顺序完成的,各个步骤的主要工作如下: 15 | 16 | * 加载:查找和导入类或接口的二进制数据; 17 | 18 | * 链接:执行下面的校验、准备和解析步骤,其中解析步骤是可以选择的; 19 | 20 | * 验证:检查导入类或接口的二进制数据的正确性; 21 | 22 | * 准备:给类的静态变量分配并初始化存储空间; 23 | 24 | * 解析:将符号引用转成直接引用; 25 | 26 | * 初始化:激活类的静态变量的初始化Java代码和静态Java代码块。 27 | 28 | ![][1] 29 | 30 | 于是乎我们可以开始看2者的区别了。 31 | 32 | Class.forName(className) 方法,其实调用的方法是`Class.forName(className,true,classloader);` 注意看第2个boolean参数,它表示的意思,在加载之后必须初始化。在执行过此方法后,目标对象的静态块代码已经被执行,静态参数也已经被初始化。 33 | 34 | 再看ClassLoader.loadClass(className) 方法,其实他调用的方法是`ClassLoader.loadClass(className,false);` 注意看第2个 boolean 参数,该参数表示目标对象被加载后不进行链接,这就意味着不会去执行该类静态块中的内容。因此两者的区别就显而易见了。 35 | 36 | 37 | 38 | 39 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/26/1516908236033.jpg -------------------------------------------------------------------------------- /Maven/01 Maven构建的项目中,把.xml等配置文件添加到编译目录.md: -------------------------------------------------------------------------------- 1 | # 01 Maven构建的项目中,把.xml等配置文件添加到编译目录 2 | 3 | Maven构建的项目,默认只会把`src/main/resources`目录下的xml配置文件添加到编译目录。 4 | 5 | 如果需要把`src/main/java`目录下的xml配置文件也添加到编译目录,需要在`pom.xml`中添加如下配置: 6 | 7 | ```xml 8 | 9 | 10 | 11 | src/main/java 12 | 13 | **/*.properties 14 | **/*.xml 15 | 16 | false 17 | 18 | 19 | 20 | ``` 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | --- 39 | 40 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/Maven/01%20Maven%E6%9E%84%E5%BB%BA%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8C%E6%8A%8A.xml%E7%AD%89%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%B7%BB%E5%8A%A0%E5%88%B0%E7%BC%96%E8%AF%91%E7%9B%AE%E5%BD%95.md](https://github.com/nnngu/LearningNotes/blob/master/Maven/01%20Maven%E6%9E%84%E5%BB%BA%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8C%E6%8A%8A.xml%E7%AD%89%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%B7%BB%E5%8A%A0%E5%88%B0%E7%BC%96%E8%AF%91%E7%9B%AE%E5%BD%95.md) -------------------------------------------------------------------------------- /_sass/_common/components/post/post-expand.scss: -------------------------------------------------------------------------------- 1 | // TODO: Refactor. 2 | 3 | .posts-expand { 4 | padding-top: 40px; 5 | } 6 | 7 | @media (max-width: 767px) { 8 | .posts-expand { 9 | margin: 0 20px; 10 | } 11 | 12 | .post-body { 13 | pre { 14 | padding: 10px; 15 | .gutter pre { 16 | padding-right: 10px; 17 | } 18 | } 19 | 20 | .highlight { 21 | margin-left: 0px; 22 | margin-right: 0px; 23 | padding: 0; 24 | .gutter pre { 25 | padding-right: 10px; 26 | } 27 | } 28 | } 29 | } 30 | 31 | .posts-expand .post-body { 32 | @include desktop() { text-align: justify; } 33 | 34 | 35 | h2, h3, h4, h5, h6 { 36 | padding-top: 10px; 37 | 38 | .header-anchor{ 39 | float: right; 40 | margin-left: 10px; 41 | color: $grey-light; 42 | border-bottom-style: none; 43 | visibility: hidden; 44 | 45 | &:hover{ 46 | color: inherit; 47 | } 48 | } 49 | 50 | &:hover .header-anchor{ 51 | visibility: visible; 52 | } 53 | } 54 | 55 | ul li { list-style: circle; } 56 | 57 | img { 58 | box-sizing: border-box; 59 | margin: auto; 60 | padding: 3px; 61 | border: 1px solid $gray-lighter; 62 | } 63 | } 64 | 65 | .posts-expand .fancybox img { margin: 0 auto; } 66 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_header.scss: -------------------------------------------------------------------------------- 1 | // Header 2 | // -------------------------------------------------- 3 | .header { background: $whitesmoke; } 4 | .header-inner { 5 | padding: 25px 0 20px; 6 | @include clearfix(); 7 | 8 | @include mobile() { 9 | width: auto; 10 | margin-bottom: 50px; 11 | padding: 10px; 12 | } 13 | } 14 | 15 | .site-meta { 16 | float: left; 17 | margin-left: -20px; 18 | line-height: normal; 19 | 20 | @include mobile() { 21 | margin-left: 10px; 22 | } 23 | 24 | .brand { 25 | padding: 2px 1px; 26 | background: none; 27 | 28 | @include mobile() { display: block; } 29 | } 30 | 31 | .logo { display: none; } 32 | 33 | .site-title { 34 | font-size: 22px; 35 | font-weight: bolder; 36 | 37 | @include mobile() { line-height: 34px; } 38 | } 39 | } 40 | 41 | 42 | .logo-line-before, 43 | .logo-line-after { 44 | display: block; 45 | overflow: hidden; 46 | margin: 0 auto; 47 | width: 75%; 48 | 49 | @include mobile() { display: none; } 50 | 51 | i { 52 | position: relative; 53 | display: block; 54 | height: 2px; 55 | background: $black-deep; 56 | @include mobile() { height: 3px; } 57 | } 58 | } 59 | 60 | .use-motion { 61 | .logo-line-before i { left: -100%; } 62 | .logo-line-after i { right: -100%; } 63 | } 64 | -------------------------------------------------------------------------------- /_posts/2017-04-18-018 final 关键字的用途.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: `final`在`Java`中是一个保留的关键字,可以声明成员变量、方法、类以及本地变量。一旦你将引用声明作`final`,你将不能改变这个引用了,编译器会检查代码,如果你试图将变量再次初始化的话,编译器会报编译错误。 4 | --- 5 | 6 | ## final关键字的含义 7 | 8 | `final`在`Java`中是一个保留的关键字,可以声明成员变量、方法、类以及本地变量。一旦你将引用声明作`final`,你将不能改变这个引用了,编译器会检查代码,如果你试图将变量再次初始化的话,编译器会报编译错误。 9 | 10 | ## final变量 11 | 12 | 凡是对成员变量或者本地变量(在方法中的或者代码块中的变量称为本地变量)声明为`final`的都叫作`final`变量。`final`变量经常和`static`关键字一起使用,作为常量。`final`变量是只读的。 13 | 14 | ## final方法 15 | 16 | `final`也可以声明方法。方法前面加上`final`关键字,代表这个方法不可以被子类的方法重写。如果你认为一个方法的功能已经足够完整了,在子类中不需要改变的话,你可以声明此方法为`final`。`final`方法比`非final`方法要快,因为在编译的时候已经静态绑定了,不需要在运行时再动态绑定。 17 | 18 | ## final类 19 | 20 | 使用`final`来修饰的类叫做`final类`。`final类`通常功能是完整的,它们不能被继承。`Java`中有许多类是`final`的,比如`String`、`Interger`以及其他包装类。 21 | 22 | ## 使用 final关键字的好处 23 | 24 | 1. `final`关键字提高了性能。`JVM`和`Java应用`都会缓存`final变量`。 25 | 2. `final变量`可以安全的在多线程环境下进行共享,而不需要额外的同步开销。 26 | 3. 使用`final关键字`,`JVM`会对变量、方法以及类进行优化。 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | --- 45 | 46 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/018%20final%20%E5%85%B3%E9%94%AE%E5%AD%97%E7%9A%84%E7%94%A8%E9%80%94.md](https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/018%20final%20%E5%85%B3%E9%94%AE%E5%AD%97%E7%9A%84%E7%94%A8%E9%80%94.md) -------------------------------------------------------------------------------- /_posts/2017-04-25-01 Maven构建的项目中,把.xml等配置文件添加到编译目录.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: Maven 3 | description: Maven构建的项目,默认只会把`src/main/resources`目录下的xml配置文件添加到编译目录。 4 | --- 5 | 6 | Maven构建的项目,默认只会把`src/main/resources`目录下的xml配置文件添加到编译目录。 7 | 8 | 如果需要把`src/main/java`目录下的xml配置文件也添加到编译目录,需要在`pom.xml`中添加如下配置: 9 | 10 | ```xml 11 | 12 | 13 | 14 | src/main/java 15 | 16 | **/*.properties 17 | **/*.xml 18 | 19 | false 20 | 21 | 22 | 23 | ``` 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | --- 42 | 43 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/Maven/01%20Maven%E6%9E%84%E5%BB%BA%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8C%E6%8A%8A.xml%E7%AD%89%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%B7%BB%E5%8A%A0%E5%88%B0%E7%BC%96%E8%AF%91%E7%9B%AE%E5%BD%95.md](https://github.com/nnngu/LearningNotes/blob/master/Maven/01%20Maven%E6%9E%84%E5%BB%BA%E7%9A%84%E9%A1%B9%E7%9B%AE%E4%B8%AD%EF%BC%8C%E6%8A%8A.xml%E7%AD%89%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E6%B7%BB%E5%8A%A0%E5%88%B0%E7%BC%96%E8%AF%91%E7%9B%AE%E5%BD%95.md) -------------------------------------------------------------------------------- /_includes/_blocks/title.html: -------------------------------------------------------------------------------- 1 | {% case page.layout %} 2 | {% when 'index' %} 3 | {% capture title %}{{ site.title }}{% if site.index_with_subtitle and site.subtitle %} - {{site.subtitle }}{% endif %}{% endcapture %} 4 | {% when 'post' %} 5 | {% capture title %}{{ page.title }} | {{ site.title }}{% endcapture %} 6 | {% when 'page' %} 7 | {% capture title %} 8 | {% assign page_title_suffix = ' | ' | append: site.title %} 9 | {% if page.type == "categories" and page.title == nil %} 10 | {{ __.title.categories | append: page_title_suffix }} 11 | {% elsif page.type == "tags" and page.title == nil %} 12 | {{ __.title.tags | append: page_title_suffix }} 13 | {% elsif page.type == "about" and page.title == nil %} 14 | {{ __.title.about | append: page_title_suffix }} 15 | {% else %} 16 | {{ page.title | append: page_title_suffix }} 17 | {% endif %} 18 | {% endcapture %} 19 | {% when 'archive' %} 20 | {% capture title %}{{ __.title.archives }} | {{ site.title }}{% endcapture %} 21 | {% when 'category' %} 22 | {% capture title %}{{ __.title.category }} | {{ site.title }}{% endcapture %} 23 | {% when 'tag' %} 24 | {% capture title %}{{ __.title.tag }} | {{ site.title }}{% endcapture %} 25 | {% when 'schedule' %} 26 | {% capture title %}{{ __.title.schedule }} | {{ site.title }}{% endcapture %} 27 | {% endcase %} 28 | 29 | {% assign title = title | strip_newlines %} 30 | -------------------------------------------------------------------------------- /Java Basis/010 有顺序的Map的实现类:TreeMap和LinkedHashMap.md: -------------------------------------------------------------------------------- 1 | # 010 有顺序的Map的实现类:TreeMap和LinkedHashMap 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | Map主要用于存储健值对,根据键得到值,因此不允许键重复,但允许值重复。 8 | 9 | ## HashMap 10 | 11 |   说到Map,首先能想起的是HashMap,它是一个最常用的Map,它根据键的HashCode 来存储数据,根据键可以直接获取它的值,具有很快的访问速度。**遍历时,取得数据的顺序是完全随机的。** 12 | 13 |   HashMap最多只允许一条记录的键为Null;允许多条记录的值为 Null。(不允许键重复,但允许值重复) 14 | 15 |   HashMap不支持线程的同步(任一时刻可以有多个线程同时写HashMap,即线程非安全),可能会导致数据的不一致。如果需要同步,可以用 Collections的synchronizedMap() 方法使HashMap具有同步的能力,或者使用ConcurrentHashMap。 16 | 17 |   Hashtable与 HashMap类似。不同的是:它不允许记录的键或者值为空;它支持线程的同步(任一时刻只有一个线程能写Hashtable,即线程安全),因此也导致了 Hashtable 在写入时会比较慢。 18 | 19 | ## TreeMap 20 | 21 |   TreeMap实现SortMap接口,能够把它保存的记录根据键排序。 22 | 23 |   **默认是按键的升序排序,也可以指定排序的比较器**,当用Iterator 遍历TreeMap时,得到的记录是排过序的。 24 | 25 | ## LinkedHashMap 26 | 27 | **LinkedHashMap保存了记录的插入顺序,在用Iterator遍历LinkedHashMap时,先得到的记录肯定是先插入的**。 28 | 29 | 在遍历的时候会比HashMap慢,不过有种情况例外:当HashMap容量很大,实际数据较少时,遍历起来可能会比LinkedHashMap慢。因为LinkedHashMap的遍历速度只和实际数据有关,和容量无关,而HashMap的遍历速度和它的容量有关。 30 | 31 | ## 三种类型的Map分别在什么时候使用 32 | 33 |   1、一般情况下,我们用的最多的是HashMap。HashMap里面存入的值在取出的时候是随机的,它根据键的HashCode来存储数据,根据键可以直接获取它的值,具有很快的访问速度。在Map 中插入、删除和定位元素,HashMap 是最好的选择。 34 | 35 |   2、TreeMap取出来的是排序后的键值对。但如果您要按自然顺序或自定义顺序遍历键,那么TreeMap会更好。 36 | 37 |   3、LinkedHashMap 是HashMap的一个子类,如果需要输出的顺序和输入的顺序相同,那么用LinkedHashMap可以实现。 38 | 39 | -------------------------------------------------------------------------------- /_sass/_common/outline/outline.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Layout 3 | // Note: Must name this file "outline" instead of "layout" 4 | // Or Hexo will use it as template layout. 5 | // ================================================= 6 | 7 | 8 | html, body { height: 100%; } 9 | 10 | .container { 11 | position: relative; 12 | min-height: 100%; 13 | } 14 | 15 | 16 | // Header Section 17 | // -------------------------------------------------- 18 | .header-inner { 19 | margin: 0 auto; 20 | padding: 100px 0 70px; 21 | width: $content-desktop; 22 | 23 | @include desktop-large() { 24 | .container & { width: $content-desktop-large; } 25 | } 26 | } 27 | 28 | // Main Section 29 | // -------------------------------------------------- 30 | .main { padding-bottom: $footer-height + $gap-between-main-and-footer; } 31 | .main-inner { 32 | margin: 0 auto; 33 | width: $content-desktop; 34 | 35 | @include desktop-large() { 36 | .container & { width: $content-desktop-large; } 37 | } 38 | } 39 | 40 | 41 | // Footer Section 42 | // -------------------------------------------------- 43 | .footer { 44 | position: absolute; 45 | left: 0; 46 | bottom: 0; 47 | width: 100%; 48 | min-height: $footer-height; 49 | } 50 | .footer-inner { 51 | box-sizing: border-box; 52 | margin: 20px auto; 53 | width: $content-desktop; 54 | 55 | @include desktop-large() { 56 | .container & { width: $content-desktop-large; } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /_sass/_schemes/Pisces/_menu.scss: -------------------------------------------------------------------------------- 1 | .site-nav { 2 | border-top: none; 3 | 4 | @include tablet() { 5 | display: none !important; 6 | } 7 | } 8 | 9 | .site-nav-on { 10 | @include tablet() { 11 | display: block !important; 12 | } 13 | } 14 | 15 | .menu .menu-item { 16 | display: block; 17 | margin: 0; 18 | 19 | a { 20 | position: relative; 21 | box-sizing: border-box; 22 | padding: 5px 20px; 23 | text-align: left; 24 | line-height: inherit; 25 | transition-property: background-color; 26 | @include the-transition(); 27 | 28 | @at-root %menu-a-hover1 { 29 | background: #f9f9f9; 30 | border-bottom-color: white; 31 | } 32 | &:hover { 33 | @extend %menu-a-hover1; 34 | } 35 | } 36 | 37 | br { display: none; } 38 | } 39 | 40 | .menu-item-active a { 41 | @extend %menu-a-hover; 42 | @extend %menu-a-hover1; 43 | 44 | &:after { 45 | content: " "; 46 | position: absolute; 47 | top: 50%; 48 | margin-top: -3px; 49 | right: 15px; 50 | width: 6px; 51 | height: 6px; 52 | border-radius: 50%; 53 | background-color: $grey; 54 | } 55 | } 56 | 57 | .btn-bar { 58 | background-color: white; 59 | } 60 | 61 | .site-nav-toggle { 62 | left: 20px; 63 | top: 50%; 64 | 65 | -webkit-transform: translateY(-50%); 66 | @include transform(translateY(-50%)); 67 | 68 | @include tablet() { 69 | display: block; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Java Basis/009 java中堆和栈的区别.md: -------------------------------------------------------------------------------- 1 | # java中堆和栈的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 堆和栈都是Java用来在RAM中存放数据的地方。 8 | 9 | ## 堆 10 | 11 | (1)**Java的堆是一个运行时数据区,类的对象从堆中分配空间**。这些对象通过new等指令建立,通过垃圾回收器来销毁。 12 | 13 | (2)堆的优势是可以动态地分配内存空间,需要多少内存空间不必事先告诉编译器,因为它是在运行时动态分配的。但缺点是,由于需要在运行时动态分配内存,所以存取速度较慢。  14 | 15 | ## 栈 16 | 17 | (1)**栈中主要存放一些基本数据类型的变量**(byte,short,int,long,float,double,boolean,char)和对象的引用。 18 | 19 | (2)栈的优势是,存取速度比堆快,栈数据可以共享。但缺点是,存放在栈中的数据占用多少内存空间需要在编译时确定下来,缺乏灵活性。 20 | 21 | ## 举例说明栈数据可以共享 22 | 23 | String 可以用以下两种方式来创建: 24 | 25 |
String str1 = new String("abc");
26 | String str2 = "abc";
27 | 28 | 第一种使用new来创建的对象,它存放在堆中。每调用一次就创建一个新的对象。  29 | 30 | 第二种是先在栈中创建对象的引用str2,然后查找栈中有没有存放“abc”,如果没有,则将“abc”存放进栈,并将str2指向“abc”,如果已经有“abc”, 则直接将str2指向“abc”。 31 | 32 | 下面用代码说明上面的理论: 33 | 34 |
    public static void main(String[] args) {
35 |         String str1 = new String("abc");
36 |         String str2 = new String("abc");
37 |         System.out.println(str1 == str2);
38 |     }
39 | 40 | 输出结果为:false 41 | 42 | * * * 43 | 44 |
    public static void main(String[] args) {
45 |         String str1 = "abc";
46 |         String str2 = "abc";
47 |         System.out.println(str1 == str2);
48 |     }
49 | 50 | 输出结果为:true 51 | 52 | 因此,用第二种方式创建多个“abc”字符串,在内存中其实只存在一个对象而已。 这种写法有利于节省内存空间。 同时还可以提高程序的运行速度,因为JVM会自动根据栈中数据的实际情况来决定是否创建新对象。 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /assets/js/src/bootstrap.js: -------------------------------------------------------------------------------- 1 | /* global NexT: true */ 2 | 3 | $(document).ready(function () { 4 | 5 | $(document).trigger('bootstrap:before'); 6 | 7 | NexT.utils.isMobile() && window.FastClick.attach(document.body); 8 | 9 | NexT.utils.lazyLoadPostsImages(); 10 | 11 | NexT.utils.registerESCKeyEvent(); 12 | 13 | NexT.utils.registerBackToTop(); 14 | 15 | $('.site-nav-toggle button').on('click', function () { 16 | var $siteNav = $('.site-nav'); 17 | var ON_CLASS_NAME = 'site-nav-on'; 18 | var isSiteNavOn = $siteNav.hasClass(ON_CLASS_NAME); 19 | var animateAction = isSiteNavOn ? 'slideUp' : 'slideDown'; 20 | var animateCallback = isSiteNavOn ? 'removeClass' : 'addClass'; 21 | 22 | $siteNav.stop()[animateAction]('fast', function () { 23 | $siteNav[animateCallback](ON_CLASS_NAME); 24 | }); 25 | }); 26 | 27 | 28 | CONFIG.fancybox && NexT.utils.wrapImageWithFancyBox(); 29 | NexT.utils.embeddedVideoTransformer(); 30 | NexT.utils.addActiveClassToMenuItem(); 31 | 32 | 33 | // Define Motion Sequence. 34 | NexT.motion.integrator 35 | .add(NexT.motion.middleWares.logo) 36 | .add(NexT.motion.middleWares.menu) 37 | .add(NexT.motion.middleWares.postList) 38 | .add(NexT.motion.middleWares.sidebar); 39 | 40 | $(document).trigger('motion:before'); 41 | 42 | // Bootstrap Motion. 43 | CONFIG.motion && NexT.motion.integrator.bootstrap(); 44 | 45 | $(document).trigger('bootstrap:after'); 46 | }); 47 | -------------------------------------------------------------------------------- /_sass/_common/components/sidebar/sidebar-toc.scss: -------------------------------------------------------------------------------- 1 | 2 | .post-toc-empty { 3 | font-size: 14px; 4 | color: $grey-dim; 5 | } 6 | 7 | .post-toc-wrap { overflow: hidden; } 8 | 9 | .post-toc { overflow: auto; } 10 | 11 | .post-toc ol { 12 | margin: 0; 13 | padding: 0 2px 5px 10px; 14 | text-align: left; 15 | list-style: none; 16 | font-size: 14px; 17 | 18 | & > ol { padding-left: 0; } 19 | 20 | a { 21 | @include the-transition(); 22 | transition-property: all; 23 | color: $toc-link-color; 24 | border-bottom-color: $toc-link-border-color; 25 | 26 | &:hover { 27 | color: $toc-link-hover-color; 28 | border-bottom-color: $toc-link-hover-border-color; 29 | } 30 | } 31 | } 32 | 33 | .post-toc .nav-item { 34 | overflow: hidden; 35 | text-overflow: ellipsis; 36 | white-space: if(not jekyll-config('toc.wrap'), nowrap, null); 37 | line-height: 1.8; 38 | } 39 | 40 | .post-toc .nav .nav-child { display: none; } 41 | 42 | .post-toc .nav .active > .nav-child { display: block; } 43 | 44 | .post-toc .nav .active-current > .nav-child { 45 | display: block; 46 | & > .nav-item { display: block; } 47 | } 48 | 49 | .post-toc .nav .active > a { 50 | color: $toc-link-active-color; 51 | border-bottom-color: $toc-link-active-border-color; 52 | } 53 | 54 | .post-toc .nav .active-current > a { 55 | color: $toc-link-active-current-color; 56 | &:hover { 57 | color: $toc-link-active-current-border-color; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /_sass/_mixins/base.scss: -------------------------------------------------------------------------------- 1 | @mixin the-transition() { 2 | transition-duration: 0.2s; 3 | transition-timing-function: ease-in-out; 4 | transition-delay: 0s; 5 | } 6 | 7 | @mixin mobile() { 8 | @media (max-width: 767px) { 9 | @content; 10 | } 11 | } 12 | 13 | @mixin tablet() { 14 | @media (min-width: 768px) and (max-width: 991px) { 15 | @content; 16 | } 17 | } 18 | 19 | @mixin desktop() { 20 | @media (min-width: 992px) { 21 | @content; 22 | } 23 | } 24 | 25 | @mixin desktop-large() { 26 | @media (min-width: 1600px) { 27 | @content; 28 | } 29 | } 30 | 31 | @mixin circle() { 32 | border-radius: 50%; 33 | } 34 | 35 | @mixin keyframes($name) { 36 | @-webkit-keyframes #{$name} { 37 | @content; 38 | } 39 | @-moz-keyframes #{$name} { 40 | @content; 41 | } 42 | @-ms-keyframes #{$name} { 43 | @content; 44 | } 45 | @keyframes #{$name} { 46 | @content; 47 | } 48 | } 49 | 50 | @mixin transform($arguments) { 51 | -webkit-transform: $arguments; 52 | -moz-transform: $arguments; 53 | -ms-transform: $arguments; 54 | -o-transform: $arguments; 55 | transform: $arguments; 56 | } 57 | 58 | 59 | @function random-color($min, $max) { 60 | @return floor(random() * ($max - $min + 1) + $min); 61 | } 62 | 63 | // Clearfix. http://nicolasgallagher.com/micro-clearfix-hack/ 64 | @mixin clearfix() { 65 | &:before, 66 | &:after { 67 | content: " "; 68 | display: table; 69 | } 70 | &:after { clear: both; } 71 | } 72 | -------------------------------------------------------------------------------- /_posts/2017-04-10-010 有顺序的Map的实现类:TreeMap和LinkedHashMap.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: Map主要用于存储健值对,根据键得到值,因此不允许键重复,但允许值重复。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | Map主要用于存储健值对,根据键得到值,因此不允许键重复,但允许值重复。 11 | 12 | ## HashMap 13 | 14 |   说到Map,首先能想起的是HashMap,它是一个最常用的Map,它根据键的HashCode 来存储数据,根据键可以直接获取它的值,具有很快的访问速度。**遍历时,取得数据的顺序是完全随机的。** 15 | 16 |   HashMap最多只允许一条记录的键为Null;允许多条记录的值为 Null。(不允许键重复,但允许值重复) 17 | 18 |   HashMap不支持线程的同步(任一时刻可以有多个线程同时写HashMap,即线程非安全),可能会导致数据的不一致。如果需要同步,可以用 Collections的synchronizedMap() 方法使HashMap具有同步的能力,或者使用ConcurrentHashMap。 19 | 20 |   Hashtable与 HashMap类似。不同的是:它不允许记录的键或者值为空;它支持线程的同步(任一时刻只有一个线程能写Hashtable,即线程安全),因此也导致了 Hashtable 在写入时会比较慢。 21 | 22 | ## TreeMap 23 | 24 |   TreeMap实现SortMap接口,能够把它保存的记录根据键排序。 25 | 26 |   **默认是按键的升序排序,也可以指定排序的比较器**,当用Iterator 遍历TreeMap时,得到的记录是排过序的。 27 | 28 | ## LinkedHashMap 29 | 30 | **LinkedHashMap保存了记录的插入顺序,在用Iterator遍历LinkedHashMap时,先得到的记录肯定是先插入的**。 31 | 32 | 在遍历的时候会比HashMap慢,不过有种情况例外:当HashMap容量很大,实际数据较少时,遍历起来可能会比LinkedHashMap慢。因为LinkedHashMap的遍历速度只和实际数据有关,和容量无关,而HashMap的遍历速度和它的容量有关。 33 | 34 | ## 三种类型的Map分别在什么时候使用 35 | 36 |   1、一般情况下,我们用的最多的是HashMap。HashMap里面存入的值在取出的时候是随机的,它根据键的HashCode来存储数据,根据键可以直接获取它的值,具有很快的访问速度。在Map 中插入、删除和定位元素,HashMap 是最好的选择。 37 | 38 |   2、TreeMap取出来的是排序后的键值对。但如果您要按自然顺序或自定义顺序遍历键,那么TreeMap会更好。 39 | 40 |   3、LinkedHashMap 是HashMap的一个子类,如果需要输出的顺序和输入的顺序相同,那么用LinkedHashMap可以实现。 41 | 42 | -------------------------------------------------------------------------------- /_includes/_macro/post-collapse.html: -------------------------------------------------------------------------------- 1 | {% comment %} post-collapse(post) {% endcomment %} 2 | 32 | -------------------------------------------------------------------------------- /_sass/_common/scaffolding/helpers.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Helpers 3 | // ================================================= 4 | 5 | 6 | 7 | // Alignment 8 | .text-left { text-align: left; } 9 | .text-center { text-align: center; } 10 | .text-right { text-align: right; } 11 | .text-justify { text-align: justify; } 12 | .text-nowrap { white-space: nowrap; } 13 | 14 | 15 | // Transformation 16 | .text-lowercase { text-transform: lowercase; } 17 | .text-uppercase { text-transform: uppercase; } 18 | .text-capitalize { text-transform: capitalize; } 19 | 20 | 21 | // Center-align a block level element. 22 | .center-block { 23 | display: block; 24 | margin-left: auto; 25 | margin-right: auto; 26 | } 27 | 28 | 29 | // Clearfix. http://nicolasgallagher.com/micro-clearfix-hack/ 30 | .clearfix { 31 | @include clearfix(); 32 | } 33 | 34 | .pullquote { 35 | width: 45%; 36 | 37 | &.left { 38 | float: left; 39 | margin-left: 5px; 40 | margin-right: 10px; 41 | } 42 | 43 | &.right { 44 | float: right; 45 | margin-left: 10px; 46 | margin-right: 5px; 47 | } 48 | } 49 | 50 | .affix.affix.affix { position: fixed; } 51 | 52 | .translation { 53 | margin-top: -20px; 54 | font-size: 14px; 55 | color: $grey-dark; 56 | } 57 | 58 | // https://davidwalsh.name/detect-scrollbar-width 59 | .scrollbar-measure { 60 | width: 100px; 61 | height: 100px; 62 | overflow: scroll; 63 | position: absolute; 64 | top: -9999px; 65 | } 66 | 67 | .use-motion .motion-element { opacity: 0; } 68 | -------------------------------------------------------------------------------- /_posts/2017-04-09-009 java中堆和栈的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 堆和栈都是Java用来在RAM中存放数据的地方。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | 堆和栈都是Java用来在RAM中存放数据的地方。 11 | 12 | ## 堆 13 | 14 | (1)**Java的堆是一个运行时数据区,类的对象从堆中分配空间**。这些对象通过new等指令建立,通过垃圾回收器来销毁。 15 | 16 | (2)堆的优势是可以动态地分配内存空间,需要多少内存空间不必事先告诉编译器,因为它是在运行时动态分配的。但缺点是,由于需要在运行时动态分配内存,所以存取速度较慢。  17 | 18 | ## 栈 19 | 20 | (1)**栈中主要存放一些基本数据类型的变量**(byte,short,int,long,float,double,boolean,char)和对象的引用。 21 | 22 | (2)栈的优势是,存取速度比堆快,栈数据可以共享。但缺点是,存放在栈中的数据占用多少内存空间需要在编译时确定下来,缺乏灵活性。 23 | 24 | ## 举例说明栈数据可以共享 25 | 26 | String 可以用以下两种方式来创建: 27 | 28 |
String str1 = new String("abc");
29 | String str2 = "abc";
30 | 31 | 第一种使用new来创建的对象,它存放在堆中。每调用一次就创建一个新的对象。  32 | 33 | 第二种是先在栈中创建对象的引用str2,然后查找栈中有没有存放“abc”,如果没有,则将“abc”存放进栈,并将str2指向“abc”,如果已经有“abc”, 则直接将str2指向“abc”。 34 | 35 | 下面用代码说明上面的理论: 36 | 37 |
    public static void main(String[] args) {
38 |         String str1 = new String("abc");
39 |         String str2 = new String("abc");
40 |         System.out.println(str1 == str2);
41 |     }
42 | 43 | 输出结果为:false 44 | 45 | * * * 46 | 47 |
    public static void main(String[] args) {
48 |         String str1 = "abc";
49 |         String str2 = "abc";
50 |         System.out.println(str1 == str2);
51 |     }
52 | 53 | 输出结果为:true 54 | 55 | 因此,用第二种方式创建多个“abc”字符串,在内存中其实只存在一个对象而已。 这种写法有利于节省内存空间。 同时还可以提高程序的运行速度,因为JVM会自动根据栈中数据的实际情况来决定是否创建新对象。 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /_sass/_common/components/pagination.scss: -------------------------------------------------------------------------------- 1 | .pagination { 2 | margin: 120px 0 40px; 3 | text-align: center; 4 | border-top: 1px solid $pagination-border; 5 | } 6 | 7 | .page-number-basic { 8 | display: inline-block; 9 | position: relative; 10 | top: -1px; 11 | margin: 0 10px; 12 | padding: 0 10px; 13 | line-height: 30px; 14 | 15 | @include mobile() { margin: 0 5px; } 16 | } 17 | 18 | .pagination { 19 | .prev, .next, .page-number { 20 | @extend .page-number-basic; 21 | border-bottom: 0; 22 | border-top: 1px solid $pagination-link-border; 23 | transition-property: border-color; 24 | @include the-transition(); 25 | 26 | &:hover { border-top-color: $pagination-link-hover-border; } 27 | } 28 | 29 | .space { 30 | @extend .page-number-basic; 31 | padding: 0; 32 | margin: 0; 33 | } 34 | 35 | .prev { margin-left: 0; } 36 | .next { margin-right: 0; } 37 | 38 | @at-root %page-number-current { 39 | color: $pagination-active-color; 40 | background: $pagination-active-bg; 41 | border-top-color: $pagination-active-border; 42 | } 43 | 44 | .page-number.current { 45 | @extend %page-number-current; 46 | } 47 | } 48 | 49 | @media (max-width: 767px) { 50 | .pagination { border-top: none; } 51 | 52 | .pagination { 53 | .prev, .next, .page-number { 54 | margin-bottom: 10px; 55 | border-top: 0; 56 | border-bottom: 1px solid $pagination-link-border; 57 | 58 | &:hover { border-bottom-color: $pagination-link-hover-border; } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/changyan.html: -------------------------------------------------------------------------------- 1 | {% if site.changyan.enable and site.changyan.appid and site.changyan.appkey %} 2 | {% if page.home %} 3 | 4 | {% else %} 5 | 16 | 17 | {% endif %} 18 | {% endif %} 19 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-corner-indicator.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace .pace-activity{display:block;position:fixed;z-index:2000;top:0;right:0;width:300px;height:300px;background:#29d;-webkit-transition:-webkit-transform .3s;transition:transform .3s;-webkit-transform:translateX(100%) translateY(-100%) rotate(45deg);transform:translateX(100%) translateY(-100%) rotate(45deg);pointer-events:none}.pace.pace-active .pace-activity{-webkit-transform:translateX(50%) translateY(-50%) rotate(45deg);transform:translateX(50%) translateY(-50%) rotate(45deg)}.pace .pace-activity::after,.pace .pace-activity::before{-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;bottom:30px;left:50%;display:block;border:5px solid #fff;border-radius:50%;content:''}.pace .pace-activity::before{margin-left:-40px;width:80px;height:80px;border-right-color:rgba(0,0,0,.2);border-left-color:rgba(0,0,0,.2);-webkit-animation:pace-theme-corner-indicator-spin 3s linear infinite;animation:pace-theme-corner-indicator-spin 3s linear infinite}.pace .pace-activity::after{bottom:50px;margin-left:-20px;width:40px;height:40px;border-top-color:rgba(0,0,0,.2);border-bottom-color:rgba(0,0,0,.2);-webkit-animation:pace-theme-corner-indicator-spin 1s linear infinite;animation:pace-theme-corner-indicator-spin 1s linear infinite}@-webkit-keyframes pace-theme-corner-indicator-spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@keyframes pace-theme-corner-indicator-spin{0%{transform:rotate(0)}100%{transform:rotate(359deg)}} -------------------------------------------------------------------------------- /_posts/2018-03-17-划分一个整形数组,把负数放在左边,零放在中间,正数放在右边.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: Algorithm 3 | description: 如题 4 | --- 5 | 6 | **题目:划分一个整形数组,把负数放在左边,零放在中间,正数放在右边** 7 | 8 | 思路:扫描遍历,发现正数出现在负数前面,就调换位置。 9 | 10 | 代码: 11 | 12 | ```java 13 | public static int[] arrayChange(int[] array) { 14 | int length = array.length; 15 | int low = 0; 16 | int high = length - 1; 17 | 18 | // 扫描遍历,发现正数出现在负数前面,就调换位置 19 | while (low < high) { 20 | while (array[low] < 0 && low < high) { 21 | low++; 22 | } 23 | while (array[high] > 0 && low < high) { 24 | high--; 25 | } 26 | int temp = array[low]; 27 | array[low] = array[high]; 28 | array[high] = temp; 29 | } 30 | return array; 31 | } 32 | ``` 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | --- 49 | 50 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/_posts/2018-03-17-%E5%88%92%E5%88%86%E4%B8%80%E4%B8%AA%E6%95%B4%E5%BD%A2%E6%95%B0%E7%BB%84%EF%BC%8C%E6%8A%8A%E8%B4%9F%E6%95%B0%E6%94%BE%E5%9C%A8%E5%B7%A6%E8%BE%B9%EF%BC%8C%E9%9B%B6%E6%94%BE%E5%9C%A8%E4%B8%AD%E9%97%B4%EF%BC%8C%E6%AD%A3%E6%95%B0%E6%94%BE%E5%9C%A8%E5%8F%B3%E8%BE%B9.md](https://github.com/nnngu/LearningNotes/blob/master/_posts/2018-03-17-%E5%88%92%E5%88%86%E4%B8%80%E4%B8%AA%E6%95%B4%E5%BD%A2%E6%95%B0%E7%BB%84%EF%BC%8C%E6%8A%8A%E8%B4%9F%E6%95%B0%E6%94%BE%E5%9C%A8%E5%B7%A6%E8%BE%B9%EF%BC%8C%E9%9B%B6%E6%94%BE%E5%9C%A8%E4%B8%AD%E9%97%B4%EF%BC%8C%E6%AD%A3%E6%95%B0%E6%94%BE%E5%9C%A8%E5%8F%B3%E8%BE%B9.md) -------------------------------------------------------------------------------- /Java Basis/003 Java中String、StringBuffer、StringBuilder的区别.md: -------------------------------------------------------------------------------- 1 | # Java中String、StringBuffer、StringBuilder的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | ## 1.从是否可变的角度 8 | 9 |   String类中使用字符数组保存字符串,因为有“final”修饰符,所以String对象是不可变的。 10 | 11 | ``` 12 | /** The value is used for character storage. */ 13 | private final char value[]; 14 | ``` 15 | 16 |   **StringBuffer和StringBuilder**都继承自AbstractStringBuilder类,在AbstractStringBuilder中也是使用字符数组保存字符串,但没有“final”修饰符,所以两种对象都是可变的。 17 | 18 | ``` 19 | /** 20 | * The value is used for character storage. 21 | */ 22 | char[] value; 23 | ``` 24 | 25 | ## 2.是否多线程安全 26 | 27 |   String中的对象是不可变的,也就可以理解为常量,所以**是线程安全的**。 28 | 29 |   AbstractStringBuilder是StringBuffer和StringBuilder的公共父类,定义了一些字符串的基本操作,如append、insert、indexOf等公共方法。 30 | 31 |   StringBuffer对方法加了同步锁(synchronized) ,所以是**线程安全的**。看如下源码: 32 | 33 | ``` 34 | 1 public synchronized StringBuffer append(String str) { 35 | 2 toStringCache = null; 36 | 3 super.append(str); 37 | 4 return this; 38 | 5 } 39 | ``` 40 | 41 |   StringBuilder并没有对方法进行加同步锁,所以是**非线程安全的**。如下源码: 42 | 43 | ``` 44 | 1 public StringBuilder append(String str) { 45 | 2 super.append(str); 46 | 3 return this; 47 | 4 } 48 | ``` 49 | 50 | ## 3.StringBuffer和StringBuilder的共同点 51 | 52 |   StringBuffer和StringBuilder有公共父类AbstractStringBuilder(**抽象类**)。 53 | 54 |   StringBuffer、StringBuilder的方法都会调用AbstractStringBuilder中的公共方法,如上面的两段源码中都调用了super.append(str);  只是StringBuffer会在方法上加synchronized关键字,进行同步。 55 | 56 |   **最后,如果程序不是多线程的,那么使用StringBuilder效率高于StringBuffer。** 57 | 58 | -------------------------------------------------------------------------------- /_data/languages/ja.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: アーカイブ 3 | category: カテゴリ 4 | tag: タグ 5 | archives: アーカイブ 6 | categories: カテゴリ 7 | tags: タグ 8 | about: About 9 | 10 | author: Author 11 | 12 | menu: 13 | home: ホーム 14 | archives: アーカイブ 15 | categories: カテゴリ 16 | tags: タグ 17 | about: About 18 | search: 検索 19 | 20 | sidebar: 21 | overview: 概要 22 | toc: 見出し 23 | 24 | post: 25 | sticky: 固定 26 | posted: 投稿日 27 | modified: Updated at 28 | in: In 29 | read_more: 続きを読む 30 | untitled: 無題 31 | toc_empty: 見出しがありません 32 | visitors: Visitors 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: 全ページ 44 | tags: タグ 45 | 46 | footer: 47 | powered: "Powered by %s" 48 | theme: Theme 49 | 50 | counter: 51 | tag_cloud: 52 | zero: タグなし 53 | one: "全 1 タグ" 54 | other: "全 %d タグ" 55 | 56 | categories: 57 | zero: カテゴリなし 58 | one: "全 1 カテゴリ" 59 | other: "全 %d カテゴリ" 60 | 61 | archive_posts: 62 | zero: ポストなし 63 | one: "全 1 ポスト" 64 | other: "全 %d ポスト" 65 | 66 | state: 67 | posts: ポスト 68 | pages: ページ 69 | tags: タグ 70 | categories: カテゴリ 71 | 72 | cheers: 73 | um: うーん 74 | ok: OK 75 | nice: まあまあ 76 | good: いいね 77 | great: すごい 78 | excellent: 最高 79 | 80 | keep_on: もっと書こう! 81 | 82 | symbol: 83 | comma: ', ' 84 | period: '. ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /_data/languages/ko.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: 아카이브 3 | category: 카테고리 4 | tag: 태그 5 | archives: 아카이브 6 | categories: 카테고리 7 | tags: 태그 8 | about: About 9 | 10 | author: 작성자 11 | 12 | menu: 13 | home: 홈 14 | archives: 아카이브 15 | categories: 카테고리 16 | tags: 태그 17 | about: About 18 | search: 검색 19 | 20 | sidebar: 21 | overview: 흝어보기 22 | toc: 목차 23 | 24 | post: 25 | sticky: 고정 26 | posted: 작성일 27 | modified: Updated at 28 | in: In 29 | read_more: 더 읽어보기 30 | untitled: 제목 없음 31 | toc_empty: 목차 없음 32 | visitors: 방문객 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: 모두 44 | tags: 태그 45 | 46 | footer: 47 | powered: "Powered by %s" 48 | theme: Theme 49 | 50 | counter: 51 | tag_cloud: 52 | zero: 태그 없음 53 | one: 1개의 태그 54 | other: "총 %d개의 태그" 55 | 56 | categories: 57 | zero: 카테고리 없음 58 | one: 1개의 카테고리 59 | other: "총 %d개의 카테고리" 60 | 61 | archive_posts: 62 | zero: 포스트 없음 63 | one: 1개의 포스트 64 | other: "총 %d개의 포스트" 65 | 66 | state: 67 | posts: 포스트 68 | pages: 페이지 69 | tags: 태그 70 | categories: 카테고리 71 | 72 | cheers: 73 | um: 음.. 74 | ok: OK 75 | nice: 잘했어요 76 | good: 좋아요 77 | great: 훌륭해요 78 | excellent: 완벽해요 79 | 80 | keep_on: 포스트를 마저 작성하세요 81 | 82 | symbol: 83 | comma: ', ' 84 | period: '. ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /_sass/_common/components/post/post-reward.scss: -------------------------------------------------------------------------------- 1 | @mixin post-reward { 2 | #rewardButton { 3 | cursor: pointer; 4 | border: 0; 5 | outline: 0; 6 | border-radius: 100%; 7 | padding: 0; 8 | margin: 0; 9 | letter-spacing: normal; 10 | text-transform: none; 11 | text-indent: 0px; 12 | text-shadow: none; 13 | } 14 | #rewardButton span { 15 | display: inline-block; 16 | width: 80px; 17 | height: 35px; 18 | border-radius: 5px; 19 | color: #fff; 20 | font-weight: 400; 21 | font-style: normal; 22 | font-variant: normal; 23 | font-stretch: normal; 24 | font-size: 18px; 25 | font-family: "Microsoft Yahei"; 26 | background: #F44336; 27 | } 28 | #rewardButton span:hover{ 29 | background: #F7877F; 30 | } 31 | #QR{ 32 | padding-top:20px; 33 | } 34 | #QR a{ 35 | border:0; 36 | } 37 | #QR img{ 38 | width: 180px; 39 | max-width: 100%; 40 | display: inline-block; 41 | margin: 0.8em 2em 0 2em; 42 | } 43 | #wechat:hover p{ 44 | animation: roll 0.1s infinite linear; 45 | -webkit-animation: roll 0.1s infinite linear; 46 | -moz-animation: roll 0.1s infinite linear; 47 | } 48 | #alipay:hover p{ 49 | animation: roll 0.1s infinite linear; 50 | -webkit-animation: roll 0.1s infinite linear; 51 | -moz-animation: roll 0.1s infinite linear; 52 | } 53 | @include keyframes(roll) { 54 | from { 55 | @include transform(rotateZ(30deg)); 56 | } 57 | to { 58 | @include transform(rotateZ(-30deg)); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /_sass/_common/components/tags/note.scss: -------------------------------------------------------------------------------- 1 | // bs-callout 2 | // See: http://cpratt.co/twitter-bootstrap-callout-css-styles/ 3 | // =============================================== 4 | 5 | .note { 6 | padding: 20px; 7 | margin: 20px 0; 8 | border: 1px solid #eee; 9 | border-left-width: 5px; 10 | border-radius: 3px; 11 | } 12 | .note h2, 13 | .note h3, 14 | .note h4, 15 | .note h5, 16 | .note h6 { 17 | margin-top: 0; 18 | margin-bottom: 5px; 19 | padding-top: 0 !important; 20 | } 21 | .note p:last-child { 22 | margin-bottom: 0; 23 | } 24 | .note code { 25 | border-radius: 3px; 26 | } 27 | .note+.note { 28 | margin-top: -5px; 29 | } 30 | .default { 31 | border-left-color: #777; 32 | } 33 | .default h2, 34 | .default h3, 35 | .default h4, 36 | .default h5, 37 | .default h6 { 38 | color: #777; 39 | } 40 | .primary { 41 | border-left-color: #428bca; 42 | } 43 | .primary h2, 44 | .primary h3, 45 | .primary h4, 46 | .primary h5, 47 | .primary h6 { 48 | color: #428bca; 49 | } 50 | .success { 51 | border-left-color: #5cb85c; 52 | } 53 | .success h2, 54 | .success h3, 55 | .success h4, 56 | .success h5, 57 | .success h6 { 58 | color: #5cb85c; 59 | } 60 | .danger { 61 | border-left-color: #d9534f; 62 | } 63 | .danger h2, 64 | .danger h3, 65 | .danger h4, 66 | .danger h5, 67 | .danger h6 { 68 | color: #d9534f; 69 | } 70 | .warning { 71 | border-left-color: #f0ad4e; 72 | } 73 | .warning h2, 74 | .warning h3, 75 | .warning h4, 76 | .warning h5, 77 | .warning h6 { 78 | color: #f0ad4e; 79 | } 80 | .info { 81 | border-left-color: #5bc0de; 82 | } 83 | .info h2, 84 | .info h3, 85 | .info h4, 86 | .info h5, 87 | .info h6 { 88 | color: #5bc0de; 89 | } 90 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-flash.min.css: -------------------------------------------------------------------------------- 1 | .pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.pace-inactive{display:none}.pace .pace-progress{background:#29d;position:fixed;z-index:2000;top:0;right:100%;width:100%;height:2px}.pace .pace-progress-inner{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0,-4px);-moz-transform:rotate(3deg) translate(0,-4px);-ms-transform:rotate(3deg) translate(0,-4px);-o-transform:rotate(3deg) translate(0,-4px);transform:rotate(3deg) translate(0,-4px)}.pace .pace-activity{display:block;position:fixed;z-index:2000;top:15px;right:15px;width:14px;height:14px;border:2px solid transparent;border-top-color:#29d;border-left-color:#29d;border-radius:10px;-webkit-animation:pace-spinner .4s linear infinite;-moz-animation:pace-spinner .4s linear infinite;-ms-animation:pace-spinner .4s linear infinite;-o-animation:pace-spinner .4s linear infinite;animation:pace-spinner .4s linear infinite}@-webkit-keyframes pace-spinner{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-moz-keyframes pace-spinner{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(360deg);transform:rotate(360deg)}}@-o-keyframes pace-spinner{0%{-o-transform:rotate(0);transform:rotate(0)}100%{-o-transform:rotate(360deg);transform:rotate(360deg)}}@-ms-keyframes pace-spinner{0%{-ms-transform:rotate(0);transform:rotate(0)}100%{-ms-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pace-spinner{0%{transform:rotate(0)}100%{transform:rotate(360deg)}} -------------------------------------------------------------------------------- /_data/languages/zh-Hans.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: 归档 3 | category: 分类 4 | tag: 标签 5 | schedule: 日程表 6 | archives: 归档 7 | categories: 分类 8 | tags: 标签 9 | about: 关于 10 | 11 | author: 博主 12 | 13 | menu: 14 | home: 首页 15 | archives: 归档 16 | categories: 分类 17 | tags: 标签 18 | about: 关于 19 | search: 搜索 20 | schedule: 日程表 21 | sitemap: 站点地图 22 | commonweal: 公益404 23 | 24 | sidebar: 25 | overview: 站点概览 26 | toc: 文章目录 27 | 28 | post: 29 | created: 创建于 30 | modified: 更新于 31 | sticky: 置顶 32 | posted: 发表于 33 | in: 分类于 34 | read_more: 阅读全文 35 | untitled: 未命名 36 | toc_empty: 此文章未包含目录 37 | visitors: 阅读次数 38 | wordcount: 字数统计 39 | min2read: 阅读时长 40 | copyright: 41 | author: 本文作者 42 | link: 本文链接 43 | license_title: 版权声明 44 | license_content: '本博客所有文章除特别声明外,均采用 45 | %s 许可协议。转载请注明出处!' 46 | 47 | page: 48 | totally: 共有 49 | tags: 标签 50 | 51 | footer: 52 | powered: "由 %s 强力驱动" 53 | theme: 主题 54 | 55 | counter: 56 | tag_cloud: 57 | zero: 暂无标签 58 | one: 目前共计 1 个标签 59 | other: "目前共计 %d 个标签" 60 | 61 | categories: 62 | zero: 暂无分类 63 | one: 目前共计 1 个分类 64 | other: "目前共计 %d 个分类" 65 | 66 | archive_posts: 67 | zero: 暂无日志。 68 | one: 目前共计 1 篇日志。 69 | other: "目前共计 %d 篇日志。" 70 | 71 | state: 72 | posts: 日志 73 | pages: 页面 74 | tags: 标签 75 | categories: 分类 76 | 77 | search: 78 | placeholder: 搜索... 79 | 80 | cheers: 81 | um: 嗯.. 82 | ok: OK 83 | nice: 好 84 | good: 很好 85 | great: 非常好 86 | excellent: 太棒了 87 | 88 | keep_on: 继续努力。 89 | 90 | symbol: 91 | comma: ', ' 92 | period: '。 ' 93 | colon: ':' 94 | -------------------------------------------------------------------------------- /_includes/_third-party/comments/duoshuo.html: -------------------------------------------------------------------------------- 1 | {% if site.duoshuo_shortname or site.duoshuo and site.duoshuo.shortname %} 2 | 3 | {% if site.duoshuo %} 4 | {% assign duoshuo_shortname = site.duoshuo.shortname %} 5 | {% else %} 6 | {% assign duoshuo_shortname = site.duoshuo_shortname %} 7 | {% endif %} 8 | 9 | 21 | 22 | {% if site.duoshuo_info.ua_enable %} 23 | {% if site.duoshuo_info.admin_enable %} 24 | {% assign ua_parser_internal = site.vendors._internal | append: '/ua-parser-js/dist/ua-parser.min.js?v=0.7.9' | relative_url %} 25 | 26 | 27 | {% endif %} 28 | {% assign ua_parser_internal = site.vendors._internal | append: '/ua-parser-js/dist/ua-parser.min.js?v=0.7.9' | relative_url %} 29 | 30 | 31 | {% endif %} 32 | 33 | {% endif %} 34 | -------------------------------------------------------------------------------- /_posts/2017-04-03-003 Java中String、StringBuffer、StringBuilder的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 1.从是否可变的角度 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | ## 1.从是否可变的角度 11 | 12 |   String类中使用字符数组保存字符串,因为有“final”修饰符,所以String对象是不可变的。 13 | 14 | ``` 15 | /** The value is used for character storage. */ 16 | private final char value[]; 17 | ``` 18 | 19 |   **StringBuffer和StringBuilder**都继承自AbstractStringBuilder类,在AbstractStringBuilder中也是使用字符数组保存字符串,但没有“final”修饰符,所以两种对象都是可变的。 20 | 21 | ``` 22 | /** 23 | * The value is used for character storage. 24 | */ 25 | char[] value; 26 | ``` 27 | 28 | ## 2.是否多线程安全 29 | 30 |   String中的对象是不可变的,也就可以理解为常量,所以**是线程安全的**。 31 | 32 |   AbstractStringBuilder是StringBuffer和StringBuilder的公共父类,定义了一些字符串的基本操作,如append、insert、indexOf等公共方法。 33 | 34 |   StringBuffer对方法加了同步锁(synchronized) ,所以是**线程安全的**。看如下源码: 35 | 36 | ``` 37 | 1 public synchronized StringBuffer append(String str) { 38 | 2 toStringCache = null; 39 | 3 super.append(str); 40 | 4 return this; 41 | 5 } 42 | ``` 43 | 44 |   StringBuilder并没有对方法进行加同步锁,所以是**非线程安全的**。如下源码: 45 | 46 | ``` 47 | 1 public StringBuilder append(String str) { 48 | 2 super.append(str); 49 | 3 return this; 50 | 4 } 51 | ``` 52 | 53 | ## 3.StringBuffer和StringBuilder的共同点 54 | 55 |   StringBuffer和StringBuilder有公共父类AbstractStringBuilder(**抽象类**)。 56 | 57 |   StringBuffer、StringBuilder的方法都会调用AbstractStringBuilder中的公共方法,如上面的两段源码中都调用了super.append(str);  只是StringBuffer会在方法上加synchronized关键字,进行同步。 58 | 59 |   **最后,如果程序不是多线程的,那么使用StringBuilder效率高于StringBuffer。** 60 | 61 | -------------------------------------------------------------------------------- /assets/lib/canvas-nest/canvas-nest.min.js: -------------------------------------------------------------------------------- 1 | !function(){function o(w,v,i){return w.getAttribute(v)||i}function j(i){return document.getElementsByTagName(i)}function l(){var i=j("script"),w=i.length,v=i[w-1];return{l:w,z:o(v,"zIndex",-1),o:o(v,"opacity",0.5),c:o(v,"color","0,0,0"),n:o(v,"count",99)}}function k(){r=u.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,n=u.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function b(){e.clearRect(0,0,r,n);var w=[f].concat(t);var x,v,A,B,z,y;t.forEach(function(i){i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>r||i.x<0?-1:1,i.ya*=i.y>n||i.y<0?-1:1,e.fillRect(i.x-0.5,i.y-0.5,1,1);for(v=0;v=x.max/2&&(i.x-=0.03*B,i.y-=0.03*z),A=(x.max-y)/x.max,e.beginPath(),e.lineWidth=A/2,e.strokeStyle="rgba("+s.c+","+(A+0.2)+")",e.moveTo(i.x,i.y),e.lineTo(x.x,x.y),e.stroke())}}w.splice(w.indexOf(i),1)}),m(b)}var u=document.createElement("canvas"),s=l(),c="c_n"+s.l,e=u.getContext("2d"),r,n,m=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(i){window.setTimeout(i,1000/45)},a=Math.random,f={x:null,y:null,max:20000};u.id=c;u.style.cssText="position:fixed;top:0;left:0;z-index:"+s.z+";opacity:"+s.o;j("body")[0].appendChild(u);k(),window.onresize=k;window.onmousemove=function(i){i=i||window.event,f.x=i.clientX,f.y=i.clientY},window.onmouseout=function(){f.x=null,f.y=null};for(var t=[],p=0;s.n>p;p++){var h=a()*r,g=a()*n,q=2*a()-1,d=2*a()-1;t.push({x:h,y:g,xa:q,ya:d,max:6000})}setTimeout(function(){b()},100)}(); -------------------------------------------------------------------------------- /React/02 React State(状态).md: -------------------------------------------------------------------------------- 1 | # 02 React State(状态) 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | React 把组件看成是一个状态机(State Machines)。通过与用户的交互,实现不同状态,然后渲染 UI,让用户界面和数据保持一致。 8 | 9 | React 里,只需更新组件的 state,然后根据新的 state 重新渲染用户界面(不用操作 DOM)。 10 | 11 | 下面的例子中创建了 LikeButton 组件,getInitialState 方法用于定义初始状态,也就是一个对象,这个对象可以通过 this.state 属性读取。当用户点击组件,导致状态变化,this.setState 方法就修改状态值,每次修改以后,自动调用 this.render 方法,再次渲染组件。 12 | 13 | ```html 14 | 15 | 16 | 17 | 18 | React 学习 19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 49 | 50 | 51 | 52 | ``` 53 | 54 | 注意:onClick 等事件,on 后面第一个字母是大写的! -------------------------------------------------------------------------------- /_posts/2017-05-09-02 React State(状态).md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: React 3 | description: React 把组件看成是一个状态机(State Machines)。通过与用户的交互,实现不同状态,然后渲染 UI,让用户界面和数据保持一致。 4 | --- 5 | 6 | React 把组件看成是一个状态机(State Machines)。通过与用户的交互,实现不同状态,然后渲染 UI,让用户界面和数据保持一致。 7 | 8 | React 里,只需更新组件的 state,然后根据新的 state 重新渲染用户界面(不用操作 DOM)。 9 | 10 | 下面的例子中创建了 LikeButton 组件,getInitialState 方法用于定义初始状态,也就是一个对象,这个对象可以通过 this.state 属性读取。当用户点击组件,导致状态变化,this.setState 方法就修改状态值,每次修改以后,自动调用 this.render 方法,再次渲染组件。 11 | 12 | ```html 13 | 14 | 15 | 16 | 17 | React 学习 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 48 | 49 | 50 | 51 | ``` 52 | 53 | 注意:onClick 等事件,on 后面第一个字母是大写的! -------------------------------------------------------------------------------- /_includes/page.html: -------------------------------------------------------------------------------- 1 |
2 | {% include _partials/page-header.html %} 3 | {% comment %} tagcloud page support {% endcomment %} 4 | {% if page.type == "tags" %} 5 |
6 |
7 | {% if site.tags.size == 0 %} 8 | {{ __.counter.tag_cloud.zero }} 9 | {% elsif site.tags.size == 1 %} 10 | {{ __.counter.tag_cloud.one }} 11 | {% else %} 12 | {{ __.counter.tag_cloud.other | replace: '%d', site.tags.size }} 13 | {% endif %} 14 |
15 |
16 | {% assign min_font = 12 %} 17 | {% assign max_font = 30 %} 18 | {% assign amount = 200 %} 19 | {% assign color = true %} 20 | {% assign start_color = '204,204,204' %} 21 | {% assign end_color = '17,17,17' %} 22 | {% include _helper/tagcloud.html %} 23 | {{ tagcloud }} 24 |
25 |
26 | {% elsif page.type == 'categories' %} 27 |
28 |
29 | {% if site.categories.size == 0 %} 30 | {{ __.counter.categories.zero }} 31 | {% elsif site.categories.size == 1 %} 32 | {{ __.counter.categories.one }} 33 | {% else %} 34 | {{ __.counter.categories.other | replace: '%d', site.categories.size }} 35 | {% endif %} 36 |
37 |
38 | {% include _helper/list_categories.html %} 39 | {{ list_categories }} 40 |
41 |
42 | {% else %} 43 | {{ content }} 44 | {% endif %} 45 |
46 | -------------------------------------------------------------------------------- /_sass/_schemes/Mist/_posts-expanded.scss: -------------------------------------------------------------------------------- 1 | // Post Expanded 2 | // -------------------------------------------------- 3 | .posts-expand { 4 | padding-top: 0; 5 | 6 | .post-title, 7 | .post-meta { 8 | text-align: $site-meta-text-align; 9 | @include mobile() { text-align: center; } 10 | } 11 | .post-eof { display: none; } 12 | 13 | .post { margin-top: 120px; } 14 | .post:first-child { margin-top: 0; } 15 | 16 | .post-meta { 17 | margin-top: 5px; 18 | margin-bottom: 20px; 19 | } 20 | 21 | .post-title { 22 | position: relative; 23 | font-size: $font-size-headings-base; 24 | font-weight: 400; 25 | @include mobile() { font-size: $font-size-headings-smaller; } 26 | @include desktop-large() { font-size: $font-size-headings-large; } 27 | } 28 | .post-title:hover:before { background: $black-deep; } 29 | 30 | .post-body img { margin: 0; } 31 | 32 | .post-tags { 33 | text-align: left; 34 | a { 35 | padding: 1px 5px; 36 | background: $whitesmoke; 37 | border-bottom: none; 38 | } 39 | a:hover { background: $grey-light; } 40 | } 41 | .post-nav { margin-top: 40px; } 42 | } 43 | 44 | .post-button { 45 | margin-top: 20px; 46 | text-align: left; 47 | 48 | a { 49 | margin: 0 8px 8px 0 !important; 50 | padding: 0; 51 | font-size: $font-size-base; 52 | color: $grey-dim; 53 | background: none; 54 | border: none; 55 | border-bottom: 2px solid $grey-dim; 56 | transition-property: border; 57 | 58 | @include mobile() { font-size: $font-size-small; } 59 | @include desktop-large() { font-size: $font-size-large; } 60 | 61 | 62 | &:hover { border-bottom-color: $black-deep; } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /_includes/_partials/comments.html: -------------------------------------------------------------------------------- 1 | {% if page.comments %} 2 |
3 | {% if site.duoshuo and site.duoshuo.shortname or site.duoshuo_shortname %} 4 |
6 |
7 | {% elsif site.facebook_sdk.enable and site.facebook_comments_plugin.enable %} 8 |
13 |
14 | {% elsif site.vkontakte_api.enable and site.vkontakte_api.comments %} 15 |
16 | {% elsif site.disqus.enable %} 17 |
18 | 22 |
23 | {% elsif site.hypercomments_id %} 24 |
25 | {% elsif site.gentie_productKey %} 26 |
27 | {% elsif site.youyan_uid %} 28 |
29 | {% elsif site.livere_uid %} 30 |
31 | {% elsif site.changyan.appid and site.changyan.appkey %} 32 |
33 | {% endif %} 34 |
35 | {% endif %} 36 | -------------------------------------------------------------------------------- /assets/lib/pace/pace-theme-center-circle.min.css: -------------------------------------------------------------------------------- 1 | .pace,.pace .pace-progress{z-index:2000;left:0;top:0;height:6rem}.pace{-webkit-pointer-events:none;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-perspective:12rem;-moz-perspective:12rem;-ms-perspective:12rem;-o-perspective:12rem;perspective:12rem;position:fixed;width:6rem;margin:auto;right:0;bottom:0}.pace.pace-inactive .pace-progress{display:none}.pace .pace-progress{display:block;position:absolute;width:6rem!important;line-height:6rem;font-size:2rem;border-radius:50%;background:rgba(34,153,221,.8);color:#fff;font-family:"Helvetica Neue",sans-serif;font-weight:100;text-align:center;-webkit-animation:pace-theme-center-circle-spin linear infinite 2s;-moz-animation:pace-theme-center-circle-spin linear infinite 2s;-ms-animation:pace-theme-center-circle-spin linear infinite 2s;-o-animation:pace-theme-center-circle-spin linear infinite 2s;animation:pace-theme-center-circle-spin linear infinite 2s;-webkit-transform-style:preserve-3d;-moz-transform-style:preserve-3d;-ms-transform-style:preserve-3d;-o-transform-style:preserve-3d;transform-style:preserve-3d}.pace .pace-progress:after{content:attr(data-progress-text);display:block}@-webkit-keyframes pace-theme-center-circle-spin{from{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(360deg)}}@-moz-keyframes pace-theme-center-circle-spin{from{-moz-transform:rotateY(0)}to{-moz-transform:rotateY(360deg)}}@-ms-keyframes pace-theme-center-circle-spin{from{-ms-transform:rotateY(0)}to{-ms-transform:rotateY(360deg)}}@-o-keyframes pace-theme-center-circle-spin{from{-o-transform:rotateY(0)}to{-o-transform:rotateY(360deg)}}@keyframes pace-theme-center-circle-spin{from{transform:rotateY(0)}to{transform:rotateY(360deg)}} -------------------------------------------------------------------------------- /_data/languages/zh-hk.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: 歸檔 3 | category: 分類 4 | tag: 標籤 5 | schedule: 日程表 6 | archives: 歸檔 7 | categories: 分類 8 | tags: 標籤 9 | about: 關於 10 | 11 | author: 博主 12 | 13 | menu: 14 | home: 首頁 15 | archives: 歸檔 16 | categories: 分類 17 | tags: 標籤 18 | about: 關於 19 | search: 檢索 20 | schedule: 日程表 21 | sitemap: 站點地圖 22 | commonweal: 公益404 23 | 24 | sidebar: 25 | overview: 本站概覽 26 | toc: 文章目錄 27 | 28 | post: 29 | created: 創建於 30 | modified: 更新於 31 | sticky: 置頂 32 | posted: 發表於 33 | in: 分類於 34 | read_more: 閱讀全文 35 | untitled: 未命名 36 | toc_empty: 此文章未包含目錄 37 | visitors: 閱讀次數 38 | wordcount: 字數統計 39 | min2read: 閱讀時長 40 | copyright: 41 | author: Post author 42 | link: Post link 43 | license_title: Copyright Notice 44 | license_content: 'All articles in this blog are licensed under 45 | %s unless stating additionally.' 46 | 47 | page: 48 | totally: 共有 49 | tags: 標籤 50 | 51 | footer: 52 | powered: "由 %s 強力驅動" 53 | theme: 主題 54 | 55 | counter: 56 | tag_cloud: 57 | zero: 暫無標籤 58 | one: 目前共有 1 個標籤 59 | other: "目前共有 %d 個標籤" 60 | 61 | categories: 62 | zero: 暫無分類 63 | one: 目前共有 1 個分類 64 | other: "目前共有 %d 個分類" 65 | 66 | archive_posts: 67 | zero: 暫無文章。 68 | one: 目前共有 1 篇文章。 69 | other: "目前共有 %d 篇文章。" 70 | 71 | state: 72 | posts: 文章 73 | pages: 頁面 74 | tags: 標籤 75 | categories: 分類 76 | 77 | search: 78 | placeholder: 搜索... 79 | 80 | cheers: 81 | um: 嗯.. 82 | ok: OK 83 | nice: 好 84 | good: 很好 85 | great: 非常好 86 | excellent: 激爆好 87 | 88 | keep_on: 繼續努力。 89 | 90 | symbol: 91 | comma: ', ' 92 | period: '。 ' 93 | colon: ':' 94 | -------------------------------------------------------------------------------- /_data/languages/zh-tw.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: 歸檔 3 | category: 分類 4 | tag: 標籤 5 | schedule: 日程表 6 | archives: 歸檔 7 | categories: 分類 8 | tags: 標籤 9 | about: 關於 10 | 11 | author: 博主 12 | 13 | menu: 14 | home: 首頁 15 | archives: 歸檔 16 | categories: 分類 17 | tags: 標籤 18 | about: 關於 19 | search: 檢索 20 | schedule: 日程表 21 | sitemap: 站點地圖 22 | commonweal: 公益404 23 | 24 | sidebar: 25 | overview: 本站概覽 26 | toc: 文章目錄 27 | 28 | post: 29 | created: 創建於 30 | modified: 更新於 31 | sticky: 置頂 32 | posted: 發表於 33 | in: 分類於 34 | read_more: 閱讀全文 35 | untitled: 未命名 36 | toc_empty: 此文章未包含目錄 37 | visitors: 閱讀次數 38 | wordcount: 字數統計 39 | min2read: 閱讀時長 40 | copyright: 41 | author: Post author 42 | link: Post link 43 | license_title: Copyright Notice 44 | license_content: 'All articles in this blog are licensed under 45 | %s unless stating additionally.' 46 | 47 | page: 48 | totally: 共有 49 | tags: 標籤 50 | 51 | footer: 52 | powered: "由 %s 強力驅動" 53 | theme: 主題 54 | 55 | counter: 56 | tag_cloud: 57 | zero: 暫無標籤 58 | one: 目前共計 1 個標籤 59 | other: "目前共計 %d 個標籤" 60 | 61 | categories: 62 | zero: 暫無分類 63 | one: 目前共計 1 個分類 64 | other: "目前共計 %d 個分類" 65 | 66 | archive_posts: 67 | zero: 暫無文章。 68 | one: 目前共計 1 篇文章。 69 | other: "目前共計 %d 篇文章。" 70 | 71 | state: 72 | posts: 文章 73 | pages: 頁面 74 | tags: 標籤 75 | categories: 分類 76 | 77 | search: 78 | placeholder: 搜索... 79 | 80 | cheers: 81 | um: 嗯.. 82 | ok: OK 83 | nice: 好 84 | good: 很好 85 | great: 非常好 86 | excellent: 非常屌 87 | 88 | keep_on: 繼續努力。 89 | 90 | symbol: 91 | comma: ', ' 92 | period: '。 ' 93 | colon: ':' 94 | -------------------------------------------------------------------------------- /Java Basis/008 如何用java语言实现C Sharp中的ref关键字(按引用传递参数)的效果.md: -------------------------------------------------------------------------------- 1 | # 如何用java语言实现C#中的ref关键字(按引用传递参数)的效果 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 在上一篇文章中([Java的参数传递是值传递还是引用传递](http://www.cnblogs.com/nnngu/p/8299724.html)),主要分析了java语言的参数传递只有按值传递而没有按引用传递。 8 | 9 | 先看一下微软的C#文档对按引用传递的定义(如下截图): 10 | 11 | ![][1] 12 | 13 | **那么java语言如何实现C#中ref关键字(按引用传递参数)的效果呢?** 14 | 15 | ## 思路 16 | 17 | 我们可以把需要传递的参数再封装一层,即定义一个新的类,使得需要传递的参数成为新类的成员变量,传递参数时就传递这个新类的实例。以此达到ref关键字的效果。 18 | 19 | ## 代码演示 20 | 21 | RefDemo.java 22 | 23 |
public class RefDemo {
24 |     public static void main(String[] args) {
25 |         Person person1 = new Person();
26 |         PersonPack personPack = new PersonPack();
27 |         personPack.person = person1;
28 | 
29 |         // 打印person
30 |         System.out.println(personPack.person);
31 | 
32 |         change(personPack);
33 | 
34 |         // 再打印person
35 |         System.out.println(personPack.person);
36 |     }
37 | 
38 |     public static void change(PersonPack personPack) {
39 |         Person person2 = new Person();
40 |         personPack.person = person2;
41 |     }
42 | }
43 | 
44 | /**
45 |  * Person类
46 |  */
47 | class Person {
48 | 
49 | }
50 | 
51 | /**
52 |  * 包装类:PersonPack
53 |  */
54 | class PersonPack {
55 |     public Person person;
56 | }
57 | 58 | 运行结果: 59 | 60 | ![][2] 61 | 62 | 可以看出两次打印person的地址值不一样,即调用完change() 方法之后,person引用(指向) 了另一个对象! 63 | 64 | 65 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516472077285.jpg 66 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516472129252.jpg -------------------------------------------------------------------------------- /_posts/2017-04-08-008 如何用java语言实现C Sharp中的ref关键字(按引用传递参数)的效果.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: java语言如何实现C#中ref关键字(按引用传递参数)的效果呢? 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | 在上一篇文章中([Java的参数传递是值传递还是引用传递](http://www.cnblogs.com/nnngu/p/8299724.html)),主要分析了java语言的参数传递只有按值传递而没有按引用传递。 11 | 12 | 先看一下微软的C#文档对按引用传递的定义(如下截图): 13 | 14 | ![][1] 15 | 16 | **那么java语言如何实现C#中ref关键字(按引用传递参数)的效果呢?** 17 | 18 | ## 思路 19 | 20 | 我们可以把需要传递的参数再封装一层,即定义一个新的类,使得需要传递的参数成为新类的成员变量,传递参数时就传递这个新类的实例。以此达到ref关键字的效果。 21 | 22 | ## 代码演示 23 | 24 | RefDemo.java 25 | 26 |
public class RefDemo {
27 |     public static void main(String[] args) {
28 |         Person person1 = new Person();
29 |         PersonPack personPack = new PersonPack();
30 |         personPack.person = person1;
31 | 
32 |         // 打印person
33 |         System.out.println(personPack.person);
34 | 
35 |         change(personPack);
36 | 
37 |         // 再打印person
38 |         System.out.println(personPack.person);
39 |     }
40 | 
41 |     public static void change(PersonPack personPack) {
42 |         Person person2 = new Person();
43 |         personPack.person = person2;
44 |     }
45 | }
46 | 
47 | /**
48 |  * Person类
49 |  */
50 | class Person {
51 | 
52 | }
53 | 
54 | /**
55 |  * 包装类:PersonPack
56 |  */
57 | class PersonPack {
58 |     public Person person;
59 | }
60 | 61 | 运行结果: 62 | 63 | ![][2] 64 | 65 | 可以看出两次打印person的地址值不一样,即调用完change() 方法之后,person引用(指向) 了另一个对象! 66 | 67 | 68 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516472077285.jpg 69 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516472129252.jpg -------------------------------------------------------------------------------- /_data/languages/id.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: Arsip 3 | category: Kategori 4 | tag: Tag 5 | archives: Arsip 6 | categories: Kategori 7 | tags: Tags 8 | about: Tentang 9 | 10 | author: Penulis 11 | 12 | menu: 13 | home: Beranda 14 | archives: Arsip 15 | categories: Kategori 16 | tags: Tags 17 | about: Tentang 18 | search: Pencarian 19 | 20 | sidebar: 21 | overview: Ikhtisar 22 | toc: Daftar Isi 23 | 24 | post: 25 | sticky: Sticky 26 | posted: Diposting di 27 | modified: Updated at 28 | in: Di 29 | read_more: Baca lebih 30 | untitled: Tidak ada title 31 | toc_empty: Posting ini tidak memiliki Daftar Isi 32 | visitors: Pengunjung 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: Total 44 | tags: tags 45 | 46 | footer: 47 | powered: "Powered by %s" 48 | theme: Tema 49 | 50 | counter: 51 | tag_cloud: 52 | zero: Tidak ada tags 53 | one: 1 total tag 54 | other: "%d total tags" 55 | 56 | categories: 57 | zero: Tidak ada kategori 58 | one: 1 total categori 59 | other: "%d total kategori" 60 | 61 | archive_posts: 62 | zero: Tidak ada posting. 63 | one: 1 posting. 64 | other: "%d total posting." 65 | 66 | state: 67 | posts: posting 68 | pages: halaman 69 | tags: tags 70 | categories: kategori 71 | 72 | cheers: 73 | um: Um.. 74 | ok: OK 75 | nice: Bagus 76 | good: Bagus 77 | great: Besar 78 | excellent: Baik 79 | 80 | keep_on: Terus Posting. 81 | 82 | symbol: 83 | comma: ', ' 84 | period: '. ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /Java Basis/013 BIO、NIO、AIO的区别.md: -------------------------------------------------------------------------------- 1 | # 013 BIO、NIO、AIO的区别 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | IO通常分为几种,BIO(阻塞 Blocking IO)、NIO(非阻塞 Non-Blocking IO)、AIO(异步非阻塞)。 8 | 9 | ## BIO 10 | 11 | 在JDK1.4出来之前,我们建立网络连接的时候采用BIO模式,需要先在服务端启动一个ServerSocket,然后在客户端启动Socket来对服务端进行通信,默认情况下服务端需要建立一堆线程等待请求,而客户端发送请求后,先询问服务端是否有线程响应,如果没有则会一直等待或者遭到拒绝请求。BIO模型图如下: 12 | 13 | ![][1] 14 | 15 | ### BIO优缺点 16 | * 优点 17 | * 模型简单 18 | * 编码简单 19 | * 缺点 20 | * 性能瓶颈低 21 | 22 | 优缺点很明显。这里主要说下缺点:主要瓶颈在线程上。每个连接都会建立一个线程。虽然线程消耗比进程小,但是一台机器实际上能建立的有效线程有限,以Java来说,1.5以后,一个线程大致消耗1M内存!且随着线程数量的增加,CPU切换线程上下文的消耗也随之增加,在高过某个阀值后,继续增加线程,性能不增反降!而同样因为一个连接就新建一个线程,所以编码模型很简单! 23 | 24 | 就性能瓶颈这一点,就确定了BIO并不适合进行高性能服务器的开发!像Tomcat这样的Web服务器,从7开始就从BIO改成了NIO,来提高服务器性能! 25 | 26 | ## NIO 27 | 28 | NIO本身是基于事件驱动思想来完成的,其主要想解决的是BIO的大并发问题:在使用同步I/O的网络应用中,如果要同时处理多个客户端请求,就必须使用多线程来处理。也就是说,将每一个客户端请求分配给一个线程来单独处理。这样做虽然可以达到我们的要求,但同时又会带来另外一个问题。由于每创建一个线程,就要为这个线程分配一定的内存空间(也叫工作存储器),而且操作系统本身也对线程的总数有一定的限制。如果客户端过多,服务端程序可能会因为不堪重负而拒绝客户端的请求,甚至服务器可能会因此而瘫痪。 29 | 30 | NIO基于Reactor,当socket有流可读或可写入socket时,操作系统会相应的通知应用程序进行处理,应用再将流读取到缓冲区或写入操作系统。 也就是说,这个时候,已经不是一个连接就要对应一个处理线程了,而是有效的请求,对应一个线程,当连接没有数据时,是没有工作线程来处理的。 31 | 32 | BIO与NIO一个比较重要的不同,是我们使用BIO的时候往往会引入多线程,每个连接一个单独的线程;而NIO则是使用单线程或者只使用少量的多线程。NIO模型图如下: 33 | 34 | ![][2] 35 | 36 | ### NIO优缺点 37 | * 优点 38 | * 性能瓶颈高 39 | * 缺点 40 | * 模型复杂 41 | * 编码复杂 42 | * 需处理半包问题 43 | 44 | NIO的优缺点和BIO就完全相反了!性能高,不用一个连接就建一个线程,可以一个线程处理所有的连接!相应的,编码就复杂很多。还有一个问题,由于是非阻塞的,应用无法知道什么时候消息读完! 45 | 46 | BIO和NIO的对比图: 47 | 48 | ![][3] 49 | 50 | ## AIO 51 | 52 | AIO没有前两者普及,暂不讨论! 53 | 54 | 55 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516814717421.jpg 56 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516814803100.jpg 57 | [3]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516812993887.jpg -------------------------------------------------------------------------------- /_sass/_common/components/post/post.scss: -------------------------------------------------------------------------------- 1 | .post-body { 2 | font-family: $font-family-posts; 3 | @include mobile() { 4 | word-break: break-word; 5 | } 6 | } 7 | 8 | .post-body .fancybox img { 9 | display: block !important; 10 | margin: 0 auto; 11 | cursor: pointer; 12 | cursor: zoom-in; 13 | cursor: -webkit-zoom-in; 14 | } 15 | 16 | .post-body img.emoji { 17 | border: 0 !important; 18 | display: inline; 19 | vertical-align: sub; 20 | } 21 | 22 | .post-body .image-caption, %caption { 23 | margin: 10px auto 15px; 24 | text-align: center; 25 | font-size: $font-size-base; 26 | color: $grey-dark; 27 | font-weight: bold; 28 | line-height: 1; 29 | } 30 | 31 | .post-body .figure .caption { 32 | @extend %caption; 33 | } 34 | 35 | .post-sticky-flag { 36 | display: inline-block; 37 | font-size: 16px; 38 | -ms-transform: rotate(30deg); 39 | @include transform(rotate(30deg)); 40 | } 41 | 42 | @import "post-expand"; 43 | @import "post-collapse"; 44 | @import "post-type"; 45 | @import "post-title"; 46 | @import "post-meta"; 47 | @import "post-button"; 48 | @import "post-tags"; 49 | @import "post-nav"; 50 | @import "post-eof"; 51 | @import "post-gallery"; 52 | 53 | @import "post-reward"; 54 | @if jekyll-config('alipay') or jekyll-config('wechatpay') { 55 | @include post-reward; 56 | } 57 | 58 | @import "post-copyright"; 59 | @if jekyll-config('post_copyright.enable') { 60 | @include post-copyright; 61 | } 62 | 63 | @import "post-wordcount"; 64 | @if not jekyll-config('post_wordcount.separated_meta') { 65 | @include post-wordcount; 66 | } 67 | 68 | @import "post-widgets"; 69 | @if (jekyll-config('facebook_sdk.enable') and jekyll-config('facebook_sdk.like_button')) or (jekyll-config('vkontakte_api.enable') and jekyll-config('vkontakte_api.like')) or jekyll-config('rating.enable') { 70 | @include post-widgets; 71 | } 72 | -------------------------------------------------------------------------------- /assets/lib/canvas-ribbon/canvas-ribbon.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zproo on 2017/4/3. 3 | */ 4 | ! function() { 5 | document.addEventListener("touchstart", (e) => { 6 | targetA = true; 7 | }); 8 | document.addEventListener("touchmove", (e) => { 9 | targetA = false 10 | }) 11 | document.addEventListener("click", (e) => { 12 | targetA = true 13 | }) 14 | function e() { 15 | if (targetA) { 16 | for (a.clearRect(0, 0, d, r), i = [{ 17 | x: 0, 18 | y: .7 * r + u 19 | }, { 20 | x: 0, 21 | y: .7 * r - u 22 | }]; i[1].x < d + u;) t(i[0], i[1]) 23 | targetA = false 24 | } 25 | } 26 | 27 | function t(e, t) { 28 | a.beginPath(), a.moveTo(e.x, e.y), a.lineTo(t.x, t.y); 29 | var o = t.x + (2 * x() - .25) * u, 30 | c = n(t.y); 31 | a.lineTo(o, c), a.closePath(), h -= m / -50, a.fillStyle = "#" + (127 * s(h) + 128 << 16 | 127 * s(h + m / 3) + 128 << 8 | 127 * s(h + m / 3 * 2) + 128).toString(16), a.fill(), i[0] = i[1], i[1] = { 32 | x: o, 33 | y: c 34 | } 35 | } 36 | 37 | function n(e) { 38 | var t = e + (2 * x() - 1.1) * u; 39 | return t > r || 0 > t ? n(e) : t 40 | } 41 | 42 | var o = document.createElement("canvas"); 43 | o.style.cssText = "position:fixed;top:0;left:0;z-index:-1", document.getElementsByTagName("body")[0].appendChild(o); 44 | var i, c = o, 45 | a = c.getContext("2d"), 46 | l = window.devicePixelRatio || 1, 47 | d = window.innerWidth, 48 | r = window.innerHeight, 49 | u = 90, 50 | f = Math, 51 | h = 0, 52 | m = 2 * f.PI, 53 | s = f.cos, 54 | x = f.random, 55 | targetA = false; 56 | c.width = d * l, c.height = r * l, a.scale(l, l), a.globalAlpha = .6, document.onclick = e, document.ontouchend = e, setTimeout(function() { 57 | targetA = true; 58 | e(); 59 | }, 100); 60 | }(); 61 | -------------------------------------------------------------------------------- /_data/languages/pt-BR.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: Arquivo 3 | category: Categoria 4 | tag: Tag 5 | archives: Arquivos 6 | categories: Categorias 7 | tags: Tags 8 | about: Sobre 9 | 10 | author: Autor 11 | 12 | menu: 13 | home: Home 14 | archives: Arquivos 15 | categories: Categorias 16 | tags: Tags 17 | about: Sobre 18 | search: Pesquisar 19 | 20 | sidebar: 21 | overview: Visão geral 22 | toc: Tabela de conteúdo 23 | 24 | post: 25 | sticky: Sticky 26 | posted: Postado em 27 | modified: Updated at 28 | in: Em 29 | read_more: Leia mais 30 | untitled: Sem título 31 | toc_empty: Este post não possui tabela de conteúdo 32 | visitors: Visitantes 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: Totalmente 44 | tags: tags 45 | 46 | footer: 47 | powered: "Feito com %s" 48 | theme: Tema 49 | 50 | counter: 51 | tag_cloud: 52 | zero: Sem tags 53 | one: 1 tag no total de 54 | other: "%d tags no total de" 55 | 56 | categories: 57 | zero: Sem categoria 58 | one: 1 categoria no total de 59 | other: "%d categoria no total de" 60 | 61 | archive_posts: 62 | zero: Sem posts. 63 | one: 1 post. 64 | other: "%d posts no total." 65 | 66 | state: 67 | posts: Posts 68 | pages: Páginas 69 | tags: Tags 70 | categories: Categorias 71 | 72 | cheers: 73 | um: Uhmmmm... 74 | ok: OK 75 | nice: Bom 76 | good: Muito Bom 77 | great: Ótimo 78 | excellent: Excelente 79 | 80 | keep_on: Continuar no post. 81 | 82 | symbol: 83 | comma: '. ' 84 | period: ', ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /_data/languages/fr-FR.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: Archive 3 | category: Catégorie 4 | tag: Tag 5 | archives: Archives 6 | categories: Categories 7 | tags: Tags 8 | about: A propos 9 | 10 | author: Author 11 | 12 | menu: 13 | home: Accueil 14 | archives: Archives 15 | categories: Categories 16 | tags: Tags 17 | about: A propos 18 | search: recherche 19 | 20 | sidebar: 21 | overview: Ensemble 22 | toc: Table Des Matières 23 | 24 | post: 25 | sticky: Sticky 26 | posted: Posté le 27 | modified: Updated at 28 | in: In 29 | read_more: Lire la suite 30 | untitled: Non titré 31 | toc_empty: This post does not have a Table of Contents 32 | visitors: Visitors 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: Total 44 | tags: tags 45 | 46 | footer: 47 | powered: "Powered by %s" 48 | theme: Thème 49 | 50 | counter: 51 | tag_cloud: 52 | zero: Aucun tags 53 | one: 1 tag au total 54 | other: "%d tags au total" 55 | 56 | categories: 57 | zero: Aucun categories 58 | one: 1 category au total 59 | other: "%d categories au total" 60 | 61 | archive_posts: 62 | zero: Aucun article. 63 | one: 1 article. 64 | other: "%d articles au total." 65 | 66 | state: 67 | posts: articles 68 | pages: pages 69 | tags: tags 70 | categories: categories 71 | 72 | cheers: 73 | um: Um.. 74 | ok: OK 75 | nice: Jolie 76 | good: Bien 77 | great: Super 78 | excellent: Excellent 79 | 80 | keep_on: Et ca ne fait que commencer. 81 | 82 | symbol: 83 | comma: ', ' 84 | period: '. ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /assets/js/src/exturl.js: -------------------------------------------------------------------------------- 1 | /* global NexT: true */ 2 | 3 | $(document).ready(function () { 4 | 5 | // Create Base64 Object 6 | var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/rn/g,"n");var t="";for(var n=0;n127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}}; 7 | 8 | $('.exturl').on('click', function () { 9 | var $exturl = $(this).attr('data-url'); 10 | var $decurl = Base64.decode($exturl); 11 | window.open($decurl, '_blank'); 12 | return false; 13 | }); 14 | 15 | }); 16 | -------------------------------------------------------------------------------- /_data/languages/pt.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: Arquivo 3 | category: Categoria 4 | tag: Tag 5 | archives: Arquivos 6 | categories: Categorias 7 | tags: Tags 8 | about: Sobre 9 | 10 | author: Author 11 | 12 | menu: 13 | home: Home 14 | archives: Arquivos 15 | categories: Categorias 16 | tags: Tags 17 | about: Sobre 18 | search: Pesquisa 19 | 20 | sidebar: 21 | overview: Visão Geral 22 | toc: Tabela de Conteúdo 23 | 24 | post: 25 | sticky: Sticky 26 | posted: Postado em 27 | modified: Updated at 28 | in: Em 29 | read_more: Ler mais 30 | untitled: Sem título 31 | toc_empty: Esta publicação não possui uma tabela de conteúdo 32 | visitors: Visitors 33 | wordcount: Words count in article 34 | min2read: Reading time 35 | copyright: 36 | author: Post author 37 | link: Post link 38 | license_title: Copyright Notice 39 | license_content: 'All articles in this blog are licensed under 40 | %s unless stating additionally.' 41 | 42 | page: 43 | totally: Totalmente 44 | tags: tags 45 | 46 | footer: 47 | powered: "Desenvolvido com amor com %s" 48 | theme: Tema 49 | 50 | counter: 51 | tag_cloud: 52 | zero: Sem tags 53 | one: 1 tag no total 54 | other: "%d tags no total" 55 | 56 | categories: 57 | zero: Sem categorias 58 | one: 1 categoria no total 59 | other: "%d categorias no total" 60 | 61 | archive_posts: 62 | zero: Sem publicações. 63 | one: 1 post. 64 | other: "%d publicações no total." 65 | 66 | state: 67 | posts: publicações 68 | pages: páginas 69 | tags: tags 70 | categories: categorias 71 | 72 | cheers: 73 | um: Um.. 74 | ok: OK 75 | nice: Legal 76 | good: Bom 77 | great: Grandioso 78 | excellent: Excelente 79 | 80 | keep_on: Mantenha-se publicando! 81 | 82 | symbol: 83 | comma: ', ' 84 | period: '. ' 85 | colon: ':' 86 | -------------------------------------------------------------------------------- /_data/languages/de.yml: -------------------------------------------------------------------------------- 1 | title: 2 | archive: Archiv 3 | category: Kategorie 4 | tag: Tag 5 | archives: Archiv 6 | categories: Kategorien 7 | tags: Tags 8 | about: Über 9 | 10 | author: Author 11 | 12 | menu: 13 | home: Startseite 14 | archives: Archiv 15 | categories: Kategorien 16 | tags: Tags 17 | about: Über 18 | feed: RSS 19 | search: Suche 20 | 21 | sidebar: 22 | overview: Übersicht 23 | toc: Inhaltsverzeichnis 24 | 25 | post: 26 | created: Post created 27 | sticky: Sticky 28 | posted: Veröffentlicht am 29 | modified: Updated at 30 | in: in 31 | read_more: Weiterlesen 32 | untitled: Unbenannt 33 | toc_empty: Dieser Artikel hat kein Inhaltsverzeichnis 34 | visitors: Visitors 35 | wordcount: Words count in article 36 | min2read: Reading time 37 | copyright: 38 | author: Post author 39 | link: Post link 40 | license_title: Copyright Notice 41 | license_content: 'All articles in this blog are licensed under 42 | %s unless stating additionally.' 43 | 44 | page: 45 | totally: Gesamt 46 | tags: tags 47 | 48 | footer: 49 | powered: "Erstellt mit %s" 50 | theme: Theme 51 | 52 | counter: 53 | tag_cloud: 54 | zero: Keine Tags 55 | one: Insgesamt ein Tag 56 | other: "Insgesamt %d Tags" 57 | 58 | categories: 59 | zero: Keine Kategorien 60 | one: Insgesamt eine Kategorie 61 | other: "Insgesamt %d Kategorien" 62 | 63 | archive_posts: 64 | zero: Keine Artikel vorhanden. 65 | one: Ein Artikel. 66 | other: "Insgesamt %d Artikel." 67 | 68 | state: 69 | posts: Artikel 70 | pages: Seiten 71 | tags: Tags 72 | categories: Kategorien 73 | 74 | cheers: 75 | um: Öhm.. 76 | ok: OK 77 | nice: Schön 78 | good: Gut 79 | great: Wunderbar 80 | excellent: Exzellent 81 | 82 | keep_on: Bleib dran. 83 | 84 | symbol: 85 | comma: '. ' 86 | period: ', ' 87 | colon: ':' 88 | -------------------------------------------------------------------------------- /Java Basis/002 Java中的String类能否被继承?为什么?.md: -------------------------------------------------------------------------------- 1 | # Java中的String类能否被继承?为什么? 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 不能被继承,因为String类有final修饰符,而final修饰的类是不能被继承的。 8 | 9 | ## **Java对String类的定义:** 10 | 11 | ``` 12 | public final class String implements java.io.Serializable, Comparable, CharSequence { 13 | // 省略...  14 | } 15 | ``` 16 | 17 | ## final修饰符的用法: 18 | 19 | 1.修饰类 20 | 21 |   当用final修饰一个类时,表明这个类不能被继承。final类中的成员变量可以根据需要设为final,但是要注意final类中的所有成员方法都会被隐式地指定为final方法。 22 | 23 | ![][1] 24 | 25 | 2.修饰方法 26 | 27 |   使用final修饰方法的原因有两个。第一个原因是把方法锁定,以防任何继承类修改它的含义;第二个原因是效率。在早期的Java实现版本中,会将final方法转为内嵌调用。但是如果方法过于庞大,可能看不到内嵌调用带来的任何性能提升。在最近的Java版本中,不需要使用final方法进行这些优化了。 28 | 29 |   因此,只有在想明确禁止该方法在子类中被覆盖的情况下才将方法设置为final。 30 | 31 |   注:一个类中的private方法会隐式地被指定为final方法。 32 | 33 | 3.修饰变量 34 | 35 |   对于被final修饰的变量,如果是基本数据类型的变量,则其数值一旦在初始化之后便不能更改;如果是引用类型的变量,则在对其初始化之后便不能再让其指向另一个对象。虽然不能再指向其他对象,但是它指向的对象的内容是可变的。 36 | 37 | ## final和static的区别: 38 | 39 | 很多时候会容易把static和final关键字混淆,static作用于成员变量用来表示只保存一份副本,而final的作用是用来保证变量不可变。看下面这个例子: 40 | 41 | ``` 42 | 1 public class Demo1 { 43 | 2 public static void main(String[] args) { 44 | 3 MyClass myClass1 = new MyClass(); 45 | 4 MyClass myClass2 = new MyClass(); 46 | 5 System.out.println(myClass1.i); 47 | 6 System.out.println(myClass2.i); 48 | 7 System.out.println(myClass1.j); 49 | 8 System.out.println(myClass2.j); 50 | 9 51 | 10 } 52 | 11 } 53 | 12 54 | 13 class MyClass { 55 | 14 public final double i = Math.random(); 56 | 15 public static double j = Math.random(); 57 | 16 } 58 | ``` 59 | 60 |  运行结果: 61 | 62 | ``` 63 | 0.3222977275463088 64 | 0.2565532218939688 65 | 0.36856868882926397 66 | 0.36856868882926397 67 | ``` 68 | 69 | 每次打印的两个j值都是一样的,而i的值却是不同的。从这里就可以知道final和static变量的区别了。 70 | 71 | 72 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516470278278.jpg -------------------------------------------------------------------------------- /_posts/2017-04-13-013 BIO、NIO、AIO的区别.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: IO通常分为几种,BIO(阻塞 Blocking IO)、NIO(非阻塞 Non-Blocking IO)、AIO(异步非阻塞)。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | IO通常分为几种,BIO(阻塞 Blocking IO)、NIO(非阻塞 Non-Blocking IO)、AIO(异步非阻塞)。 11 | 12 | ## BIO 13 | 14 | 在JDK1.4出来之前,我们建立网络连接的时候采用BIO模式,需要先在服务端启动一个ServerSocket,然后在客户端启动Socket来对服务端进行通信,默认情况下服务端需要建立一堆线程等待请求,而客户端发送请求后,先询问服务端是否有线程响应,如果没有则会一直等待或者遭到拒绝请求。BIO模型图如下: 15 | 16 | ![][1] 17 | 18 | ### BIO优缺点 19 | * 优点 20 | * 模型简单 21 | * 编码简单 22 | * 缺点 23 | * 性能瓶颈低 24 | 25 | 优缺点很明显。这里主要说下缺点:主要瓶颈在线程上。每个连接都会建立一个线程。虽然线程消耗比进程小,但是一台机器实际上能建立的有效线程有限,以Java来说,1.5以后,一个线程大致消耗1M内存!且随着线程数量的增加,CPU切换线程上下文的消耗也随之增加,在高过某个阀值后,继续增加线程,性能不增反降!而同样因为一个连接就新建一个线程,所以编码模型很简单! 26 | 27 | 就性能瓶颈这一点,就确定了BIO并不适合进行高性能服务器的开发!像Tomcat这样的Web服务器,从7开始就从BIO改成了NIO,来提高服务器性能! 28 | 29 | ## NIO 30 | 31 | NIO本身是基于事件驱动思想来完成的,其主要想解决的是BIO的大并发问题:在使用同步I/O的网络应用中,如果要同时处理多个客户端请求,就必须使用多线程来处理。也就是说,将每一个客户端请求分配给一个线程来单独处理。这样做虽然可以达到我们的要求,但同时又会带来另外一个问题。由于每创建一个线程,就要为这个线程分配一定的内存空间(也叫工作存储器),而且操作系统本身也对线程的总数有一定的限制。如果客户端过多,服务端程序可能会因为不堪重负而拒绝客户端的请求,甚至服务器可能会因此而瘫痪。 32 | 33 | NIO基于Reactor,当socket有流可读或可写入socket时,操作系统会相应的通知应用程序进行处理,应用再将流读取到缓冲区或写入操作系统。 也就是说,这个时候,已经不是一个连接就要对应一个处理线程了,而是有效的请求,对应一个线程,当连接没有数据时,是没有工作线程来处理的。 34 | 35 | BIO与NIO一个比较重要的不同,是我们使用BIO的时候往往会引入多线程,每个连接一个单独的线程;而NIO则是使用单线程或者只使用少量的多线程。NIO模型图如下: 36 | 37 | ![][2] 38 | 39 | ### NIO优缺点 40 | * 优点 41 | * 性能瓶颈高 42 | * 缺点 43 | * 模型复杂 44 | * 编码复杂 45 | * 需处理半包问题 46 | 47 | NIO的优缺点和BIO就完全相反了!性能高,不用一个连接就建一个线程,可以一个线程处理所有的连接!相应的,编码就复杂很多。还有一个问题,由于是非阻塞的,应用无法知道什么时候消息读完! 48 | 49 | BIO和NIO的对比图: 50 | 51 | ![][3] 52 | 53 | ## AIO 54 | 55 | AIO没有前两者普及,暂不讨论! 56 | 57 | 58 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516814717421.jpg 59 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516814803100.jpg 60 | [3]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/25/1516812993887.jpg -------------------------------------------------------------------------------- /Algorithm/算法05 五大查找之:顺序查找.md: -------------------------------------------------------------------------------- 1 | # 算法05 五大查找之:顺序查找 2 | 3 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 4 | 5 | --- 6 | 7 | 这一篇要介绍的是算法中的查找算法。查找在我们生活中无处不在,比如查公交,查机票,查酒店等等。 8 | 9 | 首先看一下查找的分类。如下图: 10 | 11 | ![][1] 12 | 13 | 那么这一篇要总结的是顺序表中的顺序查找。 14 | 15 | 什么是顺序查找呢?顺序查找就是遍历整个列表,逐个元素与给定值比较,若某个元素和给定值相等,则查找成功。如果直到最后一个元素和给定值比较都不相等,则查找失败。 16 | 17 | ## 顺序查找的代码实现 18 | 19 | SequenceSearch.java 20 | 21 |
public class SequenceSearch {
22 |     public static void main(String[] args) {
23 |         int[] list = {90, 10, 20, 50, 70, 40, 80, 60, 30, 52};
24 |         System.out.println("************顺序查找************");
25 |         display(list);
26 |         System.out.println("");
27 | 
28 |         int result = sequenceSearch(list, 50);
29 |         if (result != -1) {
30 |             System.out.println("50在列表中的位置是:" + result);
31 |         } else {
32 |             System.out.println("对不起,列表中不存在该元素!");
33 |         }
34 |     }
35 | 
36 |     /**
37 |      * 顺序查找
38 |      */
39 |     public static int sequenceSearch(int[] list, int key) {
40 |         for (int i = 0; i < list.length; i++) {
41 |             // 找到该元素,返回位置序号
42 |             if (list[i] == key) {
43 |                 return i;
44 |             }
45 |         }
46 |         // 没有找到
47 |         return -1;
48 |     }
49 | 
50 |     /**
51 |      * 遍历打印
52 |      */
53 |     public static void display(int[] list) {
54 |         System.out.println("********展示开始********");
55 |         if (list != null && list.length > 0) {
56 |             for (int num :
57 |                     list) {
58 |                 System.out.print(num + " ");
59 |             }
60 |             System.out.println("");
61 |         }
62 |         System.out.println("********展示结束********");
63 |     }
64 | }
65 | 66 | 运行结果: 67 | 68 | ![][2] 69 | 70 | 71 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516484702085.jpg 72 | [2]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516484738026.jpg -------------------------------------------------------------------------------- /_sass/_schemes/Mist/index.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Mist scheme 3 | // ================================================= 4 | 5 | @import "_base"; 6 | @import "outline/outline"; 7 | @import "_header"; 8 | @import "_logo"; 9 | @import "_menu"; 10 | @import "_search"; 11 | @import "_posts-expanded"; 12 | @import "sidebar/sidebar-blogroll"; 13 | 14 | 15 | // Components 16 | // -------------------------------------------------- 17 | .btn { 18 | padding: 0 10px; 19 | border-width: 2px; 20 | border-radius: 0; 21 | } 22 | 23 | .headband { display: none; } 24 | 25 | 26 | // Search 27 | // -------------------------------------------------- 28 | .site-search { 29 | position: relative; 30 | float: right; 31 | margin-top: 5px; 32 | padding-top: 3px; 33 | 34 | @include mobile() { 35 | float: none; 36 | padding: 0 10px; 37 | } 38 | } 39 | 40 | 41 | // Page - Container 42 | // -------------------------------------------------- 43 | .container .main-inner { 44 | @include mobile() { width: auto; } 45 | } 46 | 47 | 48 | // Page - Post details 49 | // -------------------------------------------------- 50 | .page-post-detail { 51 | .post-title, 52 | .post-meta { text-align: center; } 53 | 54 | .post-title:before { display: none; } 55 | 56 | .post-meta { margin-bottom: 60px; } 57 | } 58 | 59 | 60 | // Pagination 61 | // -------------------------------------------------- 62 | .pagination { 63 | margin: 120px 0 0; 64 | text-align: left; 65 | 66 | @include mobile() { 67 | margin: 80px 10px 0; 68 | text-align: center; 69 | } 70 | } 71 | 72 | // Footer 73 | // -------------------------------------------------- 74 | .footer { 75 | margin-top: 80px; 76 | padding: 10px 0; 77 | background: $whitesmoke; 78 | color: $grey-dim; 79 | } 80 | .footer-inner { 81 | margin: 0 auto; 82 | text-align: left; 83 | 84 | @include mobile() { 85 | width: auto; 86 | text-align: center; 87 | } 88 | } 89 | 90 | // Helpers 91 | // -------------------------------------------------- 92 | -------------------------------------------------------------------------------- /_posts/2017-04-02-002 Java中的String类能否被继承?为什么?.md: -------------------------------------------------------------------------------- 1 | --- 2 | categories: JavaBasis 3 | description: 不能被继承,因为String类有final修饰符,而final修饰的类是不能被继承的。 4 | --- 5 | 6 | 笔记仓库:[https://github.com/nnngu/LearningNotes](https://github.com/nnngu/LearningNotes) 7 | 8 | --- 9 | 10 | 不能被继承,因为String类有final修饰符,而final修饰的类是不能被继承的。 11 | 12 | ## **Java对String类的定义:** 13 | 14 | ``` 15 | public final class String implements java.io.Serializable, Comparable, CharSequence { 16 | // 省略...  17 | } 18 | ``` 19 | 20 | ## final修饰符的用法: 21 | 22 | 1.修饰类 23 | 24 |   当用final修饰一个类时,表明这个类不能被继承。final类中的成员变量可以根据需要设为final,但是要注意final类中的所有成员方法都会被隐式地指定为final方法。 25 | 26 | ![][1] 27 | 28 | 2.修饰方法 29 | 30 |   使用final修饰方法的原因有两个。第一个原因是把方法锁定,以防任何继承类修改它的含义;第二个原因是效率。在早期的Java实现版本中,会将final方法转为内嵌调用。但是如果方法过于庞大,可能看不到内嵌调用带来的任何性能提升。在最近的Java版本中,不需要使用final方法进行这些优化了。 31 | 32 |   因此,只有在想明确禁止该方法在子类中被覆盖的情况下才将方法设置为final。 33 | 34 |   注:一个类中的private方法会隐式地被指定为final方法。 35 | 36 | 3.修饰变量 37 | 38 |   对于被final修饰的变量,如果是基本数据类型的变量,则其数值一旦在初始化之后便不能更改;如果是引用类型的变量,则在对其初始化之后便不能再让其指向另一个对象。虽然不能再指向其他对象,但是它指向的对象的内容是可变的。 39 | 40 | ## final和static的区别: 41 | 42 | 很多时候会容易把static和final关键字混淆,static作用于成员变量用来表示只保存一份副本,而final的作用是用来保证变量不可变。看下面这个例子: 43 | 44 | ``` 45 | 1 public class Demo1 { 46 | 2 public static void main(String[] args) { 47 | 3 MyClass myClass1 = new MyClass(); 48 | 4 MyClass myClass2 = new MyClass(); 49 | 5 System.out.println(myClass1.i); 50 | 6 System.out.println(myClass2.i); 51 | 7 System.out.println(myClass1.j); 52 | 8 System.out.println(myClass2.j); 53 | 9 54 | 10 } 55 | 11 } 56 | 12 57 | 13 class MyClass { 58 | 14 public final double i = Math.random(); 59 | 15 public static double j = Math.random(); 60 | 16 } 61 | ``` 62 | 63 |  运行结果: 64 | 65 | ``` 66 | 0.3222977275463088 67 | 0.2565532218939688 68 | 0.36856868882926397 69 | 0.36856868882926397 70 | ``` 71 | 72 | 每次打印的两个j值都是一样的,而i的值却是不同的。从这里就可以知道final和static变量的区别了。 73 | 74 | 75 | [1]: https://www.github.com/nnngu/FigureBed/raw/master/2018/1/21/1516470278278.jpg -------------------------------------------------------------------------------- /assets/lib/jquery_lazyload/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Lazy Load 2 | 3 | ## Only one feature or change per pull request 4 | 5 | Make pull requests only one feature or change at the time. For example you have fixed a bug. You also have optimized some code. Optimization is not related to a bug. These should be submitted as separate pull requests. This way I can easily choose what to include. It is also easier to understand the code changes. Commit messages should be descriptive and full sentences. 6 | 7 | Do not commit minified versions. Do not touch the version number. Make the pull requests against [1.9.x branch](https://github.com/tuupola/jquery_lazyload/commits/1.9.x). 8 | 9 | ## Write meaningful commit messages 10 | 11 | Proper commit message is full sentence. It starts with capital letter but does not end with period. Headlines do not end with period. The GitHub default `Update filename.js` is not enough. When needed include also longer explanation what the commit does. 12 | 13 | ``` 14 | Capitalized, short (50 chars or less) summary 15 | 16 | More detailed explanatory text, if necessary. Wrap it to about 72 17 | characters or so. In some contexts, the first line is treated as the 18 | subject of an email and the rest of the text as the body. The blank 19 | line separating the summary from the body is critical (unless you omit 20 | the body entirely); tools like rebase can get confused if you run the 21 | two together. 22 | ``` 23 | 24 | When in doubt see Tim Pope's blogpost [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) 25 | 26 | ## Follow the existing coding standards 27 | 28 | When contributing to open source project it is polite to follow the original authors coding standars. They might be different than yours. It is not a holy war. Just follow then original. 29 | 30 | ```javascript 31 | var snake_case = "something"; 32 | 33 | function camelCase(options) { 34 | } 35 | 36 | if (true !== false) { 37 | console.log("here be dragons"); 38 | } 39 | ``` 40 | -------------------------------------------------------------------------------- /Java Basis/019 单例模式的5种写法.md: -------------------------------------------------------------------------------- 1 | # 019 单例模式的5种写法 2 | 3 | **单例模式的定义:保证一个类仅有一个实例,并提供一个访问它的全局访问点!** 4 | 5 | ## 1、懒汉 6 | 7 | ```java 8 | public class Singleton { 9 | private static Singleton instance; 10 | private Singleton (){} 11 | 12 | public static synchronized Singleton getInstance() { 13 | if (instance == null) { 14 | instance = new Singleton(); 15 | } 16 | return instance; 17 | } 18 | } 19 | ``` 20 | 21 | ## 2、饿汉 22 | 23 | ```java 24 | public class Singleton { 25 | private static Singleton instance = new Singleton(); 26 | private Singleton (){} 27 | public static Singleton getInstance() { 28 | return instance; 29 | } 30 | } 31 | ``` 32 | 33 | ## 3、双重校验锁 34 | 35 | ```java 36 | public class Singleton { 37 | private volatile static Singleton singleton; 38 | private Singleton (){} 39 | public static Singleton getSingleton() { 40 | if (singleton == null) { 41 | synchronized (Singleton.class) { 42 | if (singleton == null) { 43 | singleton = new Singleton(); 44 | } 45 | } 46 | } 47 | return singleton; 48 | } 49 | } 50 | ``` 51 | 52 | ## 4、枚举 53 | 54 | ```java 55 | public enum Singleton { 56 | INSTANCE; 57 | public void whateverMethod() { 58 | } 59 | } 60 | ``` 61 | 62 | ## 5、静态内部类 63 | 64 | ```java 65 | public class Singleton { 66 | private static class SingletonHolder { 67 | private static final Singleton INSTANCE = new Singleton(); 68 | } 69 | private Singleton (){} 70 | public static final Singleton getInstance() { 71 | return SingletonHolder.INSTANCE; 72 | } 73 | } 74 | ``` 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | --- 94 | 95 | 本文永久更新地址:[https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/019%20%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F%E7%9A%845%E7%A7%8D%E5%86%99%E6%B3%95.md](https://github.com/nnngu/LearningNotes/blob/master/Java%20Basis/019%20%E5%8D%95%E4%BE%8B%E6%A8%A1%E5%BC%8F%E7%9A%845%E7%A7%8D%E5%86%99%E6%B3%95.md) --------------------------------------------------------------------------------