-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
927 lines (541 loc) · 40.1 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
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
<meta charset="utf-8">
<title>^_^</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta property="og:type" content="website">
<meta property="og:title" content="^_^">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="^_^">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="^_^">
<link rel="alternate" href="/atom.xml" title="^_^" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="container">
<div id="wrap">
<header id="header">
<div id="banner"></div>
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<h1 id="logo-wrap">
<a href="/" id="logo">^_^</a>
</h1>
<h2 id="subtitle-wrap">
<a href="/" id="subtitle">在你的立足之地深挖下去,就会有泉水涌出!别管蒙昧者们叫嚷:“下面是地狱”</a>
</h2>
</div>
<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">About</a>
</nav>
<nav id="sub-nav">
<a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
<a id="nav-search-btn" class="nav-icon" title="Search"></a>
</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" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit"></button><input type="hidden" name="sitesearch" value="http://yoursite.com"></form>
</div>
</div>
</div>
</header>
<div class="outer">
<section id="main">
<article id="post-IO虚拟化--SR-IOV" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2018/06/17/IO虚拟化--SR-IOV/" class="article-date">
<time datetime="2018-06-17T03:56:04.000Z" itemprop="datePublished">2018-06-17</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/虚拟化/">虚拟化</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/06/17/IO虚拟化--SR-IOV/">I/O虚拟化 && SR-IOV</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="1-介绍"><a href="#1-介绍" class="headerlink" title="1.介绍"></a>1.介绍</h2><p> 在Guest和Host间添加虚拟化层会引入很大的开销;计算工业界中一直在努力来解决这种开销。<br> 为此,英特尔推出了一系列在英特尔虚拟化技术(intel@ VT )支持下的处理器、芯片组和以太网控制器增强功能。intel@ VT 系列技术可提高虚拟化平台的性能、效率和健壮性。<br> 在此之上 PCI-SIG 制定了一种单根I/O虚拟化规范(SR-IOV) ,SR-IOV 的做法是在 I/O 子系统中开发一种扩展机制,以解决 I/O 设备的共享问题。<br><img src="/imgs/SR-IOV/imagex.png" alt="figure1"></p>
<p class="article-more-link">
<a href="/2018/06/17/IO虚拟化--SR-IOV/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2018/06/17/IO虚拟化--SR-IOV/" data-id="cjvc032bf001slcvxxkdobw4q" class="article-share-link">Share</a>
<a href="http://yoursite.com/2018/06/17/IO虚拟化--SR-IOV/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/I-O虚拟化/">I/O虚拟化</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SR-IOV/">SR-IOV</a></li></ul>
</footer>
</div>
</article>
<article id="post-rpm_spec" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2018/04/06/rpm_spec/" class="article-date">
<time datetime="2018-04-06T07:20:03.000Z" itemprop="datePublished">2018-04-06</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/linux/">linux</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/04/06/rpm_spec/">RPM 使用与 SPEC 文件</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="1-概述"><a href="#1-概述" class="headerlink" title="1. 概述"></a>1. 概述</h2><p>RPM全称是 Red Hat Package Manager(Red Hat包管理器)。</p>
<p>RPM的发布基于GPL协议(GNU通用公共授權條款GNU General Public License,简称GNU <em>GPL</em>、<em>GPL</em>)。</p>
<p>RPM有五种基本的操作功能(不包括创建软件包):安装、卸载、升级、查询、和验证。关于rpm命令的使用我们可以用以下命令:</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[root@serverwyq wyq]# rpm --help</span><br></pre></td></tr></table></figure>
<p> 通常,供Linux使用的源代码包还提供一个名为 <strong>{ 软件名称 }.spec</strong> 的文件,即spec文件。如果提供spec文件,则该源代码还可以直接编译成RPM包。 </p>
<p class="article-more-link">
<a href="/2018/04/06/rpm_spec/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2018/04/06/rpm_spec/" data-id="cjvc032bg001tlcvx7yt6t42u" class="article-share-link">Share</a>
<a href="http://yoursite.com/2018/04/06/rpm_spec/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/linux/">linux</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/rpm/">rpm</a></li></ul>
</footer>
</div>
</article>
<article id="post-python装饰器" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2017/11/19/python装饰器/" class="article-date">
<time datetime="2017-11-19T14:46:38.000Z" itemprop="datePublished">2017-11-19</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/11/19/python装饰器/">python装饰器</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<blockquote>
<p>Python includes a more natural way of decorating a function by using an annotation on the function that is decorated.<br><a href="https://en.wikipedia.org/wiki/Decorator_pattern" target="_blank" rel="noopener">https://en.wikipedia.org/wiki/Decorator_pattern</a><br>译:Python提供了一种更为自然的方式来装饰一个函数,这种方法通过在被装饰的函数前加一个注释来时实现。</p>
</blockquote>
<p class="article-more-link">
<a href="/2017/11/19/python装饰器/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2017/11/19/python装饰器/" data-id="cjvc032ac000clcvxnpazr2bt" class="article-share-link">Share</a>
<a href="http://yoursite.com/2017/11/19/python装饰器/#disqus_thread" class="article-comment-link">Comments</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-stl_deque_2" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/20/stl_deque_2/" class="article-date">
<time datetime="2016-08-20T02:52:35.000Z" itemprop="datePublished">2016-08-20</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/20/stl_deque_2/">STL deque——part 2</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<blockquote>
<p>接下来介绍一下deque的插入删除操作及其他操作(push, pop …)<br>常见的有push_back, push_front, pop_back, pop_front, insert, erase, clear等<br>包括了内存分配和释放等问题</p>
</blockquote>
<p class="article-more-link">
<a href="/2016/08/20/stl_deque_2/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/20/stl_deque_2/" data-id="cjvc032bi001wlcvxm5638we9" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/20/stl_deque_2/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/list/">list</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_deque_1" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/18/stl_deque_1/" class="article-date">
<time datetime="2016-08-18T13:59:56.000Z" itemprop="datePublished">2016-08-18</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/18/stl_deque_1/">STL deque——part 1</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="deque概述"><a href="#deque概述" class="headerlink" title="deque概述"></a>deque概述</h1><p>deque是一个双端队列</p>
<p class="article-more-link">
<a href="/2016/08/18/stl_deque_1/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/18/stl_deque_1/" data-id="cjvc032bk001xlcvxq5egrnn3" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/18/stl_deque_1/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/list/">list</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_list_2" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/18/stl_list_2/" class="article-date">
<time datetime="2016-08-17T16:31:32.000Z" itemprop="datePublished">2016-08-18</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/18/stl_list_2/">STL list ——part 2</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="transfer、splice"><a href="#transfer、splice" class="headerlink" title="transfer、splice"></a>transfer、splice</h1><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//将first到last內的所有元素搬移到position 前,不包括last元素。 </span></span><br><span class="line"><span class="function"><span class="keyword">void</span> <span class="title">transfer</span><span class="params">(iterator position, iterator first, iterator last)</span> </span>{ </span><br><span class="line"> <span class="keyword">if</span> (position != last) { </span><br><span class="line"></span><br><span class="line"> (*(link_type((*last.node).prev))).next = position.node; </span><br><span class="line"> (*(link_type((*first.node).prev))).next = last.node; </span><br><span class="line"> (*(link_type((*position.node).prev))).next = first.node; </span><br><span class="line"> </span><br><span class="line"> link_type tmp = link_type((*position.node).prev); </span><br><span class="line"> (*position.node).prev = (*last.node).prev; </span><br><span class="line"> (*last.node).prev = (*first.node).prev; </span><br><span class="line"> (*first.node).prev = tmp; </span><br><span class="line"> } </span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<p class="article-more-link">
<a href="/2016/08/18/stl_list_2/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/18/stl_list_2/" data-id="cjvc032af000dlcvxno98v4qa" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/18/stl_list_2/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/list/">list</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_list_1" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/15/stl_list_1/" class="article-date">
<time datetime="2016-08-15T15:19:53.000Z" itemprop="datePublished">2016-08-15</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/15/stl_list_1/">STL list ——part 1</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="list结构"><a href="#list结构" class="headerlink" title="list结构"></a>list结构</h1><p>STL list是一个环形双向链表 ,结点结构如下:<br><figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">template</span><<span class="class"><span class="keyword">class</span> <span class="title">T</span>></span></span><br><span class="line"><span class="class"><span class="title">struct</span> __<span class="title">list_node</span></span></span><br><span class="line"><span class="class">{</span></span><br><span class="line"><span class="keyword">typedef</span> <span class="keyword">void</span>* void_pointer;</span><br><span class="line">void_pointer prev;<span class="comment">//其实可以设为__list_node<T>*</span></span><br><span class="line">void_pointer next;</span><br><span class="line">T data;</span><br><span class="line">};</span><br></pre></td></tr></table></figure></p>
<p class="article-more-link">
<a href="/2016/08/15/stl_list_1/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/15/stl_list_1/" data-id="cjvc032bm001zlcvxdmhfum8p" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/15/stl_list_1/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/list/">list</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_vector" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/14/stl_vector/" class="article-date">
<time datetime="2016-08-13T17:53:03.000Z" itemprop="datePublished">2016-08-14</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/14/stl_vector/">STL vector</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="vector概述"><a href="#vector概述" class="headerlink" title="vector概述"></a>vector概述</h1><p> vector 数据安排上和数组非常相似,差别在于数组大小定义后不能在改变而vector内部会自行扩充空间容纳新元素</p>
<h1 id="vector-定义"><a href="#vector-定义" class="headerlink" title="vector 定义"></a>vector 定义</h1>
<p class="article-more-link">
<a href="/2016/08/14/stl_vector/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/14/stl_vector/" data-id="cjvc032an000klcvxwag0ms0h" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/14/stl_vector/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/vector/">vector</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_traits" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/10/stl_traits/" class="article-date">
<time datetime="2016-08-10T04:56:46.000Z" itemprop="datePublished">2016-08-10</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/10/stl_traits/">STL traits</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="STL-traits的实现"><a href="#STL-traits的实现" class="headerlink" title="STL traits的实现"></a>STL traits的实现</h1><pre><code>traits 是一种能获取出你所需类型特性的方法:
</code></pre>
<p class="article-more-link">
<a href="/2016/08/10/stl_traits/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/10/stl_traits/" data-id="cjvc032aj000hlcvxjx8xxhvw" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/10/stl_traits/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/traits/">traits</a></li></ul>
</footer>
</div>
</article>
<article id="post-stdarg" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/06/stdarg/" class="article-date">
<time datetime="2016-08-06T06:33:58.000Z" itemprop="datePublished">2016-08-06</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/06/stdarg/">可变参函数</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="使用示例"><a href="#使用示例" class="headerlink" title="使用示例"></a>使用示例</h1><p><img src="/imgs/Summary/stdargs.png" alt="stdargs"></p>
<h1 id="实现原理"><a href="#实现原理" class="headerlink" title="实现原理"></a>实现原理</h1><h2 id="va-list"><a href="#va-list" class="headerlink" title="va_list"></a>va_list</h2><pre><code>va_list 是一个字符指针类型。
typedef char *va_list;
</code></pre>
<p class="article-more-link">
<a href="/2016/08/06/stdarg/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/08/06/stdarg/" data-id="cjvc032a90008lcvxq8jg51iz" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/08/06/stdarg/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/stdargs/">stdargs</a></li></ul>
</footer>
</div>
</article>
<article id="post-lcs" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/23/lcs/" class="article-date">
<time datetime="2016-06-23T04:18:38.000Z" itemprop="datePublished">2016-06-23</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Algorithm/">Algorithm</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/23/lcs/">最长公共子序列</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="最长公共子序列(LongestCommonSubsequence)"><a href="#最长公共子序列(LongestCommonSubsequence)" class="headerlink" title="最长公共子序列(LongestCommonSubsequence)"></a>最长公共子序列(LongestCommonSubsequence)</h1><p>一个数列S,如果分别是两个或多个已知数列的子序列,且是所有符合此条件序列中最长的,则S称为已知序列的最长公共子序列。<br>最长公共子序列问题可以由动态规划求解</p>
<h1 id="动态规划"><a href="#动态规划" class="headerlink" title="动态规划"></a>动态规划</h1><p>动态规划(英语:Dynamic programming,简称DP)是一种在数学、管理科学、计算机科学、经济学和生物信息学中使用的,通过把原问题分解为相对简单的子问题的方式求解复杂问题的方法。<br>动态规划常常适用于有重叠子问题和最优子结构性质的问题,动态规划方法所耗时间往往远少于朴素解法。<br>动态规划背后的基本思想非常简单。大致上,若要解一个给定问题,我们需要解其不同部分(即子问题),再合并子问题的解以得出原问题的解。<br>通常许多子问题非常相似,为此动态规划法试图仅仅解决每个子问题一次,从而减少计算量:一旦某个给定子问题的解已经算出,则将其记忆化(en:memoization)存储,以便下次需要同一个子问题解之时直接查表。这种做法在重复子问题的数目关于输入的规模呈指数增长时特别有用。————<a href="https://zh.wikipedia.org/wiki/%E5%8A%A8%E6%80%81%E8%A7%84%E5%88%92" target="_blank" rel="noopener">维基百科</a></p>
<h1 id="动态规划求解LCS"><a href="#动态规划求解LCS" class="headerlink" title="动态规划求解LCS"></a>动态规划求解LCS</h1>
<p class="article-more-link">
<a href="/2016/06/23/lcs/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/06/23/lcs/" data-id="cjvc032a70006lcvxe9g48hf5" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/06/23/lcs/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/Dynamic-Programming/">Dynamic_Programming</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/LongestCommonSubsequence/">LongestCommonSubsequence</a></li></ul>
</footer>
</div>
</article>
<article id="post-C++11" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/20/C++11/" class="article-date">
<time datetime="2016-06-19T17:14:38.000Z" itemprop="datePublished">2016-06-20</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/20/C++11/">C++11</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="auto"><a href="#auto" class="headerlink" title="auto"></a>auto</h1><p>auto是C++程序设计语言的关键字。自C++11以来,auto关键字用于两种情况:声明变量时根据初始化表达式自动推断该变量的类型、声明函数时函数返回值的占位符。C++98标准中auto关键字用于自动变量的声明,但由于使用极少且多余,在C++11中已删除这一用法。–维基百科<br>auto实际上实在编译时对变量进行了类型推导,似乎auto并不会影响编译速度,因为编译时本来也要右侧推导然后判断与左侧是否匹配。<br>从汇编看也是如此:<br><img src="/imgs/Summary/int.png" alt="int"><br><img src="/imgs/Summary/auto_int.png" alt="auto_int"><br>自定义类型<br><img src="/imgs/Summary/A.png" alt="A"><br><img src="/imgs/Summary/auto_A.png" alt="auto_A"><br>auto用于模板简化了模板的操作<br><img src="/imgs/Summary/auto_template.png" alt="auto_template"></p>
<h1 id="lambda表达式"><a href="#lambda表达式" class="headerlink" title="lambda表达式"></a>lambda表达式</h1><p>它可以用于创建并定义匿名的函数对象形式如下:<br>[函数对象参数](操作符重载函数参数) ->返回值类型{函数体}(具体参数)<br><img src="/imgs/Summary/lambda.png" alt="lambda"></p>
<h1 id="decltype"><a href="#decltype" class="headerlink" title="decltype"></a>decltype</h1><p>decltype的功能与auto相反,从变量得到类型<br><img src="/imgs/Summary/decltype.png" alt="decltype"></p>
<h1 id="右值引用"><a href="#右值引用" class="headerlink" title="右值引用"></a>右值引用</h1><p>右值引用(rvalue reference),是C++程序设计语言自C++11标准提出的一类数据类型。用于实现移动语义(move semantic)与完美转发(perfect forwarding)。–维基百科<br>在资源转移不是调用拷贝等操作而是实现了资源的转移<br><a href="https://www.zhihu.com/question/22111546" target="_blank" rel="noopener">参考</a></p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/06/20/C++11/" data-id="cjvc0329w0000lcvx6dwtczmt" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/06/20/C++11/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C-11/">C++11</a></li></ul>
</footer>
</div>
</article>
<article id="post-stl_alloc" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/12/stl_alloc/" class="article-date">
<time datetime="2016-06-11T17:26:33.000Z" itemprop="datePublished">2016-06-12</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Summary/">Summary</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/12/stl_alloc/">STL空间配置器</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="一级空间配置器"><a href="#一级空间配置器" class="headerlink" title="一级空间配置器"></a>一级空间配置器</h1><p>当所申请的空间大于128bytes时,stl直接使用一级空间配置器<br>一级空间配置器其实是对malloc的封装,以及添加了类似new_handler处理内存分配不足的情况<br>当内存不足时调用oom_malloc尝试回收一些已分配的内存,调用的是__malloc_alloc_oom_handler方法(如果有的话,没有就抛出异常)</p>
<p class="article-more-link">
<a href="/2016/06/12/stl_alloc/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/06/12/stl_alloc/" data-id="cjvc032aa0009lcvxjq66tjaj" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/06/12/stl_alloc/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/STL/">STL</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/alloc/">alloc</a></li></ul>
</footer>
</div>
</article>
<article id="post-heap_sort" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/06/heap_sort/" class="article-date">
<time datetime="2016-06-06T04:18:38.000Z" itemprop="datePublished">2016-06-06</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/Algorithm/">Algorithm</a>
</div>
</div>
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/06/heap_sort/">海量数据中求最大的K个数</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="题目"><a href="#题目" class="headerlink" title="题目"></a>题目</h1><p>在n个数中求最大的K个数</p>
<h1 id="思路"><a href="#思路" class="headerlink" title="思路"></a>思路</h1><p>建立一个K个节点的小根堆,再遍历n个数<br>与小根堆的第一个元素比较</p>
<h1 id="code"><a href="#code" class="headerlink" title="code"></a>code</h1>
<p class="article-more-link">
<a href="/2016/06/06/heap_sort/#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<a data-url="http://yoursite.com/2016/06/06/heap_sort/" data-id="cjvc032a10002lcvxtwok3a65" class="article-share-link">Share</a>
<a href="http://yoursite.com/2016/06/06/heap_sort/#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/C/">C++</a></li></ul>
</footer>
</div>
</article>
</section>
<aside id="sidebar">
<div class="widget-wrap">
<h3 class="widget-title">Categories</h3>
<div class="widget">
<ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Algorithm/">Algorithm</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/Summary/">Summary</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/linux/">linux</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/python/">python</a></li><li class="category-list-item"><a class="category-list-link" href="/categories/虚拟化/">虚拟化</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/C/">C</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/C/">C++</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/C-11/">C++11</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Dynamic-Programming/">Dynamic_Programming</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/I-O虚拟化/">I/O虚拟化</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/LongestCommonSubsequence/">LongestCommonSubsequence</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SR-IOV/">SR-IOV</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/STL/">STL</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/alloc/">alloc</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/list/">list</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/rpm/">rpm</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/stdargs/">stdargs</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/traits/">traits</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vector/">vector</a></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/装饰器/">装饰器</a></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Tag Cloud</h3>
<div class="widget tagcloud">
<a href="/tags/C/" style="font-size: 10px;">C</a> <a href="/tags/C/" style="font-size: 20px;">C++</a> <a href="/tags/C-11/" style="font-size: 10px;">C++11</a> <a href="/tags/Dynamic-Programming/" style="font-size: 10px;">Dynamic_Programming</a> <a href="/tags/I-O虚拟化/" style="font-size: 10px;">I/O虚拟化</a> <a href="/tags/LongestCommonSubsequence/" style="font-size: 10px;">LongestCommonSubsequence</a> <a href="/tags/SR-IOV/" style="font-size: 10px;">SR-IOV</a> <a href="/tags/STL/" style="font-size: 16.67px;">STL</a> <a href="/tags/alloc/" style="font-size: 10px;">alloc</a> <a href="/tags/linux/" style="font-size: 10px;">linux</a> <a href="/tags/list/" style="font-size: 13.33px;">list</a> <a href="/tags/python/" style="font-size: 10px;">python</a> <a href="/tags/rpm/" style="font-size: 10px;">rpm</a> <a href="/tags/stdargs/" style="font-size: 10px;">stdargs</a> <a href="/tags/traits/" style="font-size: 10px;">traits</a> <a href="/tags/vector/" style="font-size: 10px;">vector</a> <a href="/tags/装饰器/" style="font-size: 10px;">装饰器</a>
</div>
</div>
<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/2018/06/">June 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/04/">April 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2017/11/">November 2017</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/08/">August 2016</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2016/06/">June 2016</a></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Recent Posts</h3>
<div class="widget">
<ul>
<li>
<a href="/2018/06/17/IO虚拟化--SR-IOV/">I/O虚拟化 && SR-IOV</a>
</li>
<li>
<a href="/2018/04/06/rpm_spec/">RPM 使用与 SPEC 文件</a>
</li>
<li>
<a href="/2017/11/19/python装饰器/">python装饰器</a>
</li>
<li>
<a href="/2016/08/20/stl_deque_2/">STL deque——part 2</a>
</li>
<li>
<a href="/2016/08/18/stl_deque_1/">STL deque——part 1</a>
</li>
</ul>
</div>
</div>
</aside>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info" class="inner">
© 2019 wanyaoqi<br>
Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>
</div>
</div>
</footer>
</div>
<nav id="mobile-nav">
<a href="/" class="mobile-nav-link">Home</a>
<a href="/archives" class="mobile-nav-link">Archives</a>
<a href="/about" class="mobile-nav-link">About</a>
</nav>
<script>
var disqus_shortname = 'superqi';
(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="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script src="/js/script.js"></script>
</div>
</body>
</html>