├── .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 |
3 |
4 |
热评文章
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 | 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 |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 | 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;vpublic 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#文档对按引用传递的定义(如下截图):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(fpublic 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