-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
1037 lines (823 loc) · 104 KB
/
atom.xml
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
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Vurtnec</title>
<link href="/atom.xml" rel="self"/>
<link href="http://vurtnec.github.io/"/>
<updated>2018-10-21T14:01:33.586Z</updated>
<id>http://vurtnec.github.io/</id>
<author>
<name>Zachary Hou</name>
</author>
<generator uri="http://hexo.io/">Hexo</generator>
<entry>
<title>读后感:世界的眼睛</title>
<link href="http://vurtnec.github.io/2018/10/21/magnum/"/>
<id>http://vurtnec.github.io/2018/10/21/magnum/</id>
<published>2018-10-20T16:00:00.000Z</published>
<updated>2018-10-21T14:01:33.586Z</updated>
<content type="html"><![CDATA[<p>这是世界上一群特立独行的人,他们有着敏感的视觉、睿智的头脑、勇敢的精神、执着的毅力、真实的人性……他们持续着图片王国的神话。</p>
<p>马格南——这群人的组织,一个耀眼的名字,一方令人仰望的、群星璀璨的天空,它用平实而又丰富的照片,记录了灾难的痛苦、社会的变革、人类的尊严……向世人展示重大的事件、重要的人物、隐没的部落、消失的遗迹……马格南和马格南摄影师们,犹如世界的眼睛,让我们观察世界,了解世界。</p>
<p>从马格南的历史回顾中不仅可以看到整个摄影史的发展,也看到了这半个多世纪社会历史的变迁。战争造就了纪实摄影的辉煌,和平时代的手机,视频的发展也给未来摄影的道路带来了迷茫。就像书中的讨论中一样,到底是摄影是纪实还是艺术,马格南不知道,我们也不知道。</p>
<p>四个创始人先后死在了前线三个,毫无疑问,马格南的摄影师们是这个世界上最有意思的一群人,充满个性,勇敢无畏,一个好的纪实摄影师无疑是有着冒险家的特质,而一个好的冒险家却不一定是能成为好的摄影师,两者的区别就在于摄影师除了必要胆量和果决,还要有善于发现的双眼和好的艺术品位,如果再有一些悲天悯人的人道主义情怀,就再好不过了。尽管在新闻从业者的戒律中会强调冷静、克制,不被个人观念和情绪所左右,这样才会让事实的呈现中立、客观,但如果将纪实摄影作为艺术映射现实的某种媒介或形式,激情与理想主义仍然是必不可少的。</p>
<p>在本书中,除了对罗伯特•卡帕的生平介绍略微详细,其他很多重要的摄影师,都只能草草带过,因为杰出的作品和人物如此之多,经历和故事又都很丰富,给每个人出一本传记,似乎都不嫌多。让我惊奇的是,马格南的组织形式几乎是现代坏民主的典范,也许是因为摄影师这一职业的独特性吧,所有的人和事情都在强调自由和个性,而缺乏统一的规则和标准,以至于在罗伯特•卡帕英年早逝后,再也没有人能够做这个组织的精神领袖,更没有人可以高效治理和充分发展马格南,于是多年的混乱和濒于崩溃也是不难理解的,而马格南没有最终垮掉的原因,就在于这些摄影师都是行业最顶尖的人物,甚至名垂青史,出色的技术和声望,是很多同类机构无法相比拟的。相对于马格南的故事,其实我更愿意了解摄影作品里的故事,比如那些照片里的人因何而来,遭遇了什么,后来又将如何。</p>
<p>自人类文明学会书写历史以来,记录历史的方式不断改变,摄影无疑是非常重要的载体,相对于文字它给人的感官建构更为具象,且不易捏造,而相对于影像,人们在观看摄影作品时会拥有更大的思维深度和广度,在接受上不会处于被动,在对事物的认知上或许会更为深刻和有内涵。当然,每个人都有着各自的观看之道,这是不能勉强的,在一个充斥着所谓“后现代主义”的时代中,所有的观念和表现形式都在不可避免的衰老,我们生活的世界却似乎正越来越年轻,因为社会一直在发展和变化,它永远不缺好故事,无论你在场还是不在场,知道或不知道,总有一些人会在哪里,用摄影记录着时代的变迁。</p>
<p>顺便整理了下马格南四个创始人的一些资料:</p>
<h3 id="Robert-Capa"><a href="#Robert-Capa" class="headerlink" title="Robert Capa"></a>Robert Capa</h3><p>“如果你的照片拍的不够好,那是因为你靠的不够近。” 卡帕其实挺难写的,因为名气太大了,几乎稍微懂点摄影历史的人都知道。马格南的发起者,创始人之一,没有他就没有这本书。</p>
<p><img src="https://i.loli.net/2018/10/21/5bcc8068829da.jpeg" alt="timg (3).jpeg"></p>
<h3 id="Henri-Cartier-Bresson"><a href="#Henri-Cartier-Bresson" class="headerlink" title="Henri Cartier-Bresson"></a>Henri Cartier-Bresson</h3><p>亨利·卡蒂埃-布列松,世界著名的人文摄影家,决定性瞬间理论的创立者与实践者。被誉为”现代新闻摄影之父”。事实上玩街拍的没有人不认识布列松,玩徕卡的没有人不认识布列松。人需要一种信仰,在街拍的信仰里,似乎第一个膜拜的神就是布列松。并不是布列松是最伟大的,他就像50mm镜头,是其他焦距的参考。</p>
<p><img src="https://i.loli.net/2018/10/21/5bcc8068ec928.jpeg" alt="timg (1).jpeg"></p>
<h3 id="George-Rodger"><a href="#George-Rodger" class="headerlink" title="George Rodger"></a>George Rodger</h3><p>马格南的另一个创始人,对于非洲大地上的风土人文纪实摄影相当经典,是二次战后重要的摄影大师。</p>
<p><img src="https://i.loli.net/2018/10/21/5bcc806888ed6.jpg" alt="9096a97f0c8bb3bccf2b5c0622de8c22.jpg"></p>
<h3 id="David-Seymour"><a href="#David-Seymour" class="headerlink" title="David Seymour"></a>David Seymour</h3><p>西蒙的摄影作品从西班牙内战,捷克独立到其他欧洲国家的历史大事都有,其中最感动人心的是他以孩子为主题的战地摄影作品。</p>
<p><img src="https://i.loli.net/2018/10/21/5bcc80685ba39.jpeg" alt="timg (4).jpeg"></p>
]]></content>
<summary type="html">
<p>这是世界上一群特立独行的人,他们有着敏感的视觉、睿智的头脑、勇敢的精神、执着的毅力、真实的人性……他们持续着图片王国的神话。</p>
<p>马格南——这群人的组织,一个耀眼的名字,一方令人仰望的、群星璀璨的天空,它用平实而又丰富的照片,记录了灾难的痛苦、社会的变革、人类的尊
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
<category term="读书" scheme="http://vurtnec.github.io/tags/%E8%AF%BB%E4%B9%A6/"/>
</entry>
<entry>
<title>蓝光电影收藏目录</title>
<link href="http://vurtnec.github.io/2018/09/22/Blu-ray%20movie%20collection%20directory/"/>
<id>http://vurtnec.github.io/2018/09/22/Blu-ray movie collection directory/</id>
<published>2018-09-21T16:00:00.000Z</published>
<updated>2018-10-21T12:59:27.316Z</updated>
<content type="html"><![CDATA[<p>记录一下自己蓝光电影收藏的目录,这篇应该会一直更新。</p>
<h3 id="漫威"><a href="#漫威" class="headerlink" title="漫威"></a>漫威</h3><ul>
<li>钢铁侠1,2,3</li>
<li>雷神1,2,3</li>
<li>死侍1,2</li>
<li>复仇者联盟1,2,3</li>
<li>奇异博士</li>
<li>美国队长1,2,3</li>
<li>蚁人1,2</li>
<li>蜘蛛侠</li>
<li>银河护卫队1,2</li>
<li>黑豹</li>
</ul>
<h3 id="剧情"><a href="#剧情" class="headerlink" title="剧情"></a>剧情</h3><ul>
<li>完美陌生人</li>
<li>马戏之王</li>
<li>楚门的世界</li>
<li>南极之恋</li>
<li>至爱梵高</li>
<li>土拨鼠之日</li>
<li>阿甘正传</li>
<li>模仿游戏</li>
<li>泰坦尼克号</li>
<li>当幸福来敲门</li>
<li>华盛顿邮报</li>
<li>大空头</li>
</ul>
<h3 id="动作"><a href="#动作" class="headerlink" title="动作"></a>动作</h3><ul>
<li>速度与激情4,5,6,7</li>
<li>瞒天过海:美人计</li>
<li>碟中谍1,2,3,4,5,6</li>
<li>王牌特工1,2</li>
<li>英伦对决</li>
</ul>
<h3 id="科幻"><a href="#科幻" class="headerlink" title="科幻"></a>科幻</h3><ul>
<li>明日边缘</li>
<li>黑客帝国1,2,3</li>
<li>降临</li>
<li>蝙蝠侠1,2,3</li>
</ul>
<h3 id="恐怖"><a href="#恐怖" class="headerlink" title="恐怖"></a>恐怖</h3><ul>
<li>电锯惊魂</li>
<li>死亡录像</li>
<li>釜山行</li>
<li>1408幻影凶间</li>
</ul>
<h3 id="最爱"><a href="#最爱" class="headerlink" title="最爱"></a>最爱</h3><ul>
<li>脸庞,村庄</li>
<li>大圣归来</li>
<li>银翼杀手2049</li>
<li>迷雾</li>
<li>恐怖游轮</li>
<li>盗梦空间</li>
<li>遗落战境</li>
<li>追龙</li>
<li>星际穿越</li>
<li>心灵捕手</li>
<li>忠犬八公</li>
<li>海上钢琴师</li>
<li>猫鼠游戏</li>
<li>菲利普船长</li>
<li>消失的爱人</li>
<li>这个男人来自地球</li>
<li>重返20岁</li>
<li>至爱时刻</li>
<li>敦刻尔克</li>
<li>芳华</li>
<li>辛德勒的名单</li>
<li>廊桥遗梦</li>
<li>金刚狼3</li>
<li>爱乐之城</li>
<li>少年派的奇幻漂流</li>
<li>萨利机长</li>
<li>聚焦</li>
<li>末代皇帝</li>
</ul>
]]></content>
<summary type="html">
<p>记录一下自己蓝光电影收藏的目录,这篇应该会一直更新。</p>
<h3 id="漫威"><a href="#漫威" class="headerlink" title="漫威"></a>漫威</h3><ul>
<li>钢铁侠1,2,3</li>
<li>雷神1,2,3</li>
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
<category term="movie" scheme="http://vurtnec.github.io/tags/movie/"/>
</entry>
<entry>
<title>利用kafka的增量索引优化思路</title>
<link href="http://vurtnec.github.io/2018/07/03/kafka-partial-index/"/>
<id>http://vurtnec.github.io/2018/07/03/kafka-partial-index/</id>
<published>2018-07-02T16:00:00.000Z</published>
<updated>2018-07-04T14:35:55.000Z</updated>
<content type="html"><![CDATA[<p><img src="https://i.loli.net/2018/07/04/5b3cdb0ec75ce.jpg" alt="DSCF0327.jpg"></p>
<p>之前在微信上看到一篇叫<strong>批处理已死,Kafka 当道</strong>的文章,刚好我们的项目马上要到cyber了,增量索引在每五分钟之内会有10w的数据量,导致每编一次增量索引的时间都要1个小时以上。所以想到是不是可以参考kafka来优化我们的增量索引。</p>
<h3 id="什么是kafka"><a href="#什么是kafka" class="headerlink" title="什么是kafka"></a>什么是kafka</h3><p>什么是 Kafka?Apache Kafka 是 LinkedIn 开源的分布式消息系统,在 LinkedIn 目前每天处理几十万亿条的消息,并且已经部署到了世界范围内成千上万的组织之中,包括财富 500 强的公司。基本上成了一种工业标准。</p>
<p>Kafka 的基础是 log 的理念,log 是只能往上追加(append),完全有序的数据结构。log 本身采用了发布 - 订阅(pubsub)的模式,发布者能够非常容易地把不可变的数据往 log 上追加,订阅者可以维护自己的指针,以便处理当前的信息。</p>
<h3 id="增量索引模型"><a href="#增量索引模型" class="headerlink" title="增量索引模型"></a>增量索引模型</h3><h4 id="优化前"><a href="#优化前" class="headerlink" title="优化前"></a>优化前</h4><p><img src="https://i.loli.net/2018/07/04/5b3cd77516a75.jpg" alt="partial index before.jpg"></p>
<p>优化前其实思路很简单,前端或者任何地方触发了一个产品需要增量索引,就将该产品的ID添加到Incremental Table中,然后在系统后台有一个Scheduler在每五分钟执行一次将表中的数据编入索引。这个方案在平时没什么问题,但是到了cyber的时候,会有大量产品没有库存和价格的变动,导致每五分钟内的需要进行增量索引的产品过多,每次大概在需要一个小时以上的时间。</p>
<h4 id="优化后"><a href="#优化后" class="headerlink" title="优化后"></a>优化后</h4><p><img src="https://i.loli.net/2018/07/04/5b3cd8e162648.jpg" alt="partial index after.jpg"><br>优化后就是将整个原本写入table的产品写入kafka之中,然后用kafka的消费者Group来消化这些产品并build产品的属性到我们的CAS之中(一个nosql数据库),最后再由Scheduler将CAS数据读取出来编入索引。因为时间消耗最大的地方就是在对产品属性重新计算的时候,而我们把这部分横向扩展成了kafka的消费来来消费这部分,极大提升了增量索引的时间,优化后时间,基本能做到实时处理所有数据。(Scheduler设置每分钟的原因是因为磁盘读写,因为增量索引是直接往索引文件追加,并复制到多个索引备份中,时间大概为1分钟。)</p>
]]></content>
<summary type="html">
<p><img src="https://i.loli.net/2018/07/04/5b3cdb0ec75ce.jpg" alt="DSCF0327.jpg"></p>
<p>之前在微信上看到一篇叫<strong>批处理已死,Kafka 当道</strong>的文章,刚好我们的
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="Endeca" scheme="http://vurtnec.github.io/tags/Endeca/"/>
<category term="搜索引擎" scheme="http://vurtnec.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
</entry>
<entry>
<title>Web开发到微信小程序</title>
<link href="http://vurtnec.github.io/2018/06/25/Web-Develop-to-Wechat-Mini%20Program/"/>
<id>http://vurtnec.github.io/2018/06/25/Web-Develop-to-Wechat-Mini Program/</id>
<published>2018-06-24T16:00:00.000Z</published>
<updated>2018-06-21T12:50:52.842Z</updated>
<content type="html"><![CDATA[<p>闲来无事,突然想写一个小程序,于是好好的周五的晚上写了一晚上代码,从完全不知道什么情况(我的JavaScript水平很差的),到愣是写好了一个已经发布了的小程序。所以这里只是想分享一下一个Web开发人员半吊子前端水平如何写出一个小程序。</p>
<h3 id="准备条件"><a href="#准备条件" class="headerlink" title="准备条件"></a>准备条件</h3><ul>
<li>微信开发者工具,去官网下载</li>
<li>微信小程序账号注册一个,<a href="https://mp.weixin.qq.com/" target="_blank" rel="external">https://mp.weixin.qq.com/</a></li>
<li>ES6,这个我觉得Java程序员应该都是依样画葫芦写出来</li>
<li>JavaScript,不一定要精通,至少要会写吧</li>
<li>官方的微信小程序demo,<a href="https://github.com/xwartz/wechat-app-demo" target="_blank" rel="external">https://github.com/xwartz/wechat-app-demo</a></li>
<li>官方文档一份,<a href="https://developers.weixin.qq.com/miniprogram/dev/index.html" target="_blank" rel="external">https://developers.weixin.qq.com/miniprogram/dev/index.html</a></li>
</ul>
<h3 id="小程序和Web开发的相似点"><a href="#小程序和Web开发的相似点" class="headerlink" title="小程序和Web开发的相似点"></a>小程序和Web开发的相似点</h3><p>其实小程序和Web开发还是有很多相似之处的,只要知道这些,开发起来也会容易很多。当然开始开始先简单阅读下官方文档的get start。</p>
<h4 id="视图层"><a href="#视图层" class="headerlink" title="视图层"></a>视图层</h4><p><strong>WXML</strong></p>
<p>这个后缀的文件其实就和JSP或者其他模板一样,里面有些微信自己封装的标签和属性,参照官方文档写就行了。</p>
<p><strong>WXSS</strong></p>
<p>这个文件其实就是css文件,所有样式都放在里面就好。</p>
<h4 id="逻辑层"><a href="#逻辑层" class="headerlink" title="逻辑层"></a>逻辑层</h4><p>JS文件就是用来处理各种业务逻辑的地方,当计算好的结果要返回给视图层的时候,只需要将数据放入page对象的pageData.data,用setData方法就好。</p>
<h4 id="配置层"><a href="#配置层" class="headerlink" title="配置层"></a>配置层</h4><p>app.json,该文件用于配置当前app的常用配置,比如将要所有页面都注册到这个配置文件里面。</p>
<h3 id="Troubleshooting"><a href="#Troubleshooting" class="headerlink" title="Troubleshooting"></a>Troubleshooting</h3><ul>
<li>每次修改了pageData的data内容的时候,一定要调用setData方法,这里就跟flux有点相似,修改了store的内容,需要通知到视图层去更新。</li>
<li>每个page的data,和css都相互独立,意思是说pageData这个对象的scope是只是当前page。</li>
<li>全局变量建议定义在app.js里面。</li>
<li>app.wxss是公共的css文件,会被page里面的覆盖。</li>
</ul>
<h3 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h3><p>微信小程序分为开发版,体验版和正式版。</p>
<h4 id="开发版"><a href="#开发版" class="headerlink" title="开发版"></a>开发版</h4><p>这个只需要点击用手机扫面预览二维码就可以,但是只限于自己绑定的微信账号和给了权限的账号,一般用于开发人员。</p>
<h4 id="体验版"><a href="#体验版" class="headerlink" title="体验版"></a>体验版</h4><p>这个需要上传代码到微信服务器,同样也需要授权给部分微信账号,才可以使用,一般用于测试人员(我猜的)。</p>
<h4 id="正式版"><a href="#正式版" class="headerlink" title="正式版"></a>正式版</h4><p>这个就是正式发布后的,所有人都可以在手机上面搜索到该版本,但是需要提交给微信审核,审核通过之后方可发布。</p>
<h3 id="附录"><a href="#附录" class="headerlink" title="附录"></a>附录</h3><p>写好的小程序源码:<a href="https://github.com/vurtnec/vPassword" target="_blank" rel="external">https://github.com/vurtnec/vPassword</a></p>
]]></content>
<summary type="html">
<p>闲来无事,突然想写一个小程序,于是好好的周五的晚上写了一晚上代码,从完全不知道什么情况(我的JavaScript水平很差的),到愣是写好了一个已经发布了的小程序。所以这里只是想分享一下一个Web开发人员半吊子前端水平如何写出一个小程序。</p>
<h3 id="准备条件">
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="小程序" scheme="http://vurtnec.github.io/tags/%E5%B0%8F%E7%A8%8B%E5%BA%8F/"/>
</entry>
<entry>
<title>印象百内</title>
<link href="http://vurtnec.github.io/2018/06/17/Torres-del-Paine/"/>
<id>http://vurtnec.github.io/2018/06/17/Torres-del-Paine/</id>
<published>2018-06-16T16:00:00.000Z</published>
<updated>2018-06-21T14:58:23.765Z</updated>
<content type="html"><![CDATA[<p>还记得第一次知道百内是在两年前,那时候第一次到智利。一直琢磨着能去哪玩,这才有了对百内的第一次了。知道百内曾被国家地理杂志评选为“50”个一生必须去的地方之一,知道了百内有几条非常出名的徒步路线,同时也知道了一些百内条件的恶劣,什么每个人进去买门票的时候要记录你的进入时间,在里面的呆几天等等。由此便不由自主的在心中对百内产生了一个心里阴影,觉得百内的旅游条件肯定特别差,徒步条件特别原始。</p>
<p>直到今年五一终于有机会去了一趟百内,才发现百内和我心中的完全不一样,智利毕竟也是发达国家(可能是圣地亚哥给我一直都是国内三线城市的印象,^_^),所以整个百内的旅游开发都很完善。所以才有这次拍照的主题,希望拍出我两年前心中的那个百内,那个荒凉,危险又让人却步的地方。</p>
<h3 id="初入百内"><a href="#初入百内" class="headerlink" title="初入百内"></a>初入百内</h3><p>刚进入百内的路上,远处的大气凌厉的雪山和两边荒芜的杂草已经略显荒凉了。<br><img src="https://i.loli.net/2018/06/17/5b267d1a82f7e.jpg" alt="DSCF0804.jpg"></p>
<p>旅行的第一站,一个观景点,远处云雾中的雪山和进入的草丛形成鲜明的对比。还记得当时的风特别大,大到我们走路风可以吹动我们的步伐。<br><img src="https://i.loli.net/2018/06/17/5b267b3b9ed93.jpg" alt="DSCF0797.jpg"></p>
<p>接下来来到了当初百内发生火灾的地方,如今干枯的树木还不断的提醒着人们要保护自然环境,此时雪山依旧朦朦胧胧的停留在远处。<br><img src="https://i.loli.net/2018/06/18/5b2688889e742.jpg" alt="DSCF0843.jpg"></p>
<p>随着逐渐接近百内国家公园,沿路的野生羊驼开始各种成群出现。<br><img src="https://i.loli.net/2018/06/18/5b2688d4f15ca.jpg" alt="DSCF0852.jpg"></p>
<p>天上的飞机,左边的老鹰和雪山形成一道奇异的风景。<br><img src="https://i.loli.net/2018/06/17/5b267e1d34412.jpg" alt="DSCF0861.jpg"></p>
<p>接下来来到了百内的一个休息站,吃到了超好吃的牛排,三塔的雪山若影若现,旁边枯萎的树木不断提醒着深处百内国家公园内部。<br><img src="https://i.loli.net/2018/06/17/5b2681f621a2f.jpg" alt="DSCF0912.jpg"><br><img src="https://i.loli.net/2018/06/18/5b2689ad53acf.jpg" alt="DSCF0926.jpg"></p>
<p>下一站便是特别出名的格雷冰川,但是由于酒店原因没有提前预定导致不能坐船,刚好天气也不是很好,云雾缭绕,还下着小雨。<br><img src="https://i.loli.net/2018/06/18/5b2689389237c.jpg" alt="DSCF0943.jpg"></p>
<p>返回的途中看到的百内三塔,想着这边是第二天要徒步去的地方。<br><img src="https://i.loli.net/2018/06/18/5b268913bd1b5.jpg" alt="DSCF1005.jpg"></p>
<p>最后一站便是一个神奇的洞穴,话说是很多年前智利北方人迁徙到这里变居住在此。同时这个洞穴也发现很久以前有一种像哥斯拉一样的动物,不过早已经灭绝了。<br><img src="https://i.loli.net/2018/06/17/5b2682296f606.jpg" alt="DSCF1020.jpg"><br><img src="https://i.loli.net/2018/06/18/5b2686f342283.jpg" alt="DSCF1033.jpg"></p>
<h3 id="徒步百内"><a href="#徒步百内" class="headerlink" title="徒步百内"></a>徒步百内</h3><p>这天便是徒步百内的一天,全程10个小时,来回三十多公里,没有路。</p>
<p>这里说个小插曲,我们徒步的路线是必须有导游带才行,导游在路上还专门提醒了我们三个中国人,不管是否到达,下午两点多我们就要开始折返,因为路上是没有灯光的,我们没有过夜的装备。结果是一群老外成了拖后腿的,爬个山完全不行。</p>
<p>远处便是今天的目的地,走过前面的草原,翻过一个山谷,然后是一片森林,最后爬上雪山才能到达今天的目的地。<br><img src="https://i.loli.net/2018/06/17/5b2682299be55.jpg" alt="DSCF1083.jpg"></p>
<p>翻过前面的草原便来到了导游说的风之谷(wind path 姑且让我这么翻译,哈哈)。<br><img src="https://i.loli.net/2018/06/17/5b26852192e47.jpg" alt="DSCF1112.jpg"></p>
<p>一路经过了各种折腾,路全靠走出来,也不知道摔了多少次。哈哈,终于来到了百内三塔面前,达到了这次旅行的最终目的。<br><img src="https://i.loli.net/2018/06/18/5b268761e3657.jpg" alt="DSCF5038-2.jpg"></p>
<h3 id="美食"><a href="#美食" class="headerlink" title="美食"></a>美食</h3><ul>
<li>一定要推荐一家叫Santolla的餐厅,整个餐厅是由集装箱做成。所以菜品都特别好吃,尤其是甜品,让人觉得惊艳,让服务员推荐当日的菜品。</li>
<li>百内公园内部有个休息点的牛排,但是遗憾的是我不知道那个营地的名字,不过如果抱团的话应该都会在那儿休息。</li>
</ul>
<h3 id="其他注意事项"><a href="#其他注意事项" class="headerlink" title="其他注意事项"></a>其他注意事项</h3><ul>
<li>爬山一定要有登山杖</li>
<li>如果要去格雷冰川的话,要提前预定冰川旁边的那个酒店,然后才能坐船去冰川</li>
<li>天气变化特别快,要准备防雨水的衣服裤子和鞋子</li>
<li>以上只是针对非W和O线路的普通玩家</li>
</ul>
]]></content>
<summary type="html">
<p>还记得第一次知道百内是在两年前,那时候第一次到智利。一直琢磨着能去哪玩,这才有了对百内的第一次了。知道百内曾被国家地理杂志评选为“50”个一生必须去的地方之一,知道了百内有几条非常出名的徒步路线,同时也知道了一些百内条件的恶劣,什么每个人进去买门票的时候要记录你的进入时间,
</summary>
<category term="photography" scheme="http://vurtnec.github.io/categories/photography/"/>
<category term="摄影" scheme="http://vurtnec.github.io/tags/%E6%91%84%E5%BD%B1/"/>
<category term="旅行" scheme="http://vurtnec.github.io/tags/%E6%97%85%E8%A1%8C/"/>
</entry>
<entry>
<title>NodeJs异步I/O</title>
<link href="http://vurtnec.github.io/2018/06/13/NodeJs-Asynchronous-I:O/"/>
<id>http://vurtnec.github.io/2018/06/13/NodeJs-Asynchronous-I:O/</id>
<published>2018-06-12T16:00:00.000Z</published>
<updated>2018-06-21T15:08:09.956Z</updated>
<content type="html"><![CDATA[<p>要搞清楚NodeJs的异步I/O,首先要知道以下的几点。</p>
<h3 id="NodeJs单线程"><a href="#NodeJs单线程" class="headerlink" title="NodeJs单线程"></a>NodeJs单线程</h3><p>单线程其实就是按从上到下顺序依次来执行,而且每次只执行一个任务,只有当前这个任务执行完了,才会执行下一个任务。<br><strong>这里有个误区,Node自然其实是多线程的。只是解析和执行JavaScript代码的线程只有一个,即主线程。这就是NodeJs为何是单线程的原因了。</strong>但实际上还有其他的线程:处理AJAX请求的线程、处理DOM事件的线程、定时器线程、读写文件的线程等。这些线程称为工作线程,类似Web Workers的方式来接近JavaScript大计算阻塞UI渲染的问题。</p>
<h3 id="事件驱动"><a href="#事件驱动" class="headerlink" title="事件驱动"></a>事件驱动</h3><p>事件驱动编程主要思想是通过事件或状态的变化来进行应用程序的流程控制,一般通过事件监听完成,一旦事件被检测到,则调用相应的回调函数。</p>
<p><strong>事件驱动主要执行过程是当进来的一个新的请求的时候,请求将会被压入队列中,然后通过一个循环来检测队列中的事件状态变化,如果检测到有状态变化的事件,那么就执行该事件对应的处理代码(一般都是回调函数)。</strong></p>
<div id="flowchart-0" class="flow-chart"></div>
<p><strong>基于事件驱动的,先同步(即按从上到下的顺序)执行整个整个js文件中的代码(此时的事件循环是暂停的),当遇到异步函数时,会从线程池中寻求有用的线程来执行该异步函数,当异步函数执行完,就将回调函数放入消息队列里面。当整个js文件执行完后,事件循环开始执行,从消息队列里面取消息,开始执行里面的回调函数。</strong></p>
<h3 id="异步I-O"><a href="#异步I-O" class="headerlink" title="异步I/O"></a>异步I/O</h3><p>最后再来说异步I/O,NodeJs采用了事件循环的方式实现异步I/O。以下是整个异步I/O的流程:</p>
<p><img src="https://i.loli.net/2018/06/21/5b2bb72c47871.png" alt="20160622014343_9570.png"></p>
<h3 id="NodeJs优缺点"><a href="#NodeJs优缺点" class="headerlink" title="NodeJs优缺点"></a>NodeJs优缺点</h3><p>所以说因为异步I/O,大家说Node擅长处理I/O密集型的应用场景;因为单线程,在CPU密集的场景中,Node因为大量CPU的计算会阻塞JavaScript线程导致大家说Node不擅长处理CPU密集型场景。但是这里有两点要注意,<strong>第一,并不是说Node处理大量CPU计算就慢,而且因为单线程会阻塞其他操作,单以执行效率来做评价,V8的执行效率是毋庸置疑的。第二,Node也有单线程大计算的解决方案:采用和Web Workers相同的思路,子进程来应对单线程无法利用多核CPU的问题。</strong></p>
<h3 id="引用和参考"><a href="#引用和参考" class="headerlink" title="引用和参考"></a>引用和参考</h3><p>深入浅出NodeJs<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.0/raphael-min.js"></script><script src="http://flowchart.js.org/flowchart-latest.js"></script><textarea id="flowchart-0-code" style="display: none">st=>start: 开始
e=>end: 退出
op1=>operation: 取出一个事件
op2=>operation: 执行回调
cond1=>condition: 还有事件?
cond2=>condition: 有关联回调?
st->cond1
cond1(no)->e
cond1(yes)->op1->cond2
cond2(yes)->op2->cond1
cond2(no)->cond1</textarea><textarea id="flowchart-0-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("flowchart-0-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("flowchart-0-options").value)); var diagram = flowchart.parse(code); diagram.drawSVG("flowchart-0", options);</script></p>
]]></content>
<summary type="html">
<p>要搞清楚NodeJs的异步I/O,首先要知道以下的几点。</p>
<h3 id="NodeJs单线程"><a href="#NodeJs单线程" class="headerlink" title="NodeJs单线程"></a>NodeJs单线程</h3><p>单线程其实就
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="NodeJs" scheme="http://vurtnec.github.io/tags/NodeJs/"/>
<category term="JavaScript" scheme="http://vurtnec.github.io/tags/JavaScript/"/>
</entry>
<entry>
<title>Idea 基本配置</title>
<link href="http://vurtnec.github.io/2018/06/07/Idea-Configuration/"/>
<id>http://vurtnec.github.io/2018/06/07/Idea-Configuration/</id>
<published>2018-06-06T16:00:00.000Z</published>
<updated>2018-06-11T15:15:47.000Z</updated>
<content type="html"><![CDATA[<h3 id="主要文件介绍(-JetBrains-IntelliJ-IDEA-2017-3-4-bin)"><a href="#主要文件介绍(-JetBrains-IntelliJ-IDEA-2017-3-4-bin)" class="headerlink" title="主要文件介绍(\JetBrains\IntelliJ IDEA 2017.3.4\bin)"></a>主要文件介绍(<installationpath>\JetBrains\IntelliJ IDEA 2017.3.4\bin)</installationpath></h3><ul>
<li>idea.exe 文件是 IntelliJ IDEA 32 位的可行执行文件,IntelliJ IDEA 安装完默认发送到桌面的也就是这个执行文件的快捷方式。</li>
<li>idea.exe.vmoptions 文件是 IntelliJ IDEA 32 位的可执行文件的 VM 配置文件,具体配置修改会下面进行专门讲解。</li>
<li>idea64.exe 文件是 IntelliJ IDEA 64 位的可行执行文件,要求必须电脑上装有 JDK 64 位版本。64 位的系统也是建议使用该文件。</li>
<li>idea64.exe.vmoptions 文件是 IntelliJ IDEA 64 位的可执行文件的 VM 配置文件,具体配置修改会下面进行专门讲解。</li>
<li>idea.properties 文件是 IntelliJ IDEA 的一些属性配置文件,具体配置修改会下面进行专门讲解。</li>
</ul>
<h3 id="idea64-exe-vmoptions"><a href="#idea64-exe-vmoptions" class="headerlink" title="idea64.exe.vmoptions"></a>idea64.exe.vmoptions</h3><p>64 位修改idea64.exe.vmoptions ,如果你是 32 位的系统你应该修改的是 idea.exe.vmoptions 文件里面的内容,但是由于 32 位系统内存一般都是 2G 左右的,所以也没有多大空间可以调整,所以一般无需调整的。<br>修改的原则主要是根据自己机器的内存情况来判断的,我个人是建议 8G 以下的机子或是静态页面开发者都是无需修改的。如果你是开发大型项目、Java 项目或是 Android 项目,并且内存大于 8G,建议进行修改,常修改的就是下面 4 个参数,我这里主要以我的机子会例进行建议,每个人机子情况不一,这里也只是做一个引子,最好的调整方式是你可以根据 jconsole 这类工具进行观察后个性化调整。</p>
<ul>
<li>-Xms128m,16 G 内存的机器可尝试设置为 -Xms512m</li>
<li>-Xmx750m,16 G 内存的机器可尝试设置为 -Xmx1500m</li>
<li>-XX:MaxPermSize=350m,16G 内存的机器可尝试设置为 -XX:MaxPermSize=500m</li>
<li>-XX:ReservedCodeCacheSize=225m,16G 内存的机器可尝试设置为 -XX:ReservedCodeCacheSize=500m</li>
</ul>
<h3 id="idea-properties"><a href="#idea-properties" class="headerlink" title="idea.properties"></a>idea.properties</h3><p>IntelliJ IDEA 一些属性配置,没有 32 位和 64 位之分,修改原则主要根据个人对 IntelliJ IDEA 的个性化配置情况来分析。常修改的就是下面 4 个参数:</p>
<ul>
<li>idea.config.path=${user.home}/.IntelliJIdea/config,该属性主要用于指向 IntelliJ IDEA 的个性化配置目录,默认是被注释,打开注释之后才算启用该属性,这里需要特别注意的是斜杠方向,这里用的是正斜杠。</li>
<li>idea.system.path=${user.home}/.IntelliJIdea/system,该属性主要用于指向 IntelliJ IDEA 的系统文件目录,默认是被注释,打开注释之后才算启用该属性,这里需要特别注意的是斜杠方向,这里用的是正斜杠。如果你的项目很多,则该目录会很大,如果你的 C 盘空间不够的时候,还是建议把该目录转移到其他盘符下。</li>
<li>idea.max.intellisense.filesize=2500,该属性主要用于提高在编辑大文件时候的代码帮助。IntelliJ IDEA 在编辑大文件的时候还是很容易卡顿的。</li>
<li>idea.cycle.buffer.size=1024,该属性主要用于控制控制台输出缓存。有遇到一些项目开启很多输出,控制台很快就被刷满了没办法再自动输出后面内容,这种项目建议增大该值或是直接禁用掉,禁用语句 idea.cycle.buffer.size=disabled。</li>
</ul>
<h3 id="配置文件同步"><a href="#配置文件同步" class="headerlink" title="配置文件同步"></a>配置文件同步</h3><p>创建一个新的git project来同步文件</p>
]]></content>
<summary type="html">
<h3 id="主要文件介绍(-JetBrains-IntelliJ-IDEA-2017-3-4-bin)"><a href="#主要文件介绍(-JetBrains-IntelliJ-IDEA-2017-3-4-bin)" class="headerlink" title="主要
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="IDE" scheme="http://vurtnec.github.io/tags/IDE/"/>
</entry>
<entry>
<title>HOW THE ECONOMIC MACHINE WORKS</title>
<link href="http://vurtnec.github.io/2018/05/25/HOW-THE-ECONOMIC-MACHINE-WORKS/"/>
<id>http://vurtnec.github.io/2018/05/25/HOW-THE-ECONOMIC-MACHINE-WORKS/</id>
<published>2018-05-24T16:00:00.000Z</published>
<updated>2018-06-21T12:47:57.960Z</updated>
<content type="html"><![CDATA[<p><strong>How does the economy really work?</strong></p>
<p>This simple but not simplistic video by Ray Dalio, Founder of Bridgewater Associates, shows the basic driving forces behind the economy, and explains why economic cycles occur by breaking down concepts such as credit, interest rates, leveraging and deleveraging.</p>
<p><a href="https://www.youtube.com/watch?v=rFV7wdEX-Mo" target="_blank" rel="external">https://www.youtube.com/watch?v=rFV7wdEX-Mo</a></p>
<h3 id="Reference"><a href="#Reference" class="headerlink" title="Reference"></a>Reference</h3><p><a href="http://www.economicprinciples.org/zh-hans/index.html" target="_blank" rel="external">http://www.economicprinciples.org/zh-hans/index.html</a></p>
]]></content>
<summary type="html">
<p><strong>How does the economy really work?</strong></p>
<p>This simple but not simplistic video by Ray Dalio, Founder of Bridgewater Assoc
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
<category term="理财" scheme="http://vurtnec.github.io/tags/%E7%90%86%E8%B4%A2/"/>
</entry>
<entry>
<title>Spring Boot</title>
<link href="http://vurtnec.github.io/2018/04/21/Spring-Boot/"/>
<id>http://vurtnec.github.io/2018/04/21/Spring-Boot/</id>
<published>2018-04-20T16:00:00.000Z</published>
<updated>2018-06-21T12:50:46.927Z</updated>
<content type="html"><![CDATA[<h2 id="Spring-Boot简介"><a href="#Spring-Boot简介" class="headerlink" title="Spring Boot简介"></a>Spring Boot简介</h2><h3 id="Spring-Boot不是什么"><a href="#Spring-Boot不是什么" class="headerlink" title="Spring Boot不是什么"></a>Spring Boot不是什么</h3><p>过去一两年的时间里有不少和它相关的言论。原先听到或看到的东西可能给你造成了一些误解,所以首先我们要澄清一下这些误解。</p>
<p>首先,Spring Boot不是应用服务器。这个误解是这样产生的:Spring Boot可以吧Web应用程序变为可执行的JAR文件,不用部署到传统Java应用服务器里就能在命令行里面执行。Spring Boot在应用程序里面内嵌了一个Servlet容器(Tomcat,Jetty或者Undertow),以此来实现这个功能。但这是内嵌的Servlet容器提供的功能,部署Spring Boot实现的。</p>
<p>与此类似,Spring Boot也没有实现诸如JPA或者JMS之类的企业级Java规范。它的确支持了不少企业级Java规范,但是要在Spring里自动配置支持那些特性的Bean。例如,Spring Boot没有实现JPA,但是它的自动配置了某个JPA实现,(比如Hibernate Bean),以此实现JPA。</p>
<p>最后Spring Boot没有引入任何形式的代码生成,而是利用了Spring 4的条件化配置特性,以及Maven和Gradle提供的传递依赖解析,以此实现Srping应用程序上下文的自动配置。</p>
<h3 id="String-Boot是什么"><a href="#String-Boot是什么" class="headerlink" title="String Boot是什么"></a>String Boot是什么</h3><p>简而言之,本质上来说Spring Boot就是Spring,它走了那些没有它你自己也会去做的Spring Bean配置。它帮你提供了一种更简单的方式来配置Spring Bean,以此来搭建Spring环境。</p>
<h3 id="String-Boot是怎么工作的"><a href="#String-Boot是怎么工作的" class="headerlink" title="String Boot是怎么工作的"></a>String Boot是怎么工作的</h3><p>这里引用一个网上看到的图,详细讲述了Spring Boot是如何工作的</p>
<p><img src="https://i.loli.net/2018/06/16/5b24917295d35.png" alt="how-spring-boot-autoconfigure-works.png"></p>
<h3 id="我对Spring-Boot的理解"><a href="#我对Spring-Boot的理解" class="headerlink" title="我对Spring Boot的理解"></a>我对Spring Boot的理解</h3><p>Spring Boot作为一个微框架,感觉就是顺应当前微服务流行下的产物。是一个微服务框架的起点,为创建REST服务提供了简便的途径。</p>
<h2 id="引用和参考"><a href="#引用和参考" class="headerlink" title="引用和参考"></a>引用和参考</h2><p><strong>书籍:</strong></p>
<p>Spring Boot in Action</p>
<p><strong>博客:</strong></p>
<p><a href="https://afoo.me/posts/2015-07-09-how-spring-boot-works.html" target="_blank" rel="external">https://afoo.me/posts/2015-07-09-how-spring-boot-works.html</a></p>
]]></content>
<summary type="html">
<h2 id="Spring-Boot简介"><a href="#Spring-Boot简介" class="headerlink" title="Spring Boot简介"></a>Spring Boot简介</h2><h3 id="Spring-Boot不是什么"><a h
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="Spring" scheme="http://vurtnec.github.io/tags/Spring/"/>
<category term="Spring Boot" scheme="http://vurtnec.github.io/tags/Spring-Boot/"/>
</entry>
<entry>
<title>Index Improvement</title>
<link href="http://vurtnec.github.io/2017/12/21/Index-Improvment/"/>
<id>http://vurtnec.github.io/2017/12/21/Index-Improvment/</id>
<published>2017-12-20T16:00:00.000Z</published>
<updated>2018-06-21T12:44:04.789Z</updated>
<content type="html"><![CDATA[<h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><p>Todays topic is about index improvment, so first we need to know some backgrounds.</p>
<h2 id="Background"><a href="#Background" class="headerlink" title="Background"></a>Background</h2><h3 id="Index"><a href="#Index" class="headerlink" title="Index"></a>Index</h3><p>We have more than 100,000 products in production, before the full index will take almost 2 hours, so client only build index once in each day. The issue is if business change some data before do a idnex, it will cause PLP data is not match with PDP.</p>
<p>So business want to reduce the index time, and they want to build index for each 2 hours.</p>
<h3 id="Request"><a href="#Request" class="headerlink" title="Request"></a>Request</h3><p>At the same time, some of categories products have many child SKUs, like clothes, shoes categories. We only have 3 kind of properties need to display on PLP:</p>
<ol>
<li>Some product properties, like display name, brand.</li>
<li>Some of properties on the product’s default SKU, like: default image.</li>
<li>Other properties: al of the SKU colors on product, and all of the SKU price range.</li>
</ol>
<p>Means if a customer visit above categories, it will return so many useless SKUs with useless properties. </p>
<p><strong>See a example: jsp_ref.</strong></p>
<p>So business want to reduce response for those category request to improve performance.</p>
<p>There is one thing you guys need to know:</p>
<p>You guys should know our site only return results as product level, means each item is a product. But in our index, the each record is SKU level.</p>
<p><strong>See a example: jsp_ref.</strong></p>
<p>So how to implement this by Endeca:</p>
<p>Endeca OOTB need define a aggregate property, in Falabella, we are using product.repositoryId as aggregate property, </p>
<p>each record has a product.repositoryId property, Endeca will use this property to merge SKU as product group by this property.</p>
<p><strong>See a example: jsp_ref.</strong></p>
<h2 id="Process"><a href="#Process" class="headerlink" title="Process"></a>Process</h2><p>Next we need to know the process about index and request before do index improvement and after index improvement.</p>
<h3 id="Full-index"><a href="#Full-index" class="headerlink" title="Full index"></a>Full index</h3><h4 id="Before"><a href="#Before" class="headerlink" title="Before"></a>Before</h4><ol>
<li>Get all products by a RQL, <strong>see Component</strong>.</li>
<li>Filter invalid products, <strong>see Component</strong>.</li>
<li>Build each record and each property base on the XML file, and write record to CAS(CAS is a mid-database for index input). <strong>see XML file, accessor and CAS.</strong></li>
<li>Get data from CAS to build index.</li>
</ol>
<h4 id="After"><a href="#After" class="headerlink" title="After"></a>After</h4><ol>
<li>Execute a procedure to calculate all valid product in a table, <strong>see Procedure</strong>.</li>
<li>Get all valid products form the table, <strong>see Component</strong>.</li>
<li>Build each record and each property base on the XML file, and write record to CAS(CAS is a mid-database for index input). <strong>see XML file, accessor and CAS.</strong></li>
<li>Get data from CAS to build index.</li>
</ol>
<h4 id="Advantage"><a href="#Advantage" class="headerlink" title="Advantage"></a>Advantage</h4><p>Most of time spent in step 2 and 3. in step 2, the Procedure time must less than Java code. In step 3, we removed some many useless properties to reduce inde time.</p>
<h4 id="Disadvantage"><a href="#Disadvantage" class="headerlink" title="Disadvantage"></a>Disadvantage</h4><p>Procedure is mote difficute than Java code, so the maintenance costs will increase.</p>
<h3 id="Partial-index"><a href="#Partial-index" class="headerlink" title="Partial index"></a>Partial index</h3><h4 id="Before-1"><a href="#Before-1" class="headerlink" title="Before"></a>Before</h4><ol>
<li>Change a property by business.</li>
<li>Descriptor listener will write a data to a OOTB table at SKU level, <strong>see Descriptor and listener</strong>.</li>
<li>Get all SKUs from above table.</li>
<li>Build each record andeach property base on the MXL file and write record to CAS.</li>
<li>Get changed data from CAS to do partial index.</li>
</ol>
<h4 id="After-1"><a href="#After-1" class="headerlink" title="After"></a>After</h4><ol>
<li>Change a property by business.</li>
<li>Descriptor listener will write a data to a new table at product level, <strong>see Descriptor and listener</strong>.</li>
<li>Do a partial procedure to get data from above table and get all SKUs of the product to write the OOTB table.</li>
<li>Build each record andeach property base on the MXL file and write record to CAS.</li>
<li>Get changed data from CAS to do partial index.</li>
</ol>
<p>We can find that there is no performance improvement here, the only change is we add a new table and use it as a mid-table to write data to OOTB table, the reason I will explain after.</p>
<h3 id="Request-1"><a href="#Request-1" class="headerlink" title="Request"></a>Request</h3><h4 id="Before-2"><a href="#Before-2" class="headerlink" title="Before"></a>Before</h4><ol>
<li>Send a Endeca request with a parameter as “ALL”, <strong>see the parameter</strong>.</li>
<li>Aggregate record by product.repositoryId, and return all SKUs under the product.</li>
<li>We can get all product properties and all of the SKUs properties, <strong>see Record Object</strong>.</li>
<li>Display on site.</li>
</ol>
<h4 id="After-2"><a href="#After-2" class="headerlink" title="After"></a>After</h4><ol>
<li>Add a aggregate property when build index on product, <strong>see structure and code</strong>.</li>
<li>Send a Endeca request with a parameter as “ONE”, <strong>see the parameter</strong>.</li>
<li>Aggregate record by product.repositoryId, and return all SKUs under the product.</li>
<li>We can get all properties what we need, <strong>see Record Object</strong>.</li>
<li>Display on site.</li>
</ol>
<h4 id="Advantage-1"><a href="#Advantage-1" class="headerlink" title="Advantage"></a>Advantage</h4><p>Reduce response, because we need return properties what we need.</p>
<h4 id="Disadvantage-1"><a href="#Disadvantage-1" class="headerlink" title="Disadvantage"></a>Disadvantage</h4><p>We need to change partial index logic, because each record is SKU level has a property product.aggregateData, the aggregateData property has all of the SKUs prices and colors.</p>
<p>Like if business change a SKU A price under product A, we need do partial index for all of the SKUs under product A, this is the reason why we do partial index change in above.</p>
<h2 id="Design"><a href="#Design" class="headerlink" title="Design"></a>Design</h2><h3 id="Full-index-1"><a href="#Full-index-1" class="headerlink" title="Full index"></a>Full index</h3><h4 id="Table"><a href="#Table" class="headerlink" title="Table"></a>Table</h4><p>fbl_srch_sku_published</p>
<h4 id="Repository"><a href="#Repository" class="headerlink" title="Repository"></a>Repository</h4><p>Add a new descriptor searchSKUPublished in FalabellaRepository.<br>Add a new property “publishedChildSkus” on product, no need use this property, use “filteredChildSkus” to get all valid SKUs.</p>
<h4 id="Procedure"><a href="#Procedure" class="headerlink" title="Procedure"></a>Procedure</h4><p>PROC_CALC_PUBLISHED_SKU</p>
<h4 id="Component"><a href="#Component" class="headerlink" title="Component"></a>Component</h4><p>CalculatePublishedSku</p>
<p>IndexedItemsGroup</p>
<p>SkuPublishManager</p>
<p>ProductCatalogSimpleIndexingAdmin</p>
<h3 id="Partial-index-1"><a href="#Partial-index-1" class="headerlink" title="Partial index"></a>Partial index</h3><h4 id="Table-1"><a href="#Table-1" class="headerlink" title="Table"></a>Table</h4><p>fbl_srch_update_queue</p>
<h4 id="Repository-1"><a href="#Repository-1" class="headerlink" title="Repository"></a>Repository</h4><p>Add a new descriptor searchSKUQueue in IncrementalItemQueueRepository.</p>
<h4 id="Procedure-1"><a href="#Procedure-1" class="headerlink" title="Procedure"></a>Procedure</h4><p>PROC_CALC_PARTIAL_SKU</p>
<h4 id="Component-1"><a href="#Component-1" class="headerlink" title="Component"></a>Component</h4><p>CalculateParitalSku</p>
<p>ProductCatalogSimpleIndexingAdmin</p>
<h3 id="Request-2"><a href="#Request-2" class="headerlink" title="Request"></a>Request</h3><h4 id="Component-2"><a href="#Component-2" class="headerlink" title="Component"></a>Component</h4><p>SkuAggregatedDataAccessor</p>
<p>FBLPriceListMapPropertyAccessor</p>
<p>ProductColorSKUsAccessor</p>
]]></content>
<summary type="html">
<h2 id="Overview"><a href="#Overview" class="headerlink" title="Overview"></a>Overview</h2><p>Todays topic is about index improvment, so fir
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Endeca" scheme="http://vurtnec.github.io/tags/Endeca/"/>
<category term="搜索引擎" scheme="http://vurtnec.github.io/tags/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/"/>
</entry>
<entry>
<title>Sublime中配置Markdown</title>
<link href="http://vurtnec.github.io/2017/11/07/Markdown-Sublime/"/>
<id>http://vurtnec.github.io/2017/11/07/Markdown-Sublime/</id>
<published>2017-11-06T16:00:00.000Z</published>
<updated>2018-06-21T12:48:36.273Z</updated>
<content type="html"><![CDATA[<h2 id="编辑插件"><a href="#编辑插件" class="headerlink" title="编辑插件"></a>编辑插件</h2><p>安装Markdown Editing,然后在视图->语法里选择MarkdownEditing启用,支持三种风格,分别是Standard Markdown, GitHub flavored Markdown, MultiMarkdown.</p>
<h2 id="预览插件"><a href="#预览插件" class="headerlink" title="预览插件"></a>预览插件</h2><p>MarkdownLivePreview<br>MarkdownLivePreview可以实现实时预览,在首选项->Package Setting里修改MarkdownLivePreview的user配置文件,设置在打开时同步预览</p>
<h3 id="使用"><a href="#使用" class="headerlink" title="使用"></a>使用</h3><p>打开一个新的md文件,按下alt+m</p>
]]></content>
<summary type="html">
<h2 id="编辑插件"><a href="#编辑插件" class="headerlink" title="编辑插件"></a>编辑插件</h2><p>安装Markdown Editing,然后在视图-&gt;语法里选择MarkdownEditing启用,支持三种风格,分别是
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="IDE" scheme="http://vurtnec.github.io/tags/IDE/"/>
<category term="Tips" scheme="http://vurtnec.github.io/tags/Tips/"/>
</entry>
<entry>
<title>我对Java的理解</title>
<link href="http://vurtnec.github.io/2017/03/08/Java-Understanding/"/>
<id>http://vurtnec.github.io/2017/03/08/Java-Understanding/</id>
<published>2017-03-07T16:00:00.000Z</published>
<updated>2018-06-27T15:24:47.000Z</updated>
<content type="html"><![CDATA[<h3 id="Java平台"><a href="#Java平台" class="headerlink" title="Java平台"></a>Java平台</h3><p>Java不仅仅只是一门编程语言,还是一个由一系列计算机软件和规范形成的技术体系。</p>
<ul>
<li>Java程序设计语言:基本语言特性,语法糖,面向对象,反射,泛型。。。</li>
<li>Java生态:各种框架,Spring,hadoop。。。</li>
<li>Java基础类库,API<ul>
<li>核心类库:IO/NIO,网络,utils。。。</li>
<li>安全类库</li>
<li>jdk.management等类库</li>
<li>第三方类库</li>
</ul>
</li>
<li>Java虚拟机<ul>
<li>垃圾收集器</li>
<li>运行时</li>
<li>动态编译</li>
<li>辅助功能,JFR等</li>
</ul>
</li>
<li>工具包<ul>
<li>辅助工具:如Jlink,jar,jdeps</li>
<li>编译器:javac,sjavac</li>
<li>诊断工具:jmap,jstack,jconsole,jcmd</li>
</ul>
</li>
</ul>
<p><img src="https://i.loli.net/2018/06/27/5b3398b5be351.png" alt="20bc6a900fc0b829c2f0e723df050732.png"></p>
<h3 id="JDK-amp-JRE"><a href="#JDK-amp-JRE" class="headerlink" title="JDK & JRE"></a>JDK & JRE</h3><p>JDK是Java开发工具包,JRE是Java运行环境,它包含虚拟机,但不包含编译器。<br><img src="https://i.loli.net/2018/06/27/5b33a20c031f9.jpg" alt="1530110442146.jpg"></p>
<h3 id="Java编译"><a href="#Java编译" class="headerlink" title="Java编译"></a>Java编译</h3><ol>
<li>首先是使用Java的编译工具,比如javac将源码编译成虚拟机可以认识的字节码。</li>
<li><strong>字节码会给不同的虚拟机(Windows,Mac上的虚拟机)在运行时,通过类加载器加载字节码,解释或编译成对应的机器码执行。</strong>这里就两点要注意的:<ol>
<li>第一是可以给虚拟机设置参数,是使用解释还是编译的方式。编译会导致启动较慢,而解释会导致执行稍慢。可以针对不同场景进行调整。</li>
<li>这里还有个一个<strong>动态编译器(JIT)</strong>,会在运行时将热点代码(以方法为单位,那些会反复执行或者循环的代码)编译成机器码,这部分代码也是编译执行的。</li>
</ol>
</li>
</ol>
<h3 id="参考和引用"><a href="#参考和引用" class="headerlink" title="参考和引用"></a>参考和引用</h3><p><strong>极客时间</strong>:Java核心36讲</p>
<p><strong>书籍</strong>:深入理解Java虚拟机</p>
]]></content>
<summary type="html">
<h3 id="Java平台"><a href="#Java平台" class="headerlink" title="Java平台"></a>Java平台</h3><p>Java不仅仅只是一门编程语言,还是一个由一系列计算机软件和规范形成的技术体系。</p>
<ul>
<li>
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="Java" scheme="http://vurtnec.github.io/tags/Java/"/>
</entry>
<entry>
<title>V8垃圾回收机制</title>
<link href="http://vurtnec.github.io/2017/03/07/V8-Memory-Model/"/>
<id>http://vurtnec.github.io/2017/03/07/V8-Memory-Model/</id>
<published>2017-03-06T16:00:00.000Z</published>
<updated>2018-06-23T14:43:05.000Z</updated>
<content type="html"><![CDATA[<h3 id="V8的内存模型"><a href="#V8的内存模型" class="headerlink" title="V8的内存模型"></a>V8的内存模型</h3><p>要搞清楚V8的垃圾回收,先要搞清楚V8的内存模型是什么样的。</p>
<h4 id="V8的内存限制"><a href="#V8的内存限制" class="headerlink" title="V8的内存限制"></a>V8的内存限制</h4><p>一般开发语言中,基本内存使用上没有什么限制,<strong>然而在Node中却只能使用部分内存(64位系统下约为1.4G,32位0.7G),所以一般情况Node不能操作大内存。</strong>这其实是V8的限制,这个限制在浏览器中绰绰有余,但是Node作为后端开发使用,就显得有点不够了。</p>
<p><strong>V8做这个限制的根本原因在于V8的垃圾回收机制限制。</strong>按官方说法,以1.5G的垃圾回收堆内存为例,V8做一次增量垃圾回收需要50毫秒以上,做一次全量垃圾回收甚至需要1秒以上。这些垃圾回收会引起JavaScript线程暂停执行,应用的性能和响应能力都会直线下降,所以直接限制堆内存在浏览器使用是一个好的选择。不过这个限制也不是不能打开,V8依然提供了选项让我们使用更多的内存,可以通过Node启动时传递参数来修改最大内存空间。</p>
<h4 id="V8的对象分配"><a href="#V8的对象分配" class="headerlink" title="V8的对象分配"></a>V8的对象分配</h4><p>当我们在代码中声名变量并赋值的时候,所使用对象的内存就分配在堆中。如果已申请的堆空闲内存不够分配新的对象,将继续申请堆内存,知道堆的大小超过V8的限制为止。</p>
<h4 id="V8的内存分代"><a href="#V8的内存分代" class="headerlink" title="V8的内存分代"></a>V8的内存分代</h4><p>在V8中,<strong>主要将内存分为新生代(64位64MB,32位32MB)和老生代(64位1400MB,32位700MB)两代。新生代中的对象生命周期比较短,老生代的生命周期比较长或者是全部对象常驻内存中。</strong>V8堆的大小就是就是新生代内存加老生代内存之和。</p>
<h3 id="V8的垃圾回收机制"><a href="#V8的垃圾回收机制" class="headerlink" title="V8的垃圾回收机制"></a>V8的垃圾回收机制</h3><p>实际情况中没有一种算法能够胜任所有场景,所以有了V8的内存分代。<strong>不同生命周期的对象采用不同算法来来进行垃圾回收才能得到最好的效果。</strong></p>
<h4 id="V8主要垃圾回收算法"><a href="#V8主要垃圾回收算法" class="headerlink" title="V8主要垃圾回收算法"></a>V8主要垃圾回收算法</h4><h4 id="Scavenge算法"><a href="#Scavenge算法" class="headerlink" title="Scavenge算法"></a>Scavenge算法</h4><p>新生代内存中的对象主要通过Scavenge算法进行垃圾回收。</p>
<p>新生代使用Scavenge算法进行回收。在Scavenge算法的实现中,主要采用了Cheney算法。</p>
<p>Cheney算法算法是一种采用复制的方式实现的垃圾回收算法。它将新生代内存一分为二,每一部分空间称为semispace。在这两个semispace中,一个处于使用状态,另一个处于闲置状态。处于使用状态的semispace空间称为From空间,处于闲置状态的空间称为To空间,当我们分配对象时,先是分配在From空间中。<strong>当开始进行垃圾回收算法时,会检查From空间中的存活对象,这些存活对象将会被复制到To空间中,而非活跃对象占用的空间将会被释放,完成复制后,From空间和To空间的角色发生对换。</strong>使用Cheney算法时,总有一半的内存是空的。但是由于新生代很小,所以浪费的内存空间并不大。由于新生代中的对象绝大部分生命周期很短,是非活跃对象,需要复制的活跃对象比例很小,所以其时间效率十分理想。复制的过程采用的是BFS(广度优先遍历)的思想,从根对象出发,广度优先遍历所有能到达的对象。</p>
<p>但是在每一次复制之前,将会先做以下检查:</p>
<div id="flowchart-0" class="flow-chart"></div>
<div id="flowchart-1" class="flow-chart"></div>
<p>25%是因为复制完成后,To空间将会变成From空间,所以需要给From空间预留足够的内存在分配新对象。</p>
<h4 id="Mark-Sweep-amp-Mark-Compact"><a href="#Mark-Sweep-amp-Mark-Compact" class="headerlink" title="Mark-Sweep & Mark-Compact"></a>Mark-Sweep & Mark-Compact</h4><p><strong>Mark-Sweep</strong>是标记清除的意思,分为标记和清除两个阶段。在标记阶段遍历所有对象,并标记活着的对象。清除阶段只清除没有被标记的对象。</p>
<p><strong>Mark-Compact</strong>是标记整理的意思,Mark-Sweep清除对象后会存在一个问题,内存空间出现不连续的情况。所以Mark-Compact的作用就是在标记阶段完了之后将被标记的对象全部移动到内存空间的一侧,清除阶段只需清理另一侧没有标记的对象。Mark-Compact由于移动对象效率不够高的原因,导致只有在空间不足以对从新生代晋级过来的对象进行分配时才使用Mark-Compact。 </p>
<p><script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.0/raphael-min.js"></script><script src="http://flowchart.js.org/flowchart-latest.js"></script><textarea id="flowchart-0-code" style="display: none">op1=>operation: From空间
op2=>operation: 老生代空间
op3=>operation: To空间
cond1=>condition: 是否经历过Scavenge回收
op1->cond1
cond1(yes)->op2
cond1(no)->op3</textarea><textarea id="flowchart-0-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("flowchart-0-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("flowchart-0-options").value)); var diagram = flowchart.parse(code); diagram.drawSVG("flowchart-0", options);</script><textarea id="flowchart-1-code" style="display: none">op1=>operation: From空间
op2=>operation: 老生代空间
op3=>operation: To空间
cond1=>condition: To空间是否已使用25%
op1->cond1
cond1(yes)->op2
cond1(no)->op3</textarea><textarea id="flowchart-1-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("flowchart-1-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("flowchart-1-options").value)); var diagram = flowchart.parse(code); diagram.drawSVG("flowchart-1", options);</script></p>
]]></content>
<summary type="html">
<h3 id="V8的内存模型"><a href="#V8的内存模型" class="headerlink" title="V8的内存模型"></a>V8的内存模型</h3><p>要搞清楚V8的垃圾回收,先要搞清楚V8的内存模型是什么样的。</p>
<h4 id="V8的内存限制
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
<category term="NodeJs" scheme="http://vurtnec.github.io/tags/NodeJs/"/>
<category term="JavaScript" scheme="http://vurtnec.github.io/tags/JavaScript/"/>
</entry>
<entry>
<title>Https小结</title>
<link href="http://vurtnec.github.io/2016/12/24/Https-introduce/"/>
<id>http://vurtnec.github.io/2016/12/24/Https-introduce/</id>
<published>2016-12-23T16:00:00.000Z</published>
<updated>2018-06-21T12:51:12.627Z</updated>
<content type="html"><![CDATA[<p>最近由于复习了下Http相关的知识,所以写了一些关于Http的文章,算是自己的读书笔记。上次写的是Http方法定义的文章,这次聊聊Https。</p>
<h4 id="Https简介"><a href="#Https简介" class="headerlink" title="Https简介"></a>Https简介</h4><p>Https全称Http Secure,它并非是一种新协议。只是Http通信接口部分用SSL和TSL协议代替。简言之,Https就是身披SSL协议外壳的Http。</p>
<p><a href="https://i.loli.net/2018/06/11/5b1e15cfd332f.png" target="_blank" rel="external"><img src="https://i.loli.net/2018/06/11/5b1e15cfd332f.png" alt="Http&Https.png"></a></p>
<p><strong>TLS/SSL</strong></p>
<p>TLS/SSL是一个公钥/私钥的结构,它是一个非对称的结构,每个服务器端和客户端都有自己的公私钥。公钥用来加密数据,而私钥用来解密收到的数据。公钥和私钥是配对的,(其实可以理解成是一把锁和对应的钥钥),所以在建立安全传输之前,客户端和服务器端会互换公钥(锁头),客户端发送的数据要通过服务器公钥加密,服务器端发送数据时则需要客户端公钥加密。</p>
<p><a href="https://i.loli.net/2018/06/11/5b1e15cfd4f0f.png" target="_blank" rel="external"><img src="https://i.loli.net/2018/06/11/5b1e15cfd4f0f.png" alt="TSL&SSL.png"></a></p>
<p>这里还引入了一个第三方:CA(Certificate Authority,数字证书认证中心)。客户端在发起安全连接前会去获取服务器端的证书,并通过CA的帧数验证服务器端证书的真伪。除了验证真伪外,通常还含有对服务器名称,IP地址等进行验证的过程。<br>简单点说就是在公钥互换的时候,客户端需要验证服务器给过来的公钥是否真的是我们想要的服务器发过来的,而不是其他中间人伪造的。</p>
<p><a href="https://i.loli.net/2018/06/11/5b1e15d008093.png" target="_blank" rel="external"><img src="https://i.loli.net/2018/06/11/5b1e15d008093.png" alt="CA.png"></a></p>
<h4 id="Https的安全通信机制"><a href="#Https的安全通信机制" class="headerlink" title="Https的安全通信机制"></a>Https的安全通信机制</h4><p>为了更好的理解Https,来看下Https的通信步骤。</p>
<div id="sequence-0"></div>
<ol>
<li>客户端发送Client Hello开始通信。</li>
<li>服务器以Server Hello作为应答。</li>
<li>之后服务器发送Certificate报文,包含公钥证书(此步将发送服务器端公钥给客户端)。</li>
<li>服务器再次发送Server Hello Done通知客户端。</li>
<li>客户端以Client Key Exchange作为回应(此步将验证服务器证书,并发送客户端公钥给服务器)。</li>
<li>接着客户端继续发送Change Cipher Spec,提示服务器,之后会用之前发送的客户端公钥进行加密通信。</li>
<li>客户端发送finished告知服务器。</li>
<li>服务器同样发送Change Cipher Spec提示客户端。</li>
<li>服务器发送finished给客户端。</li>
<li>SSL连接建立完成,之后开始发送加密后的数据通过Http通信。</li>
<li>服务器加密数据响应客户端。</li>
<li>客户端断开连接,发送close_notify,这步之后再发送TCP FIN来关闭与TCP的连接。</li>
</ol>
<h4 id="两种Https攻击方式"><a href="#两种Https攻击方式" class="headerlink" title="两种Https攻击方式"></a>两种Https攻击方式</h4><p>简单介绍完Https,在说说现在Https下常见的两种攻击方式:</p>
<p><strong>中间人攻击</strong></p>
<p>客户端和服务器端在交换公钥的过程中,中间人对客户端扮演服务器的角色,对服务器扮演客户端的角色。因为客户端和服务器双方都感觉不到中间人的存在。</p>
<div id="sequence-1"></div>
<p><strong>SSLstrip</strong></p>
<p><strong>原理</strong></p>
<p>SSLstrip使用了社会工程学的原理:许多人为了图方便省事,在输入网址时一般不考虑传输协议,习惯上只是简单输入主机名,浏览器默认在这种情况下会使用HTTP协议。例如用户为了使用Gmail邮箱,直接输入accounts.google.com,浏览器会给谷歌服务器发送一个HTTP 请求,谷歌服务器认为电子邮件属于应加密的重要事务,使用HTTP不恰当,应改为使用HTTPS,于是它返回一个状态码为302的HTTP 响应,给出一个重定向网址<a href="https://accounts.google.com/ServiceLogin,浏览器再使用这个重定向网址发出HTTPS" target="_blank" rel="external">https://accounts.google.com/ServiceLogin,浏览器再使用这个重定向网址发出HTTPS</a> 请求。一个原本应该从头到尾使用HTTPS加密会话的过程中混入了使用明文传输的HTTP会话,一旦HTTP会话被劫持,HTTPS会话就可能受到威胁。</p>
<div id="sequence-2"></div>
<h4 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h4><ol>
<li>书籍:图解Http,第七章</li>
<li>书籍:深入浅出Nodejs,第七章</li>
<li>博客:<a href="http://blog.csdn.net/howeverpf/article/details/19366215" target="_blank" rel="external"> 分析两种实现SSL会话劫持的典型技术</a><script src="https://bramp.github.io/js-sequence-diagrams/js/webfont.js"></script><script src="https://bramp.github.io/js-sequence-diagrams/js/snap.svg-min.js"></script><script src="https://bramp.github.io/js-sequence-diagrams/js/underscore-min.js"></script><script src="https://bramp.github.io/js-sequence-diagrams/js/sequence-diagram-min.js"></script><textarea id="sequence-0-code" style="display: none">客户端-->服务器端: 1. Handshake:Client Hello
服务器端->客户端: 2. Handshake:Server Hello
服务器端->客户端: 3. Handshake:Certificate
服务器端-->客户端: 4. Handshake:Server Hello Done
客户端->服务器端: 5. Handshake:Client Key Exchange
客户端->服务器端: 6. Change Cipher Spec
客户端-->服务器端: 7. Handshake:Finished
服务器端->客户端: 8. Change Cipher Spec
服务器端-->客户端: 9. Handshake:Finished
客户端->服务器端: 10. Transfer Application data(HTTP)
服务器端->客户端: 11. Transfer Application data(HTTP)
客户端-->服务器端: 12. Alert: warning, close notify</textarea><textarea id="sequence-0-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("sequence-0-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-0-options").value)); var diagram = Diagram.parse(code); diagram.drawSVG("sequence-0", options);</script><textarea id="sequence-1-code" style="display: none">客户端->中间人: 发起连接
中间人->服务器: 发起连接
服务器->中间人: 响应连接(服务器公钥)
中间人->客户端: 响应连接(伪造的服务器公钥)
note left of 客户端: 验证证书(部分验证失\n败,浏览器弹出警告)
客户端->中间人: 建立连接并发送数据
中间人->服务器: 转发数据
服务器->中间人: 响应数据
中间人->客户端: 转发数据</textarea><textarea id="sequence-1-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("sequence-1-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-1-options").value)); var diagram = Diagram.parse(code); diagram.drawSVG("sequence-1", options);</script><textarea id="sequence-2-code" style="display: none">客户端->SSLstrip: 请求http://www.***.com
SSLstrip->服务器: 请求http://www.***.com
服务器->SSLstrip: 响应302,location=https://www.***.com
SSLstrip->客户端: 响应302,location=http://www.SSLstrip.com:8181
客户端->SSLstrip: 建立http连接,并发送数据
SSLstrip->服务器: 与服务器建立https连接,并转发数据
服务器->SSLstrip: 响应数据
SSLstrip->客户端: 转发数据</textarea><textarea id="sequence-2-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script> var code = document.getElementById("sequence-2-code").value; var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-2-options").value)); var diagram = Diagram.parse(code); diagram.drawSVG("sequence-2", options);</script></li>
</ol>
]]></content>
<summary type="html">
<p>最近由于复习了下Http相关的知识,所以写了一些关于Http的文章,算是自己的读书笔记。上次写的是Http方法定义的文章,这次聊聊Https。</p>
<h4 id="Https简介"><a href="#Https简介" class="headerlink" title=
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="http" scheme="http://vurtnec.github.io/tags/http/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
</entry>
<entry>
<title>HTTP-方法定义</title>
<link href="http://vurtnec.github.io/2016/12/15/Http-method-definitions/"/>
<id>http://vurtnec.github.io/2016/12/15/Http-method-definitions/</id>
<published>2016-12-14T16:00:00.000Z</published>
<updated>2018-06-21T12:51:16.346Z</updated>
<content type="html"><![CDATA[<p>上周用一个下午的时候读了图解Http这本书,本来是想好好帮自己回忆并整理Http相关的知识,奈何读完才发现这本书其实更适合初学者阅读,里面大量Http协议讲解也只是点到为止。<br>不过总的来说还是想从一个Web开发人员的角度写点经常会用又有很人开发人员说不清楚的东西。</p>
<p>这篇先聊聊Http Request的方法定义,到底GET,POST,PUT,DELETE之间有什么区别,都分别代表什么意思。详细文档参阅了Http RFC原文,有兴趣的也可以阅读下原文:<a href="https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9" target="_blank" rel="external">HTTP RFC, Method Definitions</a>.</p>
<p>先说两个概念,<strong>安全方法</strong>和<strong>幂等方法</strong>。</p>
<h4 id="安全方法"><a href="#安全方法" class="headerlink" title="安全方法"></a><strong>安全方法</strong></h4><p>先说两个概念,方法不应具有采取除检索之外的动作的意义。这些方法应该被认为是“安全的”。就是说一个方法应该只能从服务器获取内容,且不会对服务器产生其他任何影响。<br>同时有一点很重要,我们无法保证服务器不会因为这个请求产生副作用(比如一个浏览用户访问了一个人的博客,只是查看了博文,但是服务器会使这篇博客的访问数加一),所以定义一个方法是否安全在于用户是否有请求副作用,用户不用对这个请求产生任何责任。</p>
<h4 id="幂等方法"><a href="#幂等方法" class="headerlink" title="幂等方法"></a><strong>幂等方法</strong></h4><p>幂等是数学里面的一个概念,具体可参见<a href="http://baike.baidu.com/link?url=0bAavXkdOTjl7azRk4X6iHdhDoY2sV3OWrT8tFXM8D2usJSZKqj_AynB81Uu7p2ZfVpYXLF5yrTNoF74uAtgi-e1XenogYR3dof2RfFw3me" target="_blank" rel="external">百度百科</a>,这里指的是一个请求如果访问N次产生的副作用和访问一次的副作用相同,我们可以认为是幂等的。</p>
<p>所以我们可以认为安全方法一定是幂等的,但是幂等不一定是安全的。</p>
<hr>
<h5 id="什么是HTTP-Entity?"><a href="#什么是HTTP-Entity?" class="headerlink" title="什么是HTTP Entity?"></a><strong>什么是HTTP Entity?</strong></h5><p>我们知道一个Http请求包含了报文首部和主体部分,中间以空行隔开。而通常报文主体等于实体主体,只有当传输中进行编码操作时,实体主体的内容发生变化,才导致它和报文主体产生差异。<br><a href="https://i.loli.net/2018/06/11/5b1e152fc64b3.png" target="_blank" rel="external"><img src="https://i.loli.net/2018/06/11/5b1e152fc64b3.png" alt="Http header.png"></a></p>
<h5 id="GET-Method"><a href="#GET-Method" class="headerlink" title="GET Method"></a><strong>GET Method</strong></h5><p>GET属于安全方法,代表从指定的URI以实体(Entity)形式获取信息。也就是说,如果请求的资源说文本,则保持原样返回,如果说一段程序,则返回执行后的输出结果,而不是返回源程序。</p>
<h5 id="POST-Method"><a href="#POST-Method" class="headerlink" title="POST Method"></a><strong>POST Method</strong></h5><p>POST方法允许请求中包含实体作为从属的Request-URI发送给服务器。简而言之就是一个POST的请求包含了报文首部和实体主体传送给服务器,而且POST既不是安全,也不是幂等的方法。</p>
<h5 id="PUT-Method"><a href="#PUT-Method" class="headerlink" title="PUT Method"></a><strong>PUT Method</strong></h5><p>PUt方法则用于将请求中包含的实体储存在Request-URI下。它和POST的根本区别在于:</p>
<ol>
<li>PUT方法是幂等的,而POST不是。</li>
<li>PUT方法该URI不得不处理该实体,如果服务器期望交由其他URI处理,则必须返回30X告知用户,由用户来判断是否跳转。而POST可以由服务器决定是否交给其他网关处理,并最终返回Response。<h5 id="DELETE-Method"><a href="#DELETE-Method" class="headerlink" title="DELETE Method"></a><strong>DELETE Method</strong></h5>DELETE方法与PUT刚好相反,用于删除由Request-URI标识的资源。同样DELETE是幂等的。</li>
</ol>
<p>由于HTTP/1.1的PUT和DELETE方自身不带验证机制,任何人都可以删除和创建资源,存在安全问题,因此一般网站都不使用该方法。但是如果配合Web应用自身的验证机制,或采用REST标准的架构,就可能开放这两个方法。(说实话,为此我还专门看了下我们网站所使用的REST API,居然专门移除了对PUT和DELETE方法的支持,有点不大明白为什么)</p>
<p>关于Http方法定义就说这么多了,接下来会写写HTTPS。</p>
]]></content>
<summary type="html">
<p>上周用一个下午的时候读了图解Http这本书,本来是想好好帮自己回忆并整理Http相关的知识,奈何读完才发现这本书其实更适合初学者阅读,里面大量Http协议讲解也只是点到为止。<br>不过总的来说还是想从一个Web开发人员的角度写点经常会用又有很人开发人员说不清楚的东西。</
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
<category term="http" scheme="http://vurtnec.github.io/tags/http/"/>
<category term="Favorites" scheme="http://vurtnec.github.io/tags/Favorites/"/>
</entry>
<entry>
<title>读后感:淘宝技术这十年</title>
<link href="http://vurtnec.github.io/2016/11/30/Taobao-tech/"/>
<id>http://vurtnec.github.io/2016/11/30/Taobao-tech/</id>
<published>2016-11-29T16:00:00.000Z</published>
<updated>2018-10-21T14:01:49.240Z</updated>
<content type="html"><![CDATA[<p>这是一本好玩的书,从前面两章看,主要是讲故事;从后面两章看,主要是讲人物;从中间几章看,主要是讲技术。我在写作的过程中,把部分章节贴到了博客上,有人看了说励志,有人看了说对技术有帮助,有人看了说对产品有帮助,有人看了说对创业有帮助,有人看了说里面的段子特别逗,现在我也不知道这是人文读物还是技术书了。</p>
<p>正如序章所说,这根本就不是算是一本技术书记, 技术书很容易写成催眠的读物,这本书一开始作者就没有当做技术书来写。所以读者也大可抱着看一本淘宝历史的心态来阅读此书。</p>
<p>里面有一句话说的让我特别有感触,淘宝从最开始的主动改版,创新,到最后需求,规模的不断扩大,不得不被动创新,这一步步走来和我这几年在公司项目的不断重构尤其相似,恰好我所处的项目也是电商项目。以下我针对此书总结的淘宝技术发展阶段:</p>
<ol>
<li>最初的淘宝是一套买来的 LAMP(Linux+Apache+MySQL+PHP)架构系统,一个很常见的网站架构模型。客户化也只是拆分成了一个主库,两个从库,数据库读写分离这些最基本的改进。</li>
<li>到接下来简单架构的升级,把数据库换成了Oracle,并使用了一个开源的连接池代理服务SQL Relay,买了NAS作为数据库的存储设备,加上Oracle RAC(Real Application Clusters)来实现负载均衡。</li>
<li>以及作者所说的脱胎换骨的升级:PHP替换称为Java,打造一个自己的WebX MVC框架,持久层支使用ibatis,控制层则是EJB和Spring,引入搜索引擎iSearch,以及后来开始使用IBM小型机,EMC存储,引入缓存系统Berkeley DB,CDN等等。</li>
<li>再之后的随着规模扩大,成本大幅度增加,开始自主研发出淘宝文件系统TFS和淘宝KV缓存系统Tair。</li>
<li>分布式电子商务系统的产生,服务化后使用的高性能服务框架HFS和消息中间件Notify,分布式数据访问层TDDL,TBSession框架。</li>
</ol>
<p>其实可以看出来作者很多也是点到为止,如果读者感兴趣完全就可以根据作者给的各种技术的名字找相关资料阅读。</p>
<p>最后在聊聊自己,在一个电子商务项目三年了,前前后后重构了三次,最开始参与搜索引擎的替换,摸索中前进,到后来去除JSP里面所有业务逻辑(没办法,零几年的项目大量逻辑直接写在JSP),公司内部自己创造的MVC框架,再到最后一年整个Checkout重构,前后端分离,使用React,去除form表单,所有请求使用Rest。这中间踩过的雷和坑也是一言难尽,总之之后会单独歇歇这几年来项目重构中间的技术变化。</p>
]]></content>
<summary type="html">
<p>这是一本好玩的书,从前面两章看,主要是讲故事;从后面两章看,主要是讲人物;从中间几章看,主要是讲技术。我在写作的过程中,把部分章节贴到了博客上,有人看了说励志,有人看了说对技术有帮助,有人看了说对产品有帮助,有人看了说对创业有帮助,有人看了说里面的段子特别逗,现在我也不知道
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
<category term="读书" scheme="http://vurtnec.github.io/tags/%E8%AF%BB%E4%B9%A6/"/>
</entry>
<entry>
<title>Eclipse to IntelliJ IDEA</title>
<link href="http://vurtnec.github.io/2016/10/31/Eclipse-to-IntelliJ/"/>
<id>http://vurtnec.github.io/2016/10/31/Eclipse-to-IntelliJ/</id>
<published>2016-10-30T16:00:00.000Z</published>
<updated>2018-06-11T15:12:14.000Z</updated>
<content type="html"><![CDATA[<p>身边越来越多的人开始使用IntelliJ IDEA,都在向我推荐用了之后工作效率提高了一大截。抱着半信半疑的心态,我也尝试使用这个新的IDE,经过一周的使用,个人体会就是好比玩dota的从dota键位改成了QWER,用智能ABC的换成了搜狗输入法。当然不要认为我是在夸这个IDE,因为到目前为止我还没发现有什么特别的理由让我一定要从Eclipse切换到IDEA。<br>不过还是分享下摸索一周来的一些小技巧,说说如何减轻IDE过渡之间的不使用。</p>
<h3 id="快捷键"><a href="#快捷键" class="headerlink" title="快捷键"></a>快捷键</h3><p>开发工具中的重中之重,工作效率提升最直接的体现。IDEA支持直接切换快捷键模版,习惯Eclipse的人可以直接使用Eclipse模版,另外IDEA还提供了Eclipse for MAC OS X和Eclipse两套快捷键,方便习惯MAC键位的人员。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">Windows: Files → Setting → keymap </div><div class="line">Mac: Preference → keymap</div></pre></td></tr></table></figure>
<p>另外要单独推荐的就是find action这个快捷键了,可以方便开发人员搜索IDEA的各种功能,而不需要记住快捷键。<br>还有代码补全依然和Eclipse一样,要修改成Alt+Slash的可以打开</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">Main Menu → Code → Completion → Basic</div></pre></td></tr></table></figure>
<h3 id="视图"><a href="#视图" class="headerlink" title="视图"></a>视图</h3><p>默认的两个试图显示其实不错,不过个人喜欢Sublime,这里推荐下:</p>
<ol>
<li>下载 Eclectide Monokai 主题的jar包</li>
<li>打开 File → Import Settings → Select the jar file</li>
<li>重启 IntelliJ</li>
</ol>
<p>作者原文:<a href="https://darekkay.com/2014/11/23/monokai-theme-intellij/" target="_blank" rel="external">monokai-theme-intellij</a></p>
<h3 id="优化IDEA"><a href="#优化IDEA" class="headerlink" title="优化IDEA"></a>优化IDEA</h3><p>都说IDEA最大的好处是没有了Eclipse的卡顿问题,但是我个人使用来看,Mac上确实比Eclipse流畅,可是在Windows上,编索引的时候占满CPU我也就忍了,可是平时也巨卡无比。经过google之后才知道,原来因为我Windows电脑没有JDK1.8,导致IDEA默认启动是idea32.exe,于是悄悄安装JDK1.8,环境变量配置 IDEA_JDK_64指向JDK1.8即可,这样就不影响开发用的JDK版本。详细可以参考: <a href="http://www.tuicool.com/articles/NBRnYn" target="_blank" rel="external">http://www.tuicool.com/articles/NBRnYn</a></p>
<h3 id="插件"><a href="#插件" class="headerlink" title="插件"></a>插件</h3><p><strong><em>Check Style</em></strong>:导入Eclipse的xml即可。</p>
<p><strong><em>Code Formatter</em></strong>:要在IDEA的Plugin Repositories里面搜索一个叫Eclipse Code Formatter的插件,但是貌似不支持IDEA 2016。</p>
<p><strong><em>Getter & Setter</em></strong>:这个不算插件,顶多就是个模版配置,但是也写了我好久,分享给大家:</p>
<p><strong>Getter</strong>:</p>
<figure class="highlight"><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><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div></pre></td><td class="code"><pre><div class="line">/**</div><div class="line">* Getter method for property <tt>$field.name</tt>.</div><div class="line">*</div><div class="line">* @return property value of $field.name</div><div class="line">*/</div><div class="line"></div><div class="line">public ##</div><div class="line">#if($field.modifierStatic)</div><div class="line">static ##</div><div class="line">#end</div><div class="line">$field.type ##</div><div class="line">#if ($StringUtil.startsWith($helper.getPropertyName($field, $project),"_"))</div><div class="line"> #set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($StringUtil.substringAfter($helper.getPropertyName($field, $project),"_"))))</div><div class="line">#elseif ($StringUtil.startsWith($helper.getPropertyName($field, $project),"m") && $StringUtil.isCapitalized($StringUtil.substringAfter($helper.getPropertyName($field, $project),"m")))</div><div class="line"> #set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($StringUtil.substringAfter($helper.getPropertyName($field, $project),"m"))))</div><div class="line">#else</div><div class="line"> #set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project))))</div><div class="line">#end</div><div class="line">#if ($field.boolean && $field.primitive)</div><div class="line">#if ($StringUtil.startsWithIgnoreCase($name, 'is'))</div><div class="line"> #set($name = $StringUtil.decapitalize($name))</div><div class="line">#else</div><div class="line">is##</div><div class="line">#end</div><div class="line">#else</div><div class="line">get##</div><div class="line">#end</div><div class="line">${name}() {</div><div class="line">return $field.name;</div><div class="line">}</div></pre></td></tr></table></figure>
<p><strong>Setter</strong>:</p>
<figure class="highlight plain"><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><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div></pre></td><td class="code"><pre><div class="line">#if ($StringUtil.startsWith($helper.getPropertyName($field, $project),"_"))</div><div class="line"> #set($paramName = $StringUtil.substringAfter($helper.getParamName($field, $project),"_"))</div><div class="line">#elseif ($StringUtil.startsWith($helper.getPropertyName($field, $project),"m") && $StringUtil.isCapitalized($StringUtil.substringAfter($helper.getPropertyName($field, $project),"m")))</div><div class="line"> #set($paramName = $StringUtil.substringAfter($helper.getParamName($field, $project),"m"))</div><div class="line">#else</div><div class="line"> #set($paramName = $helper.getParamName($field, $project))</div><div class="line">#end</div><div class="line">/**</div><div class="line">* Setter method for property <tt>$field.name</tt>.</div><div class="line">*</div><div class="line">* @param p$paramName value to be assigned to property $field.name</div><div class="line">*/</div><div class="line">#if($field.modifierStatic)</div><div class="line">static ##</div><div class="line">#end</div><div class="line">void set$StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($paramName))($field.type p$paramName) {</div><div class="line">#if ($field.name == $paramName)</div><div class="line"> #if (!$field.modifierStatic)</div><div class="line"> this.##</div><div class="line"> #else</div><div class="line"> $classname.##</div><div class="line"> #end</div><div class="line">#end</div><div class="line">$field.name = p$paramName;</div><div class="line">}</div></pre></td></tr></table></figure>
<p><strong><em>GIT</em></strong>: 比Eclipse的git插件使用起来方便很多,但是遇到个小问题就是有时Pull代码会不起作用,老是找不到有些branch,然后使用自身的那个update project却可以了。</p>
<p><strong><em>Debugger</em></strong>:初次配置不是Eclipse的Application,而且搜索一个叫remote的选项,配置IP和端口即可,<a href="http://yiminghe.iteye.com/blog/1027707,使用过程也发现一个奇怪问题,在方法上打断点会特别慢,而且有时还不进断点。" target="_blank" rel="external">http://yiminghe.iteye.com/blog/1027707,使用过程也发现一个奇怪问题,在方法上打断点会特别慢,而且有时还不进断点。</a></p>
<p>总之,找不到特别的理由让人使用IDEA,一切还是看个人习惯。</p>
]]></content>
<summary type="html">
<p>身边越来越多的人开始使用IntelliJ IDEA,都在向我推荐用了之后工作效率提高了一大截。抱着半信半疑的心态,我也尝试使用这个新的IDE,经过一周的使用,个人体会就是好比玩dota的从dota键位改成了QWER,用智能ABC的换成了搜狗输入法。当然不要认为我是在夸这个I
</summary>
<category term="programing" scheme="http://vurtnec.github.io/categories/programing/"/>
</entry>
<entry>
<title>读后感:驱动力</title>
<link href="http://vurtnec.github.io/2016/10/22/Drive/"/>
<id>http://vurtnec.github.io/2016/10/22/Drive/</id>
<published>2016-10-21T16:00:00.000Z</published>
<updated>2018-10-21T14:01:33.581Z</updated>
<content type="html"><![CDATA[<p>上周末闲来无事,一口气把驱动力(DRiVE)看完了,书中的观点其实不错,但是太啰嗦。</p>
<p>书中阐述了三种驱动力:</p>
<p><strong>驱动力1.0</strong>,来自生存冲动。衣食住行,食色性也,人类本能。就大多数人而言,找第一份工作的时候往往基于第一驱动力。</p>
<p><strong>驱动力2.0</strong>,来自外在驱动,激励,KPI 考评,胡萝卜加大棒,这也是绝大多数公司采取的驱动方式;绝大多数人可能终身在第二驱动力范畴内,找到一家合适的公司,一个还可以的工作,薪水不错,给点激励就努力一点,激励不够就磨一下洋工。</p>
<p><strong>驱动力3.0</strong>,则为内在驱动,自发自主。而第三种驱动力又包括三大要素:自主、专精和目的。需要强调一下所说的「目的」:将自己正在从事的事情变换成乐趣,以兴趣最大化原则为导向而非利润最大化,把利润看做是取得成就后让人愉快的副产品。可能创业者或是有创业者心态的人都是用第三种驱动力做事情。用这种驱动力做事情的人,一定是一个最值得合作的人。</p>
<p>所谓的科学向左,企业向右指的就是科学虽然不断印证驱动力3.0的正确性,可绝大多数企业却始终采取驱动力2.0的方式激励员工,提高生产力。<br>从个人出发,想想自己更倾向于哪一种人,可以更明白自己的定位,提高自己的工作效率。</p>
<p>而书中从各种不同的角度举例印证驱动力3.0的正确性,两百多页完全没有必要。总的来说还是推荐快速阅读,了解大概即可,Daniel H. Pink的观点可以在其TED演讲上已经讲述:</p>
<p>附平克的TED演讲</p>
<p>官网视频:<br><a href="http://www.ted.com/talks/dan_pink_on_motivation" target="_blank" rel="external">http://www.ted.com/talks/dan_pink_on_motivation</a></p>
<p>网易公开课翻译后的视频:<br><a href="http://v.163.com/movie/2011/7/U/D/M7CTOI99C_M7E3PUTUD.html" target="_blank" rel="external">http://v.163.com/movie/2011/7/U/D/M7CTOI99C_M7E3PUTUD.html</a> </p>
]]></content>
<summary type="html">
<p>上周末闲来无事,一口气把驱动力(DRiVE)看完了,书中的观点其实不错,但是太啰嗦。</p>
<p>书中阐述了三种驱动力:</p>
<p><strong>驱动力1.0</strong>,来自生存冲动。衣食住行,食色性也,人类本能。就大多数人而言,找第一份工作的时候往往基于第
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
<category term="读书" scheme="http://vurtnec.github.io/tags/%E8%AF%BB%E4%B9%A6/"/>
</entry>
<entry>
<title>读后感:Soft Skills</title>
<link href="http://vurtnec.github.io/2016/10/16/Soft-skills/"/>
<id>http://vurtnec.github.io/2016/10/16/Soft-skills/</id>
<published>2016-10-15T16:00:00.000Z</published>
<updated>2018-06-21T12:44:22.390Z</updated>
<content type="html"><![CDATA[<p>一直想认真写我的博客,可是每次都不知从何说起。最近终于发现可以把读过的每一本书都分享出来,一方面帮助自己回忆书中的要点,同时也是分享给身边的人,让大家对每本书都个大致的了解。</p>
<p>这次要聊的是一本叫软技能的书,一本关于程序员的方方面面,唯独不讲代码的书,尽管这本书有着不少缺点,妄图面面俱到,结果却都浅尝即止,但它依旧是一本值得一读的好书。</p>
<p>说说优点吧,书里讲的道理其实谁都懂,但是在这个浮躁的社会,生活节奏越来越快,大家忙于工作很少有时间静下心来思考,思考生活的方方面面,本书其实就将一些很重要却又容易被人遗忘的道理有条理的整理出来。</p>
<h3 id="职业发展"><a href="#职业发展" class="headerlink" title="职业发展"></a>职业发展</h3><p><strong><em>The driven force of a career must come form the individual.</em></strong></p>
<p>职业生涯属于个人,很多人不明白自己想要什么,随波逐流,一个人在职业生涯明确自己的目标,知道自己想要什么尤其重要。</p>
<h3 id="自我营销"><a href="#自我营销" class="headerlink" title="自我营销"></a>自我营销</h3><p><strong><em>At its core, marketing is just connecting a product or service with someone who wants or needs that product or service.</em></strong></p>
<p>在程序员心中营销的名声其实并不好,这也是我现在不爱发朋友圈的原因,总觉得朋友圈的意义早已变成了一个炫耀的平台,而不是分享身边的美好。</p>
<p>同时切记陷入林黛玉困境,吴军博士前几天刚聊了对10000个小时的理解,随着程序员coding水平的上升,面也会越来越窄,到最后身边的人谁都瞧不起,生活在自己的世界里,哪怕自己再牛也无人知晓。本书也一直在讲述一个观点,读书,自我学习的最后一步永远是分享,成为人师,帮助他人也是帮助自己。</p>
<p>所以对于程序员,博客永远说是绝佳的营销手段。现在国内前端开发的大牛们,似乎个个都是老博主。</p>
<h3 id="自我学习"><a href="#自我学习" class="headerlink" title="自我学习"></a>自我学习</h3><p>身边的不少朋友总是认为大学毕业之后我们再也不用拾起书本,甚至对我会在空余时间看书嗤之以鼻。</p>
<p>我们走出学校,学习就变成了自己的事,没人会像老师一样督促你,引导你。网上有句话说,一个人的成就取决于下班之后的几个小时,这点其实我非常认同,而学会学习是teach yourself的核心技能。</p>
<h3 id="生产效率"><a href="#生产效率" class="headerlink" title="生产效率"></a>生产效率</h3><p>外行静坐等待灵感,其他人则唤起激情努力工作。 ?? 斯蒂芬 金</p>
<p><strong><em>No more Procrastination</em></strong>, 做一个行动主义,工作之中学会专注,工作之外学会找寻各种工具来节省重复工作时间。</p>
<p><strong><em>Find your time wasters.</em></strong></p>
<p>戒掉电视,少刷微博吧,好好想一想,时间都去哪了。戒掉那些耗费大把时间而又毫无意义的日常行为。</p>
<h3 id="FINANCIAL-FITNESS-SPIRIT"><a href="#FINANCIAL-FITNESS-SPIRIT" class="headerlink" title="FINANCIAL, FITNESS, SPIRIT"></a>FINANCIAL, FITNESS, SPIRIT</h3><p>理财,健身和心态,好的身体,好的心态才能更好的工作,更好的生活,学会理财可以让我们更好的管理自己的财产,工资不是一个人所有的财产。</p>
<p>人的身体就就是人的灵魂的最好写照。</p>
<p>总之,书中的道理人人都懂,但是如何看待这些观点,如何执行就要看自己了。 </p>
]]></content>
<summary type="html">
<p>一直想认真写我的博客,可是每次都不知从何说起。最近终于发现可以把读过的每一本书都分享出来,一方面帮助自己回忆书中的要点,同时也是分享给身边的人,让大家对每本书都个大致的了解。</p>
<p>这次要聊的是一本叫软技能的书,一本关于程序员的方方面面,唯独不讲代码的书,尽管这本书
</summary>
<category term="other" scheme="http://vurtnec.github.io/categories/other/"/>
</entry>
<entry>
<title>IOC和AOP</title>
<link href="http://vurtnec.github.io/2016/06/15/IOC&AOP/"/>
<id>http://vurtnec.github.io/2016/06/15/IOC&AOP/</id>
<published>2016-06-14T16:00:00.000Z</published>
<updated>2018-06-21T12:50:46.938Z</updated>
<content type="html"><![CDATA[<h2 id="Ioc简介"><a href="#Ioc简介" class="headerlink" title="Ioc简介"></a>Ioc简介</h2><h3 id="什么是Ioc"><a href="#什么是Ioc" class="headerlink" title="什么是Ioc"></a>什么是Ioc</h3><p>IOC(Ioc—Inversion of Control),即“控制反转”,不是什么技术,而是一种设计思想。在Java开发中,Ioc意味着将你设计好的对象交给容器控制,而不是传统的在你的对象内部直接控制。</p>
<h3 id="Ioc图解"><a href="#Ioc图解" class="headerlink" title="Ioc图解"></a>Ioc图解</h3><p><strong>传统程序时序图:</strong></p>
<div id="sequence-0"></div>
<p><strong>Ioc设计思路程序时序图:</strong></p>