-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
561 lines (473 loc) · 21.3 KB
/
index2.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
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
<!DOCTYPE html>
<html lang="chinese (simplified)" prefix="og: http://ogp.me/ns# fb: https://www.facebook.com/2008/fbml">
<head>
<title>天天的博客</title>
<!-- Using the latest rendering mode for IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="/pictures/favicon.ico" rel="icon">
<link rel="canonical" href="">
<meta name="author" content="天天" />
<!-- Open Graph tags -->
<meta property="og:site_name" content="天天的博客" />
<meta property="og:type" content="website"/>
<meta property="og:title" content="天天的博客"/>
<meta property="og:url" content=""/>
<meta property="og:description" content="天天的博客"/>
<!-- Bootstrap -->
<link rel="stylesheet" href="/theme/css/bootstrap.journal.min.css" type="text/css"/>
<link href="/theme/css/font-awesome.min.css" rel="stylesheet">
<link href="/theme/css/pygments/monokai.css" rel="stylesheet">
<link href="/theme/tipuesearch/tipuesearch.css" rel="stylesheet">
<link rel="stylesheet" href="/theme/css/style.css" type="text/css"/>
<link href="/static/css/custom.css" rel="stylesheet">
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="/" class="navbar-brand">
天天的博客 </a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="/">文章</a></li>
<li><a href="/tags.html">标签</a></li>
<li><a href="/categories.html">分类</a></li>
<li><a href="/archives.html">归档</a></li>
<li><a href="/pages/shu-ji.html">
书籍
</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><span>
<form class="navbar-search" action="/search.html">
<input type="text" class="search-query" placeholder="Search" name="q" id="tipue_search_input" required>
</form></span>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</div>
</div> <!-- /.navbar -->
<!-- Banner -->
<style>
#banner{
background-image:url("/pictures/banner.jpg");
}
</style>
<div id="banner">
<div class="container">
<div class="copy">
<h1>天天的博客</h1>
<p class="intro">自律给我自由</p>
</div>
</div>
</div><!-- End Banner -->
<div class="container">
<div class="row">
<div class="col-sm-9">
<article>
<h2><a href="/posts/qi-ta/git常用命令.html">git常用命令</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-08-14T15:08:00+08:00"> 2016-08-14(周日)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/qi-ta.html">其他</a>
<span class="label label-default">Tags</span>
<a href="/tag/git.html">git</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><h3 id="_1">创建</h3>
<p>复制一个已创建的仓库:</p>
<div class="highlight"><pre><span></span>$ git clone ssh://user@domain.com/repo.git
</pre></div>
<p>创建一个新的本地仓库:</p>
<div class="highlight"><pre><span></span>$ git init
</pre></div>
<hr>
<h3 id="_2">本地修改</h3>
<p>显示工作路径下已修改的文件:</p>
<div class="highlight"><pre><span></span>$ git status
</pre></div>
<p>显示与上次提交版本文件的不同:</p>
<div class="highlight"><pre><span></span>$ git diff …</pre></div>
<a class="btn btn-default btn-xs" href="/posts/qi-ta/git常用命令.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/python/安装Django遇到的坑.html">安装Django遇到的坑</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-08-05T09:20:00+08:00"> 2016-08-05(周五)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/python.html">python</a>
<span class="label label-default">Tags</span>
<a href="/tag/python.html">python</a>
/
<a href="/tag/django.html">django</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><p>用<code>django-admin.py startproject your-project</code>命令创建项目</p>
<blockquote>
<p>报错:ImportError: No module named django.core</p>
</blockquote>
<p>明明已经安装好了Django,却提示没有Django模块,搞什么鬼?
最后查阅资料发现,是因为安装了多个版本Python。
<strong>解决办法:</strong></p>
<div class="highlight"><pre><span></span>python3 …</pre></div>
<a class="btn btn-default btn-xs" href="/posts/python/安装Django遇到的坑.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/php/php常用魔术方法.html">php常用魔术方法</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-06-23T12:33:00+08:00"> 2016-06-23(周四)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/php.html">php</a>
<span class="label label-default">Tags</span>
<a href="/tag/php.html">php</a>
/
<a href="/tag/mo-zhu-fang-fa.html">魔术方法</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><div class="highlight"><pre><span></span><span class="kr">class</span> <span class="nx">Ceshi</span><span class="p">{</span>
<span class="kr">public</span> <span class="nx">$array</span><span class="p">;</span>
<span class="cm">/*</span>
<span class="cm"> * 对一个不存在的属性进行赋值时,触发此方法</span>
<span class="cm"> * */</span>
<span class="kd">function</span> <span class="nx">__set</span><span class="p">(</span><span class="nx">$name</span><span class="p">,</span> <span class="nx">$value</span><span class="p">)</span>
<span class="p">{</span>
<span class="c1">// TODO: Implement __set() method.</span>
<span class="nx">$this</span><span class="o">-></span><span class="nx">array</span><span class="p">[</span><span class="nx">$name</span><span class="p">]</span> <span class="o">=</span> <span class="nx">$value</span><span class="p">;</span>
<span class="p">}</span>
<span class="cm">/*</span>
<span class="cm"> * 获取一个不存在的属性时,触发此方法 …</span></pre></div>
<a class="btn btn-default btn-xs" href="/posts/php/php常用魔术方法.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/shu-ju-ku/mysql开发技巧-join连表查询.html">mysql开发技巧-join连表查询</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-03-04T13:59:00+08:00"> 2016-03-04(周五)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/shu-ju-ku.html">数据库</a>
<span class="label label-default">Tags</span>
<a href="/tag/shu-ju-ku.html">数据库</a>
/
<a href="/tag/mysql.html">mysql</a>
</footer><!-- /.post-info --> </div>
<div class="summary">
<a class="btn btn-default btn-xs" href="/posts/shu-ju-ku/mysql开发技巧-join连表查询.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/php/php观察者模式.html">php观察者模式</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-02-20T13:08:00+08:00"> 2016-02-20(周六)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/php.html">php</a>
<span class="label label-default">Tags</span>
<a href="/tag/php.html">php</a>
/
<a href="/tag/guan-cha-zhe-mo-shi.html">观察者模式</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><p>当发生一个事件后,可能需要执行多种业务的逻辑操作,这里的每一种逻辑都是一个观察者。</p>
<hr>
<p><strong>观察者基类</strong></p>
<div class="highlight"><pre><span></span>abstract class EventGenerator{
private $observers = [];//观察者对象数组
/*
* 添加观察者
* */
function addObserver(Observer $observer){
$this->observers[] = $observer;
}
/*
* 通知观察者
* */
function …</pre></div>
<a class="btn btn-default btn-xs" href="/posts/php/php观察者模式.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/php/php简单工厂模式.html">php简单工厂模式</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-02-18T16:34:00+08:00"> 2016-02-18(周四)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/php.html">php</a>
<span class="label label-default">Tags</span>
<a href="/tag/php.html">php</a>
/
<a href="/tag/gong-han-mo-shi.html">工厂模式</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><p>有个<strong>Databases</strong>类,传统用法是,哪里需要,哪里<code>new Databases;</code>;这样若<strong>Databases</strong>对象发生了改变,则有实例化<strong>Databases</strong>的地方都要相应改变。</p>
<p>采用工厂模式实现:</p>
<div class="highlight"><pre><span></span><span class="cm">/*</span>
<span class="cm">*工厂模式</span>
<span class="cm">**/</span>
<span class="kr">class</span> <span class="nx">Factory</span><span class="p">{</span>
<span class="kr">static</span> <span class="kd">function …</span></pre></div>
<a class="btn btn-default btn-xs" href="/posts/php/php简单工厂模式.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/php/php数据映射模式.html">php数据映射模式</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-02-16T14:44:00+08:00"> 2016-02-16(周二)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/php.html">php</a>
<span class="label label-default">Tags</span>
<a href="/tag/php.html">php</a>
/
<a href="/tag/shu-ju-ying-she-mo-shi.html">数据映射模式</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><p><strong>获取用户id为$id的用户对象</strong></p>
<div class="highlight"><pre><span></span><span class="cm">/*</span>
<span class="cm">*数据映射模式</span>
<span class="cm">**/</span>
<span class="kr">class</span> <span class="nx">User</span><span class="p">{</span>
<span class="c1">//这里的id,name,age属性和数据库中的字段相对应</span>
<span class="kr">public</span> <span class="nx">$id</span><span class="p">;</span>
<span class="kr">public</span> <span class="nx">$name</span><span class="p">;</span>
<span class="kr">public</span> <span class="nx">$age</span><span class="p">;</span>
<span class="kr">protected</span> <span class="nx">$db</span><span class="p">;</span>
<span class="kd">function</span> <span class="nx">__construct</span><span class="p">(</span><span class="nx">$id</span><span class="p">)</span>
<span class="p">{</span>
<span class="nx">$this …</span></pre></div>
<a class="btn btn-default btn-xs" href="/posts/php/php数据映射模式.html">more ...</a>
</div>
</article>
<hr/>
<article>
<h2><a href="/posts/php/php策略模式.html">php策略模式</a></h2>
<div class="well well-sm">
<footer class="post-info">
<span class="label label-default">Date</span>
<span class="published">
<i class="fa fa-calendar"></i><time datetime="2016-02-15T15:57:00+08:00"> 2016-02-15(周一)</time>
</span>
<span class="label label-default">Category</span>
<a href="/category/php.html">php</a>
<span class="label label-default">Tags</span>
<a href="/tag/php.html">php</a>
/
<a href="/tag/ce-lue-mo-shi.html">策略模式</a>
</footer><!-- /.post-info --> </div>
<div class="summary"><p>需求:对于不同的用户展示不同的内容</p>
<hr>
<p><strong>定义接口</strong></p>
<div class="highlight"><pre><span></span><span class="kr">interface</span> <span class="nx">UserStrategy</span><span class="p">{</span>
<span class="kd">function</span> <span class="nx">showAd</span><span class="p">();</span><span class="c1">//展示广告</span>
<span class="kd">function</span> <span class="nx">showCategory</span><span class="p">();</span><span class="c1">//展示分类</span>
<span class="p">}</span>
</pre></div>
<hr>
<p><strong>普通用户展示的内容</strong></p>
<div class="highlight"><pre><span></span><span class="kr">class</span> <span class="nx">CommonUser</span> <span class="kr">implements</span> <span class="nx">UserStrategy</span><span class="p">{</span>
<span class="kr">public</span> <span class="kd">function</span> <span class="nx">showAd</span><span class="p">()</span>
<span class="p">{</span>
<span class="c1">// TODO …</span></pre></div>
<a class="btn btn-default btn-xs" href="/posts/php/php策略模式.html">more ...</a>
</div>
</article>
<hr/>
<ul class="pagination">
<li class="prev"><a href="/index.html">«</a>
</li>
<li class=""><a
href="/index.html">1</a></li>
<li class="active"><a
href="/index2.html">2</a></li>
<li class=""><a
href="/index3.html">3</a></li>
<li class=""><a
href="/index4.html">4</a></li>
<li class="next"><a
href="/index3.html">»</a></li>
</ul>
</div>
<div class="col-sm-3" id="sidebar">
<aside>
<!-- Sidebar -->
<section class="well well-sm">
<ul class="list-group list-group-flush">
<!-- Sidebar/Social -->
<li class="list-group-item">
<h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Social</span></h4>
<ul class="list-group" id="social">
<li class="list-group-item"><a href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=Uionfyg6OyU3PBIjI3wxPT8"><i class="fa fa-envelope fa-lg"></i> 给我写信</a></li>
</ul>
</li>
<!-- End Sidebar/Social -->
<!-- Sidebar/Categories -->
<li class="list-group-item">
<h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4>
<ul class="list-group" id="categories">
<li class="list-group-item">
<a href="/category/linux.html"><i class="fa fa-folder-open fa-lg"></i>linux</a>
</li>
<li class="list-group-item">
<a href="/category/php.html"><i class="fa fa-folder-open fa-lg"></i>php</a>
</li>
<li class="list-group-item">
<a href="/category/python.html"><i class="fa fa-folder-open fa-lg"></i>python</a>
</li>
<li class="list-group-item">
<a href="/category/qi-ta.html"><i class="fa fa-folder-open fa-lg"></i>其他</a>
</li>
<li class="list-group-item">
<a href="/category/shu-ju-ku.html"><i class="fa fa-folder-open fa-lg"></i>数据库</a>
</li>
</ul>
</li>
<!-- End Sidebar/Categories -->
<!-- Sidebar/Tag Cloud -->
<li class="list-group-item">
<a href="/tags.html"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a>
<ul class="list-group list-inline tagcloud" id="tags">
<li class="list-group-item tag-4">
<a href="/tag/ce-lue-mo-shi.html">策略模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/cgi.html">cgi</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/crontab.html">crontab</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/curl.html">curl</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/dan-li-mo-shi.html">单例模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/ding-shi-ren-wu.html">定时任务</a>
</li>
<li class="list-group-item tag-2">
<a href="/tag/django.html">django</a>
</li>
<li class="list-group-item tag-3">
<a href="/tag/git.html">git</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/gong-han-mo-shi.html">工厂模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/gua-pei-qi-mo-shi.html">适配器模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/guan-cha-zhe-mo-shi.html">观察者模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/json.html">json</a>
</li>
<li class="list-group-item tag-3">
<a href="/tag/linux.html">linux</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/mo-zhu-fang-fa.html">魔术方法</a>
</li>
<li class="list-group-item tag-2">
<a href="/tag/mysql.html">mysql</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/pelican.html">pelican</a>
</li>
<li class="list-group-item tag-1">
<a href="/tag/php.html">php</a>
</li>
<li class="list-group-item tag-1">
<a href="/tag/python.html">python</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/redis.html">redis</a>
</li>
<li class="list-group-item tag-2">
<a href="/tag/shu-ju-ku.html">数据库</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/shu-ju-ying-she-mo-shi.html">数据映射模式</a>
</li>
<li class="list-group-item tag-4">
<a href="/tag/zhu-ce-shu-mo-shi.html">注册树模式</a>
</li>
</ul>
</li>
<!-- End Sidebar/Tag Cloud -->
<!-- Sidebar/Links -->
<li class="list-group-item">
<h4><i class="fa fa-external-link-square fa-lg"></i><span class="icon-label">Links</span></h4>
<ul class="list-group" id="links">
<li class="list-group-item">
<a href="https://yiyibooks.cn/xx/django_182/index.html" target="_blank">Django 1.8.2 中文文档</a>
</li>
<li class="list-group-item">
<a href="https://yiyibooks.cn/xx/python_352/index.html" target="_blank">Python 3.5.2 中文文档</a>
</li>
</ul>
</li>
<!-- End Sidebar/Links -->
</ul>
</section>
<!-- End Sidebar --> </aside>
</div>
</div>
</div>
<footer>
<div class="container">
<hr>
<div class="row">
<div class="col-xs-10">© 2018 天天
· Powered by <a href="https://github.com/getpelican/pelican-themes/tree/master/pelican-bootstrap3" target="_blank">pelican-bootstrap3</a>,
<a href="http://docs.getpelican.com/" target="_blank">Pelican</a>,
<a href="http://getbootstrap.com" target="_blank">Bootstrap</a> </div>
<div class="col-xs-2"><p class="pull-right"><i class="fa fa-arrow-up"></i> <a href="#">Back to top</a></p></div>
</div>
</div>
</footer>
<script src="/theme/js/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/theme/js/bootstrap.min.js"></script>
<!-- Enable responsive features in IE8 with Respond.js (https://github.com/scottjehl/Respond) -->
<script src="/theme/js/respond.min.js"></script>
<script src="/static/js/custom.js"></script>
<script src="/theme/js/bodypadding.js"></script>
</body>
</html>