-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1346 lines (867 loc) · 153 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
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<link rel="dns-prefetch" href="http://www.barondu.com">
<title>Baron的博客</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="My blog">
<meta property="og:type" content="website">
<meta property="og:title" content="Baron的博客">
<meta property="og:url" content="http://www.barondu.com/index.html">
<meta property="og:site_name" content="Baron的博客">
<meta property="og:description" content="My blog">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Baron的博客">
<meta name="twitter:description" content="My blog">
<link rel="alternative" href="/atom.xml" title="Baron的博客" type="application/atom+xml">
<link rel="icon" href="/img/favicon.ico">
<link rel="stylesheet" type="text/css" href="/./main.0cf68a.css">
<style type="text/css">
#container.show {
background: linear-gradient(200deg,#a0cfe4,#e8c37e);
}
</style>
<!-- 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-90161812-1', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
</head>
<body>
<div id="container" q-class="show:isCtnShow">
<canvas id="anm-canvas" class="anm-canvas"></canvas>
<div class="left-col" q-class="show:isShow">
<div class="overlay" style="background: #4d4d4d"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="/" class="profilepic">
<img src="/img/favicon.ico" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="/">Baron</a></h1>
</hgroup>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/categories/随笔/">随笔</a></li>
<li><a href="/categories/笔记/">笔记</a></li>
<li><a href="/categories/常旅客/">常旅客</a></li>
</ul>
</nav>
<nav class="header-smart-menu">
<a q-on="click: openSlider(e, 'innerArchive')" href="javascript:void(0)">所有文章</a>
<a q-on="click: openSlider(e, 'friends')" href="javascript:void(0)">友链</a>
<a q-on="click: openSlider(e, 'aboutme')" href="javascript:void(0)">关于我</a>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/barondu" title="github"><i class="icon-github"></i></a>
<a class="weibo" target="_blank" href="http://www.weibo.com/274805500" title="weibo"><i class="icon-weibo"></i></a>
<a class="rss" target="_blank" href="/atom.xml" title="rss"><i class="icon-rss"></i></a>
<a class="zhihu" target="_blank" href="https://www.zhihu.com/people/barondu" title="zhihu"><i class="icon-zhihu"></i></a>
<a class="bilibili" target="_blank" href="#" title="bilibili"><i class="icon-bilibili"></i></a>
<a class="acfun" target="_blank" href="#" title="acfun"><i class="icon-acfun"></i></a>
<a class="mail" target="_blank" href="mailto:" title="mail"><i class="icon-mail"></i></a>
<a class="facebook" target="_blank" href="https://www.facebook.com/profile.php?id=100011039793137" title="facebook"><i class="icon-facebook"></i></a>
<a class="twitter" target="_blank" href="https://twitter.com/BaronDU96" title="twitter"><i class="icon-twitter"></i></a>
</div>
</nav>
</header>
</div>
</div>
<div class="mid-col" q-class="show:isShow,hide:isShow|isFalse">
<nav id="mobile-nav">
<div class="overlay js-overlay" style="background: #4d4d4d"></div>
<div class="btnctn js-mobile-btnctn">
<div class="slider-trigger list" q-on="click: openSlider(e)"><i class="icon icon-sort"></i></div>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img src="/img/favicon.ico" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author js-header-author">Baron</h1>
</hgroup>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/barondu" title="github"><i class="icon-github"></i></a>
<a class="weibo" target="_blank" href="http://www.weibo.com/274805500" title="weibo"><i class="icon-weibo"></i></a>
<a class="rss" target="_blank" href="/atom.xml" title="rss"><i class="icon-rss"></i></a>
<a class="zhihu" target="_blank" href="https://www.zhihu.com/people/barondu" title="zhihu"><i class="icon-zhihu"></i></a>
<a class="bilibili" target="_blank" href="#" title="bilibili"><i class="icon-bilibili"></i></a>
<a class="acfun" target="_blank" href="#" title="acfun"><i class="icon-acfun"></i></a>
<a class="mail" target="_blank" href="mailto:" title="mail"><i class="icon-mail"></i></a>
<a class="facebook" target="_blank" href="https://www.facebook.com/profile.php?id=100011039793137" title="facebook"><i class="icon-facebook"></i></a>
<a class="twitter" target="_blank" href="https://twitter.com/BaronDU96" title="twitter"><i class="icon-twitter"></i></a>
</div>
</nav>
<nav class="header-menu js-header-menu">
<ul style="width: 70%">
<li style="width: 25%"><a href="/">主页</a></li>
<li style="width: 25%"><a href="/categories/随笔/">随笔</a></li>
<li style="width: 25%"><a href="/categories/笔记/">笔记</a></li>
<li style="width: 25%"><a href="/categories/常旅客/">常旅客</a></li>
</ul>
</nav>
</header>
</div>
<div class="mobile-mask" style="display:none" q-show="isShow"></div>
</nav>
<div id="wrapper" class="body-wrap">
<div class="menu-l">
<div class="canvas-wrap">
<canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1" class="anm-canvas"></canvas>
</div>
<div id="js-content" class="content-ll">
<article id="post-G52CPP" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/11/26/G52CPP/">G52CPP复习</a>
</h1>
<a href="/2018/11/26/G52CPP/" class="archive-article-date">
<time datetime="2018-11-25T19:27:27.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-11-26</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="G52CPP"><a href="#G52CPP" class="headerlink" title="G52CPP"></a>G52CPP</h2><hr>
<h3 id="Lecture-1-amp-2"><a href="#Lecture-1-amp-2" class="headerlink" title="Lecture 1 & 2"></a>Lecture 1 & 2</h3><h5 id="Header"><a href="#Header" class="headerlink" title="Header"></a>Header</h5><figure class="highlight cpp"><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"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string"><stdio.h></span> <span class="comment">// C or C++</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string"><cstdio></span> <span class="comment">// C++</span></span></div></pre></td></tr></table></figure>
<p>reference 省去 copy的过程<br>What is usually in a header file?</p>
<ol>
<li>Function declarations</li>
<li>Macro definitions (#define)</li>
<li>Constant definitions</li>
<li>Possibly other things as well<blockquote>
<ol>
<li>Ensure that the header file #includes everything that it needs itself</li>
<li>Ensure that it doesn’t matter if the header file is #included multiple times</li>
<li>Ensure that header files can be included in any order</li>
</ol>
<a class="article-more-a" href="/2018/11/26/G52CPP/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">CPP</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">C++</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/笔记//" class="article-tag-list-link color3">笔记</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/11/26/G52CPP/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-PyCharm运行TensorBoard时的小BUG" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2018/02/21/PyCharm运行TensorBoard时的小BUG/">PyCharm运行TensorBoard时的小BUG</a>
</h1>
<a href="/2018/02/21/PyCharm运行TensorBoard时的小BUG/" class="archive-article-date">
<time datetime="2018-02-21T08:03:41.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-02-21</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="PyCharm运行TensorBoard时的小BUG"><a href="#PyCharm运行TensorBoard时的小BUG" class="headerlink" title="PyCharm运行TensorBoard时的小BUG"></a>PyCharm运行TensorBoard时的小BUG</h2><p>@(G53IDS)[PyCharm, TensorBoard, BUG]<br>今天在PyCharm的Terminal使用TensorBoard的时候出现了以下报错,但是mac自带的terminal却可以正常使用:</p>
<figure class="highlight vhdl"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div></pre></td><td class="code"><pre><div class="line"># tensorboard <span class="comment">--logdir=logs</span></div><div class="line">Traceback (most recent call last):</div><div class="line"> <span class="keyword">File</span> <span class="string">"/Users/baron/.pyenv/versions/3.6.3/bin/tensorboard"</span>, <span class="literal">line</span> <span class="number">11</span>, <span class="keyword">in</span> <module></div><div class="line"> sys.<span class="keyword">exit</span>(main())</div><div class="line"> <span class="keyword">File</span> <span class="string">"/Users/baron/.pyenv/versions/3.6.3/lib/python3.6/site-packages/tensorboard/main.py"</span>, <span class="literal">line</span> <span class="number">45</span>, <span class="keyword">in</span> main</div><div class="line"> <span class="keyword">default</span>.get_assets_zip_provider())</div><div class="line"> <span class="keyword">File</span> <span class="string">"/Users/baron/.pyenv/versions/3.6.3/lib/python3.6/site-packages/tensorboard/program.py"</span>, <span class="literal">line</span> <span class="number">147</span>, <span class="keyword">in</span> main</div><div class="line"> util.setup_logging()</div><div class="line"> <span class="keyword">File</span> <span class="string">"/Users/baron/.pyenv/versions/3.6.3/lib/python3.6/site-packages/tensorboard/util.py"</span>, <span class="literal">line</span> <span class="number">50</span>, <span class="keyword">in</span> setup_logging</div><div class="line"> locale.setlocale(locale.LC_ALL, '')</div><div class="line"> <span class="keyword">File</span> <span class="string">"/Users/baron/.pyenv/versions/3.6.3/lib/python3.6/locale.py"</span>, <span class="literal">line</span> <span class="number">598</span>, <span class="keyword">in</span> setlocale</div><div class="line"> <span class="keyword">return</span> _setlocale(category, locale)</div><div class="line">locale.<span class="literal">Error</span>: unsupported locale setting</div></pre></td></tr></table></figure>
<a class="article-more-a" href="/2018/02/21/PyCharm运行TensorBoard时的小BUG/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Machine Learning</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">TensorFlow</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">pyenv</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color3">PyCharm</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/随笔//" class="article-tag-list-link color3">随笔</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2018/02/21/PyCharm运行TensorBoard时的小BUG/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Hexo以及yilia主题个性化设置" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/11/26/Hexo以及yilia主题个性化设置/">Hexo以及yilia主题个性化设置</a>
</h1>
<a href="/2017/11/26/Hexo以及yilia主题个性化设置/" class="archive-article-date">
<time datetime="2017-11-25T19:11:27.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-11-26</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="Hexo以及yilia主题个性化设置"><a href="#Hexo以及yilia主题个性化设置" class="headerlink" title="Hexo以及yilia主题个性化设置"></a>Hexo以及yilia主题个性化设置</h1><h3 id="修改浏览器Tab里的icon"><a href="#修改浏览器Tab里的icon" class="headerlink" title="修改浏览器Tab里的icon"></a>修改浏览器Tab里的icon</h3><p>修改后效果如下<br><img src="https://app.yinxiang.com/shard/s67/res/b7a1bfae-d09c-4a00-be66-a474d57e6378/20171123140602_rXDDHa_Screenshot.jpg" alt="aaaaa"></p>
<ul>
<li>很简单我们只需要在yilia主题里<code>_config.yml</code>文件里修改为<code>favicon: /img/favicon.ico</code></li>
<li>将自己想要的icon,转换成<code>.ico</code>格式修改命名放在<code>yilia/sourse/img</code>里,大功告成</li>
</ul>
<a class="article-more-a" href="/2017/11/26/Hexo以及yilia主题个性化设置/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">Hexo</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">yilia</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">blog</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/随笔//" class="article-tag-list-link color3">随笔</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/11/26/Hexo以及yilia主题个性化设置/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-TensorFlow" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/11/17/TensorFlow/">Installing TensorFlow</a>
</h1>
<a href="/2017/11/17/TensorFlow/" class="archive-article-date">
<time datetime="2017-11-17T11:43:51.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-11-17</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="TensorFlow"><a href="#TensorFlow" class="headerlink" title="TensorFlow"></a>TensorFlow</h1><h2 id="配置环境"><a href="#配置环境" class="headerlink" title="配置环境"></a>配置环境</h2><p>我的环境是 macOS Sierra 10.12.6,其他mac版本应该也适用。</p>
<h3 id="pyenv"><a href="#pyenv" class="headerlink" title="pyenv"></a>pyenv</h3><p>安装<a href="https://github.com/pyenv/pyenv">pyenv</a> 管理多版本 python,通过它安装 python。原因是不希望污染mac自带系统python。详细过程参考官方doc,这里描述一下我的安装过程。</p>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=518894283&auto=1&height=66"></iframe>
<embed src="https://emumo.xiami.com/widget/291251140_1775818238/singlePlayer.swf" type="application/x-shockwave-flash" width="257" height="33" wmode="transparent"></embed>
<ol>
<li>安装:</li>
</ol>
<figure class="highlight elixir"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line"><span class="comment"># 使用git安装</span></div><div class="line"><span class="variable">$ </span>git clone <span class="symbol">https:</span>/<span class="regexp">/github.com/pyenv</span><span class="regexp">/pyenv.git ~/</span>.pyenv</div><div class="line"><span class="comment"># 使用Homebrew on Mac OS X 安装</span></div><div class="line"><span class="variable">$ </span>brew update</div><div class="line"><span class="variable">$ </span>brew install pyenv</div></pre></td></tr></table></figure>
<p>没有<a href="https://brew.sh/" title="Homebrew">Homebrew</a>请安装并更新<br>
<a class="article-more-a" href="/2017/11/17/TensorFlow/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Machine Learning</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">TensorFlow</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color1">pyenv</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/随笔//" class="article-tag-list-link color3">随笔</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/11/17/TensorFlow/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Deadlocks" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/05/03/Deadlocks/">笔记 OSC_Deadlocks</a>
</h1>
<a href="/2017/05/03/Deadlocks/" class="archive-article-date">
<time datetime="2017-05-03T15:10:14.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-05-03</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="Deadlocks"><a href="#Deadlocks" class="headerlink" title="Deadlocks"></a>Deadlocks</h1><hr>
<h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><ul>
<li>Deadlocks and <strong>conditions for deadlocks</strong> </li>
<li>Algorithms to <strong>detect[探知] deadlocks</strong><br>Approaches to <strong>recover</strong> from deadlocks
<a class="article-more-a" href="/2017/05/03/Deadlocks/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">OSC</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color5">Deadlocks</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/笔记//" class="article-tag-list-link color3">笔记</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/05/03/Deadlocks/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-N和NP问题" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/02/06/N和NP问题/">拓展 N和NP问题</a>
</h1>
<a href="/2017/02/06/N和NP问题/" class="archive-article-date">
<time datetime="2017-02-06T03:43:27.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-02-06</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="N和NP问题"><a href="#N和NP问题" class="headerlink" title="N和NP问题"></a>N和NP问题</h1><blockquote>
<p>“P” refers to the class of problems that can be solved in polynomial time<br>“NP” refers to problems that can be solved in non- deterministic polynomial time</p>
</blockquote>
<ul>
<li>P是能在多项式时间内<strong>解决</strong>的问题,</li>
<li>NP是能在多项式时间<strong>验证答案正确与否</strong>的问题。</li>
</ul>
<p>用大白话讲大概就是这样。P是否等于NP实质上就是在问,如果对于一个问题我能在多项式时间内验证其答案的正确性,那么我是否能在多项式时间内解决它?这个表述不太严谨,但通俗来讲就是如此。(2014, Wang)</p>
<h4 id="什么是-polynomial-time?"><a href="#什么是-polynomial-time?" class="headerlink" title="什么是 polynomial time?"></a>什么是 polynomial time?</h4><ul>
<li>多项式级的复杂度:O(1),O(log(n)),O(n^a)等,因为它的规模n出现在底数的位置;</li>
<li>非多项式级的复杂度:O(a^n)和O(n!)型复杂度,其复杂度计算机往往不能承受。</li>
</ul>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">G52LAC</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/笔记//" class="article-tag-list-link color3">笔记</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/02/06/N和NP问题/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Concurrency2" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/01/09/Concurrency2/">笔记 OSC_Concurrency2</a>
</h1>
<a href="/2017/01/09/Concurrency2/" class="archive-article-date">
<time datetime="2017-01-09T09:33:27.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-01-09</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="Concurrency-2"><a href="#Concurrency-2" class="headerlink" title="Concurrency 2"></a>Concurrency 2</h1><hr>
<h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><ul>
<li><strong>Software approaches</strong>: Peterson’s solution Hardware approaches:</li>
<li><strong>Disabling interrupts</strong>:<ul>
<li><code>test_and_set()</code></li>
<li><code>compare_and_swap()</code></li>
</ul>
</li>
<li>Higher level approaches include <strong>mutexes</strong> and <strong>semaphores</strong><h3 id="Peterson’s-Solution"><a href="#Peterson’s-Solution" class="headerlink" title="Peterson’s Solution"></a>Peterson’s Solution</h3></li>
<li>Peterson’s solution is a <strong>software based solution</strong> which worked well for <strong>older machines</strong></li>
<li>Two <strong>shared variables</strong> are used:<ul>
<li>turn: indicates <strong>which process is next</strong> to enter its critical section </li>
<li>boolean flag[2]: indicates that a <strong>process is ready</strong> to enter its critical section</li>
</ul>
</li>
<li>It is restricted[限制] to <strong>two processes</strong> that execute in <strong>strict alternation</strong>[严格的交替]<figure class="highlight sqf"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line"><span class="keyword">do</span> {</div><div class="line"> <span class="built_in">flag</span>[j] = <span class="literal">true</span>; <span class="comment">// j wants to enter critical section turn = i; // allow i to access first</span></div><div class="line"> <span class="keyword">while</span> (<span class="built_in">flag</span>[i] && turn == i);</div><div class="line"> <span class="comment">// whilst i wants to access critical section</span></div><div class="line"> <span class="comment">// and its i’s turn, apply busy waiting </span></div><div class="line"> </div><div class="line"> <span class="comment">// CRITICAL SECTION</span></div><div class="line"> </div><div class="line"> <span class="built_in">flag</span>[j] = <span class="literal">false</span>;</div><div class="line"> <span class="comment">// remainder section</span></div><div class="line">} <span class="keyword">while</span> (...);</div></pre></td></tr></table></figure>
</li>
</ul>
<a class="article-more-a" href="/2017/01/09/Concurrency2/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">OSC</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">concurrency</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/笔记//" class="article-tag-list-link color3">笔记</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/01/09/Concurrency2/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">
<div class="mod-side-operation">
<div class="jump-container" id="js-jump-container" style="display:none;">
<a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
<i class="icon-font icon-back"></i>
</a>
<div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
<i class="icon-font icon-plane jump-plane"></i>
</div>
</div>
</div>
</aside>
<article id="post-Concurrency1" class="article article-type-post article-index" itemscope itemprop="blogPost">
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2017/01/09/Concurrency1/">笔记 OSC_Concurrency1</a>
</h1>
<a href="/2017/01/09/Concurrency1/" class="archive-article-date">
<time datetime="2017-01-09T06:09:27.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2017-01-09</time>
</a>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="Concurrency-1"><a href="#Concurrency-1" class="headerlink" title="Concurrency 1"></a>Concurrency 1</h1><hr>
<h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><ul>
<li>Examples of <strong>concurrency issues</strong> (e.g. counter++)</li>
<li>Root causes of <strong>concurrency issues</strong></li>
<li><strong>Critical sections</strong> and <strong>mutual exclusion</strong> </li>
<li><strong>Requirements and approaches</strong> for mutual exclusion</li>
</ul>
<h3 id="Concurrency"><a href="#Concurrency" class="headerlink" title="Concurrency"></a>Concurrency</h3><ul>
<li>Threads and processes execute concurrently or in parallel and can share resources<ul>
<li>Multiprogramming/multiprocessing <strong>improves system utilisation</strong></li>
</ul>
</li>
<li>A process/thread can be <strong>interrupted at any point in time</strong> (I/O, timer)<ul>
<li>The process “state” is <strong>saved</strong> in the p<strong>rocess control block</strong> </li>
</ul>
</li>
<li>The outcome of programs may become <strong>unpredictable</strong>[不可预知的]<ul>
<li>Sharing data can lead to <strong>inconsistencies</strong>[矛盾]</li>
<li>I.e., the <strong>outcome of execution</strong> may <strong>depend on the order</strong> win which instructions are carried out</li>
</ul>
</li>
</ul>
<a class="article-more-a" href="/2017/01/09/Concurrency1/#more">more >></a>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<i class="icon-price-tags icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color4">OSC</a>
</li>
<li class="article-tag-list-item">
<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">concurrency</a>
</li>
</ul>
</div>
<div class="article-category tagcloud">
<i class="icon-book icon"></i>
<ul class="article-tag-list">
<li class="article-tag-list-item">
<a href="/categories/笔记//" class="article-tag-list-link color3">笔记</a>
</li>
</ul>
</div>
<p class="article-more-link">
<a class="article-more-a" href="/2017/01/09/Concurrency1/">展开全文 >></a>
</p>
<div class="clearfix"></div>
</div>
</div>
</article>
<aside class="wrap-side-operation">