Skip to content

Commit 49a4752

Browse files
author
Jason
committed
highlight
1 parent 0738e59 commit 49a4752

File tree

16 files changed

+337
-365
lines changed

16 files changed

+337
-365
lines changed

_includes/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta name="description" content="{{ site.description }}">
55
<link href="{{ site.baseurl }}/css/bootstrap.min.css" rel="stylesheet">
66
<link href="{{ site.baseurl }}/css/hc.css" rel="stylesheet">
7+
<link href="{{ site.baseurl }}/css/highlight.css" rel="stylesheet">
78
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
89
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
910
<!--[if lt IE 9]>

_posts/2015-04-05-PHP的排序算法.markdown

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
#PHP排序算法
2-
31
准备
42
---
53
1. 先写一个打印输出的方法,用于调试。
4+
65
```php
76
<?php
87
function p($msg) {
@@ -13,6 +12,7 @@
1312
```
1413

1514
2. 一个需要排序的数组。
15+
1616
```php
1717
<?php
1818
$arr = [3, 5, 2, 8, 7, 1, 2, 4];
@@ -72,6 +72,7 @@ I. 冒泡排序(BubbleSort)
7272
```
7373

7474
去掉邪恶的注释后的精简版:
75+
7576
```php
7677
<?php
7778
function bubbleSort(&$arr) {
@@ -148,6 +149,7 @@ II. 选择排序(SelectionSort)
148149
```
149150

150151
无注释精简版:
152+
151153
```php
152154
<?php
153155
function selectionSort(&$arr) {
@@ -236,6 +238,7 @@ function insertSort(&$arr) {
236238
```
237239

238240
去掉注释的版本:
241+
239242
```php
240243
<?php
241244
function insertSort(&$arr) {
@@ -324,6 +327,7 @@ function bucketSort($arr) {
324327
```
325328

326329
无注释精简版:
330+
327331
```php
328332
<?php
329333
function bucketSort($arr) {
@@ -371,7 +375,8 @@ V. 快速排序(QuickSort)
371375
还是排队,高个子在后,小个子在前。我们以第一人作为标志,身高低于他的站在他前面,身高高于或等于他的站在他后面,这样再在身高低于他的所有人中和高于等于他身高的人中,分别找一个标志,再如此比较站队...最后的队伍一定是有序的。
372376

373377
###分治排序的演示
374-
```php
378+
379+
```
375380
3, 5, 2, 8, 7, 1, 2 // 原始数组
376381
[2, 1, 2], 3, [5, 8, 7] // 以第一个数3作为标志,形成的小于和大于等于它的两个集合
377382
[[1], 2, [2]], 3, [[], 5, [8, 7]] // 再对集合中的数以它们各自的第一个数做标志形成小于和大于等于的两个集合
@@ -380,6 +385,7 @@ V. 快速排序(QuickSort)
380385
```
381386

382387
```php
388+
<?php
383389
function quickSort($arr) {
384390
$count = count($arr);
385391
// 当数组元素的数量为0或1时,返回数组
@@ -398,9 +404,11 @@ function quickSort($arr) {
398404
// 返回小于标志的集合分治结果、标志、大于等于标志的集合分治结果的合并集合
399405
return array_merge(quickSort($smaller), [$flag], quickSort($larger));
400406
}
407+
?>
401408
```
402409

403410
形成小于、等于、大于参考数的集合的做法:(重复数多的情况下这种做法应该更好)
411+
404412
```php
405413
<?php
406414
function quickSort($arr) {

_site/2013/12/04/Samples.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<meta name="description" content="上善若水,人淡如菊">
88
<link href="/css/bootstrap.min.css" rel="stylesheet">
99
<link href="/css/hc.css" rel="stylesheet">
10+
<link href="/css/highlight.css" rel="stylesheet">
1011
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1112
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
1213
<!--[if lt IE 9]>
@@ -26,7 +27,7 @@
2627
<span class="icon-bar"></span>
2728
<span class="icon-bar"></span>
2829
</button>
29-
<p class="navbar-brand">Jason's Blog</p>
30+
<p class="navbar-brand">Jason's Klog</p>
3031
</div>
3132
<div class="navbar-collapse collapse">
3233
<ul class="nav navbar-nav">
@@ -42,7 +43,7 @@
4243
<!-- Sidebar -->
4344
<div id="sidebar-wrapper">
4445
<ul class="sidebar-nav">
45-
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Blog</h1></a><h3>上善若水,人淡如菊</h3></li>
46+
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Klog</h1></a><h3>上善若水,人淡如菊</h3></li>
4647
<hr />
4748
<li><a href="/list.html">List</a></li>
4849
<li><a href="/links.html">Links</a></li>
@@ -191,9 +192,9 @@ <h2>Code</h2>
191192
<div class="container">
192193
<footer>
193194
<p class="text-muted credit">
194-
&copy; 2015 Jason's Blog &middot;
195+
&copy; 2015 Jason's Klog &middot;
195196
<a href="https://github.com/arnp/herring-cove"> Herring Cove for Jekyll </a>
196-
2015-04-06 01:03:04 +0800
197+
2015-04-06 03:39:04 +0800
197198
</p>
198199
</footer>
199200
</div>

_site/2015/04/05/PHP的排序算法.html

Lines changed: 157 additions & 168 deletions
Large diffs are not rendered by default.

_site/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jiayintao.com

_site/README.md

Lines changed: 0 additions & 41 deletions
This file was deleted.

_site/about.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<meta name="description" content="上善若水,人淡如菊">
88
<link href="/css/bootstrap.min.css" rel="stylesheet">
99
<link href="/css/hc.css" rel="stylesheet">
10+
<link href="/css/highlight.css" rel="stylesheet">
1011
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1112
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
1213
<!--[if lt IE 9]>
@@ -26,7 +27,7 @@
2627
<span class="icon-bar"></span>
2728
<span class="icon-bar"></span>
2829
</button>
29-
<p class="navbar-brand">Jason's Blog</p>
30+
<p class="navbar-brand">Jason's Klog</p>
3031
</div>
3132
<div class="navbar-collapse collapse">
3233
<ul class="nav navbar-nav">
@@ -42,7 +43,7 @@
4243
<!-- Sidebar -->
4344
<div id="sidebar-wrapper">
4445
<ul class="sidebar-nav">
45-
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Blog</h1></a><h3>上善若水,人淡如菊</h3></li>
46+
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Klog</h1></a><h3>上善若水,人淡如菊</h3></li>
4647
<hr />
4748
<li><a href="/list.html">List</a></li>
4849
<li><a href="/links.html">Links</a></li>
@@ -87,9 +88,9 @@ <h1>Herring Cove</h1>
8788
<div class="container">
8889
<footer>
8990
<p class="text-muted credit">
90-
&copy; 2015 Jason's Blog &middot;
91+
&copy; 2015 Jason's Klog &middot;
9192
<a href="https://github.com/arnp/herring-cove"> Herring Cove for Jekyll </a>
92-
2015-04-06 01:03:04 +0800
93+
2015-04-06 03:39:04 +0800
9394
</p>
9495
</footer>
9596
</div>

_site/css/highlight.css

Lines changed: 63 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,65 @@
1-
.hll { background-color: #ffffcc }
2-
.c { color: #60a0b0; font-style: italic } /* Comment */
3-
.err { border: 1px solid #FF0000 } /* Error */
4-
.k { color: #007020; font-weight: bold } /* Keyword */
5-
.o { color: #666666 } /* Operator */
6-
.cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
7-
.cp { color: #007020 } /* Comment.Preproc */
8-
.c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
9-
.cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
10-
.gd { color: #A00000 } /* Generic.Deleted */
1+
.hll { background-color: #a39e9b }
2+
.c { color: #8d8687 } /* Comment */
3+
.err { color: #ef6155 } /* Error */
4+
.k { color: #815ba4 } /* Keyword */
5+
.l { color: #f99b15 } /* Literal */
6+
.n { color: #2f1e2e } /* Name */
7+
.o { color: #5bc4bf } /* Operator */
8+
.p { color: #2f1e2e } /* Punctuation */
9+
.cm { color: #8d8687 } /* Comment.Multiline */
10+
.cp { color: #8d8687 } /* Comment.Preproc */
11+
.c1 { color: #8d8687 } /* Comment.Single */
12+
.cs { color: #8d8687 } /* Comment.Special */
13+
.gd { color: #ef6155 } /* Generic.Deleted */
1114
.ge { font-style: italic } /* Generic.Emph */
12-
.gr { color: #FF0000 } /* Generic.Error */
13-
.gh { color: #000080; font-weight: bold } /* Generic.Heading */
14-
.gi { color: #00A000 } /* Generic.Inserted */
15-
.go { color: #888888 } /* Generic.Output */
16-
.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
15+
.gh { color: #2f1e2e; font-weight: bold } /* Generic.Heading */
16+
.gi { color: #48b685 } /* Generic.Inserted */
17+
.gp { color: #8d8687; font-weight: bold } /* Generic.Prompt */
1718
.gs { font-weight: bold } /* Generic.Strong */
18-
.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
19-
.gt { color: #0044DD } /* Generic.Traceback */
20-
.kc { color: #007020; font-weight: bold } /* Keyword.Constant */
21-
.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
22-
.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
23-
.kp { color: #007020 } /* Keyword.Pseudo */
24-
.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
25-
.kt { color: #902000 } /* Keyword.Type */
26-
.m { color: #40a070 } /* Literal.Number */
27-
.s { color: #4070a0 } /* Literal.String */
28-
.na { color: #4070a0 } /* Name.Attribute */
29-
.nb { color: #007020 } /* Name.Builtin */
30-
.nc { color: #0e84b5; font-weight: bold } /* Name.Class */
31-
.no { color: #60add5 } /* Name.Constant */
32-
.nd { color: #555555; font-weight: bold } /* Name.Decorator */
33-
.ni { color: #d55537; font-weight: bold } /* Name.Entity */
34-
.ne { color: #007020 } /* Name.Exception */
35-
.nf { color: #06287e } /* Name.Function */
36-
.nl { color: #002070; font-weight: bold } /* Name.Label */
37-
.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
38-
.nt { color: #062873; font-weight: bold } /* Name.Tag */
39-
.nv { color: #bb60d5 } /* Name.Variable */
40-
.ow { color: #007020; font-weight: bold } /* Operator.Word */
41-
.w { color: #bbbbbb } /* Text.Whitespace */
42-
.mb { color: #40a070 } /* Literal.Number.Bin */
43-
.mf { color: #40a070 } /* Literal.Number.Float */
44-
.mh { color: #40a070 } /* Literal.Number.Hex */
45-
.mi { color: #40a070 } /* Literal.Number.Integer */
46-
.mo { color: #40a070 } /* Literal.Number.Oct */
47-
.sb { color: #4070a0 } /* Literal.String.Backtick */
48-
.sc { color: #4070a0 } /* Literal.String.Char */
49-
.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
50-
.s2 { color: #4070a0 } /* Literal.String.Double */
51-
.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
52-
.sh { color: #4070a0 } /* Literal.String.Heredoc */
53-
.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
54-
.sx { color: #c65d09 } /* Literal.String.Other */
55-
.sr { color: #235388 } /* Literal.String.Regex */
56-
.s1 { color: #4070a0 } /* Literal.String.Single */
57-
.ss { color: #517918 } /* Literal.String.Symbol */
58-
.bp { color: #007020 } /* Name.Builtin.Pseudo */
59-
.vc { color: #bb60d5 } /* Name.Variable.Class */
60-
.vg { color: #bb60d5 } /* Name.Variable.Global */
61-
.vi { color: #bb60d5 } /* Name.Variable.Instance */
62-
.il { color: #40a070 } /* Literal.Number.Integer.Long */
19+
.gu { color: #5bc4bf; font-weight: bold } /* Generic.Subheading */
20+
.kc { color: #815ba4 } /* Keyword.Constant */
21+
.kd { color: #815ba4 } /* Keyword.Declaration */
22+
.kn { color: #5bc4bf } /* Keyword.Namespace */
23+
.kp { color: #815ba4 } /* Keyword.Pseudo */
24+
.kr { color: #815ba4 } /* Keyword.Reserved */
25+
.kt { color: #fec418 } /* Keyword.Type */
26+
.ld { color: #48b685 } /* Literal.Date */
27+
.m { color: #f99b15 } /* Literal.Number */
28+
.s { color: #48b685 } /* Literal.String */
29+
.na { color: #06b6ef } /* Name.Attribute */
30+
.nb { color: #2f1e2e } /* Name.Builtin */
31+
.nc { color: #fec418 } /* Name.Class */
32+
.no { color: #ef6155 } /* Name.Constant */
33+
.nd { color: #5bc4bf } /* Name.Decorator */
34+
.ni { color: #2f1e2e } /* Name.Entity */
35+
.ne { color: #ef6155 } /* Name.Exception */
36+
.nf { color: #06b6ef } /* Name.Function */
37+
.nl { color: #2f1e2e } /* Name.Label */
38+
.nn { color: #fec418 } /* Name.Namespace */
39+
.nx { color: #06b6ef } /* Name.Other */
40+
.py { color: #2f1e2e } /* Name.Property */
41+
.nt { color: #5bc4bf } /* Name.Tag */
42+
.nv { color: #ef6155 } /* Name.Variable */
43+
.ow { color: #5bc4bf } /* Operator.Word */
44+
.w { color: #2f1e2e } /* Text.Whitespace */
45+
.mb { color: #f99b15 } /* Literal.Number.Bin */
46+
.mf { color: #f99b15 } /* Literal.Number.Float */
47+
.mh { color: #f99b15 } /* Literal.Number.Hex */
48+
.mi { color: #f99b15 } /* Literal.Number.Integer */
49+
.mo { color: #f99b15 } /* Literal.Number.Oct */
50+
.sb { color: #48b685 } /* Literal.String.Backtick */
51+
.sc { color: #2f1e2e } /* Literal.String.Char */
52+
.sd { color: #8d8687 } /* Literal.String.Doc */
53+
.s2 { color: #48b685 } /* Literal.String.Double */
54+
.se { color: #f99b15 } /* Literal.String.Escape */
55+
.sh { color: #48b685 } /* Literal.String.Heredoc */
56+
.si { color: #f99b15 } /* Literal.String.Interpol */
57+
.sx { color: #48b685 } /* Literal.String.Other */
58+
.sr { color: #48b685 } /* Literal.String.Regex */
59+
.s1 { color: #48b685 } /* Literal.String.Single */
60+
.ss { color: #48b685 } /* Literal.String.Symbol */
61+
.bp { color: #2f1e2e } /* Name.Builtin.Pseudo */
62+
.vc { color: #ef6155 } /* Name.Variable.Class */
63+
.vg { color: #ef6155 } /* Name.Variable.Global */
64+
.vi { color: #ef6155 } /* Name.Variable.Instance */
65+
.il { color: #f99b15 } /* Literal.Number.Integer.Long */

_site/index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Jason's Blog</title>
5+
<title>Jason's Klog</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="description" content="上善若水,人淡如菊">
88
<link href="/css/bootstrap.min.css" rel="stylesheet">
99
<link href="/css/hc.css" rel="stylesheet">
10+
<link href="/css/highlight.css" rel="stylesheet">
1011
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
1112
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
1213
<!--[if lt IE 9]>
@@ -26,7 +27,7 @@
2627
<span class="icon-bar"></span>
2728
<span class="icon-bar"></span>
2829
</button>
29-
<p class="navbar-brand">Jason's Blog</p>
30+
<p class="navbar-brand">Jason's Klog</p>
3031
</div>
3132
<div class="navbar-collapse collapse">
3233
<ul class="nav navbar-nav">
@@ -42,7 +43,7 @@
4243
<!-- Sidebar -->
4344
<div id="sidebar-wrapper">
4445
<ul class="sidebar-nav">
45-
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Blog</h1></a><h3>上善若水,人淡如菊</h3></li>
46+
<li class="sidebar-brand"><a href="/"><h1 class="brand">Jason's Klog</h1></a><h3>上善若水,人淡如菊</h3></li>
4647
<hr />
4748
<li><a href="/list.html">List</a></li>
4849
<li><a href="/links.html">Links</a></li>
@@ -159,9 +160,9 @@ <h4>
159160
<div class="container">
160161
<footer>
161162
<p class="text-muted credit">
162-
&copy; 2015 Jason's Blog &middot;
163+
&copy; 2015 Jason's Klog &middot;
163164
<a href="https://github.com/arnp/herring-cove"> Herring Cove for Jekyll </a>
164-
2015-04-06 01:03:04 +0800
165+
2015-04-06 03:39:04 +0800
165166
</p>
166167
</footer>
167168
</div>

0 commit comments

Comments
 (0)