-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
1140 lines (741 loc) · 86.6 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-CHS">
<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 7.1.1">
<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/font-awesome.min.css">
<script id="hexo-configurations">
var NexT = window.NexT || {};
var CONFIG = {"hostname":"www.icaca.net","root":"/","scheme":"Muse","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="一个关注技术和创新的博客">
<meta property="og:type" content="website">
<meta property="og:title" content="caca's Blog">
<meta property="og:url" content="https://www.icaca.net/index.html">
<meta property="og:site_name" content="caca's Blog">
<meta property="og:description" content="一个关注技术和创新的博客">
<meta property="og:locale">
<meta property="article:author" content="https://www.icaca.net">
<meta name="twitter:card" content="summary">
<link rel="canonical" href="https://www.icaca.net/">
<script id="page-configurations">
// https://hexo.io/docs/variables.html
CONFIG.page = {
sidebar: "",
isHome : true,
isPost : false,
lang : 'zh-CHS'
};
</script>
<title>caca's Blog</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">caca's Blog</h1>
<span class="logo-line-after"><i></i></span>
</a>
<p class="site-subtitle" itemprop="description">道法自然</p>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2022/03/%E5%B0%86%E8%BF%9B%E9%85%92/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2022/03/%E5%B0%86%E8%BF%9B%E9%85%92/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2022-03-24 00:00:00" itemprop="dateCreated datePublished" datetime="2022-03-24T00:00:00+08:00">2022-03-24</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2022-05-04 13:32:12" itemprop="dateModified" datetime="2022-05-04T13:32:12+08:00">2022-05-04</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E5%8F%A4%E8%AF%97/" itemprop="url" rel="index"><span itemprop="name">古诗</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>君不见,黄河之水天上来,奔流到海不复回。<br>君不见,高堂明镜悲白发,朝如青丝暮成雪。<br>人生得意须尽欢,莫使金樽空对月。<br>天生我材必有用,千金散尽还复来。<br>烹羊宰牛且为乐,会须一饮三百杯。<br>岑夫子,丹丘生,将进酒,杯莫停。<br>与君歌一曲,请君为我倾耳听。<br>钟鼓馔玉不足贵,但愿长醉不复醒。<br>古来圣贤皆寂寞,惟有饮者留其名。<br>陈王昔时宴平乐,斗酒十千恣欢谑。<br>主人何为言少钱,径须沽取对君酌。<br>五花马,千金裘,呼儿将出换美酒,与尔同销万古愁。</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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2022/03/%E8%B5%A0%E8%8D%AF%E5%B1%B1%E9%AB%98%E5%83%A7%E6%83%9F%E4%BF%A8%E4%BA%8C%E9%A6%96/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2022/03/%E8%B5%A0%E8%8D%AF%E5%B1%B1%E9%AB%98%E5%83%A7%E6%83%9F%E4%BF%A8%E4%BA%8C%E9%A6%96/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2022-03-05 21:47:00" itemprop="dateCreated datePublished" datetime="2022-03-05T21:47:00+08:00">2022-03-05</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2022-05-04 13:32:12" itemprop="dateModified" datetime="2022-05-04T13:32:12+08:00">2022-05-04</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E5%8F%A4%E8%AF%97/" itemprop="url" rel="index"><span itemprop="name">古诗</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>练得身形如鹤形,千株松下两函经。<br>我来问道无馀说,云在青天水在瓶。<br>选得幽居惬野情,终年无送亦无迎。<br>有时直上孤峰顶,月下披云啸一声。</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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2022/01/%E5%A4%A9%E4%B8%8B%E7%9A%86%E7%9F%A5%E7%BE%8E%E4%B9%8B%E4%B8%BA%E7%BE%8E%EF%BC%8C%E6%81%B6%E5%B7%B2/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2022/01/%E5%A4%A9%E4%B8%8B%E7%9A%86%E7%9F%A5%E7%BE%8E%E4%B9%8B%E4%B8%BA%E7%BE%8E%EF%BC%8C%E6%81%B6%E5%B7%B2/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2022-01-18 00:00:00 / 修改时间:18:46:27" itemprop="dateCreated datePublished" datetime="2022-01-18T00:00:00+08:00">2022-01-18</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E9%81%93%E5%BE%B7%E7%BB%8F/" itemprop="url" rel="index"><span itemprop="name">道德经</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>第二章<br>[原文]</p>
<p>天下皆知美之为美,恶已①;皆知善,斯不善矣②。有无之相生也③,难易之相成也,长短之相刑也④,高下之相盈也⑤,音声之相和也⑥,先后之相随,恒也。是以圣人居无为之事⑦,行不言之教,万物作而弗始也⑧,为而弗志也⑨,成功而弗居也。夫唯弗居,是以弗去。</p>
<p> </p>
<p>[译文]</p>
<p>天下人都知道美之所以为美,那是由于有丑陋的存在。都知道善之所以为善,那是因为有恶的存在。所以有和无互相转化,难和易互相形成,长和短互相显现,高和下互相充实,音与声互相谐和,前和后互相接随——这是永恒的。因此圣人用无为的观点对待世事,用不言的方式施行教化:听任万物自然兴起而不为其创始,有所施为,但不加自己的倾向,功成业就而不自居。正由于不居功,就无所谓失去。</p>
<p> </p>
<p>[注释]</p>
<p>①恶已:恶、丑。已,通“矣”。</p>
<p>②斯:这。</p>
<p>③相:互相。</p>
<p>④刑:通“形”,此指比较、对照中显现出来的意思。</p>
<p>⑤盈:充实、补充、依存。</p>
<p>⑥音声:汉代郑玄为《礼记·乐记》作注时说,合奏出的乐音叫做“音”,单一发出的音响叫做“声”。</p>
<p>⑦圣人居无为之事:圣人,古时人所推崇的最高层次的典范人物。居,担当、担任。无为,顺应自然,不加干涉、不必管束,任凭人们去干事。</p>
<p>⑧作:兴起、发生、创造。</p>
<p>⑨弗志:弗,不。志,指个人的志向、意志、倾向。</p>
<p> </p>
<p>[延伸阅读1]王弼《道德经注》</p>
<p>天下皆知美之为美,斯恶已;皆知善之为善,斯不善已。故有无相生,难易相成,长短相较,高下相倾,音声相和,前后相随。<br>美者,人心之所进乐也。亚心者,人心之所恶疾也。美恶,犹喜怒也。善不善,犹是非也。喜怒同根,是非同门,故不可得徧举也。此六者,皆陈自然不可徧举之明数也。</p>
<p>是以圣人处无为之事,<br>自然已足,为则败也。</p>
<p>行不言之教。万物作焉而不辞,生而不有,为而不恃,<br>智慧自备,为则伪也。</p>
<p>功成而弗居。<br>因物而用,功自彼成,故不居也。</p>
<p>夫唯弗居,是以不去。<br>使功在己,则功不可久也。</p>
<p> </p>
<p>[延伸阅读2]苏辙《老子解》</p>
<p>天下皆知美之為美,斯惡矣;皆知善之為善,斯不善矣。故有無之相生,難易之相成,長短之相形,高下之相傾,聲音之相和,前後之相隨。<br>天下以形名言美惡,其所謂美且善者,豈信美且善哉。彼不知有無、難易、長短、高下、聲音、前後之相生相奪,皆非其正也。方且自以為長,而有長於我者臨之,斯則短矣。方且自以為前,而有前於我者先之,斯則後矣。苟從其所美而信之,則失之遠矣。</p>
<p>是以聖人處無為之事,行不言之教。<br>當事而為,無為之之心;當教而言,無言之之意。夫是以出於長短之度,離於先後之數,非美非惡,非善非不善,而天下何足以知之。</p>
<p>萬物作而不辭,生而不有,為而不恃,功成不居。<br>萬物為我作,而我無所辭。我生之為之,而未嘗有,未嘗恃。至於成功,亦未嘗以自居也。此則無為不言之報,其為美且善也,豈復有惡與不善繼之哉。 </p>
<p>夫惟不居,是以不去。<br>聖人居於貧賤而無貧賤之憂,居於富貴而無富貴之累,此所謂不居也。我且不居,彼尚何從去哉,此則居之至也。</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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2020/10/%E9%81%93%E5%8F%AF%E9%81%93%E9%9D%9E%E5%B8%B8%E9%81%93/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2020/10/%E9%81%93%E5%8F%AF%E9%81%93%E9%9D%9E%E5%B8%B8%E9%81%93/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2020-10-21 00:00:00 / 修改时间:01:05:23" itemprop="dateCreated datePublished" datetime="2020-10-21T00:00:00+08:00">2020-10-21</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E9%81%93%E5%BE%B7%E7%BB%8F/" itemprop="url" rel="index"><span itemprop="name">道德经</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>第一章<br>[原文]</p>
<p>道可道也①,非恒道也②。名可名也③,非恒名也。无名④,万物之始也;有名⑤,万物之母也⑥。故恒无欲也⑦,以观其眇⑧;恒有欲也,以观其所徼⑨。两者同出,异名同谓⑩。玄之又玄⑾,众眇之门⑿。</p>
<p> </p>
<p>[译文]</p>
<p>“道”如果可以用言语来表述,那它就是常“道”(“道”是可以用言语来表述的,它并非一般的“道”);“名”如果可以用文辞去命名,那它就是常“名”(“名”也是可以说明的,它并非普通的“名”)。“无”可以用来表述天地浑沌未开之际的状况;而“有”,则是宇宙万物产生之本原的命名。因此,要常从“无”中去观察领悟“道”的奥妙;要常从“有”中去观察体会“道”的端倪。无与有这两者,来源相同而名称相异,都可以称之为玄妙、深远。它不是一般的玄妙、深奥,而是玄妙又玄妙、深远又深远,是宇宙天地万物之奥妙的总门(从“有名”的奥妙到达无形的奥妙,“道”是洞悉一切奥妙变化的门径)。</p>
<p> </p>
<p>[注释]</p>
<p>①第一个“道”是名词,指的是宇宙的本原和实质,引申为原理、原则、真理、规律等。第二个“道”是动词。指解说、表述的意思,犹言“说得出”。<br>②恒:一般的,普通的。<br>③第一个“名”是名词,指“道”的形态。第二个“名”是动词,说明的意思。<br>④无名:指无形。<br>⑤有名:指有形。<br>⑥母:母体,根源。<br>⑦恒:经常。</p>
<p>⑧眇(miao):通妙,微妙的意思。<br>⑨徼(jiao):边际、边界。引申端倪的意思。<br>⑩谓:称谓。此为“指称”。<br>⑾玄:深黑色,玄妙深远的含义。<br>⑿门:之门,一切奥妙变化的总门径,此用来比喻宇宙万物的唯一原“道”的门径。</p>
<p> </p>
<p>[延伸阅读1]王弼《道德经注》</p>
<p>道可道,非常道,名可名,非常名。<br>可道之道,可名之名,指事造形,非其常也,故不可道,不可名也。</p>
<p>无名,天地之始;有名,万物之母。<br>凡有皆始於无,故未形无名之时,则为万物之始。及其有形有名之时,则长之育之,亭之毒之,为其母也。言道以无形无名,始成万物,以始以成,而不知其所以玄之又玄也。</p>
<p>故常无欲,以观其妙;<br>妙者,微之极也。万物始於微而后成,始於无而后生,故常无欲空虚,可以观其始物之妙。</p>
<p>常有欲,以观其徼。<br>徼,归终也。凡有之为利,必以无为用;欲之所本,适道而后济。故常有欲,可以观其终物之徼也。</p>
<p>此两者,同出而异名。同谓之玄,玄之又玄,众妙之门。<br>两者,始与母也。同出者,同出於玄也。异名所施,不可同也,在首则谓之始,在终则谓之母。玄者,冥也,默然无有也,始、母之所出也,不可得而名,故不可言。同名曰玄,而言同谓之玄者,取於不可得而谓之然也。谓之然则不可以定乎一玄而已,则是名则失之远矣,故曰玄之又玄也。众妙皆从同而出,故曰众妙之门也。</p>
<p> </p>
<p>[延伸阅读2]苏辙《老子解》</p>
<p>道可道,非常道。<br>莫非道也。而可道者不可常,惟不可道,而後可常耳。今夫仁義禮智,此道之可道者也。然而仁不可以為義,而禮不可以為智,可道之不可常如此。惟不可道,然後在仁為仁,在義為義,在禮為禮,在智為智。彼皆不常,而道常不變,不可道之能常如此。</p>
<p>名可名,非常名。<br>道不可道,而況可得而名之乎?凡名皆其可道者也。名既立,則圓方曲直之不同,不可常矣。</p>
<p>無名,天地之始;有名,萬物之母。常無,欲以觀其妙;常有,欲以觀其徼。<br>自其無名,形而為天地,天地位而名始立矣。自其有名,播而為萬物,萬物育而名不可勝載矣。故無名者道之體,而有名者道之甩也。聖人體道以為天下用,入於衆有而常無,將以觀其妙也。體其至無而常有,將以觀其徼也。若夫行於其徼而不知其妙,則粗而不神矣。留於其妙而不知其繳,則精而不遍矣。</p>
<p>此兩者,同出而異名,同謂之玄。<br>以形而言有無,則信兩矣。安知無運而為有,有復而為無,未嘗不一哉。其名雖異,其本則一,知本之一也,則玄矣。凡遠而無所至極者,其色又玄,故老子常以玄寄極也。玄之又玄,衆妙之門。言玄則至矣,然猶有玄之心在焉。玄之又玄則盡矣,不可以有加矣,衆妙之所從出也。</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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2018/11/Contenteditable/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2018/11/Contenteditable/" class="post-title-link" itemprop="url">Div Contenteditable 支持 Enter / Ctrl+Enter 换行</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2018-11-20 16:50:00 / 修改时间:17:10:49" itemprop="dateCreated datePublished" datetime="2018-11-20T16:50:00+08:00">2018-11-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E6%8A%80%E6%9C%AF/" itemprop="url" rel="index"><span itemprop="name">技术</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>网站找了不少代码,但总有点问题,最后拼拼凑凑,终于实现了。<br>模拟微信,支持Ctrl+Enter换行,Enter发送,测试环境win7+chrome,mac+chrome</p>
<p>核心部分代码如下,其他的代码可以点击示例查看:</p>
<figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br></pre></td><td class="code"><pre><span class="line">$(<span class="string">'div[contenteditable="true"]'</span>).<span class="title function_">keypress</span>(<span class="keyword">function</span>(<span class="params">e</span>) {</span><br><span class="line"></span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(e.<span class="property">keyCode</span>)</span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> (e.<span class="property">keyCode</span> == <span class="number">13</span> && !e.<span class="property">ctrlKey</span>) {</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">"enter"</span>)</span><br><span class="line"> e.<span class="title function_">preventDefault</span>();</span><br><span class="line"> <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line"> } <span class="keyword">else</span> <span class="keyword">if</span> (e.<span class="property">keyCode</span> == <span class="number">10</span> || (e.<span class="property">keyCode</span> == <span class="number">13</span> && e.<span class="property">ctrlKey</span>)) {</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(<span class="string">"ctrl + enter"</span>);</span><br><span class="line"> e.<span class="title function_">preventDefault</span>();</span><br><span class="line"></span><br><span class="line"> <span class="keyword">var</span> docFragment = <span class="variable language_">document</span>.<span class="title function_">createDocumentFragment</span>();</span><br><span class="line"></span><br><span class="line"> <span class="comment">//add a new line</span></span><br><span class="line"> <span class="keyword">var</span> newEle = <span class="variable language_">document</span>.<span class="title function_">createTextNode</span>(<span class="string">'\n'</span>);</span><br><span class="line"> docFragment.<span class="title function_">appendChild</span>(newEle);</span><br><span class="line"></span><br><span class="line"> <span class="comment">//add the br, or p, or something else</span></span><br><span class="line"> newEle = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'br'</span>);</span><br><span class="line"> docFragment.<span class="title function_">appendChild</span>(newEle);</span><br><span class="line"></span><br><span class="line"> <span class="comment">//make the br replace selection</span></span><br><span class="line"> <span class="keyword">var</span> range = <span class="variable language_">window</span>.<span class="title function_">getSelection</span>().<span class="title function_">getRangeAt</span>(<span class="number">0</span>);</span><br><span class="line"> range.<span class="title function_">deleteContents</span>();</span><br><span class="line"> range.<span class="title function_">insertNode</span>(docFragment);</span><br><span class="line"></span><br><span class="line"> <span class="comment">//create a new range</span></span><br><span class="line"> range = <span class="variable language_">document</span>.<span class="title function_">createRange</span>();</span><br><span class="line"> range.<span class="title function_">setStartAfter</span>(newEle);</span><br><span class="line"> range.<span class="title function_">collapse</span>(<span class="literal">true</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">//make the cursor there</span></span><br><span class="line"> <span class="keyword">var</span> sel = <span class="variable language_">window</span>.<span class="title function_">getSelection</span>();</span><br><span class="line"> sel.<span class="title function_">removeAllRanges</span>();</span><br><span class="line"> sel.<span class="title function_">addRange</span>(range);</span><br><span class="line"></span><br><span class="line"> <span class="keyword">return</span> <span class="literal">false</span>;</span><br><span class="line"> }</span><br><span class="line">}).<span class="title function_">keyup</span>(<span class="keyword">function</span>(<span class="params"></span>) {</span><br><span class="line"> <span class="keyword">if</span> (!<span class="variable language_">this</span>.<span class="property">lastChild</span> || <span class="variable language_">this</span>.<span class="property">lastChild</span>.<span class="property">nodeName</span>.<span class="title function_">toLowerCase</span>() != <span class="string">"br"</span>) {</span><br><span class="line"> <span class="variable language_">this</span>.<span class="title function_">appendChild</span>(<span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">"br"</span>));</span><br><span class="line"> }</span><br><span class="line">})</span><br></pre></td></tr></table></figure>
<p>Demo<br><a target="_blank" rel="noopener" href="http://jsfiddle.net/icaca/jDvau/592/">http://jsfiddle.net/icaca/jDvau/592/</a></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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2018/08/snmp4j%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2018/08/snmp4j%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3/" class="post-title-link" itemprop="url">SNMP4J 中文乱码问题解决</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2018-08-11 16:00:00" itemprop="dateCreated datePublished" datetime="2018-08-11T16:00:00+08:00">2018-08-11</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2018-11-21 13:07:15" itemprop="dateModified" datetime="2018-11-21T13:07:15+08:00">2018-11-21</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E6%8A%80%E6%9C%AF/" itemprop="url" rel="index"><span itemprop="name">技术</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>因为项目原因,用到了snmp trap,使用UDP 162端口来接收SNMP报警信息。<br>在显示中文和日期时会出现乱码,具体原因网上写的比较多,我就不做解释了。<br>从网上找了一部分代码,总有点问题,然后修修改改中文能显示了,但是遇到日期仍然有问题,然后又找了一部分代码,将其整合,终于解决了,先粘一下代码,后面如果改动了再作更新。</p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 处理SNMP事件</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">processPdu</span><span class="params">(CommandResponderEvent event)</span> {</span><br><span class="line"> System.out.println(<span class="string">"processPdu"</span>);</span><br><span class="line"></span><br><span class="line"> <span class="type">String</span> <span class="variable">version</span> <span class="operator">=</span> <span class="literal">null</span>;</span><br><span class="line"> <span class="type">String</span> <span class="variable">community</span> <span class="operator">=</span> <span class="literal">null</span>;</span><br><span class="line"> <span class="keyword">if</span> (event.getPDU().getType() == PDU.V1TRAP) {</span><br><span class="line"> version = <span class="string">"v1"</span>;</span><br><span class="line"> community = <span class="keyword">new</span> <span class="title class_">String</span>(event.getSecurityName());</span><br><span class="line"> } <span class="keyword">else</span> <span class="keyword">if</span> (event.getPDU().getType() == PDU.TRAP) {</span><br><span class="line"> <span class="keyword">if</span> (event.getSecurityModel() == <span class="number">2</span>) {</span><br><span class="line"> version = <span class="string">"v2"</span>;</span><br><span class="line"> community = <span class="keyword">new</span> <span class="title class_">String</span>(event.getSecurityName());</span><br><span class="line"> } <span class="keyword">else</span> {</span><br><span class="line"> version = <span class="string">"v3"</span>;</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="type">PDU</span> <span class="variable">pdu</span> <span class="operator">=</span> event.getPDU();</span><br><span class="line"></span><br><span class="line"> <span class="type">String</span> <span class="variable">output</span> <span class="operator">=</span> <span class="string">"SNMP:[IP = "</span> + event.getPeerAddress() + <span class="string">"]"</span>;</span><br><span class="line"> <span class="comment">// System.out.println(output);</span></span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> (event != <span class="literal">null</span> && event.getPDU() != <span class="literal">null</span>) {</span><br><span class="line"> Vector<VariableBinding> recVBs = (Vector<VariableBinding>) pdu.getVariableBindings();</span><br><span class="line"> <span class="keyword">for</span> (<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i < recVBs.size(); i++) {</span><br><span class="line"> <span class="type">VariableBinding</span> <span class="variable">recVB</span> <span class="operator">=</span> recVBs.elementAt(i);</span><br><span class="line"></span><br><span class="line"> <span class="type">String</span> <span class="variable">des</span> <span class="operator">=</span> OID.get(recVB.getOid().toString()) + <span class="string">" : "</span> + getChinese(recVB.getVariable().toString());</span><br><span class="line"> <span class="comment">// System.out.println(des);</span></span><br><span class="line"> output += <span class="string">"\n"</span> + des;</span><br><span class="line"></span><br><span class="line"> <span class="comment">// }</span></span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> System.out.println(output);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"> }</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// octetString 转 二进制</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">static</span> <span class="type">int</span>[] octetStringToBytes(String value_ipar) {</span><br><span class="line"> <span class="comment">// ---------------------------</span></span><br><span class="line"> <span class="comment">// Split string into its parts</span></span><br><span class="line"> <span class="comment">// ---------------------------</span></span><br><span class="line"> String[] bytes;</span><br><span class="line"> bytes = value_ipar.split(<span class="string">"[^0-9A-Fa-f]"</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// -----------------</span></span><br><span class="line"> <span class="comment">// Initialize result</span></span><br><span class="line"> <span class="comment">// -----------------</span></span><br><span class="line"> <span class="type">int</span>[] result;</span><br><span class="line"> result = <span class="keyword">new</span> <span class="title class_">int</span>[bytes.length];</span><br><span class="line"></span><br><span class="line"> <span class="comment">// -------------</span></span><br><span class="line"> <span class="comment">// Convert bytes</span></span><br><span class="line"> <span class="comment">// -------------</span></span><br><span class="line"> <span class="type">int</span> counter;</span><br><span class="line"> <span class="keyword">for</span> (counter = <span class="number">0</span>; counter < bytes.length; counter++)</span><br><span class="line"> result[counter] = Integer.parseInt(bytes[counter], <span class="number">16</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// ----</span></span><br><span class="line"> <span class="comment">// Done</span></span><br><span class="line"> <span class="comment">// ----</span></span><br><span class="line"> <span class="keyword">return</span> (result);</span><br><span class="line"></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// octetString 转 Date</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">static</span> Date <span class="title function_">octetStringToDate</span><span class="params">(String value_ipar)</span> <span class="keyword">throws</span> Exception {</span><br><span class="line"> <span class="comment">// ---------------------------</span></span><br><span class="line"> <span class="comment">// Convert into array of bytes</span></span><br><span class="line"> <span class="comment">// ---------------------------</span></span><br><span class="line"> <span class="type">int</span>[] bytes;</span><br><span class="line"> bytes = octetStringToBytes(value_ipar);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// -----------------------</span></span><br><span class="line"> <span class="comment">// Maybe nothing specified</span></span><br><span class="line"> <span class="comment">// -----------------------</span></span><br><span class="line"> <span class="keyword">if</span> (bytes[<span class="number">0</span>] == <span class="number">0</span>)</span><br><span class="line"> <span class="keyword">return</span> (<span class="literal">null</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// ------------------</span></span><br><span class="line"> <span class="comment">// Extract parameters</span></span><br><span class="line"> <span class="comment">// ------------------</span></span><br><span class="line"> <span class="type">int</span> year;</span><br><span class="line"> <span class="type">int</span> month;</span><br><span class="line"> <span class="type">int</span> day;</span><br><span class="line"> <span class="type">int</span> hour;</span><br><span class="line"> <span class="type">int</span> minute;</span><br><span class="line"> <span class="type">int</span> second;</span><br><span class="line"> <span class="type">int</span> <span class="variable">deci_sec</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line"> <span class="type">int</span> <span class="variable">offset</span> <span class="operator">=</span> <span class="number">0</span>;</span><br><span class="line"> year = (bytes[<span class="number">0</span>] * <span class="number">256</span>) + bytes[<span class="number">1</span>];</span><br><span class="line"> month = bytes[<span class="number">2</span>];</span><br><span class="line"> day = bytes[<span class="number">3</span>];</span><br><span class="line"> hour = bytes[<span class="number">4</span>];</span><br><span class="line"> minute = bytes[<span class="number">5</span>];</span><br><span class="line"> second = bytes[<span class="number">6</span>];</span><br><span class="line"> <span class="keyword">if</span> (bytes.length >= <span class="number">8</span>)</span><br><span class="line"> deci_sec = bytes[<span class="number">7</span>];</span><br><span class="line"> <span class="keyword">if</span> (bytes.length >= <span class="number">10</span>) {</span><br><span class="line"> offset = bytes[<span class="number">9</span>] * <span class="number">60</span>;</span><br><span class="line"> <span class="keyword">if</span> (bytes.length >= <span class="number">11</span>)</span><br><span class="line"> offset += bytes[<span class="number">10</span>];</span><br><span class="line"> <span class="keyword">if</span> (bytes[<span class="number">8</span>] == <span class="string">'-'</span>)</span><br><span class="line"> offset = -offset;</span><br><span class="line"> offset *= <span class="number">60</span> * <span class="number">1000</span>;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="comment">// ------------------------------------</span></span><br><span class="line"> <span class="comment">// Get current DST and time zone offset</span></span><br><span class="line"> <span class="comment">// ------------------------------------</span></span><br><span class="line"> Calendar calendar;</span><br><span class="line"> <span class="type">int</span> my_dst;</span><br><span class="line"> <span class="type">int</span> my_zone;</span><br><span class="line"> calendar = Calendar.getInstance();</span><br><span class="line"> my_dst = calendar.get(Calendar.DST_OFFSET);</span><br><span class="line"> my_zone = calendar.get(Calendar.ZONE_OFFSET);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// ----------------------------------</span></span><br><span class="line"> <span class="comment">// Compose result</span></span><br><span class="line"> <span class="comment">// Month to be converted into 0-based</span></span><br><span class="line"> <span class="comment">// ----------------------------------</span></span><br><span class="line"> calendar.clear();</span><br><span class="line"> calendar.set(Calendar.YEAR, year);</span><br><span class="line"> calendar.set(Calendar.MONTH, month - <span class="number">1</span>);</span><br><span class="line"> calendar.set(Calendar.DAY_OF_MONTH, day);</span><br><span class="line"> calendar.set(Calendar.HOUR_OF_DAY, hour);</span><br><span class="line"> calendar.set(Calendar.MINUTE, minute);</span><br><span class="line"> calendar.set(Calendar.SECOND, second);</span><br><span class="line"> calendar.set(Calendar.MILLISECOND, deci_sec * <span class="number">100</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// ---------</span></span><br><span class="line"> <span class="comment">// Reset DST</span></span><br><span class="line"> <span class="comment">// ---------</span></span><br><span class="line"> calendar.add(Calendar.MILLISECOND, my_dst);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// -----------------------------------------------------------------------------------</span></span><br><span class="line"> <span class="comment">// If the offset is set, we have to convert the time using the offset of</span></span><br><span class="line"> <span class="comment">// our time zone</span></span><br><span class="line"> <span class="comment">// -----------------------------------------------------------------------------------</span></span><br><span class="line"> <span class="keyword">if</span> (offset != <span class="number">0</span>) {</span><br><span class="line"> <span class="type">int</span> delta;</span><br><span class="line"> delta = my_zone - offset;</span><br><span class="line"> calendar.add(Calendar.MILLISECOND, delta);</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="comment">// -------------</span></span><br><span class="line"> <span class="comment">// Return result</span></span><br><span class="line"> <span class="comment">// -------------</span></span><br><span class="line"> <span class="keyword">return</span> (calendar.getTime());</span><br><span class="line"></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// octetString 转 中文</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">private</span> <span class="keyword">static</span> String <span class="title function_">getChinese</span><span class="params">(String variable)</span> {</span><br><span class="line"> <span class="type">String</span> <span class="variable">result</span> <span class="operator">=</span> variable;</span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> (!variable.contains(<span class="string">":"</span>)) {</span><br><span class="line"> <span class="keyword">return</span> result;</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> (variable.length() == <span class="number">23</span> || variable.length() == <span class="number">32</span>) {</span><br><span class="line"> <span class="keyword">try</span> {</span><br><span class="line"> <span class="keyword">return</span> format.format(octetStringToDate(variable));</span><br><span class="line"> } <span class="keyword">catch</span> (Exception e) {</span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"></span><br><span class="line"> <span class="keyword">if</span> (result.equals(variable)) {</span><br><span class="line"> <span class="keyword">try</span> {</span><br><span class="line"></span><br><span class="line"> String[] temps = variable.split(<span class="string">":"</span>);</span><br><span class="line"> <span class="type">byte</span>[] bs = <span class="keyword">new</span> <span class="title class_">byte</span>[temps.length];</span><br><span class="line"> <span class="keyword">for</span> (<span class="type">int</span> <span class="variable">i</span> <span class="operator">=</span> <span class="number">0</span>; i < temps.length; i++)</span><br><span class="line"> bs[i] = (<span class="type">byte</span>) Integer.parseInt(temps[i], <span class="number">16</span>);</span><br><span class="line"> result = <span class="keyword">new</span> <span class="title class_">String</span>(bs, <span class="string">"utf-8"</span>);</span><br><span class="line"> } <span class="keyword">catch</span> (Exception ex) {</span><br><span class="line"></span><br><span class="line"> }</span><br><span class="line"> }</span><br><span class="line"> <span class="keyword">return</span> result;</span><br><span class="line"></span><br><span class="line">}</span><br></pre></td></tr></table></figure>
<p>参考网址:<br><a target="_blank" rel="noopener" href="http://www.cnblogs.com/yuanfy008/p/8046189.html">http://www.cnblogs.com/yuanfy008/p/8046189.html</a><br><a target="_blank" rel="noopener" href="https://blog.csdn.net/appletreesujie/article/details/50752065">https://blog.csdn.net/appletreesujie/article/details/50752065</a><br><a target="_blank" rel="noopener" href="https://forum.huawei.com/enterprise/zh/thread-429027.html">https://forum.huawei.com/enterprise/zh/thread-429027.html</a><br><a target="_blank" rel="noopener" href="http://www.mibdepot.com/cgi-bin/getmib3.cgi?win=mib_a&i=1&n=MSEA-MIB&r=johnsoncontrols&f=msea.mi2&v=v2&t=tree">http://www.mibdepot.com/cgi-bin/getmib3.cgi?win=mib_a&i=1&n=MSEA-MIB&r=johnsoncontrols&f=msea.mi2&v=v2&t=tree</a></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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2016/09/Play-Framework1-4-2%E5%BC%95%E5%85%A5MariaDB%E4%BD%BF%E7%94%A8utf8mb4%E7%BC%96%E7%A0%81/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2016/09/Play-Framework1-4-2%E5%BC%95%E5%85%A5MariaDB%E4%BD%BF%E7%94%A8utf8mb4%E7%BC%96%E7%A0%81/" class="post-title-link" itemprop="url">Play Framework1.4.2引入MariaDB使用utf8mb4编码</a>
</h2>
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2016-09-16 00:32:53" itemprop="dateCreated datePublished" datetime="2016-09-16T00:32:53+08:00">2016-09-16</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2018-12-29 21:29:09" itemprop="dateModified" datetime="2018-12-29T21:29:09+08:00">2018-12-29</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E6%8A%80%E6%9C%AF/" itemprop="url" rel="index"><span itemprop="name">技术</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>最近挺忙的,一直没时间做其他事情,这两天好不容易解决了几个问题,于是把问题的经过整理一下,希望遇到类似问题的小伙伴能快速解决。</p>
<p>步骤一:Play Framework引入MariaDB,这个相对简单,只要从maven上下载一个类库然后修改application.conf即可。</p>
<figure class="highlight apacheconf"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">db</span>.default.url=jdbc:mariadb://ip/db?useUnicode=yes&characterEncoding=utf8mb4&connectionCollation=utf8mb4_general_ci&zeroDateTimeBehavior=convertToNull</span><br><span class="line"><span class="attribute">db</span>.default.driver=org.mariadb.jdbc.Driver</span><br><span class="line"><span class="attribute">db</span>.default.user= 用户</span><br><span class="line"><span class="attribute">db</span>.default.pass= 密码</span><br><span class="line"><span class="attribute">jpa</span>.default.dialect=org.hibernate.dialect.MySQLDialect</span><br></pre></td></tr></table></figure>
<p>最后一句不加的话,play!运行的时候会报错。<br>步骤二:接下来就是修改MariaDB的编码了。 </p>
<figure class="highlight apacheconf"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">vim</span> /etc/my.cnf </span><br><span class="line"> </span><br><span class="line">[<span class="attribute">client</span>] </span><br><span class="line"><span class="attribute">default</span>-character-set = utf8mb4 </span><br><span class="line"> </span><br><span class="line">[<span class="attribute">mysql</span>] </span><br><span class="line"><span class="attribute">default</span>-character-set = utf8mb4 </span><br><span class="line"> </span><br><span class="line">[<span class="attribute">mysqld</span>] </span><br><span class="line"><span class="attribute">init</span>-connect='SET NAMES utf8mb4' </span><br><span class="line"><span class="attribute">collation_server</span>=utf8mb4_unicode_ci </span><br><span class="line"><span class="attribute">character_set_server</span>=utf8mb4 </span><br><span class="line"><span class="attribute">character</span>-set-client-handshake = FALSE</span><br></pre></td></tr></table></figure>
<p>重启mysqld,service mysqld restart,查看是否生效</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">mysql> SHOW VARIABLES WHERE Variable_name LIKE <span class="string">'character\_set\_%'</span> OR Variable_name LIKE <span class="string">'collation%'</span>; </span><br><span class="line">+--------------------------+--------------------+ </span><br><span class="line">| Variable_name | Value | </span><br><span class="line">+--------------------------+--------------------+ </span><br><span class="line">| character_set_client | utf8mb4 | </span><br><span class="line">| character_set_connection | utf8mb4 | </span><br><span class="line">| character_set_database | utf8mb4 | </span><br><span class="line">| character_set_filesystem | binary | </span><br><span class="line">| character_set_results | utf8mb4 | </span><br><span class="line">| character_set_server | utf8mb4 | </span><br><span class="line">| character_set_system | utf8 | </span><br><span class="line">| collation_connection | utf8mb4_unicode_ci | </span><br><span class="line">| collation_database | utf8mb4_unicode_ci | </span><br><span class="line">| collation_server | utf8mb4_unicode_ci | </span><br><span class="line">+--------------------------+--------------------+ </span><br><span class="line">10 rows <span class="keyword">in</span> <span class="built_in">set</span> (0.00 sec) </span><br></pre></td></tr></table></figure>
<p>步骤三:就是将之前的数据表都刷成utf8mb4_unicode_ci编码</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">ALTER</span> SCHEMA `db` <span class="keyword">DEFAULT</span> <span class="keyword">COLLATE</span> utf8mb4_general_ci ; </span><br><span class="line"><span class="keyword">SELECT</span> CONCAT(<span class="string">'alter table '</span>,table_name,<span class="string">' CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;'</span>) <span class="keyword">FROM</span> INFORMATION_SCHEMA.tables </span><br><span class="line"><span class="keyword">WHERE</span> TABLE_SCHEMA<span class="operator">=</span><span class="string">'库名'</span> <span class="keyword">and</span> table_type<span class="operator">=</span><span class="string">'BASE TABLE'</span> <span class="keyword">into</span> outfile <span class="string">'/data/altertable.sql'</span>;</span><br></pre></td></tr></table></figure>
<p>这个语句可以生成语句,然后在mysql中执行即可</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">mysql -u用户名 -p表名 实力名称 < /data/altertable.sql</span><br></pre></td></tr></table></figure>
<p>字段类型的修改可以参考下方语句</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">SELECT</span> CONCAT(<span class="string">'ALTER TABLE `'</span>, table_name, <span class="string">'` MODIFY `'</span>, column_name, <span class="string">'` '</span>, DATA_TYPE, <span class="string">'('</span>, CHARACTER_MAXIMUM_LENGTH, <span class="string">') CHARACTER SET UTF8 COLLATE utf8_general_ci'</span>, (<span class="keyword">CASE</span> <span class="keyword">WHEN</span> IS_NULLABLE <span class="operator">=</span> <span class="string">'NO'</span> <span class="keyword">THEN</span> <span class="string">' NOT NULL'</span> <span class="keyword">ELSE</span> <span class="string">''</span> <span class="keyword">END</span>), <span class="string">';'</span>)<span class="keyword">FROM</span> information_schema.COLUMNS <span class="keyword">WHERE</span> TABLE_SCHEMA <span class="operator">=</span> <span class="string">'库名'</span> <span class="keyword">AND</span> DATA_TYPE <span class="operator">=</span> <span class="string">'varchar'</span> <span class="keyword">AND</span> (</span><br><span class="line"> CHARACTER_SET_NAME <span class="operator">!=</span> <span class="string">'utf8'</span></span><br><span class="line"> <span class="keyword">OR</span></span><br><span class="line"> COLLATION_NAME <span class="operator">!=</span> <span class="string">'utf8_general_ci'</span>) ;</span><br></pre></td></tr></table></figure>
<p>至此,所有的操作都已完成。</p>
<p>参考网址:<br><a target="_blank" rel="noopener" href="https://mathiasbynens.be/notes/mysql-utf8mb4">https://mathiasbynens.be/notes/mysql-utf8mb4</a><br><a target="_blank" rel="noopener" href="http://blog.flect.co.jp/labo/2012/07/playmysql-283f.html">http://blog.flect.co.jp/labo/2012/07/playmysql-283f.html</a></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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2016/09/%E6%B1%82%E5%85%A8%E4%B9%8B%E6%AF%81,%E4%B8%8D%E8%99%9E%E4%B9%8B%E9%9A%99/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2016/09/%E6%B1%82%E5%85%A8%E4%B9%8B%E6%AF%81,%E4%B8%8D%E8%99%9E%E4%B9%8B%E9%9A%99/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2016-09-01 15:46:56" itemprop="dateCreated datePublished" datetime="2016-09-01T15:46:56+08:00">2016-09-01</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2016-09-02 15:13:58" itemprop="dateModified" datetime="2016-09-02T15:13:58+08:00">2016-09-02</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E5%A4%A7%E9%81%93%E8%87%B3%E7%AE%80/" itemprop="url" rel="index"><span itemprop="name">大道至简</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2016/07/%E5%BD%93%E2%80%9C%E9%B2%B6%E9%B1%BC%E6%95%88%E5%BA%94%E2%80%9D%E9%81%AD%E9%81%87%E2%80%9C%E5%8A%A3%E5%B8%81%E9%A9%B1%E9%80%90%E8%89%AF%E5%B8%81%E2%80%9D/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2016/07/%E5%BD%93%E2%80%9C%E9%B2%B6%E9%B1%BC%E6%95%88%E5%BA%94%E2%80%9D%E9%81%AD%E9%81%87%E2%80%9C%E5%8A%A3%E5%B8%81%E9%A9%B1%E9%80%90%E8%89%AF%E5%B8%81%E2%80%9D/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2016-07-26 09:37:34 / 修改时间:09:39:14" itemprop="dateCreated datePublished" datetime="2016-07-26T09:37:34+08:00">2016-07-26</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E5%A4%A7%E9%81%93%E8%87%B3%E7%AE%80/" itemprop="url" rel="index"><span itemprop="name">大道至简</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>稍微有点管理常识的网友对下面的“鲶鱼效应”都不会陌生:</p>
<p>“爱吃鲜活沙丁鱼的挪威人曾经一直为它们在长途航行中的大量死亡而苦恼不已,直到某一位聪明的渔民率先想出了用几条活泼好动的鲶鱼去刺激一船懒惰的沙丁鱼的妙招后,问题才迎刃而解”。</p>
<p>“鲶鱼效应”的理念虽然在中国企业的团队培育中备受推崇,但缘于“目的不明,激励不足,职责不清,考核不到”等诸多因素的存在,结果却大跌眼球。活泼的鲶鱼不仅激活不了懒惰的沙丁鱼,而且注定要被淹死在它们的唾沫星子里,劣币驱逐良币。</p>
<p>首先是目的不明。</p>
<p>众多中国企业之所以卖力地鼓吹团队精神,其初衷决不是为着如欧美同行那样,强调基于沟通、协作、授权和分享的效益提升,而是因为他们看到了一个“团”字,就想当然地将团队当作团结来提倡。</p>
<p>团结和团队虽只一字之差,但意思却貌合神离,相距甚远。特别是在中国特殊的语境之下,团结主要是指自觉地与领导保持一致,尊重上级,服从命令听指挥,不允许有不同意见等。</p>
<p>偏离了以提升效率为目的团队建设无疑会本末倒置。这时,有没有创新精神不重要,重要的是不能因为说“不”,让同事没有了面子;任务完成得好坏不重要,重要的是你好我好大家好地保持一团和气;工作积极性高低不重要,重要的是不能让大家感到你咄咄逼人。</p>
<p>不用说,活泼好动的鲶鱼,一朝进入了如此这般的团队,懒惰的沙丁鱼们将如何反应亦可想而知。诸如“严重地脱离群众、工作作风粗暴、个人英雄主义作怪,急功近利,自以为是,骄傲自满”等一句句冷嘲热讽,一支支明枪暗箭很快会铺天盖地而来,势单力薄的鲶鱼除了落荒而逃又能怎样?劣币驱逐良币。</p>
<p>其次是激励不足。</p>
<p>老板尽管情真意切地指望靠引进鲶鱼型人才来激发整个团队的活力和效率,但囿于偏颇的利益视角,即使在团队的活力提升、效率提高后,也不肯给予任何的激励。只想要马儿跑,马儿跑得快,就是不想给马儿吃草。</p>
<p>被激活起来的,比之前多付出的沙丁鱼们一看投入得不到回报当然要心有不平。虽然不敢、不能怪罪于老板,但气撒在老板引进过来的鲶鱼身上,让鲶鱼代不明事理的老板受过总可以吧?</p>
<p>于是乎,沙丁鱼们相互心领神会,心有灵犀一点通,立即像泄了气的皮球,消极怠工起来。老板眼看效率下降,心急如焚。“要你鲶鱼何用,还不快快继续给我整”?</p>
<p>这时的鲶鱼如果仍然不识相,仍然要待在那儿幻想沙丁鱼们能再次被他激活,那只有与大伙一步步交恶,直到势不两立的份。</p>
<p>势不两立可不行呀!老板会想要你鲶鱼来激活大家,不是要你来得罪大家。现在大家都容不下你了,我也不能为了你区区几条鲶鱼而倒掉一船沙丁鱼呀?劣币驱逐良币。</p>
<p>再次是职责不清。</p>
<p>职责不清意味着什么?</p>
<p>意味着虽不是企业里所有的事,如薪资报酬,但一定是大多数的事、琐事、杂事,所有人都该管。</p>
<p>意味着相当多的中国企业老板都希望一人多专,一人多能,驾驶员兼文秘兼保安兼来宾接待兼采购兼物资搬运┅┅,最好是一个人能把所有的事都包揽下来;希望每个员工都能不计报酬,争先恐后地抢着干;希望通过他倡导的企业奉献文化、感恩文化让每个员工都变成企业里的雷锋、焦裕禄,是神不是人。</p>
<p>意味着当老板的希望在并非是神的雷锋、焦裕禄员工那儿落空时,当老板准备通过引进报酬相对高出许多的鲶鱼来激活懒惰的沙丁鱼时,敢怒而不敢言的沙丁鱼们能够巧钻职责不清的空子,变着法子,绕着弯子,兜着圈子地与鲶鱼进行软对抗。</p>
<p>意味着最后除了人人争抢的好事,其他所有的难事、烦心事、吃力不讨好的事、人人避之唯恐不及的事都得有鲶鱼做。多做多错,到头来所有的责任还得由鲶鱼一个人扛起来。“谁叫他或她收入比我们多,地位比我们高呢?他或她不下地狱谁下,活该!”劣币驱逐良币。</p>
<p>第四是考核不到。</p>
<p>一边是享有了较高报酬的鲶鱼为了向老板证明自己的价值,不得不绞尽脑汁,千方百计地去激活沙丁鱼,弄得大家鸡犬不宁,寝食难安;一边是职责不清没法考核或没有考核或考核不得要领,无法准确反应各人的工作能力与绩效,干多干少看不清,干与不干也看不出。</p>
<p>每个人都说自己好,思想好,品德好,工作好,劳苦功高;有成绩都是自己的,有问题都是别人、别的部门,都怪他们不肯配合,不肯为自己创造必要的成功条件。</p>
<p>春风得意马蹄轻的都是“外交家”,四平八稳、四处讨好、八面玲珑,面面俱到,从不肯当头阵,只栽花为栽刺,说话模棱两可,干活似干非干,懵懵做公爵。</p>
<p>门庭冷落车马稀的都是“实干家”,说实在话,做实才事,真心为老板着想,眼睛里掺不进一点沙子,对事不对人,不管是老板的什么人,有错必纠,不留一点情面,把人都得罪光了。</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-CHS">
<link itemprop="mainEntityOfPage" href="https://www.icaca.net/2016/07/%E6%9C%89%E9%81%93%E6%97%A0%E6%9C%AF%EF%BC%8C%E6%9C%AF%E5%B0%9A%E5%8F%AF%E6%B1%82%EF%BC%9B%E6%9C%89%E6%9C%AF%E6%97%A0%E9%81%93%EF%BC%8C%E6%AD%A2%E4%BA%8E%E6%9C%AF%E3%80%82/">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.gif">
<meta itemprop="name" content="https://www.icaca.net">
<meta itemprop="description" content="一个关注技术和创新的博客">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="caca's Blog">
</span>
<header class="post-header">
<h2 class="post-title" itemprop="name headline">
<a href="/2016/07/%E6%9C%89%E9%81%93%E6%97%A0%E6%9C%AF%EF%BC%8C%E6%9C%AF%E5%B0%9A%E5%8F%AF%E6%B1%82%EF%BC%9B%E6%9C%89%E6%9C%AF%E6%97%A0%E9%81%93%EF%BC%8C%E6%AD%A2%E4%BA%8E%E6%9C%AF%E3%80%82/" 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="fa fa-calendar-o"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2016-07-20 10:58:48" itemprop="dateCreated datePublished" datetime="2016-07-20T10:58:48+08:00">2016-07-20</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-calendar-check-o"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2016-07-22 16:18:17" itemprop="dateModified" datetime="2016-07-22T16:18:17+08:00">2016-07-22</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="fa fa-folder-o"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E5%A4%A7%E9%81%93%E8%87%B3%E7%AE%80/" itemprop="url" rel="index"><span itemprop="name">大道至简</span></a>
</span>
</span>
</div>
</header>
<div class="post-body" itemprop="articleBody">
</div>
<footer class="post-footer">
<div class="post-eof"></div>
</footer>
</article>
<nav class="pagination">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="extend next" rel="next" href="/page/2/"><i class="fa fa-angle-right" aria-label="下一页"></i></a>
</nav>
</div>
<script>
window.addEventListener('tabs:register', () => {
let { activeClass } = CONFIG.comments;
if (CONFIG.comments.storage) {
activeClass = localStorage.getItem('comments_active') || activeClass;
}
if (activeClass) {
let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
if (activeTab) {
activeTab.click();
}
}
});
if (CONFIG.comments.storage) {
window.addEventListener('tabs:click', event => {
if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
let commentClass = event.target.classList[1];
localStorage.setItem('comments_active', commentClass);