-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1031 lines (519 loc) · 29.3 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 class="theme-next muse use-motion">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<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 href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css"/>
<link href="//fonts.googleapis.com/css?family=Lato:300,400,700,400italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=0.5.0" rel="stylesheet" type="text/css" />
<meta name="keywords" content="Hexo, NexT" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=0.5.0" />
<meta name="description" content="iOS Coder的小屋">
<meta property="og:type" content="website">
<meta property="og:title" content="DavidCap">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="DavidCap">
<meta property="og:description" content="iOS Coder的小屋">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="DavidCap">
<meta name="twitter:description" content="iOS Coder的小屋">
<script type="text/javascript" id="hexo.configuration">
var NexT = window.NexT || {};
var CONFIG = {
scheme: 'Muse',
sidebar: {"position":"left","display":"post"},
fancybox: true,
motion: true,
duoshuo: {
userId: 0,
author: '博主'
}
};
</script>
<title> DavidCap </title>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container one-collumn sidebar-position-left
page-home
">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">DavidCap</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">生活不止眼前的苟且</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-home fa-fw"></i> <br />
首页
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives" rel="section">
<i class="menu-item-icon fa fa-archive fa-fw"></i> <br />
归档
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-tags fa-fw"></i> <br />
标签
</a>
</li>
<li class="menu-item menu-item-search">
<a href="#" class="popup-trigger">
<i class="menu-item-icon fa fa-search fa-fw"></i> <br />
搜索
</a>
</li>
</ul>
<div class="site-search">
<div class="popup">
<span class="search-icon fa fa-search"></span>
<input type="text" id="local-search-input">
<div id="local-search-result"></div>
<span class="popup-btn-close">close</span>
</div>
</div>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<section id="posts" class="posts-expand">
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2017/02/20/2017年计划/" itemprop="url">
未命名
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2017-02-20T15:07:48+08:00" content="2017-02-20">
2017-02-20
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>title: 2017年计划<br>date: February 19, 2017 10:18 PM<br>tags: 生活<br>Categories: 生活<br>toc: true</p>
<h1 id="2017_u5E74_u8BA1_u5212_u6742_u8C08"><a href="#2017_u5E74_u8BA1_u5212_u6742_u8C08" class="headerlink" title="2017年计划杂谈"></a>2017年计划杂谈</h1><h2 id="u5E74_u5EA6_u8BA1_u5212"><a href="#u5E74_u5EA6_u8BA1_u5212" class="headerlink" title="年度计划"></a>年度计划</h2><p>最近痴迷武侠,要练就一生本事 来年找THS报仇雪恨。<br>先列举一下2017年的年度计划吧。</p>
<h3 id="u5543_u4E66_u8BA1_u5212"><a href="#u5543_u4E66_u8BA1_u5212" class="headerlink" title="啃书计划"></a>啃书计划</h3><p><strong>华山剑法,重在内功</strong></p>
<ol>
<li>代码大全 (代码规范)</li>
<li>设计模式 (API设计)</li>
<li>HTTP权威指南 (哈哈哈,不知道)</li>
</ol>
<p><strong>独孤九剑,招式牛逼</strong></p>
<ol>
<li>坚持看WWDC视频 with firend (热门Skill)</li>
<li>Swift</li>
</ol>
<h3 id="u8BFB_u8F6E_u5B50_uFF0C_u9020_u8F6E_u5B50"><a href="#u8BFB_u8F6E_u5B50_uFF0C_u9020_u8F6E_u5B50" class="headerlink" title="读轮子,造轮子"></a>读轮子,造轮子</h3><p><strong>降龙十八掌,第一式 读轮有悔</strong></p>
<ol>
<li>AFNetworking (主要学习网络层架构)</li>
<li>Aspects (主要学习Runtime和面试切面AOP)</li>
</ol>
<p><strong>降龙十八掌,第二式 造轮在天</strong></p>
<ol>
<li>造轮子计划A XCode插件一个,关于快速打包的吧。</li>
<li>造轮子计划B Weex,具体没想好,想法是要用Weex写一个高仿XXX的。</li>
<li>造轮子计划C Unity,写一个游戏,游戏 坦克大战???</li>
</ol>
<p>造轮子计划排序分先后,中间缺一个高逼格的开源项目。暂时先如此。</p>
<h3 id="A_u9898_u7834_u4E07_u5377_uFF0C_u4EE3_u7801_u5982_u6709_u795E"><a href="#A_u9898_u7834_u4E07_u5377_uFF0C_u4EE3_u7801_u5982_u6709_u795E" class="headerlink" title="A题破万卷,代码如有神"></a>A题破万卷,代码如有神</h3><p>leetCode 每日一A,熟悉算法数据结构。并写博客总结,贴代码。</p>
<h3 id="u8981_u996D_u6A21_u5F0F"><a href="#u8981_u996D_u6A21_u5F0F" class="headerlink" title="要饭模式"></a>要饭模式</h3><p>尝试性接外包项目,不强求。无聊是Web HTML(David and Novial),安卓(啃那笔 小杰),iOS(David and Novial),Java Or C# Or PHP(波)</p>
<h3 id="u5173_u4E8E_u751F_u6D3B"><a href="#u5173_u4E8E_u751F_u6D3B" class="headerlink" title="关于生活"></a>关于生活</h3><ol>
<li>早起一小时,跑步 30~40min 练字 10min 发呆 10min</li>
<li>日常娱乐,新闻联播 焦点访谈</li>
<li>健身 keep</li>
<li>旅游 with bros to 华山论剑</li>
</ol>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/03/28/iOS二维码扫描/" itemprop="url">
iOS二维码扫描
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-03-28T22:31:08+08:00" content="2016-03-28">
2016-03-28
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="iOS_u5F00_u53D1_u4E2D__u4E8C_u7EF4_u7801_u626B_u63CF"><a href="#iOS_u5F00_u53D1_u4E2D__u4E8C_u7EF4_u7801_u626B_u63CF" class="headerlink" title="iOS开发中 二维码扫描"></a>iOS开发中 二维码扫描</h1><h2 id="u524D_u8A00"><a href="#u524D_u8A00" class="headerlink" title="前言"></a>前言</h2><p>在移动开发中二维码扫描这种事情越来越常见了,在iOS中我选择了用ZBar这个第三方来实现。<br><br>原因有三:好用,好用,好用。<br><br>好了来点正经的干货吧。首先献上下载地址:<a href="https://github.com/bmorton/ZBarSDK">快来点我</a><br><br>然后你就可以把整个 ZBar文件夹拉到你的项目的Lib之类的目录下面了。<br></p>
<p>如果用pod,就直接 <strong>pod ‘ZBarSDK’, ‘~> 1.3.1’</strong> , 那么你就可以越过下面那个添加库类的步骤了。<br> </p>
<p>ZBar的使用给我们俩种选择,一种是自定义一个二维码视图,另一种是用他们自带的二维码视图(奇丑无比)。</p>
<h2 id="u6DFB_u52A0_u5E93_u7C7B"><a href="#u6DFB_u52A0_u5E93_u7C7B" class="headerlink" title="添加库类"></a>添加库类</h2><p>如下添加这些库类。<br></p>
<p><img src="/images/iOS二维码扫描/1.png" alt="ZBar库类"></p>
<h2 id="u81EA_u5B9A_u4E49_u4E8C_u7EF4_u7801_u89C6_u56FE"><a href="#u81EA_u5B9A_u4E49_u4E8C_u7EF4_u7801_u89C6_u56FE" class="headerlink" title="自定义二维码视图"></a>自定义二维码视图</h2><p>一般都是给一个按钮绑定一个点击事件,然后当按钮点击的时候 就会调用二维码扫描,然后扫描成功就返回。<br><br>就像下面这个demo截图一样。<br></p>
<p><img src="/images/iOS二维码扫描/2.png" alt="Demo截图.png"><br></p>
<p>然后就是正题了,我们首先要<strong>#import “ZBarSDK.h”</strong>.然后自定义的话 就要遵循这个代理 <strong>ZBarReaderViewDelegate</strong></p>
<p>然后就可以在点击的回调函数中设置如下:<br>
<div class="post-more-link text-center">
<a class="btn" href="/2016/03/28/iOS二维码扫描/#more" rel="contents">
阅读全文 »
</a>
</div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2016/03/05/入职同花顺有感/" itemprop="url">
入职同花顺有感
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2016-03-05T09:06:52+08:00" content="2016-03-05">
2016-03-05
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="u5165_u804C_u540C_u82B1_u987A_u6709_u611F"><a href="#u5165_u804C_u540C_u82B1_u987A_u6709_u611F" class="headerlink" title="入职同花顺有感"></a>入职同花顺有感</h1><h2 id="u524D_u8A00"><a href="#u524D_u8A00" class="headerlink" title="前言"></a>前言</h2><p>这俩星期可以说是我最累的俩个星期,经历了很多这辈子都没有经历的事情。租房子,正式的iOS技术面,搬家,零零碎碎的东西卖,忍受一个人住的孤独,加班。累……<br><br><strong>slogan:</strong>但是人总要学着长大的,人总要学着一个人,总要学着累。<br></p>
<h1 id="u5173_u4E8E_u9762_u8BD5"><a href="#u5173_u4E8E_u9762_u8BD5" class="headerlink" title="关于面试"></a>关于面试<br></h1><p>同花顺面试对技术要求还是挺高的,问的问题都是比较有水平的。不像以前在小公司 CTO基本不了解iOS,一出来就是和你聊聊简历上的东西 聊聊人生理想的。<br><br>一面的时候,问的还是比较简单的,问一些循环引用,weak assign 区别,iOS 优化工具啊,项目经历,工作流程(这个应该是确定一下我是不是培训的)。还算顺利吧 一面,基本能聊上天。<br><br>二面的时候,问msg_send底层实现(这我没答上,看过忘了 需要加强),如果你要写一个TableView你要怎么写(主要考察 Cell循环利用这块)。二面就被虐的比较惨了,特别是第一个问题 我们聊了好久,我也没有说出个所以然来(捂脸 尴尬)。看来自己要走的路还很长。<br><br>三面的时候,聊聊钱 聊聊人生理想 聊聊会不会跳槽等等,这个就聊的比较开心了,因为这种事情反正没什么难点的。<br><br>面试大体就这么结束了,2天后他们就叫我去上班了(实习岗,我还未毕业)。然后我就要开始租房子了。<br><br>
<div class="post-more-link text-center">
<a class="btn" href="/2016/03/05/入职同花顺有感/#more" rel="contents">
阅读全文 »
</a>
</div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2015/07/25/效率就是生命,提高效率方法/" itemprop="url">
效率就是生命,提高效率方法
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2015-07-25T21:39:08+08:00" content="2015-07-25">
2015-07-25
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="Xcode__u7684_u6B66_u88C5"><a href="#Xcode__u7684_u6B66_u88C5" class="headerlink" title="Xcode 的武装"></a>Xcode 的武装</h1><h2 id="u63D2_u4EF6"><a href="#u63D2_u4EF6" class="headerlink" title="插件"></a>插件</h2><ol>
<li>最好用的代码补齐插件,没有之一<br><br>FuzzyAutocompletePlugin是一个Xcode 5兼容的插件,通过添加模糊匹配来提高Xcode代码自动补全功能,开发者无需遵循从头匹配的原则,只要记得方法里某个关键字即可进行匹配,很好地提高了工作效率。<br>注意:该插件只在Xcode 5上进行过测试,没有测试和其他插件之间的兼容性(KSImageNamed除外)。<br>项目地址:<a href="https://github.com/chendo/FuzzyAutocompletePlugin">https://github.com/chendo/FuzzyAutocompletePlugin</a></li>
</ol>
<div class="post-more-link text-center">
<a class="btn" href="/2015/07/25/效率就是生命,提高效率方法/#more" rel="contents">
阅读全文 »
</a>
</div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
<a class="post-title-link" href="/2015/07/24/Cocoapads使用入门/" itemprop="url">
Cocoapads使用入门
</a>
</h1>
<div class="post-meta">
<span class="post-time">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time itemprop="dateCreated" datetime="2015-07-24T21:03:37+08:00" content="2015-07-24">
2015-07-24
</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h1 id="Cocoapads__u4F7F_u7528_u5165_u95E8_u4ECB_u7ECD"><a href="#Cocoapads__u4F7F_u7528_u5165_u95E8_u4ECB_u7ECD" class="headerlink" title="Cocoapads 使用入门介绍"></a>Cocoapads 使用入门介绍</h1><h2 id="u7B2C_u4E00__u5B89_u88C5"><a href="#u7B2C_u4E00__u5B89_u88C5" class="headerlink" title="第一 安装"></a>第一 安装</h2><p>中国特色Cocoapads安装<br><br>在Mac的命令行中打入:</p>
<figure class="highlight groovy"><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></pre></td><td class="code"><pre><span class="line"><span class="comment">//更新</span></span><br><span class="line">sudo gem update --system</span><br><span class="line"><span class="comment">//去除国外的ruby镜像 (有墙)</span></span><br><span class="line">gem sources --remove <span class="string">https:</span><span class="comment">//rubygems.org/</span></span><br><span class="line"><span class="comment">//设置为 某宝的镜像</span></span><br><span class="line">gem sources -a <span class="string">https:</span><span class="comment">//ruby.taobao.org/</span></span><br><span class="line"><span class="comment">//安装</span></span><br><span class="line">sudo gem install cocoapods</span><br><span class="line">pod setup</span><br></pre></td></tr></table></figure>
<div class="post-more-link text-center">
<a class="btn" href="/2015/07/24/Cocoapads使用入门/#more" rel="contents">
阅读全文 »
</a>
</div>
</div>
<div>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
</section>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div class="sidebar-inner">
<section class="site-overview sidebar-panel sidebar-panel-active ">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image"
src="/images/avatar.png"
alt="DavidCap" />
<p class="site-author-name" itemprop="name">DavidCap</p>
<p class="site-description motion-element" itemprop="description">iOS Coder的小屋</p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives">
<span class="site-state-item-count">5</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags">
<span class="site-state-item-count">3</span>
<span class="site-state-item-name">标签</span>
</a>
</div>
</nav>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/DavidCap" target="_blank">
<i class="fa fa-git"></i> GitHub
</a>
</span>
</div>
<div class="links-of-blogroll motion-element">
</div>
</section>
</div>
</aside>
</div>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright" >
©
<span itemprop="copyrightYear">2017</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">DavidCap</span>
</div>
<div class="powered-by">
由 <a class="theme-link" href="http://hexo.io">Hexo</a> 强力驱动
</div>
<div class="theme-info">
主题 -
<a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
NexT.Muse
</a>
</div>
</div>
</footer>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
</div>
</div>
<script type="text/javascript">
if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
window.Promise = null;
}
</script>
<script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
<script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.min.js"></script>
<script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js"></script>
<script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/js/src/utils.js?v=0.5.0"></script>
<script type="text/javascript" src="/js/src/motion.js?v=0.5.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=0.5.0"></script>
<script type="text/javascript">
// Popup Window;
var isfetched = false;
// Search DB path;
var search_path = "search.xml";
if (search_path.length == 0) {
search_path = "search.xml";
}
var path = "/" + search_path;
// monitor main search box;
function proceedsearch() {
$("body").append('<div class="popoverlay">').css('overflow', 'hidden');
$('.popup').toggle();
}
// search function;
var searchFunc = function(path, search_id, content_id) {
'use strict';
$.ajax({
url: path,
dataType: "xml",
async: true,
success: function( xmlResponse ) {
// get the contents from search data
isfetched = true;
$('.popup').detach().appendTo('.header-inner');
var datas = $( "entry", xmlResponse ).map(function() {
return {
title: $( "title", this ).text(),
content: $("content",this).text(),
url: $( "url" , this).text()
};
}).get();
var $input = document.getElementById(search_id);
var $resultContent = document.getElementById(content_id);
$input.addEventListener('input', function(){
var matchcounts = 0;
var str='<ul class=\"search-result-list\">';
var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
$resultContent.innerHTML = "";
if (this.value.trim().length > 1) {
// perform local searching
datas.forEach(function(data) {
var isMatch = true;
var content_index = [];
var data_title = data.title.trim().toLowerCase();
var data_content = data.content.trim().replace(/<[^>]+>/g,"").toLowerCase();
var data_url = data.url;
var index_title = -1;
var index_content = -1;
var first_occur = -1;
// only match artiles with not empty titles and contents
if(data_title != '' && data_content != '') {
keywords.forEach(function(keyword, i) {
index_title = data_title.indexOf(keyword);
index_content = data_content.indexOf(keyword);
if( index_title < 0 && index_content < 0 ){
isMatch = false;
} else {
if (index_content < 0) {
index_content = 0;
}
if (i == 0) {
first_occur = index_content;
}
}
});
}
// show search results
if (isMatch) {
matchcounts += 1;
str += "<li><a href='"+ data_url +"' class='search-result-title'>"+ data_title +"</a>";
var content = data.content.trim().replace(/<[^>]+>/g,"");
if (first_occur >= 0) {
// cut out 100 characters
var start = first_occur - 20;
var end = first_occur + 80;
if(start < 0){
start = 0;
}
if(start == 0){
end = 50;
}
if(end > content.length){
end = content.length;
}
var match_content = content.substring(start, end);
// highlight all keywords
keywords.forEach(function(keyword){
var regS = new RegExp(keyword, "gi");
match_content = match_content.replace(regS, "<b class=\"search-keyword\">"+keyword+"</b>");
});
str += "<p class=\"search-result\">" + match_content +"...</p>"
}
str += "</li>";
}
})};
str += "</ul>";
if (matchcounts == 0) { str = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>' }
if (keywords == "") { str = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>' }
$resultContent.innerHTML = str;
});
proceedsearch();
}