-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1255 lines (874 loc) · 63.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 lang="zh-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.8.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
<link rel="mask-icon" href="/images/logo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"tachikomachann.github.io","root":"/","scheme":"Mist","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
</script>
<meta name="description" content="Less is more">
<meta property="og:type" content="website">
<meta property="og:title" content="タチコマの部屋">
<meta property="og:url" content="https://tachikomachann.github.io/index.html">
<meta property="og:site_name" content="タチコマの部屋">
<meta property="og:description" content="Less is more">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="タチコマの部屋">
<meta name="twitter:description" content="Less is more">
<link rel="canonical" href="https://tachikomachann.github.io/">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : true,
isPost : false,
lang : 'zh-Hans'
};
</script>
<title>タチコマの部屋</title>
<noscript>
<style>
.use-motion .brand,
.use-motion .menu-item,
.sidebar-inner,
.use-motion .post-block,
.use-motion .pagination,
.use-motion .comments,
.use-motion .post-header,
.use-motion .post-body,
.use-motion .collection-header { opacity: initial; }
.use-motion .site-title,
.use-motion .site-subtitle {
opacity: initial;
top: initial;
}
.use-motion .logo-line-before i { left: initial; }
.use-motion .logo-line-after i { right: initial; }
</style>
</noscript>
</head>
<body itemscope itemtype="http://schema.org/WebPage">
<div class="container use-motion">
<div class="headband"></div>
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏">
<span class="toggle-line toggle-line-first"></span>
<span class="toggle-line toggle-line-middle"></span>
<span class="toggle-line toggle-line-last"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<h1 class="site-title">タチコマの部屋</h1>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="main-menu menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>
</li>
</ul>
</nav>
</div>
</header>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<main class="main">
<div class="main-inner">
<div class="content-wrap">
<div class="content index posts-expand">
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/05/04/《人类简史》读书笔记/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/05/04/《人类简史》读书笔记/" class="post-title-link" itemprop="url">《人类简史》读书笔记</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-05-04 14:39:38 / 修改时间:14:44:07" itemprop="dateCreated datePublished" datetime="2021-05-04T14:39:38+08:00">2021-05-04</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>从一月份拿到这本原版书,到五一假期,终于断断续续地把它读完。对于英语渣渣的我来说,原本计划一天读个四五页,花一年时间把它看完。没想到这本书确实挺有意思,加上后来买了个小米电纸书Pro,通勤的时间看起来更方便了,一看就停不下来。真的是很不错的英文读物,虽然有很多专有名词,但是只要有一定的社科知识基础,一些专有名词还是可以靠读音猜出大半。</p>
<p>我后来有查了一下网上对这本书的评价,是两极分化的。喜欢的人极力推荐,不喜欢的人骂它是书商吹捧出来的民科读物。专业这块暂且不去争论,我说说自己整本书看下来的感受。</p>
<p>整本书分成了认知革命,农业革命,科技革命几大部分介绍了我们的祖先智人(Homo Sapiens)是怎么从其他灵长类中脱颖而出,变成这个星球上的主宰。通读下来,我觉得整本书的主旨就一个:我们人类社会之所以是现在这个样子,靠的都是一些虚无缥缈的东西。我们能讲故事,能八卦,能用语言描述那些物质世界之外的东西。靠着这个能力,我们获得了比其他种群更强大的动员能力,让智人们能够集中起来为同一个目标努力。我们生活的世界所相信的所有东西,都是基于这个基础,不管是国家,民族,宗教,亦或是金钱,资本主义,共产主义等等。它们全都是看不见摸不着的东西,但是由于我们的相信,我们做到了其他物种做不到的事情。我以前听说过一个类似的概念:“想像共同体”,只是没想到作者赫拉利能拿它来解释人类社会的一切。书里面的用这个观点解释了人类社会的很多事情,但是里面提到的一些例子和数据,我还是不完全相信的,毕竟我也不是专业人士。这些观点拿来拓宽自己的视野还行,完全当成知识吸收我觉得还是要存疑的,这也是这本书为啥被喷为民科读物的原因吧?</p>
<p>所以一旦接受了书里这个观点,一切是不是就变得悲观了呢?我们所相信的一切,原来都只是我们自己骗自己的而已。作者却又不这么认为,就像他在谈论人类历史的时候同样说,人类从不会从历史中得到教训,历史是重复的,那我们为什么要学习历史呢?因为尽可能的知道我们的祖先是怎么做的,我们可以了解更多的可能性,对未来我们可以有更多的选择。这个也同样适用于我们对人类自己的研究,哪怕我们知道这些东西都是虚无的,但是更好地了解它们的规律,有助于我们在未来做出更好的选择。</p>
<p>在这本书科技革命之后的几章,谈论了人的幸福和人类的未来。我觉得这一块的内容就有点俗套了,特别是关于未来畅想的部分(作者是文科生的关系?),还是没逃脱出科幻小说的话题:环境问题,人类永生,生物革命,赛博朋克等等。这本书写于2014年,从现在2021年回头看,我对科学方面的进步还是持悲观的态度的。</p>
<p>智人未来会走向何方,作者自己也不知道。未来智人这个种群仍然会面对各种未知的困难,然而,作者认为,我们最应该提防的,其实是我们自己,就像他在最后说的:“Is there anything more dangerous than dissatisfied and irresponsible gods who don’t know what they want?” </p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/04/10/小米电纸书Pro体验/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/04/10/小米电纸书Pro体验/" class="post-title-link" itemprop="url">小米电纸书Pro体验</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-04-10 12:00:56 / 修改时间:21:48:30" itemprop="dateCreated datePublished" datetime="2021-04-10T12:00:56+08:00">2021-04-10</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>从去年开始,我强迫自己看一些大部头的技术类书籍,来练习自己的专注能力,同时试着远离手机以及各种公众号文章带来的焦虑。为此我屯了很多PDF电子书,给自己列了一个书单。一开始的做法是用电脑配合PDF阅读器阅读,发现自己还是很容易分心,于是想脱离手机电脑来看书。然而手头的Kindle 只有6寸,拿来看技术文档无异于折磨自己,当时各种品牌的大尺寸电纸书动不动就要2K以上,狠不下心来下单。最后还是选择了折衷方案,找淘宝上打印书本的店铺,把文档打印下来装订成书看,就这么持续了几个月。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/04/10/小米电纸书Pro体验/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/02/21/Java中的volatile关键字总结/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/02/21/Java中的volatile关键字总结/" class="post-title-link" itemprop="url">Java中的volatile关键字总结</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-02-21 14:55:29 / 修改时间:16:49:08" itemprop="dateCreated datePublished" datetime="2021-02-21T14:55:29+08:00">2021-02-21</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>Java 中的volatile 关键字主要是用于处理并发场景下多线程访问共享变量的内存屏障(Memory Fence/Memory Barrier)问题。经常与同步块sychronized配合使用,因此很多人想到并发就想到它,但是它其实不是用来解决共享变量的问题。以前对它的理解也是浑浑噩噩,今天这里做一下系统性的梳理。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/02/21/Java中的volatile关键字总结/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/02/10/我的中医观/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/02/10/我的中医观/" class="post-title-link" itemprop="url">我的中医观</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-02-10 12:53:39" itemprop="dateCreated datePublished" datetime="2021-02-10T12:53:39+08:00">2021-02-10</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-02-19 12:57:07" itemprop="dateModified" datetime="2021-02-19T12:57:07+08:00">2021-02-19</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>最近在v站上看到一篇医生给开中成药的帖子,不出意外没几楼后就开始撕了起来,不愧为经典的友尽话题。一段时间观察下来,我发现网上这类争论挺没有意义的。大力鼓吹中医贬低西医,或者一股脑踩中医的,其实是同一类人。西医好还是中医好对他们来说不重要,他们只是借着这个论点来兜售自己的私货或者借此抨击其他事情。比如厌恶中医的,往往还会一并攻击国学,体制,国民素质等等。而鼓吹中医的,还会带入西方阴谋论等一系列友尽话题。这也是在网上讨论这些永远讨论不出结果的原因。当我们讨论问题的时候带入主观情绪,其实就没只要讨论了,因为最后不会产生理性的结果。</p>
<p>对于不可知的东西,我还是倾向于不急着否定。中医的理论对于现代医学来说,是很荒谬。但是很多时候它的治疗方案是人们长期依赖经验总结的结果,是有可能真的有效的。我们要认识到当前现代医学的局限性,毕竟现在科学还不能解释所有事情。所以在西医久治不愈的情况下,尝试中医方案也未尝不可,前提是它是正规医院给出的方案而不是江湖郎中,并且它的副作用经过现代医学的检验。病人的诉求是把病治好,这个大前提不解决的情况下,你跟他讲中医疗效是安慰剂,通不过双盲测试,真的一点用都没有,那种居高临下嘲笑对方愚昧的态度甚至还有点刻薄。</p>
<p>当然,可以选择的话,看病我还是会优先考虑西医方案。中医目前局限在于它的理论没法证伪,同时又固守经典而不进步,所以骗子很多。现代医学是科学的分支,是通过试验,观测,不断更新前人理论的结果。如果中医还是抱着那些看不见摸不着的东西,不采用现代科学的方法去验证,它的擅长的所有领域被现代医学攻破也是迟早的事。 </p>
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/01/17/关于Java 8中-XX-MetaspaceSize的一点误解/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/01/17/关于Java 8中-XX-MetaspaceSize的一点误解/" class="post-title-link" itemprop="url">关于Java 8中-XX:MetaspaceSize的一点误解</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-01-17 15:41:38 / 修改时间:16:34:03" itemprop="dateCreated datePublished" datetime="2021-01-17T15:41:38+08:00">2021-01-17</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="背景"><a href="#背景" class="headerlink" title="背景"></a>背景</h2><p>最近手头有个新项目做压测,本来打算一边压测一边寻找瓶颈调整JVM options。在分析压测时的服务的GC日志过程中,发现有很多类似这样的Full GC记录:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">[Full GC (Metadata GC Threshold) ...]</span><br></pre></td></tr></table></figure>
<p>整个应用的GC日志看起来挺正常的,就是这类Full GC有点多,不过在压测一段时间后,就不再出现了。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/01/17/关于Java 8中-XX-MetaspaceSize的一点误解/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2021/01/10/2020年总结/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2021/01/10/2020年总结/" class="post-title-link" itemprop="url">2020年总结</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2021-01-10 18:08:51 / 修改时间:22:15:51" itemprop="dateCreated datePublished" datetime="2021-01-10T18:08:51+08:00">2021-01-10</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>不出意外地,本应该在年末完成的总结,又拖到现在才动笔。果然我也许要花一辈子的时间与自己的拖延症斗争到底。2020年在很多人的人生中,绝对是特殊的一年,大家应该都没想到,新冠疫情的影响能够这么久远,甚至到现在国内都还有复发的迹象。我算是幸运的,碰上了一家靠谱的公司,让我们在家办公了大半年。在家办公真的是蛮特殊的一次体验,作为码农,以前心心念念远程工作,但是经过几个月的折磨以后,我更加想念自己的工位,复工之后第一时间回到公司上班。</p>
<p>现在回头想想,回顾2020这一整年,自己都做了什么呢,哪里做得好,又有哪些遗憾?</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2021/01/10/2020年总结/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2020/12/06/关于MySQL出现'Deadlock found when trying to get lock'的一点思考/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/12/06/关于MySQL出现'Deadlock found when trying to get lock'的一点思考/" class="post-title-link" itemprop="url">关于MySQL出现'Deadlock found when trying to get lock'的一点思考</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-12-06 16:37:55 / 修改时间:18:44:03" itemprop="dateCreated datePublished" datetime="2020-12-06T16:37:55+08:00">2020-12-06</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>最近项目上碰到一个MySQL死锁的情况,折腾了一下,为了以后温故知新,在这里覆盘一下。</p>
<h2 id="问题"><a href="#问题" class="headerlink" title="问题"></a>问题</h2><p>我们项目里一个定时计划在每次到运行时间的时候,会出现“<code>Deadlock found when trying to get lock</code>” 这样的死锁字样的日志。</p>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/12/06/关于MySQL出现'Deadlock found when trying to get lock'的一点思考/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2020/11/28/用树莓派4B组件简易NAS/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/11/28/用树莓派4B组件简易NAS/" class="post-title-link" itemprop="url">用树莓派4B组件简易NAS</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-11-28 21:42:04" itemprop="dateCreated datePublished" datetime="2020-11-28T21:42:04+08:00">2020-11-28</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-12-06 19:51:02" itemprop="dateModified" datetime="2020-12-06T19:51:02+08:00">2020-12-06</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>最近尝试用树莓派和两块硬盘搭建了简易的NAS服务,稳定运行了几周,感觉还不错。今天把自己折腾的过程记录一下。</p>
<h2 id="我对NAS的需求"><a href="#我对NAS的需求" class="headerlink" title="我对NAS的需求"></a>我对NAS的需求</h2><ol>
<li>2T左右的空间</li>
<li>个人多媒体库(我没有屯片习惯,主要是听歌和偶尔下载一些片子来看)</li>
<li>管理家庭照片(我和我老婆手机的照片)</li>
<li>备份<ol>
<li>增量备份到老硬盘</li>
<li>异地备份到公有云(其实就是百度云)</li>
<li>定时备份系统,可快速还原系统</li>
</ol>
</li>
<li>外网访问:查看文件,听音乐,看照片</li>
<li>用家里电视盒子看视频</li>
<li>长时间运行不折腾</li>
<li>可以休眠硬盘(其实现在大部分硬盘自带休眠功能)</li>
<li>定时开关机</li>
<li>消息推送:对于一些关注的事件,给我手机发通知(备份成功,开机,关机等等)</li>
</ol>
<h2 id="购物清单"><a href="#购物清单" class="headerlink" title="购物清单"></a>购物清单</h2><ol>
<li>咸鱼树莓派4B 2G版本,带外壳带风扇(260元)</li>
<li>闪迪16G SD卡2张(45元),一张做树莓派系统,一张作为备用</li>
<li>东芝新小黑A3 2T移动硬盘+2年包换(跟家里一个1T台式机硬盘配合着用)(418元)</li>
<li>腾讯云HK轻量服务器(安装frp作为内网穿透用)(每月24元)</li>
<li>腾讯云买的两年域名+免费一年证书(内网穿透用)(46元)</li>
<li>小米wifi插座(定时开关机用)(40元)</li>
<li>水星(MERCURY)SG105M 5口千兆交换机 (52元)</li>
</ol>
<!--noindex-->
<div class="post-button">
<a class="btn" href="/2020/11/28/用树莓派4B组件简易NAS/#more" rel="contents">
阅读全文 »
</a>
</div>
<!--/noindex-->
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-Hans">
<link itemprop="mainEntityOfPage" href="https://tachikomachann.github.io/2019/12/22/SAML-与-SSO/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="Tachikoma">
<meta itemprop="description" content="Less is more">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="タチコマの部屋">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2019/12/22/SAML-与-SSO/" class="post-title-link" itemprop="url">SAML 与 SSO</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-12-22 20:09:36" itemprop="dateCreated datePublished" datetime="2019-12-22T20:09:36+08:00">2019-12-22</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2020-11-28 17:20:52" itemprop="dateModified" datetime="2020-11-28T17:20:52+08:00">2020-11-28</time>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<h2 id="SSO-与-SAML"><a href="#SSO-与-SAML" class="headerlink" title="SSO 与 SAML"></a>SSO 与 SAML</h2><p>在谈论单点登录系统(SSO)实现的时候,我们做技术选型,最常听到的两个方案是SAML与OAuth。得益于现在各互联网大厂的推广,OAuth的概念在这几年深入人心,几乎是SSO的首选方案。但是在OAuth还没兴起的年代,想要快速搭建一套符合业界标准的SSO系统,SAML基本上是唯一选择了。所以在众多历史悠久的企业级应用里,SAML仍然占据着SSO服务的半壁江山。<br>OAuth 之前已经了解的听清楚了,今天稍微总结一下SAML。</p>
<h2 id="SAML-的一些概念"><a href="#SAML-的一些概念" class="headerlink" title="SAML 的一些概念"></a>SAML 的一些概念</h2><h3 id="SP-与-IdP"><a href="#SP-与-IdP" class="headerlink" title="SP 与 IdP"></a>SP 与 IdP</h3><p>SAML 中分为SP(service provider)与IdP(identity provider)两个角色。SP属于为用户提供各种业务服务的应用,IdP属于提供用户登录认证的应用。<br><img src="1.gif" alt="SAML SSO flow"><br>上面这张图摘自Oasis官方网站上SAML的说明,其中<code>hotels.example.ca</code>就是IdP,当其他两个SP应用需要用户登录时,就会重定向到它这边做登录认证,然后重定向回SP。<br>详细的认证流程可以参考Oasis官网上的<a href="http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0-cd-02.html#3.3.Identity%20Federation%20Use%20Case|outline" target="_blank" rel="noopener">3.3 Identity Federation Use Case</a>对该流程的说明</p>
<h3 id="SAML的XML文档结构"><a href="#SAML的XML文档结构" class="headerlink" title="SAML的XML文档结构"></a>SAML的XML文档结构</h3><p><img src="2.gif" alt="SAML Architecture"><br>上图阐述了传输SAML数据时用到的一些概念。其中Assertions就是传输中具体的用户认证数据,用XML组织。Protocols是Assertions所承载的协议,SAML定义了多种协议,一般常用的是Authentication Request Protocol。Binding定义了idP与SP之间通信的方式(HTTP POST Binding或者SOAP等)。Profiles定义了使用SAML时一些最基础的信息,一般做SSO单点登录时,Profiles是相对固定的。<br>对于SAML的XML文档中每个属性用途的说明,其实一开始不必过于详细地了解,由于概念太多,很容易收到打击。可以先快速过一遍OASIS网站上的说明,然后挑一种认证流程详细了解一下各请求报文。</p>
<h2 id="Web-Broswer-SSO-Profile"><a href="#Web-Broswer-SSO-Profile" class="headerlink" title="Web Broswer SSO Profile"></a>Web Broswer SSO Profile</h2><p>常见web应用基于SAML的SSO实现一般使用的就是Web Broswer SSO Profile。它包含两种flow:<br>SP-initiated web SSO flow 和 IdP-initiated web SSO flow ,从字面上就很容易理解,一种是SP发起的,一种是IdP发起的。SP-initiated web SSO flow 又分为两种: Redirect/POST Bindings 和 POST/Artifact Bindings。</p>
<h3 id="SP-Initiated-SSO-Redirect-POST-Bindings"><a href="#SP-Initiated-SSO-Redirect-POST-Bindings" class="headerlink" title="SP-Initiated SSO: Redirect/POST Bindings"></a>SP-Initiated SSO: Redirect/POST Bindings</h3><p><img src="3.png" alt="Redirect/POST Bindings"><br>流程说明摘抄自OASIS,挺清楚的,就不翻译了:</p>
<ol>
<li>The user attempts to access a resource on sp.example.com. The user does not have a valid logon session (i.e. security context) on this site. The SP saves the requested resource URL in local state information that can be saved across the web SSO exchange.</li>
<li><p>The SP sends an HTML form back to the browser in the HTTP response (HTTP status 200). The HTML FORM contains a SAML <authnrequest> message encoded as the value of a hidden form control named SAMLRequest.</authnrequest></p>
<pre><code><form method="post" action="https://idp.example.org/SAML2/SSO/POST" ...>
<input type="hidden" name="SAMLRequest" value="request" />
<input type="hidden" name="RelayState" value="token" />
...
<input type="submit" value="Submit" />
</form>
</code></pre><p> The <strong>RelayState</strong> token is an opaque reference to state information maintained at the service provider. (The <strong>RelayState</strong> mechanism can leak details of the user’s activities at the SP to the IdP and so the SP should take care in its implementation to protect the user’s privacy.) The value of the <strong>SAMLRequest</strong> parameter is the base64 encoding of the following <a href="samlp:AuthnRequest" target="_blank" rel="noopener"><code>samlp:AuthnRequest</code></a> element:</p>
<pre><code><samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_1"
Version="2.0"
IssueInstant="2004-12-05T09:21:59Z"
AssertionConsumerServiceIndex="1">
<saml:Issuer>https://sp.example.com/SAML2</saml:Issuer>
<samlp:NameIDPolicy
AllowCreate="true"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"/>
</samlp:AuthnRequest>
</code></pre><p> For ease-of-use purposes, the HTML FORM typically will be accompanied by script code that will automatically post the form to the destination site (which is the IdP in this case). The browser, due either to a user action or execution of an “auto-submit” script, issues an HTTP POST request to send the form to the identity provider’s Single Sign-On Service.</p>
<pre><code>POST /SAML2/SSO/POST HTTP/1.1
Host: idp.example.org
Content-Type: application/x-www-form-urlencoded
Content-Length: nnn
SAMLRequest=request&RelayState=token
</code></pre></li>
<li><p>The Single Sign-On Service determines whether the user has an existing logon security context at the identity provider that meets the default or requested authentication policy requirements. If not, the IdP interacts with the browser to challenge the user to provide valid credentials.</p>
</li>
<li>The user provides valid credentials and a local logon security context is created for the user at the IdP.</li>
<li>The IdP Single Sign-On Service issues a SAML assertion representing the user’s logon security context and places the assertion within a SAML <code><Response></code> message. Since the HTTP Artifact binding will be used to deliver the SAML Response message, <strong>it is not mandated that the assertion be digitally signed.</strong> The IdP creates an artifact containing the source ID for the <code>idp.example.org</code> site and a reference to the <code><Response></code> message (the <strong>MessageHandle</strong>). The HTTP Artifact binding allows the choice of either HTTP redirection or an HTML form POST as the mechanism to deliver the artifact to the partner. The figure shows the use of redirection.</li>
<li><p>The SP’s Assertion Consumer Service now sends a SAML <code><ArtifactResolve></code> message containing the artifact to the IdP’s Artifact Resolution Service endpoint. This exchange is <strong>performed using a synchronous SOAP message exchange.</strong></p>
<pre><code><samlp:ArtifactResolve
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_2"
Version="2.0"
IssueInstant="2004-12-05T09:22:04Z"
Destination="https://idp.example.org/SAML2/ArtifactResolution">
<saml:Issuer>https://sp.example.com/SAML2</saml:Issuer>
<!-- an ArtifactResolve message SHOULD be signed -->
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Artifact>artifact</samlp:Artifact>
</samlp:ArtifactResolve>
</code></pre></li>
<li><p>The IdP’s Artifact Resolution Service extracts the <strong>MessageHandle</strong> from the artifact and locates the original SAML <code><Response></code> message associated with it. This message is then placed inside a SAML <code><ArtifactResponse></code> message, which is returned to the SP over the SOAP channel.</p>
<pre><code><samlp:ArtifactResponse
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="identifier_3"
InResponseTo="identifier_2"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z">
<!-- an ArtifactResponse message SHOULD be signed -->
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Status>
<samlp:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<samlp:Response
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_4"
InResponseTo="identifier_1"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z"
Destination="https://sp.example.com/SAML2/SSO/Artifact">
<saml:Issuer>https://idp.example.org/SAML2</saml:Issuer>
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Status>
<samlp:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_5"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z">
<saml:Issuer>https://idp.example.org/SAML2</saml:Issuer>
<!-- a Subject element is required -->
<saml:Subject>
<saml:NameID
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
</saml:NameID>
<saml:SubjectConfirmation
Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData
InResponseTo="identifier_1"
Recipient="https://sp.example.com/SAML2/SSO/Artifact"
NotOnOrAfter="2004-12-05T09:27:05Z"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions
NotBefore="2004-12-05T09:17:05Z"
NotOnOrAfter="2004-12-05T09:27:05Z">
<saml:AudienceRestriction>
<saml:Audience>https://sp.example.com/SAML2</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement
AuthnInstant="2004-12-05T09:22:00Z"
SessionIndex="identifier_5">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
</saml:Assertion>
</samlp:Response>
</samlp:ArtifactResponse>
</code></pre><p> The SP extracts and processes the <code><Response></code> message and then processes the embedded assertion in order to create a local logon security context for the user at the SP. Once this is completed, the SP retrieves the local state information indicated by the <strong>RelayState</strong> data to recall the originally-requested resource URL. It then sends an HTTP redirect response to the browser directing it to access the originally requested resource (not shown).</p>
</li>
<li><p>An access check is made to establish whether the user has the correct authorization to access the resource. If the access check passes, the resource is then returned to the browser.</p>
</li>
</ol>
<h3 id="SP-Initiated-SSO-POST-Artifact-Bindings"><a href="#SP-Initiated-SSO-POST-Artifact-Bindings" class="headerlink" title="SP-Initiated SSO: POST/Artifact Bindings"></a>SP-Initiated SSO: POST/Artifact Bindings</h3><p><img src="4.png" alt="POST/Artifact Bindings"></p>
<ol>
<li>The user attempts to access a resource on sp.example.com. The user does not have a valid logon session (i.e. security context) on this site. The SP saves the requested resource URL in local state information that can be saved across the web SSO exchange.</li>
<li><p>The SP sends an HTML form back to the browser in the HTTP response (HTTP status 200). The HTML FORM contains a SAML <authnrequest> message encoded as the value of a hidden form control named SAMLRequest.</authnrequest></p>
<pre><code><form method="post" action="https://idp.example.org/SAML2/SSO/POST" ...>
<input type="hidden" name="SAMLRequest" value="request" />
<input type="hidden" name="RelayState" value="token" />
...
<input type="submit" value="Submit" />
</form>
</code></pre><p> The <strong>RelayState</strong> token is an opaque reference to state information maintained at the service provider. (The <strong>RelayState</strong> mechanism can leak details of the user’s activities at the SP to the IdP and so the SP should take care in its implementation to protect the user’s privacy.) The value of the <strong>SAMLRequest</strong> parameter is the base64 encoding of the following <a href="samlp:AuthnRequest" target="_blank" rel="noopener"><code>samlp:AuthnRequest</code></a> element:</p>
<pre><code><samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_1"
Version="2.0"
IssueInstant="2004-12-05T09:21:59Z"
AssertionConsumerServiceIndex="1">
<saml:Issuer>https://sp.example.com/SAML2</saml:Issuer>
<samlp:NameIDPolicy
AllowCreate="true"
Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient"/>
</samlp:AuthnRequest>
</code></pre><p> For ease-of-use purposes, the HTML FORM typically will be accompanied by script code that will automatically post the form to the destination site (which is the IdP in this case). The browser, due either to a user action or execution of an “auto-submit” script, issues an HTTP POST request to send the form to the identity provider’s Single Sign-On Service.</p>
<pre><code>POST /SAML2/SSO/POST HTTP/1.1
Host: idp.example.org
Content-Type: application/x-www-form-urlencoded
Content-Length: nnn
SAMLRequest=request&RelayState=token
</code></pre></li>
<li><p>The Single Sign-On Service determines whether the user has an existing logon security context at the identity provider that meets the default or requested authentication policy requirements. If not, the IdP interacts with the browser to challenge the user to provide valid credentials.</p>
</li>
<li>The user provides valid credentials and a local logon security context is created for the user at the IdP.</li>
<li>The IdP Single Sign-On Service issues a SAML assertion representing the user’s logon security context and places the assertion within a SAML <code><Response></code> message. Since the HTTP Artifact binding will be used to deliver the SAML Response message, <strong>it is not mandated that the assertion be digitally signed.</strong> The IdP creates an artifact containing the source ID for the <code>idp.example.org</code> site and a reference to the <code><Response></code> message (the <strong>MessageHandle</strong>). The HTTP Artifact binding allows the choice of either HTTP redirection or an HTML form POST as the mechanism to deliver the artifact to the partner. The figure shows the use of redirection.</li>
<li><p>The SP’s Assertion Consumer Service now sends a SAML <code><ArtifactResolve></code> message containing the artifact to the IdP’s Artifact Resolution Service endpoint. This exchange is <strong>performed using a synchronous SOAP message exchange.</strong></p>
<pre><code><samlp:ArtifactResolve
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_2"
Version="2.0"
IssueInstant="2004-12-05T09:22:04Z"
Destination="https://idp.example.org/SAML2/ArtifactResolution">
<saml:Issuer>https://sp.example.com/SAML2</saml:Issuer>
<!-- an ArtifactResolve message SHOULD be signed -->
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Artifact>artifact</samlp:Artifact>
</samlp:ArtifactResolve>
</code></pre></li>
<li><p>The IdP’s Artifact Resolution Service extracts the <strong>MessageHandle</strong> from the artifact and locates the original SAML <code><Response></code> message associated with it. This message is then placed inside a SAML <code><ArtifactResponse></code> message, which is returned to the SP over the SOAP channel.</p>
<pre><code><samlp:ArtifactResponse
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="identifier_3"
InResponseTo="identifier_2"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z">
<!-- an ArtifactResponse message SHOULD be signed -->
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Status>
<samlp:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<samlp:Response
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_4"
InResponseTo="identifier_1"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z"
Destination="https://sp.example.com/SAML2/SSO/Artifact">
<saml:Issuer>https://idp.example.org/SAML2</saml:Issuer>
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds:Signature>
<samlp:Status>
<samlp:StatusCode
Value="urn:oasis:names:tc:SAML:2.0:status:Success"/>
</samlp:Status>
<saml:Assertion
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
ID="identifier_5"
Version="2.0"
IssueInstant="2004-12-05T09:22:05Z">
<saml:Issuer>https://idp.example.org/SAML2</saml:Issuer>
<!-- a Subject element is required -->
<saml:Subject>
<saml:NameID
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">
</saml:NameID>
<saml:SubjectConfirmation
Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
<saml:SubjectConfirmationData
InResponseTo="identifier_1"
Recipient="https://sp.example.com/SAML2/SSO/Artifact"
NotOnOrAfter="2004-12-05T09:27:05Z"/>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:Conditions
NotBefore="2004-12-05T09:17:05Z"
NotOnOrAfter="2004-12-05T09:27:05Z">
<saml:AudienceRestriction>
<saml:Audience>https://sp.example.com/SAML2</saml:Audience>
</saml:AudienceRestriction>
</saml:Conditions>
<saml:AuthnStatement
AuthnInstant="2004-12-05T09:22:00Z"
SessionIndex="identifier_5">
<saml:AuthnContext>
<saml:AuthnContextClassRef>
urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
</saml:AuthnContextClassRef>
</saml:AuthnContext>
</saml:AuthnStatement>
</saml:Assertion>
</samlp:Response>