-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
695 lines (419 loc) · 34.9 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
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
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>阿驹</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="阿驹的个人博客, 学习笔记, 生活感悟。关注Python, Nodejs, Web开发。爱生活,Geek范。">
<meta property="og:type" content="website">
<meta property="og:title" content="阿驹">
<meta property="og:url" content="http://aju.space/index.html">
<meta property="og:site_name" content="阿驹">
<meta property="og:description" content="阿驹的个人博客, 学习笔记, 生活感悟。关注Python, Nodejs, Web开发。爱生活,Geek范。">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="阿驹">
<meta name="twitter:description" content="阿驹的个人博客, 学习笔记, 生活感悟。关注Python, Nodejs, Web开发。爱生活,Geek范。">
<link rel="alternative" href="/atom.xml" title="阿驹" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,600' rel='stylesheet' type='text/css'> -->
<!-- <link href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700" rel="stylesheet" type="text/css"> -->
<!-- <link href="//fonts.gmirror.org/css?family=Source+Code+Pro:400,700" rel="stylesheet" type="text/css"> -->
<!-- <link href='//fonts.gmirror.org/css?family=Open+Sans:300,600' rel='stylesheet' type='text/css'> -->
<link rel="stylesheet" href="/css/style.css" type="text/css">
<!-- Google Analytics -->
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-70781226-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>
<body>
<div id="container">
<div id="wrap">
<header id="header">
<div id="header-outer" class="outer">
<a href="/" class="logo">阿驹</a>
<div id="header-inner" class="inner">
<nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"></a>
<a class="main-nav-link" href="/">Home</a>
<a class="main-nav-link" href="/archives">Archives</a>
<a class="main-nav-link" href="/about/index.html">About</a>
</nav>
<nav id="sub-nav">
<div id="search-form-wrap">
<form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit"></button><input type="hidden" name="sitesearch" value="http://aju.space"></form>
</div>
<a id="nav-search-btn" class="nav-icon" title="Search"></a>
<a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
<a id="nav-github-link" class="nav-icon" href="https://github.com/denglj/denglj.github.io" title="Fork me on GitHub"></a>
</nav>
</div>
</div>
</header>
<nav id="mobile-nav" class="off">
<a href="/" class="mobile-nav-link">Home</a>
<a href="/archives" class="mobile-nav-link">Archives</a>
<a href="/about/index.html" class="mobile-nav-link">About</a>
<div id="search-form-wrap-mobile">
<form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit"></button><input type="hidden" name="sitesearch" value="http://aju.space"></form>
</div>
</nav>
<div class="outer">
<aside id="sidebar">
<div class="widget-wrap">
<h3 class="widget-title">Archives</h3>
<div class="widget">
<ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/08/">八月 2017</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/09/">九月 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">八月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/06/">六月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/04/">四月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/01/">一月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/12/">十二月 2015</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/11/">十一月 2015</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/10/">十月 2015</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2015/09/">九月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/11/">十一月 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2014/07/">七月 2014</a><span class="archive-list-count">1</span></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Recents</h3>
<div class="widget">
<ul>
<li>
<a href="/2017/07/31/Drive-into-python-asyncio-programming-part-1.html">深入理解Python异步编程(上)</a>
</li>
<li>
<a href="/2016/09/20/blocking-nonblocking-sync-async.html">阻塞、非阻塞、同步、异步</a>
</li>
<li>
<a href="/2016/08/30/what-is-cloud-compute.html">什么是云计算</a>
</li>
<li>
<a href="/2016/08/15/unable-to-find-vcvarsall-bat.html">Unable to find vcvarsall.bat</a>
</li>
<li>
<a href="/2016/06/24/talk-about-time-and-timer.html">UTC+8还是GMT+8?聊聊时间与计时法</a>
</li>
</ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Tags</h3>
<div class="widget">
<ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/杂谈/">-杂谈</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DCOS/">DCOS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/GUI/">GUI</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Kivy/">Kivy</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/">Linux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Mesos/">Mesos</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/OOP/">OOP</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/PIL/">PIL</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Pillow/">Pillow</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/PyQT/">PyQT</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Python/">Python</a><span class="tag-list-count">13</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Python-on-Windows/">Python on Windows</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Web/">Web</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/asyncio/">asyncio</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/cloud/">cloud</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/git/">git</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ssh/">ssh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wechat/">wechat</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wxPython/">wxPython</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/云计算/">云计算</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/协程/">协程</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/字符编码/">字符编码</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/并发/">并发</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/异步/">异步</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/微信开发/">微信开发</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/性能优化/">性能优化</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/非阻塞/">非阻塞</a><span class="tag-list-count">1</span></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Tag Cloud</h3>
<div class="widget tagcloud">
<a href="/tags/杂谈/" style="font-size: 10px;">-杂谈</a> <a href="/tags/DCOS/" style="font-size: 10px;">DCOS</a> <a href="/tags/GUI/" style="font-size: 10px;">GUI</a> <a href="/tags/Kivy/" style="font-size: 10px;">Kivy</a> <a href="/tags/Linux/" style="font-size: 10px;">Linux</a> <a href="/tags/Mesos/" style="font-size: 10px;">Mesos</a> <a href="/tags/OOP/" style="font-size: 10px;">OOP</a> <a href="/tags/PIL/" style="font-size: 10px;">PIL</a> <a href="/tags/Pillow/" style="font-size: 10px;">Pillow</a> <a href="/tags/PyQT/" style="font-size: 10px;">PyQT</a> <a href="/tags/Python/" style="font-size: 20px;">Python</a> <a href="/tags/Python-on-Windows/" style="font-size: 10px;">Python on Windows</a> <a href="/tags/Web/" style="font-size: 10px;">Web</a> <a href="/tags/asyncio/" style="font-size: 10px;">asyncio</a> <a href="/tags/cloud/" style="font-size: 10px;">cloud</a> <a href="/tags/git/" style="font-size: 15px;">git</a> <a href="/tags/python/" style="font-size: 10px;">python</a> <a href="/tags/ssh/" style="font-size: 10px;">ssh</a> <a href="/tags/wechat/" style="font-size: 10px;">wechat</a> <a href="/tags/wxPython/" style="font-size: 10px;">wxPython</a> <a href="/tags/云计算/" style="font-size: 10px;">云计算</a> <a href="/tags/协程/" style="font-size: 10px;">协程</a> <a href="/tags/字符编码/" style="font-size: 10px;">字符编码</a> <a href="/tags/并发/" style="font-size: 15px;">并发</a> <a href="/tags/异步/" style="font-size: 10px;">异步</a> <a href="/tags/微信开发/" style="font-size: 10px;">微信开发</a> <a href="/tags/性能优化/" style="font-size: 10px;">性能优化</a> <a href="/tags/非阻塞/" style="font-size: 10px;">非阻塞</a>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">links</h3>
<div class="widget">
<ul>
<li>
<a href="http://hexo.io">Hexo</a>
</li>
</ul>
</div>
</div>
</aside>
<section id="main">
<article id="post-Drive-into-python-asyncio-programming-part-1" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/07/31/Drive-into-python-asyncio-programming-part-1.html" class="article-date">
<time datetime="2017-07-31T19:13:51.000Z" itemprop="datePublished">2017-08-01</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/07/31/Drive-into-python-asyncio-programming-part-1.html">深入理解Python异步编程(上)</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Python asyncio异步编程中文教程,只此一篇足矣,一览众山小!</p>
<p>彻底理解异步编程是什么、为什么、怎么样。深入学习asyncio的基本原理和原型,了解生成器、协程在Python异步编程中是如何发展的。<br>本文首发至微信公众号<strong>“驹说码事”(jushuoms)</strong>,欢迎关注以获取更多干货!<br>
<p class="article-more-link">
<a href="/2017/07/31/Drive-into-python-asyncio-programming-part-1.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2017/07/31/Drive-into-python-asyncio-programming-part-1.html" data-id="cj7mo2u9c002ckvhi7vsqe6ht" class="article-share-link">分享</a>
<a href="http://aju.space/2017/07/31/Drive-into-python-asyncio-programming-part-1.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/asyncio/">asyncio</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/">python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/协程/">协程</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/并发/">并发</a></li></ul>
</footer>
</div>
</article>
<article id="post-blocking-nonblocking-sync-async" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/09/20/blocking-nonblocking-sync-async.html" class="article-date">
<time datetime="2016-09-20T04:07:39.000Z" itemprop="datePublished">2016-09-20</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/09/20/blocking-nonblocking-sync-async.html">阻塞、非阻塞、同步、异步</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>几个经常容易混淆的概念。特别是像异步与非阻塞,在某些情况下这两个术语常常混用。下面就我谈谈自己对这四个概念的理解,也解释了异步与非阻塞这两个词为何会形影不离。希望对这些概念迷惑,学习Python协程、并发相关的朋友有所帮助。</p>
<h2 id="探究事物的基本逻辑">探究事物的基本逻辑</h2><p><strong>当我们探讨事物的时候,一定要先界定清楚事物的时空界限以及其基本定义,也要先界定清楚探讨的事物/问题的级别或层次</strong>(在阿驹看来,世界上的任何东西都是具有分层/分级的,当我们层次分明的时候,很多架构就显得清晰明了)。<br>
<p class="article-more-link">
<a href="/2016/09/20/blocking-nonblocking-sync-async.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/09/20/blocking-nonblocking-sync-async.html" data-id="cj7mo2u8t001hkvhiv45fesmm" class="article-share-link">分享</a>
<a href="http://aju.space/2016/09/20/blocking-nonblocking-sync-async.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/并发/">并发</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/异步/">异步</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/非阻塞/">非阻塞</a></li></ul>
</footer>
</div>
</article>
<article id="post-what-is-cloud-compute" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/30/what-is-cloud-compute.html" class="article-date">
<time datetime="2016-08-30T02:36:29.000Z" itemprop="datePublished">2016-08-30</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/30/what-is-cloud-compute.html">什么是云计算</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>美国国家标准技术研究所(NIST)对云计算给的基本定义如下。</p>
<h3 id="定义">定义</h3><p>云计算是一个实现了无处不在的、方便的、通过网络访问按需取用可配置的计算资源共享池(例如:网络、服务器、存储、应用程序和服务)的模型,用户能以最小的管理成本或与提供商沟通的代价即可快速配置和发布所需的计算资源。<br>
<p class="article-more-link">
<a href="/2016/08/30/what-is-cloud-compute.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/08/30/what-is-cloud-compute.html" data-id="cj7mo2u7j0001kvhiln5yqkvk" class="article-share-link">分享</a>
<a href="http://aju.space/2016/08/30/what-is-cloud-compute.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/云计算/">云计算</a></li></ul>
</footer>
</div>
</article>
<article id="post-unable-to-find-vcvarsall-bat" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/15/unable-to-find-vcvarsall-bat.html" class="article-date">
<time datetime="2016-08-15T21:09:40.000Z" itemprop="datePublished">2016-08-16</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/15/unable-to-find-vcvarsall-bat.html">Unable to find vcvarsall.bat</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="1-_什么是_vcvarsall-bat_?">1. 什么是 vcvarsall.bat ?</h2><p>Visual Studio 的编译器的一个组件。</p>
<h2 id="2-_使用Python开发环境,何时需要它?">2. 使用Python开发环境,何时需要它?</h2><p>在Windows环境下,使用了lxml、mysqlclient、pillow等第三方库,这些第三方库的一些子模块是用C语言扩展写的。而在安装这些库时试图通过源码安装,需要编译,如果当前系统下没有对应的编译环境,则会报错,这里是报“无法找到vcvarsall.bat”。<br>
<p class="article-more-link">
<a href="/2016/08/15/unable-to-find-vcvarsall-bat.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/08/15/unable-to-find-vcvarsall-bat.html" data-id="cj7mo2u7x000ekvhism8dgycj" class="article-share-link">分享</a>
<a href="http://aju.space/2016/08/15/unable-to-find-vcvarsall-bat.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/">Python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python-on-Windows/">Python on Windows</a></li></ul>
</footer>
</div>
</article>
<article id="post-talk-about-time-and-timer" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/24/talk-about-time-and-timer.html" class="article-date">
<time datetime="2016-06-24T05:17:14.000Z" itemprop="datePublished">2016-06-24</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/24/talk-about-time-and-timer.html">UTC+8还是GMT+8?聊聊时间与计时法</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>今天一位同事问道:“你写入ES的时间字段是考虑过时区处理了的吗?”</p>
<p>原来是我们有一个可能部署在全球各地的软件系统,这个系统会记录各种服务监控指标存入ES(一种数据存档索引系统)。今日那位同事发现他获取的是北京时间,而存入ES系统后却比北京时间晚了8个小时。<br>
<p class="article-more-link">
<a href="/2016/06/24/talk-about-time-and-timer.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/06/24/talk-about-time-and-timer.html" data-id="cj7mo2u80000kkvhipkdcdbs8" class="article-share-link">分享</a>
<a href="http://aju.space/2016/06/24/talk-about-time-and-timer.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/杂谈/">-杂谈</a></li></ul>
</footer>
</div>
</article>
<article id="post-use-S-O-L-I-D-in-python" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/17/use-S-O-L-I-D-in-python.html" class="article-date">
<time datetime="2016-06-17T04:10:31.000Z" itemprop="datePublished">2016-06-17</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/17/use-S-O-L-I-D-in-python.html">如何在Python里应用SOLID原则</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>如今OOP编程大行其道。不少人以为用编程语言里的class关键字定义一个类,然后用类创建一个对象就是OOP了。肤浅!</p>
<p>OOP编程很贴近人们的正常思维方式,所以容易被接受,而且应用也很广泛。的确,这给编程带来了很大的好处。但并不是任何人都能深谙OOP的本质。简略证明如下:如果把“女朋友”作为一个类,你自己的女朋友就是你的对象,是“女朋友”类的具体的实例。如果你能熟练掌握“女朋友”这个类的特性以及方法,还不能创建一个实例么?你没女朋友,说明你没吃透女朋友类,进而说明你肯定没理解好OOP。但创建了一个实例出来也并不能证明你就吃透了这个类。<br>
<p class="article-more-link">
<a href="/2016/06/17/use-S-O-L-I-D-in-python.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/06/17/use-S-O-L-I-D-in-python.html" data-id="cj7mo2u7v0009kvhi97g12lyh" class="article-share-link">分享</a>
<a href="http://aju.space/2016/06/17/use-S-O-L-I-D-in-python.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/OOP/">OOP</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/">Python</a></li></ul>
</footer>
</div>
</article>
<article id="post-Mesosphere-DCOS-Questions" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/04/27/Mesosphere-DCOS-Questions.html" class="article-date">
<time datetime="2016-04-27T21:20:01.000Z" itemprop="datePublished">2016-04-28</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/04/27/Mesosphere-DCOS-Questions.html">Mesosphere DCOS 常见问题</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>本文摘自Mesosphere 官网,可以从这些常见问题中明确Mesosphere DOCS的定位以及作用。并可一瞥其架构。<br>
<p class="article-more-link">
<a href="/2016/04/27/Mesosphere-DCOS-Questions.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/04/27/Mesosphere-DCOS-Questions.html" data-id="cj7mo2u980025kvhiqictwt3l" class="article-share-link">分享</a>
<a href="http://aju.space/2016/04/27/Mesosphere-DCOS-Questions.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/DCOS/">DCOS</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Mesos/">Mesos</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/cloud/">cloud</a></li></ul>
</footer>
</div>
</article>
<article id="post-use-multi-ssh-key-for-git" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/04/20/use-multi-ssh-key-for-git.html" class="article-date">
<time datetime="2016-04-20T01:30:02.000Z" itemprop="datePublished">2016-04-20</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/04/20/use-multi-ssh-key-for-git.html">管理多个SSH Key以支持多个Git账号</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>SSH Key 可以方便地解决系统登录的问题,不用每次提交代码时输入相关Git平台的登录密码。</p>
<p>由于各种各样的原因,程序猿一般都有多台电脑或多个开发系统环境,同样也有多个Git账户,最起码的可能有一个GitHub账户加公司内部的一个GitLab账户。可能不同的账户有不同的用户名,邮箱等。</p>
<h2 id="1-_生成SSH密钥">1. 生成SSH密钥</h2><ul>
<li><h4 id="生成默认公钥">生成默认公钥</h4>先确认系统中是否已有默认的SSH密钥(使用的是公钥,之后都称公钥)存在。</li>
</ul>
<figure class="highlight crystal"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cat ~<span class="regexp">/.ssh/id</span>_rsa.pub</span><br></pre></td></tr></table></figure>
<p>如果已经有了则不用生成默认的公钥了,如果没有,则按照如下命令生成。生成后再用上述<code>cat</code>命令查看公钥。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ssh-keygen -t rsa -C <span class="string">"<span class="variable">$your_email</span>"</span></span><br></pre></td></tr></table></figure>
<p>将上述的<code>$your_email</code>替换为你想使用的默认email地址。如我在工作电脑上生成默认公钥时邮箱使用的是公司内部邮箱。在私人电脑上则用的是本人Gmail邮箱。</p>
<p class="article-more-link">
<a href="/2016/04/20/use-multi-ssh-key-for-git.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/04/20/use-multi-ssh-key-for-git.html" data-id="cj7mo2u7r0004kvhilhzmrjzy" class="article-share-link">分享</a>
<a href="http://aju.space/2016/04/20/use-multi-ssh-key-for-git.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/git/">git</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ssh/">ssh</a></li></ul>
</footer>
</div>
</article>
<article id="post-python-memoization" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/01/22/python-memoization.html" class="article-date">
<time datetime="2016-01-22T06:43:16.000Z" itemprop="datePublished">2016-01-22</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/01/22/python-memoization.html">Python性能优化之记忆化(Memoization)</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="记忆化(Memoization)介绍">记忆化(Memoization)介绍</h2><p>简单说来 Memoization 是一种利用缓存来加速函数调用的技术手段,将消耗较大的调用结果存储起来,当再次遇到相同调用时就从缓存读取结果而无需重新计算。<br><strong>有一个限制条件是该函数必须是纯函数式的</strong>,相当于函数式编程中的不可变性,即输入一致时输出一定不会改变。比如计算平方的函数就满足这种条件,<code>square(3)</code> 的结果永远是<code>9</code>,所以我们才能把它的结果存储起来,下次需要知道<code>3</code>的平方的结果时,无需计算,直接从内存中读取就好了。<br>
<p class="article-more-link">
<a href="/2016/01/22/python-memoization.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/01/22/python-memoization.html" data-id="cj7mo2u83000nkvhikg5tkhx4" class="article-share-link">分享</a>
<a href="http://aju.space/2016/01/22/python-memoization.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/">Python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/性能优化/">性能优化</a></li></ul>
</footer>
</div>
</article>
<article id="post-dive-into-python-decorator" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/01/14/dive-into-python-decorator.html" class="article-date">
<time datetime="2016-01-14T05:52:34.000Z" itemprop="datePublished">2016-01-14</time>
</a>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/01/14/dive-into-python-decorator.html">深入浅出Python装饰器</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<p>有朋友说看到《Python CookBook》的装饰器部分有些迷糊,究其原因是没有清晰地理解Python装饰器是什么,能干什么。于是有了本文。看此文时,从头到尾跟着思路走,应该会对Python装饰器有更明白深刻的认识。新手不要跳读,新手不要跳读,新手不要跳读。<br>本文假定你已经明白了Python中什么叫做函数,变量的作用域、解析规则及生存周期。阿驹还是简单阐述一下:</p>
<ul>
<li><strong>作用域</strong>: 变量起作用的范围, 也称之为命名空间。以方法、类、函数、模块、包、Python内置环境(当前Python解释器的Python Path里所包含的)这几个的程序结构为单元,以<code>大结构</code>包含<code>小结构</code>,<code>外层</code>包含<code>内层</code>的方式,把变量放置在这样一个个的空间中,一个程序结构单元就对应一个作用域(命名空间)。每个变量,不加global和nonlocal关键字时,只属于声明该变量的这层作用域。
<p class="article-more-link">
<a href="/2016/01/14/dive-into-python-decorator.html#more">阅读全文</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://aju.space/2016/01/14/dive-into-python-decorator.html" data-id="cj7mo2u8q001fkvhiwfl1kwfr" class="article-share-link">分享</a>
<a href="http://aju.space/2016/01/14/dive-into-python-decorator.html#disqus_thread" class="article-comment-link">评论</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Python/">Python</a></li></ul>
</footer>
</div>
</article>
<nav id="page-nav">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><a class="extend next" rel="next" href="/page/2/">Next »</a>
</nav>
</section>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
<a href="/" class="logo">阿驹</a>
© 2014-2017 阿驹<br>
Powered by <a href="http://hexo.io/" target="_blank" style="font-weight: bold">Hexo</a><br>
Hosted by <a href="https://pages.coding.me" style="font-weight: bold" target="_blank">Coding Pages</a>
</div>
</div>
</footer>
</div>
<script>
var disqus_shortname = 'aju';
(function(){
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<script src="/js/jquery.min.js" type="text/javascript"></script>
<script src="/js/jquery.scrollLoading.js" type="text/javascript"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>
<script src="/js/script.js" type="text/javascript"></script>
</div>
</body>
</html>