-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
459 lines (327 loc) · 18.7 KB
/
index.html
1
2
3
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>Stone's Blog</title>
<meta name="description" content="" />
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="/css/component.css" />
<link rel="stylesheet" type="text/css" href="/css/screen.css" />
<meta name="generator" content="Stone's Blog">
<script src="http://static.duoshuo.com/embed.js"></script>
</head>
<body>
<div class="container">
<div class="mp-pusher" id="mp-pusher">
<i id="scroll-up" class="fa fa-angle-up"></i>
<nav id="mp-menu" class="mp-menu">
<div class="mp-level">
<a data-pjax class="back-home" style="font-size: 20px" href="/"><h2 ><i class="fa fa-home"></i>
Home</h2></a>
<ul class="first-level">
<li>
<a class="fa fa-archive" href="#"><i class="fa fa-angle-left">
</i> Archive</a>
<div class="mp-level page-list">
<h2 ><i class="fa fa-archive"></i>
Archive</h2>
<a class="mp-back" href="#">back</a>
<form id="search-form" action="">
<input type="text" class="search search-archive" placeholder="Search.."/>
</form>
<ul>
<div class="mp-scroll">
<li class="search-archive-li mp-pjax">
<a href="/2015/02/08/welcome/">Welcome to Stone's Blog</a>
</li>
<li class="search-archive-li mp-pjax">
<a href="/2015/01/25/lunar_to_solar/">阴阳历算法实现(2) -- 阴(农)历转阳历</a>
</li>
<li class="search-archive-li mp-pjax">
<a href="/2015/01/25/solar_to_lunar/">阴阳历算法实现(1) -- 阳历转阴(农)历</a>
</li>
<li class="search-archive-li mp-pjax">
<a href="/2014/12/17/design-patterns/">设计模式</a>
</li>
<li class="search-archive-li mp-pjax">
<a href="/2014/12/17/grep/">grep命令详解-9个经典使用场景</a>
</li>
</div>
</ul>
</div>
</li>
<li>
<a class="fa fa-copy" href="#"><i class="fa fa-angle-left">
</i> Categories</a>
<div class="mp-level page-list">
<h2 ><i class="fa fa-copy"></i>
Categories</h2>
<a class="mp-back" href="#">back</a>
<form id="search-form" action="">
<input type="text" class="search search-category" placeholder="Search.."/>
</form>
<ul>
<div class="mp-scroll">
<li class="search-category-li mp-pjax">
<a href="/categories/Python/"> Python</a>
<small>2</small>
</li>
<li class="search-category-li mp-pjax">
<a href="/categories/linux/"> linux</a>
<small>1</small>
</li>
<li class="search-category-li mp-pjax">
<a href="/categories/设计模式/"> 设计模式</a>
<small>1</small>
</li>
</div>
</ul>
</div>
</li>
<li>
<a class="fa fa-tags" href="#"><i class="fa fa-angle-left">
</i> Tags</a>
<div class="mp-level page-list">
<h2 ><i class="fa fa-tags"></i>
Tags</h2>
<a class="mp-back" href="#">back</a>
<form id="search-form" action="">
<input type="text" class="search search-tag" placeholder="Search.."/>
</form>
<ul>
<div class="mp-scroll">
<li class="search-tag-li mp-pjax">
<a href="/tags/shell/"> shell</a>
<small>1</small>
</li>
<li class="search-tag-li mp-pjax">
<a href="/tags/接口/"> 接口</a>
<small>2</small>
</li>
<li class="search-tag-li mp-pjax">
<a href="/tags/正则表达式/"> 正则表达式</a>
<small>1</small>
</li>
<li class="search-tag-li mp-pjax">
<a href="/tags/算法/"> 算法 </a>
<small>2</small>
</li>
<li class="search-tag-li mp-pjax">
<a href="/tags/设计/"> 设计</a>
<small>1</small>
</li>
<li class="search-tag-li mp-pjax">
<a href="/tags/阴阳历/"> 阴阳历 </a>
<small>2</small>
</li>
</div>
</ul>
</div>
</li>
<li><a class="fa fa-user" href="/resume.html"> About me</a></li>
<li><a class="fa fa-github" href="https://github.com/helei24"> Github</a></li>
</ul>
</div>
</nav>
<div id="pjax">
<div class="pjax-hidden" style="display: none">
<a data-pjax href="/2015/02/08/welcome/">Welcome to Stone's Blog</a>
<a data-pjax href="/2015/01/25/lunar_to_solar/">阴阳历算法实现(2) -- 阴(农)历转阳历</a>
<a data-pjax href="/2015/01/25/solar_to_lunar/">阴阳历算法实现(1) -- 阳历转阴(农)历</a>
<a data-pjax href="/2014/12/17/design-patterns/">设计模式</a>
<a data-pjax href="/2014/12/17/grep/">grep命令详解-9个经典使用场景</a>
<a data-pjax href="/categories/Python/"> Python</a>
<a data-pjax href="/categories/linux/"> linux</a>
<a data-pjax href="/categories/设计模式/"> 设计模式</a>
<a data-pjax href="/tags/shell/"> shell</a>
<a data-pjax href="/tags/接口/"> 接口</a>
<a data-pjax href="/tags/正则表达式/"> 正则表达式</a>
<a data-pjax href="/tags/算法/"> 算法 </a>
<a data-pjax href="/tags/设计/"> 设计</a>
<a data-pjax href="/tags/阴阳历/"> 阴阳历 </a>
<a data-pjax class="fa fa-user" href="/about"> About me</a>
</div>
<nav class="nexus">
<li style="border-left: 1px solid #c6d0da;">
<a id="trigger" href="#"><i class="fa fa-bars"></i></a>
</li>
<li ><a id="nexus-back" data-pjax href="/">Stone's Blog</a></li>
<div id="nav-container">
<div class="post-navbar" style="line-height: 63px;display:none">
<li id="navbar-title"><a href="#">undefined</a></li>
<li id="navbar-toc" style="border-left: none">
<a style="padding-right: 15px">
<span id="toc-content" >Introduction</span><i class="fa fa-chevron-down" ></i>
</a>
<div class="hidden-box">
<ul id="toc"></ul>
</div>
</li>
</div>
</div>
</nav>
<div class="scroller">
<div class="scroller-inner">
<!-- -->
<!--<body class="home-template">-->
<!---->
<main class="content" role="main">
<article class="post">
<header class="post-header">
<div class="tag-tile">
<span class="fa fa-bookmark" style="float:right;color:#f39c12"></span>
</div>
<h1 class="post-title"><a data-pjax href="/2015/02/08/welcome/">Welcome to Stone's Blog</a>
</h1>
<div class="post-meta">
Post on<span class="fa fa-clock-o"></span>
<time datetime="2015-02-08T09:25:18.000Z"
itemprop="datePublished">Feb 8 2015</time>
</div>
</header>
<section class="post-excerpt">
<p>
Welcome to my blog!本人个人技术分享陆续更新中,欢迎支持和雅正…
</p>
</section>
</article>
<article class="post">
<header class="post-header">
<div class="tag-tile">
<a data-pjax href='/tags/算法/'>算法 </a>
<a data-pjax href='/tags/阴阳历/'>阴阳历 </a>
<a data-pjax href='/tags/接口/'>接口</a>
<span class="fa fa-bookmark" style="float:right;color:#f39c12"></span>
</div>
<h1 class="post-title"><a data-pjax href="/2015/01/25/lunar_to_solar/">阴阳历算法实现(2) -- 阴(农)历转阳历</a>
</h1>
<div class="post-meta">
Post on<span class="fa fa-clock-o"></span>
<time datetime="2015-01-25T10:42:16.000Z"
itemprop="datePublished">Jan 25 2015</time>
</div>
</header>
<section class="post-excerpt">
<p>
阴(农)历转阳历
算法设计
上篇讲到了阳历转阴历,我们先求出阳历日期到正月初一之间的间隔天数,这个间隔天数在阳历和阴历的增长中都是一样的,我们可以以其作为中间桥梁来进行转换.这种方式在农历转阳历中同样适用,但是由于农历的闰月存在,比如XX年Y月有闰月存在,即XX年有两个Y月,所以我们必须在算法输入的时候明确指定求的是Y月,还是Y的闰月,然后计算对应的阳历日期.上篇中的数据结构依旧有用,如下:
LUNAR_CALENDAR_TABLE =
</p>
</section>
</article>
<article class="post">
<header class="post-header">
<div class="tag-tile">
<a data-pjax href='/tags/算法/'>算法 </a>
<a data-pjax href='/tags/阴阳历/'>阴阳历 </a>
<a data-pjax href='/tags/接口/'>接口</a>
<span class="fa fa-bookmark" style="float:right;color:#f39c12"></span>
</div>
<h1 class="post-title"><a data-pjax href="/2015/01/25/solar_to_lunar/">阴阳历算法实现(1) -- 阳历转阴(农)历</a>
</h1>
<div class="post-meta">
Post on<span class="fa fa-clock-o"></span>
<time datetime="2015-01-25T10:42:16.000Z"
itemprop="datePublished">Jan 25 2015</time>
</div>
</header>
<section class="post-excerpt">
<p>
阳历转阴(农)历
实现背景
本人一年前实习时候参与过一个API项目,其中就包括实现阴阳历互换API接口,调研过一番其实现算法.时间久了算法详细过程大概忘记了,最近突然就想重新实现一次,于是又开始了. 跟什么进制转换,计算器等等算法相比,阳历(即公历,就是生活中走得较快的那个全世界都在使用的日期)与阴历(即农历,旧历,就是生活中走得较慢的只有咱们中国在用的那个日期)之间的相互转换就没有一套固定的转换规律了. 对于阳历而言,其相对还算
</p>
</section>
</article>
<article class="post">
<header class="post-header">
<div class="tag-tile">
<a data-pjax href='/tags/设计/'>设计</a>
<span class="fa fa-bookmark" style="float:right;color:#f39c12"></span>
</div>
<h1 class="post-title"><a data-pjax href="/2014/12/17/design-patterns/">设计模式</a>
</h1>
<div class="post-meta">
Post on<span class="fa fa-clock-o"></span>
<time datetime="2014-12-17T10:42:16.000Z"
itemprop="datePublished">Dec 17 2014</time>
</div>
</header>
<section class="post-excerpt">
<p>
浅谈常见设计模式
设计模式主要分三个类型: 创建型、结构型和行为型
创建型:
一、Singleton,单例模式:保证一个类只有一个实例,并提供一个访问它的全局访问点
二、Abstract Factory,抽象工厂:提供一个创建一系列相关或相互依赖对象的接口,而无须指定它们的具体类。
三、Factory Method,工厂方法:定义一个用于创建对象的接口,让子类决定实例化哪一个类,Factory Method使一个类的实例化延迟到了子
</p>
</section>
</article>
<article class="post">
<header class="post-header">
<div class="tag-tile">
<a data-pjax href='/tags/shell/'>shell</a>
<a data-pjax href='/tags/正则表达式/'>正则表达式</a>
<span class="fa fa-bookmark" style="float:right;color:#f39c12"></span>
</div>
<h1 class="post-title"><a data-pjax href="/2014/12/17/grep/">grep命令详解-9个经典使用场景</a>
</h1>
<div class="post-meta">
Post on<span class="fa fa-clock-o"></span>
<time datetime="2014-12-17T10:14:35.000Z"
itemprop="datePublished">Dec 17 2014</time>
</div>
</header>
<section class="post-excerpt">
<p>
grep全称Global Regular Expression Print,表示全局正则表达式是一个强大的文本搜索工具,采用正则匹配
1、命令格式
grep [options] files
2、主要参数
-c: 只输出匹配行的数目-i: 不区分大小写-n:显示匹配航以及行号-l:查询多文件的时候只输出包含匹配字符的文件名-v:反向匹配,即显示不匹配的行-h: 查询的时候不适用文件名-s:不显示错误信息
3、部分正则表达
</p>
</section>
</article>
<nav class="pagination" role="pagination">
<span class="page-number">Page 1 of 1</span>
</nav>
</main>
<footer class="site-footer">
<div class="inner">
<section class="copyright"><a href="/"></a> © Stone's Blog 2014</section>
<section class="poweredby">Published with <a target="_blank" href="http://hexo.io/">Hexo </a> and Theme by <a target="_blank" href="https://github.com/yuche/hexo-theme-kael">Kael</a></section>
</div>
</footer>
</div>
</div><!-- /scroller -->
</div><!-- /pusher -->
</div><!-- /container -->
</div>
<!-- Easter eggs -->
<div class="egg animated">
<a id="close-button" href="#">X</a>
<div class="block">
<div class="loading">
<span class="ball1"></span>
<span class="ball2"></span>
</div>
</div>
</div>
<script src="//cdn.staticfile.org/jquery/1.11.0/jquery.min.js"></script>
<script>
if (!window.jQuery) {
var script = document.createElement('script');
script.src = "/js/jquery.min.js";
document.body.appendChild(script);
}
</script>
<script type="text/javascript" src="/js/lib.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
</body>
</html>