-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
562 lines (285 loc) · 14.8 KB
/
index.html
File metadata and controls
562 lines (285 loc) · 14.8 KB
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
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="alternate" href="/atom.xml" title="Anniywell">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.0.1" />
<link rel="canonical" href="https://anniywell.github.io/"/>
<meta property="og:type" content="website">
<meta property="og:title" content="Anniywell">
<meta property="og:url" content="https://anniywell.github.io/index.html">
<meta property="og:site_name" content="Anniywell">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Anniywell">
<link rel="stylesheet" type="text/css" href="/css/style.css?v=0.0.1" />
<link rel="stylesheet" type="text/css" href="/css/search.css" />
<link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />
<script>
var CONFIG = {
search: true,
searchPath: "/search.xml",
fancybox: true,
toc: true,
}
</script>
<title> Anniywell </title>
</head>
<body><div id="mobile-navbar" class="mobile-navbar">
<div class="mobile-header-logo">
<a href="/." class="logo">Anniywell</a>
</div>
<div class="mobile-navbar-icon">
<span></span>
<span></span>
<span></span>
</div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
<ul class="mobile-menu-list">
<a href="/">
<li class="mobile-menu-item">
Home
</li>
</a>
<a href="/archives/">
<li class="mobile-menu-item">
Archives
</li>
</a>
<a href="/tags">
<li class="mobile-menu-item">
Tags
</li>
</a>
<a href="/categories">
<li class="mobile-menu-item">
Categories
</li>
</a>
<a href="/about">
<li class="mobile-menu-item">
About
</li>
</a>
</ul>
</nav>
<div class="container" id="mobile-panel">
<header id="header" class="header"><div class="logo-wrapper">
<a href="/." class="logo">Anniywell</a>
</div>
<nav class="site-navbar">
<ul id="menu" class="menu">
<li class="menu-item">
<a class="menu-item-link" href="/">
首页
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/archives/">
归档
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/tags">
标签
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/categories">
分类
</a>
</li>
<li class="menu-item">
<a class="menu-item-link" href="/about">
关于
</a>
</li>
<li class="menu-search">
<a href="#search" class="iconfont icon-search" id="search_btn"></a>
</li>
</ul>
</nav>
</header>
<main id="main" class="main">
<div class="content-wrapper">
<div id="content" class="content">
<section id="posts" class="posts">
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/06/23/Windows软件清单/">Windows软件清单</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017年6月23日
</span>
</div>
</header>
<div class="post-content">
<h2 id="日常"><a href="#日常" class="headerlink" title="日常"></a>日常</h2><h3 id="浏览器"><a href="#浏览器" class="headerlink" title="浏览器"></a>浏览器</h3><p><a href="https://www.mozilla.org/en-US/firefox/all/" target="_blank" rel="external">Firefox国际版</a><br><a href="https://www.google.cn/chrome/browser/desktop/index.html" target="_blank" rel="external">Chrome</a><br><a href="https://vivaldi.com/download/" target="_blank" rel="external">Vivaldi</a></p>
<h3 id="下载"><a href="#下载" class="headerlink" title="下载"></a>下载</h3><p><a href="">迅雷极速版</a></p>
<h3 id="压缩归档"><a href="#压缩归档" class="headerlink" title="压缩归档"></a>压缩归档</h3><p><a href="http://www.7-zip.org/" target="_blank" rel="external">7-Zip</a></p>
<h3 id="编辑阅读"><a href="#编辑阅读" class="headerlink" title="编辑阅读"></a>编辑阅读</h3><p><a href="http://ep.wps.cn/product/wps-office-download.html" target="_blank" rel="external">WPS专业增强版</a><br><a href="https://www.sumatrapdfreader.org/download-free-pdf-viewer.html" target="_blank" rel="external">SumatraPDF</a></p>
<div class="read-more">
<a href="/2017/06/23/Windows软件清单/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/06/23/Python协程/">Python协程</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017年6月23日
</span>
</div>
</header>
<div class="post-content">
<h2 id="协程简介"><a href="#协程简介" class="headerlink" title="协程简介"></a>协程简介</h2><p>协程,即协作式程序,又称微线程、纤程,英文名Coroutine。</p>
<p>其思想是,一系列互相依赖的协程间依次使用CPU,每次只有一个协程工作,而其他协程处于休眠状态。协程可以在运行期间的某个点上暂停执行,并在恢复运行时从暂停的点上继续执行。<br>协程已经被证明是一种非常有用的程序组件,不仅被python、lua、ruby等脚本语言广泛采用,而且被新一代面向多核的编程语言如golang rust-lang等采用作为并发的基本单位。<br>协程可以被认为是一种用户空间线程,与传统的线程相比,有2个主要的优点:</p>
<ul>
<li>与线程不同,协程是自己主动让出CPU,并交付他期望的下一个协程运行,而不是在任何时候都有可能被系统调度打断。因此协程的使用更加清晰易懂,并且多数情况下不需要锁机制。</li>
<li>与线程相比,协程的切换由程序控制,发生在用户空间而非内核空间,因此切换的代价非常小。</li>
</ul>
<p>总结起来是一句话:协程可以认为是一种用户态线程,与系统提供的线程不同点是,它需要主动让出CPU时间,而不是由系统进行调度,即控制权在程序员手上。</p>
<h2 id="Python协程史"><a href="#Python协程史" class="headerlink" title="Python协程史"></a>Python协程史</h2><ul>
<li>Python 2.2 中的生成器让代码执行过程可以暂停 (yield)</li>
<li>Python 2.5 中可以将值返回给暂停的生成器,这使得 Python 中协程的概念成为可能 (send)</li>
<li>Python 3.3 中的 yield from,使得重构生成器与将它们串联起来都很简单 (yield from)</li>
<li>Python 3.4 以后通过标准库 asyncio 获得了事件循环的特性 (asyncio)</li>
<li>Python 3.5 使用async/await语法引入对协程的显式支持 (async/await)</li>
<li>Python 3.6 增强asyncio,支持异步生成器、异步解析式</li>
</ul>
<div class="read-more">
<a href="/2017/06/23/Python协程/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/06/16/浅析Python元类及应用/">浅析Python元类及应用</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017年6月16日
</span>
</div>
</header>
<div class="post-content">
<h2 id="写这篇文章的缘由"><a href="#写这篇文章的缘由" class="headerlink" title="写这篇文章的缘由"></a>写这篇文章的缘由</h2><p>前几天去一家公司面试,面试的岗位是Python后台开发,面试中被问到了一道题,考虑很久想不到答案,顾回来查阅资料在此总结一下。<br>题目的描述是这样的:<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">SQLAlchemy中Model中定义类成员时,如何做到声明顺序与数据库表的列顺序一致</div><div class="line">提示:普通类成员是存储在__dict__,而dict本身是无序的</div></pre></td></tr></table></figure></p>
<p>通过阅读SQLAlchemy源码得知,其内部实现是使用元类编程来完成的,元类编程是Python的一种高级黑暗魔法,经常听其大名,并没有进入深入了解,借此机会稍微总结一下。</p>
<h2 id="元编程"><a href="#元编程" class="headerlink" title="元编程"></a>元编程</h2><p>元编程我个人理解是:<strong>用代码生成(操纵)代码</strong>的编程手法。<br>Python中元编程的几种手段:</p>
<ul>
<li>预定义方法</li>
<li>函数赋值</li>
<li>descriptor</li>
<li>eval</li>
<li>元类</li>
</ul>
<p>上面的几种方式相对于元类来说简单一些,这里暂时先不讲了,以后有时间再去补充<br>
<div class="read-more">
<a href="/2017/06/16/浅析Python元类及应用/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/06/16/hello-world/">Hello World</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017年6月16日
</span>
</div>
</header>
<div class="post-content">
<p>Welcome to <a href="https://hexo.io/" target="_blank" rel="external">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/" target="_blank" rel="external">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html" target="_blank" rel="external">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues" target="_blank" rel="external">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">$ hexo new <span class="string">"My New Post"</span></div></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html" target="_blank" rel="external">Writing</a><br>
<div class="read-more">
<a href="/2017/06/16/hello-world/" class="read-more-link">阅读更多</a>
</div>
</div>
</article>
<article class="post">
<header class="post-header">
<h1 class="post-title">
<a class="post-link" href="/2017/06/16/My-blog/">My blog</a>
</h1>
<div class="post-meta">
<span class="post-time">
2017年6月16日
</span>
</div>
</header>
<div class="post-content">
<h2 id="关于博客"><a href="#关于博客" class="headerlink" title="关于博客"></a>关于博客</h2><p>此blog是基于hexo-theme-even修改而来,目前已经托管到我个人的github仓库中,后面会持续更新。</p>
<h2 id="博客内容"><a href="#博客内容" class="headerlink" title="博客内容"></a>博客内容</h2><p>以技术学习与分享为主,主要关注:</p>
<ol>
<li>Web全栈</li>
<li>JavaScript</li>
<li>Node.js</li>
<li>Python3</li>
<li>Swift</li>
<li><hr>
</li>
</ol>
</div>
</article>
</section>
<nav class="pagination">
</nav>
</div>
</div>
</main>
<footer id="footer" class="footer">
<div class="social-links">
<a href="mailto:wellq.an@email.com" class="iconfont icon-email" title="email"></a>
<a href="/atom.xml" class="iconfont icon-rss" title="rss"></a>
</div>
<div class="copyright">
<span class="power-by">
由 <a class="hexo-link" href="https://hexo.io/">Hexo</a> 强力驱动
</span>
<span class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/Anniywell/hexo-theme-well">Well</a>
</span>
<span class="copyright-year">
©
2017
<span class="heart">
<i class="iconfont icon-heart"></i>
</span>
<span class="author">Anniywell</span>
</span>
</div>
</footer>
<div class="back-to-top" id="back-to-top">
<i class="iconfont icon-up"></i>
</div>
</div>
<script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="/lib/slideout/slideout.js"></script>
<script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/js/src/well.js?v=0.0.1"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=0.0.1"></script>
<div class="modal search-modal">
<div class="input-field">
<input type="text" id='search_input'>
<label for="search-input">搜索</label>
</div>
<div class="search-result" id="search_result"></div>
</div>
<div class="blog-overlay"></div>
<script src="/js/src/search.js"></script>
</body>
</html>