-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.xml
1407 lines (1407 loc) · 348 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>jdhao's digital space</title><link>https://jdhao.github.io/</link><description>Recent content on jdhao's digital space</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>© 2017 - 2025 ❤️ jdhao</copyright><lastBuildDate>Sun, 02 Feb 2025 15:53:14 +0100</lastBuildDate><atom:link href="https://jdhao.github.io/index.xml" rel="self" type="application/rss+xml"/><item><title>About</title><link>https://jdhao.github.io/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://jdhao.github.io/about/</guid><description>Welcome to my personal website! I am glad to hear what brings you here. Do not hesitate to share in the comment below! Who am I? # Hi, I am jdhao, a machine learning engineer who is passionate about working with computer vision. I am experienced in tools like NumPy, OpenCV, and PIL, and also in data visualization tools like Matplotlib. I have broad experiences working on various vision-related projects,</description></item><item><title>家常烤箱烤鸡腿</title><link>https://jdhao.github.io/2025/02/02/oven-roasted-chicken/</link><pubDate>Sun, 02 Feb 2025 15:53:14 +0100</pubDate><guid>https://jdhao.github.io/2025/02/02/oven-roasted-chicken/</guid><description><p>这次来总结一下烤箱烤鸡腿的做法。</p></description></item><item><title>Comparison between Several Desktop Speakers</title><link>https://jdhao.github.io/2025/01/23/kanto_speakers_comparison/</link><pubDate>Thu, 23 Jan 2025 22:41:32 +0100</pubDate><guid>https://jdhao.github.io/2025/01/23/kanto_speakers_comparison/</guid><description><p>In this post, I would like to compare several speakers that are relatively small in size and are suitable as desktop speakers.</p></description></item><item><title>How to Use luarocks Package in Neovim</title><link>https://jdhao.github.io/2024/12/11/how_to_use_luarocks_package_in_neovim/</link><pubDate>Wed, 11 Dec 2024 19:20:15 +0100</pubDate><guid>https://jdhao.github.io/2024/12/11/how_to_use_luarocks_package_in_neovim/</guid><description><p>Although neovim has built a lot of modules to ease the use of Lua,
sometimes we may still want to use some packages from <a href="https://luarocks.org/" target="_blank">Luarocks</a>.
In this post, I would like to share how you can install a package from Luarocks and use it in nvim.</p></description></item><item><title>Macbook 外接显示器</title><link>https://jdhao.github.io/2024/12/04/external_monitor_for_macbook/</link><pubDate>Wed, 04 Dec 2024 01:00:01 +0100</pubDate><guid>https://jdhao.github.io/2024/12/04/external_monitor_for_macbook/</guid><description><p>最近趁着黑五入手了外接显示器,顺便了解了一下显示器相关的各种标准和技术,本文做一个总结。</p></description></item><item><title>家常萝卜炖羊排</title><link>https://jdhao.github.io/2024/11/29/radish_mutton_stew/</link><pubDate>Fri, 29 Nov 2024 23:31:57 +0100</pubDate><guid>https://jdhao.github.io/2024/11/29/radish_mutton_stew/</guid><description><p>寒冷的冬天,和羊肉汤更配。</p></description></item><item><title>Run the Job Immediately after Starting Scheduler in Python APScheduler</title><link>https://jdhao.github.io/2024/11/02/python_apascheduler_start_job_immediately/</link><pubDate>Sat, 02 Nov 2024 00:36:33 +0100</pubDate><guid>https://jdhao.github.io/2024/11/02/python_apascheduler_start_job_immediately/</guid><description><p>When using APScheduler package in Python, I want to run the scheduled job right after I start the scheduler.
How can I do it properly?</p></description></item><item><title>Retry for Google Cloud Client</title><link>https://jdhao.github.io/2024/10/08/gcloud_client_retry/</link><pubDate>Tue, 08 Oct 2024 23:28:16 +0200</pubDate><guid>https://jdhao.github.io/2024/10/08/gcloud_client_retry/</guid><description><p>When we use one of the google cloud python clients to communicate with GCP,
there may be errors occurring sometime calling the client API methods.</p></description></item><item><title>菜谱:土豆金枪鱼沙拉</title><link>https://jdhao.github.io/2024/10/02/potato_tuna_salad/</link><pubDate>Wed, 02 Oct 2024 18:59:56 +0200</pubDate><guid>https://jdhao.github.io/2024/10/02/potato_tuna_salad/</guid><description><p>今天来总结一下土豆金枪鱼沙拉的做法。</p></description></item><item><title>菜谱:椰香咖喱鸡</title><link>https://jdhao.github.io/2024/09/26/coco_milk_curry_chicken/</link><pubDate>Thu, 26 Sep 2024 22:47:09 +0200</pubDate><guid>https://jdhao.github.io/2024/09/26/coco_milk_curry_chicken/</guid><description><p>本次来总结一下椰汁咖喱鸡的做法。</p></description></item><item><title>凉拌绿豆宽粉制作</title><link>https://jdhao.github.io/2024/09/23/lv_dou_kuan_fen_salad/</link><pubDate>Mon, 23 Sep 2024 21:40:13 +0200</pubDate><guid>https://jdhao.github.io/2024/09/23/lv_dou_kuan_fen_salad/</guid><description><p>本次来总结凉拌绿豆宽粉的做法。</p></description></item><item><title>Make Python logging Work in GCP</title><link>https://jdhao.github.io/2024/09/20/python_logging_in_gcp/</link><pubDate>Fri, 20 Sep 2024 18:30:19 +0200</pubDate><guid>https://jdhao.github.io/2024/09/20/python_logging_in_gcp/</guid><description><p>When deploying a Python application to GCP Kuberntes Engine,
we may see issues that the <a href="https://stackoverflow.com/q/75361466/6064933" target="_blank">logging level is not correct</a> in the cloud logging explorer.
In order for the <a href="https://docs.python.org/3/library/logging.html" target="_blank">Python logging package</a> to work with GCP, we need some additional configurations.</p></description></item><item><title>Liveness and Readiness Check in Kubernetes</title><link>https://jdhao.github.io/2024/09/20/kubernetes_liveness_readiness_check/</link><pubDate>Fri, 20 Sep 2024 18:27:14 +0200</pubDate><guid>https://jdhao.github.io/2024/09/20/kubernetes_liveness_readiness_check/</guid><description>Readiness and Liveness probe # The readiness probe checks if the service in pod can accept traffic. Kubernetes will remove the pod if the readiness probe fails.
The liveness probe is used to check whether the pod is still alive and functioning. If the liveness check fails, the pod will be restarted by Kubernetes.
Types of readiness and liveness probe # We can use HTTP, command or TCP probe.
Get configuration for liveness and readiness # We can run the following command to get the pod configuration:</description></item><item><title>Notes on Using GCP Logging</title><link>https://jdhao.github.io/2024/09/16/gcp_logging_notes/</link><pubDate>Mon, 16 Sep 2024 23:23:44 +0200</pubDate><guid>https://jdhao.github.io/2024/09/16/gcp_logging_notes/</guid><description>Use the SEARCH() function with care # In the GCP Log Explorer, if you type some thing in the search bar without quote, the SEARCH() method is used.
The SEARCH() function is case insensitive. Note also that SEARCH() function uses text analyzer to tokenize the string. The SEARCH() function performs exact matches, not partial matching. So SEARCH(&quot;world&quot;) will not be able to match worldwide. Another example, suppose in some of the log entries, you may have &ldquo;today is 202408180429&rdquo;, if you use SEARCH(&quot;20240818&quot;), you will find nothing matching, which you may not expect.</description></item><item><title>西班牙土豆饼制作</title><link>https://jdhao.github.io/2024/09/12/potato_omelette_spanish_style/</link><pubDate>Thu, 12 Sep 2024 22:27:19 +0200</pubDate><guid>https://jdhao.github.io/2024/09/12/potato_omelette_spanish_style/</guid><description><p>本次来复刻一下在网上看到的西班牙土豆饼。</p></description></item><item><title>Elasticsearch Version Conflict Error</title><link>https://jdhao.github.io/2024/09/11/elasticsearch_version_conflict_error/</link><pubDate>Wed, 11 Sep 2024 21:36:04 +0200</pubDate><guid>https://jdhao.github.io/2024/09/11/elasticsearch_version_conflict_error/</guid><description><p>The version conflict error is often seen when doing document indexing operations in Elasticsearch.</p></description></item><item><title>How to Use the Elasticsearch task API</title><link>https://jdhao.github.io/2024/08/15/elasticsearch_task_api/</link><pubDate>Thu, 15 Aug 2024 22:26:59 +0200</pubDate><guid>https://jdhao.github.io/2024/08/15/elasticsearch_task_api/</guid><description><p>In Elasticsearch (ES), you can run a task and check its status with the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html" target="_blank">task API</a>.
For example, if you use the <code>reindex</code> API in ES with parameter <code>with_for_completion=False</code>,
ES will not wait for the process to finish and will return a task instead.</p></description></item><item><title>Speed up document indexing in Elasticsearch via bulk indexing</title><link>https://jdhao.github.io/2024/07/26/elasticsearch_bulk_indexing/</link><pubDate>Fri, 26 Jul 2024 20:04:57 +0200</pubDate><guid>https://jdhao.github.io/2024/07/26/elasticsearch_bulk_indexing/</guid><description><p>In Elasticsearch, there is <a href="https://elasticsearch-py.readthedocs.io/en/v8.14.0/api/elasticsearch.html#elasticsearch.Elasticsearch.index" target="_blank">index API</a> where you can index a single document to an index.</p></description></item><item><title>Index refresh issue in Elasticsearch</title><link>https://jdhao.github.io/2024/07/24/elasticsearch_doc_count_not_correct/</link><pubDate>Wed, 24 Jul 2024 20:50:51 +0200</pubDate><guid>https://jdhao.github.io/2024/07/24/elasticsearch_doc_count_not_correct/</guid><description><p>Recently when I was working with Elasticsearch, I found this weird issue that the document count for the newly created index is not correct.
Also there are problems with reindex, if you reindex the source index to dst index, there is nothing in the dst index despite no errors.</p></description></item><item><title>Google Cloud Storage Usage</title><link>https://jdhao.github.io/2024/07/10/gcloud_storage_usage/</link><pubDate>Wed, 10 Jul 2024 22:42:29 +0200</pubDate><guid>https://jdhao.github.io/2024/07/10/gcloud_storage_usage/</guid><description><p>Some notes on using the <a href="https://cloud.google.com/storage/docs/introduction#quickstarts" target="_blank">Google Cloud storage</a>.</p></description></item><item><title>家常煎羊排制作</title><link>https://jdhao.github.io/2024/04/09/pan-fried-lamb-chops/</link><pubDate>Tue, 09 Apr 2024 23:02:47 +0200</pubDate><guid>https://jdhao.github.io/2024/04/09/pan-fried-lamb-chops/</guid><description><p>在德国的德超很少能见到羊肉,不过在土耳其超市可以很方便买到羊肉。
本期我来做一个煎羊排,之所以不是因为烤羊排是因为我没有合适的烤盘和锡箔纸,所以没有尝试。</p></description></item><item><title>凉拌茄子制作</title><link>https://jdhao.github.io/2024/04/09/eggplant_salad/</link><pubDate>Tue, 09 Apr 2024 22:33:44 +0200</pubDate><guid>https://jdhao.github.io/2024/04/09/eggplant_salad/</guid><description><p>本文简单总结凉拌茄子的制作方法。</p></description></item><item><title>Configure Python logging with dictConfig</title><link>https://jdhao.github.io/2024/03/11/python-logging-dictconfig/</link><pubDate>Mon, 11 Mar 2024 23:30:24 +0100</pubDate><guid>https://jdhao.github.io/2024/03/11/python-logging-dictconfig/</guid><description><p>Apart from directly configuring the Python logging in the code itself.
We can also configuring the logging using <a href="https://docs.python.org/3/library/logging.config.html#logging.config.fileConfig" target="_blank">fileConfig</a> or <a href="https://docs.python.org/3/library/logging.config.html#logging.config.dictConfig" target="_blank">dictConfig</a>.</p></description></item><item><title>Debugging Wezterm Issues</title><link>https://jdhao.github.io/2024/02/26/debug_wezterm_issue/</link><pubDate>Mon, 26 Feb 2024 23:32:57 +0100</pubDate><guid>https://jdhao.github.io/2024/02/26/debug_wezterm_issue/</guid><description><p>A short summary on how to debug <a href="https://wezfurlong.org/wezterm/index.html" target="_blank">Wezterm</a> issues.</p></description></item><item><title>Black Formatter Setup for Python Project</title><link>https://jdhao.github.io/2024/02/22/black_formatter_setup/</link><pubDate>Thu, 22 Feb 2024 22:55:02 +0100</pubDate><guid>https://jdhao.github.io/2024/02/22/black_formatter_setup/</guid><description><p>This post is about how to set up <a href="https://github.com/psf/black" target="_blank">black</a>, the popular code formatter for Python projects.</p></description></item><item><title>Git line ending config</title><link>https://jdhao.github.io/2024/02/21/git_line_ending_config/</link><pubDate>Wed, 21 Feb 2024 23:11:43 +0100</pubDate><guid>https://jdhao.github.io/2024/02/21/git_line_ending_config/</guid><description><p>This post is about how to set up Git so that people using different operating systems can work in the same repository,
without messing up the line ending of source files.</p></description></item><item><title>Garmin Forerunner 965 Essential Tips and Setups</title><link>https://jdhao.github.io/2024/02/04/garmin_forrunner_setup/</link><pubDate>Sun, 04 Feb 2024 20:46:34 +0100</pubDate><guid>https://jdhao.github.io/2024/02/04/garmin_forrunner_setup/</guid><description><p>In this post, I want to share a list of tips/setups for the Garmin Forerunner 965 watch.
Some of the settings are also applicable to other Garmin watches.</p></description></item><item><title>How to Download Files from Google Cloud Storage in the Databricks Workspace Notebook</title><link>https://jdhao.github.io/2023/11/21/databricks-notebook-gcloud-storage-download/</link><pubDate>Tue, 21 Nov 2023 23:56:36 +0100</pubDate><guid>https://jdhao.github.io/2023/11/21/databricks-notebook-gcloud-storage-download/</guid><description><p>In this post, I want to share the complete process and setup to download files from GCP in a Databricks workspace notebook.
Since the notebook itself is non-interactive when you run the shell command,
the setup process is a bit different from the normal GCP authentication.</p></description></item><item><title>Databricks Cli Usage</title><link>https://jdhao.github.io/2023/11/21/databricks-cli-usage/</link><pubDate>Tue, 21 Nov 2023 23:49:06 +0100</pubDate><guid>https://jdhao.github.io/2023/11/21/databricks-cli-usage/</guid><description><p>We can use the <a href="https://learn.microsoft.com/en-us/azure/databricks/dev-tools/cli/" target="_blank">Databricks cli</a> to interact with Databricks workspaces programmatically on the command line.
In this post, I want to share simple usage about Databricks cli.</p></description></item><item><title>Working with Databricks Workspace Files</title><link>https://jdhao.github.io/2023/11/18/databricks-workspace-files/</link><pubDate>Sat, 18 Nov 2023 22:34:20 +0100</pubDate><guid>https://jdhao.github.io/2023/11/18/databricks-workspace-files/</guid><description><p>Some observation and finding in working with Databricks workspace files.</p></description></item><item><title>手抓羊肉饭制作</title><link>https://jdhao.github.io/2023/11/09/lamb_pilaf/</link><pubDate>Thu, 09 Nov 2023 20:33:49 +0100</pubDate><guid>https://jdhao.github.io/2023/11/09/lamb_pilaf/</guid><description><p>这次我来复刻手抓羊肉饭。</p></description></item><item><title>Databricks Init Scripts</title><link>https://jdhao.github.io/2023/10/21/databricks-init-scripts/</link><pubDate>Sat, 21 Oct 2023 00:54:33 +0200</pubDate><guid>https://jdhao.github.io/2023/10/21/databricks-init-scripts/</guid><description>General # Init script is just a shell script, which will be run for each node in the cluster, before Apache Spark driver or executor JVM starts.
A cluster can have multiple init script if you want. These init scripts will be executed in the order provided.
Cluster scope init script # If your cluster is not in Edit mode, you can not see the button to add init script. You need to click Edit in the cluster configuration page, then you can add init script to your cluster settings.</description></item><item><title>Using Virutal Environment in Python with venv</title><link>https://jdhao.github.io/2023/10/11/python-use-venv/</link><pubDate>Wed, 11 Oct 2023 00:23:33 +0200</pubDate><guid>https://jdhao.github.io/2023/10/11/python-use-venv/</guid><description><p>Using a virtual environment for Project dev in Python is a good practice.
<a href="https://docs.python.org/3/library/venv.html" target="_blank">venv</a> is module that is available since Python 3.3.
It can help us to manage the virtual environment in a simple way.</p></description></item><item><title>File Systems in Databricks</title><link>https://jdhao.github.io/2023/10/03/databricks-dbfs-and-other-filesystem/</link><pubDate>Tue, 03 Oct 2023 15:35:28 +0200</pubDate><guid>https://jdhao.github.io/2023/10/03/databricks-dbfs-and-other-filesystem/</guid><description><p>A summary of different file systems in Databricks.</p></description></item><item><title>LATERAL VIEW EXPLODE in Spark</title><link>https://jdhao.github.io/2023/09/26/spark_lateral_view_explode/</link><pubDate>Tue, 26 Sep 2023 06:58:20 +0200</pubDate><guid>https://jdhao.github.io/2023/09/26/spark_lateral_view_explode/</guid><description><p>For array type column, <code>explode()</code> will convert it to <code>n</code> rows, where <code>n</code> is the number of elements in the array.
For map/dictionary type column, <code>explode()</code> will convert it to <code>nx2</code> shape, i.e., n rows, 2 columns (for key and value).</p></description></item><item><title>菜谱:麻婆豆腐</title><link>https://jdhao.github.io/2023/09/23/mapo_tou_fu/</link><pubDate>Sat, 23 Sep 2023 16:04:08 +0200</pubDate><guid>https://jdhao.github.io/2023/09/23/mapo_tou_fu/</guid><description><p>本文总结麻婆豆腐的做法。</p></description></item><item><title>在德国做台湾卤肉饭</title><link>https://jdhao.github.io/2023/09/22/taiwan_lu_rou_fan/</link><pubDate>Fri, 22 Sep 2023 18:36:22 +0200</pubDate><guid>https://jdhao.github.io/2023/09/22/taiwan_lu_rou_fan/</guid><description><p>本次来复刻台湾卤肉饭。</p></description></item><item><title>FastAPI testing and OpenAPI doc generation</title><link>https://jdhao.github.io/2023/09/20/fastapi-testing-and-openapi-spec/</link><pubDate>Wed, 20 Sep 2023 23:57:37 +0200</pubDate><guid>https://jdhao.github.io/2023/09/20/fastapi-testing-and-openapi-spec/</guid><description><p>Some notes on developing a web application with FastAPI.</p></description></item><item><title>Change Timezone in Databricks Spark</title><link>https://jdhao.github.io/2023/09/15/databricks-spark-change-timezone/</link><pubDate>Fri, 15 Sep 2023 20:12:22 +0200</pubDate><guid>https://jdhao.github.io/2023/09/15/databricks-spark-change-timezone/</guid><description><p>The Databricks cluster is using UTC as the default timezone.
So when you run some time-related code, the displayed time is not the local time, which is not ideal.
In this post, I want to share how to change the timezone setting for Databricks cluster.</p></description></item><item><title>How to Profile Your Python Script/Module</title><link>https://jdhao.github.io/2023/09/12/python_profiling_visualization/</link><pubDate>Tue, 12 Sep 2023 23:31:38 +0200</pubDate><guid>https://jdhao.github.io/2023/09/12/python_profiling_visualization/</guid><description><p>In my <a href="https://jdhao.github.io/2020/11/06/profile_python_line_profiler/" target="_blank">previous post</a>, I shared how to profile a single function using line_profiler.
In this post, I want to share how to profile Python script/module and visualize the profile stat to pinpoint the slow part of the code.</p></description></item><item><title>菜谱:茄子肉沫</title><link>https://jdhao.github.io/2023/09/09/eggplant_with_minced_meat/</link><pubDate>Sat, 09 Sep 2023 15:46:14 +0200</pubDate><guid>https://jdhao.github.io/2023/09/09/eggplant_with_minced_meat/</guid><description><p>家常少油版本茄子肉沫制作。</p></description></item><item><title>Migrating from Packer.nvim to Lazy.nvim</title><link>https://jdhao.github.io/2023/09/02/from_packer_to_lazy_nvim/</link><pubDate>Sat, 02 Sep 2023 16:04:08 +0200</pubDate><guid>https://jdhao.github.io/2023/09/02/from_packer_to_lazy_nvim/</guid><description><p><strong>TL;DR: Lazy.nvim is amazing. It is easy to switch and reduce your startup time immensely. Just try it!</strong></p>
<p>I think <a href="https://github.com/wbthomason/packer.nvim" target="_blank">Packer.nvim</a> has been a revolutionary plugin manager after nvim 0.5.
It introduces a lot of lazy loading techniques to speed up the startup process of Neovim.</p></description></item><item><title>How to Extract PDF file on macOS</title><link>https://jdhao.github.io/2023/08/24/extract_pdf_macos/</link><pubDate>Thu, 24 Aug 2023 23:44:16 +0200</pubDate><guid>https://jdhao.github.io/2023/08/24/extract_pdf_macos/</guid><description><p>To extract pdf pages from several files, we can use the open source tool <a href="https://github.com/qpdf/qpdf" target="_blank">qpdf</a>.</p></description></item><item><title>How to Deploy Fastapi Application with Docker</title><link>https://jdhao.github.io/2023/08/01/fastapi-app-deployment-docker/</link><pubDate>Tue, 01 Aug 2023 23:02:09 +0200</pubDate><guid>https://jdhao.github.io/2023/08/01/fastapi-app-deployment-docker/</guid><description><p>In post, I want to summarize the complete steps to deploy a demo web service implemented with FastAPI in Docker container.</p></description></item><item><title>Nerdfont Icon Missing after Wezterm Upgrade</title><link>https://jdhao.github.io/2023/07/25/wezterm_icon_missing/</link><pubDate>Tue, 25 Jul 2023 22:33:26 +0200</pubDate><guid>https://jdhao.github.io/2023/07/25/wezterm_icon_missing/</guid><description><p>When I upgrade wezterm from <a href="https://github.com/wez/wezterm/releases/tag/20230408-112425-69ae8472" target="_blank">April release</a> to <a href="https://github.com/wez/wezterm/releases/tag/20230712-072601-f4abf8fd" target="_blank">July release</a>,
I noticed that some of the unicode icons in my neovim config are shown as box.</p></description></item><item><title>Pylsp setup for Neovim in 2023</title><link>https://jdhao.github.io/2023/07/22/neovim-pylsp-setup/</link><pubDate>Sat, 22 Jul 2023 15:02:55 +0200</pubDate><guid>https://jdhao.github.io/2023/07/22/neovim-pylsp-setup/</guid><description><p>TL;DR: my config for pylsp can be found <a href="https://github.com/jdhao/nvim-config/blob/4d8ef868ad0ef7f6433d91332aa6649186d9a2fb/lua/config/lsp.lua" target="_blank">here</a>.</p>
<p>In this post, I would like to share my latest setup for Pylsp in Neovim.</p></description></item><item><title>How to Parse Query Param With Multiple Values in FastAPI</title><link>https://jdhao.github.io/2023/07/13/fastapi-query-param-with-multiple-value/</link><pubDate>Thu, 13 Jul 2023 22:14:40 +0200</pubDate><guid>https://jdhao.github.io/2023/07/13/fastapi-query-param-with-multiple-value/</guid><description><p>In HTTP request, same query parameter with multiple values are allowed.
For example, for query parameter <code>brand</code>, the query string looks like this: <code>brand=foo&amp;brand=bar</code>.
How to parse value of this parameter to a list in FastAPI?
There are several different ways.</p></description></item><item><title>菜谱:土豆胡萝卜烧牛肉</title><link>https://jdhao.github.io/2023/07/01/beef_potatoo_carrot/</link><pubDate>Sat, 01 Jul 2023 18:58:00 +0200</pubDate><guid>https://jdhao.github.io/2023/07/01/beef_potatoo_carrot/</guid><description><p>本文总结简易版“土豆胡萝卜烧牛肉”做法。</p></description></item><item><title>Zsh Startup Files in macOS</title><link>https://jdhao.github.io/2023/06/16/zsh_startup_file/</link><pubDate>Fri, 16 Jun 2023 23:34:20 +0200</pubDate><guid>https://jdhao.github.io/2023/06/16/zsh_startup_file/</guid><description><p>In this post, I want to share what I find about the Zsh startup files and their loading order in macOS.</p></description></item><item><title>PATH Variable Changed inside Tmux on macOS?</title><link>https://jdhao.github.io/2023/06/12/macos_path_changed_inside_tmux/</link><pubDate>Mon, 12 Jun 2023 23:36:18 +0200</pubDate><guid>https://jdhao.github.io/2023/06/12/macos_path_changed_inside_tmux/</guid><description><p>Recently, I met a strange issue related to Tmux.
After open a tmux session, the <code>PATH</code> variable is changed and is different from outside tmux.</p></description></item><item><title>Work with JSON File in Neovim</title><link>https://jdhao.github.io/2023/06/12/neovim-json-file/</link><pubDate>Mon, 12 Jun 2023 23:22:07 +0200</pubDate><guid>https://jdhao.github.io/2023/06/12/neovim-json-file/</guid><description><p>In this post, I want to share how you can work effectively with JSON file inside Neovim.</p></description></item><item><title>Running/importing Python code/module in Databricks</title><link>https://jdhao.github.io/2023/06/06/databricks-run-import-code/</link><pubDate>Tue, 06 Jun 2023 21:37:45 +0200</pubDate><guid>https://jdhao.github.io/2023/06/06/databricks-run-import-code/</guid><description><p>Databricks is centered around notebooks for doing a lot of works.
As a result, it is often not obvious how to run or re-use code from another notebook or Python module.
In this post, I want to share how to do this in the Databricks.</p></description></item><item><title>Agile and Scrum</title><link>https://jdhao.github.io/2023/05/24/agile_scrum/</link><pubDate>Wed, 24 May 2023 22:54:25 +0200</pubDate><guid>https://jdhao.github.io/2023/05/24/agile_scrum/</guid><description><p>This is my learning notes for <a href="https://en.wikipedia.org/wiki/Agile_software_development" target="_blank">Agile</a> and <a href="https://en.wikipedia.org/wiki/Scrum_%28software_development%29" target="_blank">Scrum</a>.</p></description></item><item><title>菜谱:凉拌牛肉</title><link>https://jdhao.github.io/2023/05/21/cold_beef_with_sauce/</link><pubDate>Sun, 21 May 2023 19:44:40 +0200</pubDate><guid>https://jdhao.github.io/2023/05/21/cold_beef_with_sauce/</guid><description><p>本文总结简易版凉拌牛肉的做法。</p></description></item><item><title>Awesome Command Line Tools Written in Rust</title><link>https://jdhao.github.io/2023/05/15/terminal_tool_alternative_written_in_rust/</link><pubDate>Mon, 15 May 2023 20:00:47 +0200</pubDate><guid>https://jdhao.github.io/2023/05/15/terminal_tool_alternative_written_in_rust/</guid><description><p>In this post, I want to share some command line tools written in Rust,
which are good alternatives to some of the original tools used in command line.</p></description></item><item><title>How to get or set Databricks spark configuration</title><link>https://jdhao.github.io/2023/05/13/databricks-spark-get-set-conf/</link><pubDate>Sat, 13 May 2023 21:57:26 +0200</pubDate><guid>https://jdhao.github.io/2023/05/13/databricks-spark-get-set-conf/</guid><description><p>In this post, I summarize how to get or set a Databricks spark configuration/property.</p></description></item><item><title>Set Up German Version macOS</title><link>https://jdhao.github.io/2023/04/21/macos_german_version_setup/</link><pubDate>Fri, 21 Apr 2023 22:22:55 +0200</pubDate><guid>https://jdhao.github.io/2023/04/21/macos_german_version_setup/</guid><description><p>I got a Macbook with a German keyboard layout, and I am not accustomed to it.
This post summarizes some tweaks made to the German version of Macbook to make it work for me.</p></description></item><item><title>Add A Custom Search Engine for Vimium</title><link>https://jdhao.github.io/2023/04/18/vimium_custom_search_engine/</link><pubDate>Tue, 18 Apr 2023 22:55:03 +0200</pubDate><guid>https://jdhao.github.io/2023/04/18/vimium_custom_search_engine/</guid><description><p><a href="https://github.com/philc/vimium" target="_blank">Vimium</a> is a Chrome extension that lets us to browse the internet with our fingers, rather than using the mouse.
In this post, I will going to share how to add a custom search engine for Vimium.</p></description></item><item><title>中国大陆小米手机如何使用 Google Pay</title><link>https://jdhao.github.io/2023/03/21/xiaomi_google_pay/</link><pubDate>Tue, 21 Mar 2023 00:23:57 +0800</pubDate><guid>https://jdhao.github.io/2023/03/21/xiaomi_google_pay/</guid><description><p>要使用 <a href="https://en.wikipedia.org/wiki/Google_Pay_%28payment_method%29" target="_blank">Google Pay</a> 需要谷歌服务的支持,小米手机至少旗舰机型都是自带谷歌服务的,但是默认没有打开。以我的小米 12S Pro 为例,直接在系统设置界面搜索 “谷歌”,有个“谷歌基础服务”,打开即可。</p></description></item><item><title>春节回乡记</title><link>https://jdhao.github.io/2023/03/04/hometown_2023/</link><pubDate>Sat, 04 Mar 2023 14:20:41 +0800</pubDate><guid>https://jdhao.github.io/2023/03/04/hometown_2023/</guid><description><p>由于疫情的影响,已经有两年没有在老家过春节。中国国内疫情管控放开以后,终于有机会回乡过春节。</p></description></item><item><title>滇西之行 2023</title><link>https://jdhao.github.io/2023/03/01/yun-nan-2023/</link><pubDate>Wed, 01 Mar 2023 00:00:00 +0000</pubDate><guid>https://jdhao.github.io/2023/03/01/yun-nan-2023/</guid><description><p>我在高中还是大学读了宗璞的<a href="https://book.douban.com/subject/30425634/" target="_blank">《野葫芦引》</a>,其中的《西征记》描写了滇西抗战的经历,所以我一直想去腾冲走一趟,去拜访一下国殇墓园,苦于打工人没有时间,这个愿望在今年实现了。</p></description></item><item><title>贵阳行 2023</title><link>https://jdhao.github.io/2023/02/20/guiyang_2023/</link><pubDate>Mon, 20 Feb 2023 00:00:00 +0000</pubDate><guid>https://jdhao.github.io/2023/02/20/guiyang_2023/</guid><description><p>每次去贵阳都是浮光掠影,因为它不是我的终点站。这次是因为去云南,需要在贵阳转车停留一晚。</p></description></item><item><title>程序员海外工作---语言篇</title><link>https://jdhao.github.io/2023/02/18/work_overseas_english/</link><pubDate>Sat, 18 Feb 2023 13:33:34 +0800</pubDate><guid>https://jdhao.github.io/2023/02/18/work_overseas_english/</guid><description><p>找海外工作很重要的一个要求语言过关,根据国家的不同,对语言的要求也不同,英语国家当然英语就足够了,有的欧洲国家公司还会要求你掌握当地语言,如果你不会,那投递简历时就可以跳过这些公司了。本文谈一谈我的英语学习经验,仅供参考。英语主要分为听说读写四个方面,下面就分开写一写我的经验。</p></description></item><item><title>2023 长沙行</title><link>https://jdhao.github.io/2023/02/10/changsha_2023/</link><pubDate>Fri, 10 Feb 2023 00:00:00 +0000</pubDate><guid>https://jdhao.github.io/2023/02/10/changsha_2023/</guid><description><p>大学毕业以后,就没去过长沙了,来深圳工作几年也没去过长沙一次,正好趁着这次有时间去长沙逛一下。</p></description></item><item><title>2023 西安行</title><link>https://jdhao.github.io/2023/02/03/xi_an_2023/</link><pubDate>Fri, 03 Feb 2023 00:00:00 +0000</pubDate><guid>https://jdhao.github.io/2023/02/03/xi_an_2023/</guid><description><p>如果你要问我心中第一美食之都,我会说是西安。西安我此前已经去过两次了,但仍意犹未尽。</p></description></item><item><title>德国工签申请指南</title><link>https://jdhao.github.io/2023/01/18/german_work_visa_guide/</link><pubDate>Wed, 18 Jan 2023 13:32:15 +0800</pubDate><guid>https://jdhao.github.io/2023/01/18/german_work_visa_guide/</guid><description><p>拿到德国工作 offer 以后,我们需要申请合适的签证前往德国。本文将会详细总结德国工签(欧盟蓝卡)申请需要的材料,填写细节,以及面签的流程,希望能够帮助到有同样疑惑的人。</p>
<p><font color="red">Disclaimer: 本文仅仅代表个人经历,非官方权威建议,仅供各位读者参考。</font></p></description></item><item><title>2022 年博客回顾</title><link>https://jdhao.github.io/2023/01/06/blog-2022/</link><pubDate>Fri, 06 Jan 2023 01:41:41 +0800</pubDate><guid>https://jdhao.github.io/2023/01/06/blog-2022/</guid><description>2022 年总共写了 49 篇博客 1,大部分博客很短,没花太多时间就可以写完。从类别上看,大部分都是技术相关的,关于 Neovim,Lua,机器学习,SQL</description></item><item><title>感染 omicron 记录</title><link>https://jdhao.github.io/2023/01/02/i-got-covid/</link><pubDate>Mon, 02 Jan 2023 22:32:09 +0800</pubDate><guid>https://jdhao.github.io/2023/01/02/i-got-covid/</guid><description><p>在 2022 年 12 月底,我也感染了 omicron 病毒,本文对感染过程做一记录。</p></description></item><item><title>How to Override Default Options in Neovim</title><link>https://jdhao.github.io/2022/12/02/nvim-override-default-options/</link><pubDate>Fri, 02 Dec 2022 02:24:23 +0800</pubDate><guid>https://jdhao.github.io/2022/12/02/nvim-override-default-options/</guid><description><p>A very common confusion for new users of Neovim is that their option settings for a particular filetype does not work in <code>init.vim</code> (or <code>init.lua</code>).</p></description></item><item><title>Variadic Arguments in Lua</title><link>https://jdhao.github.io/2022/12/02/lua-variadic-arguments/</link><pubDate>Fri, 02 Dec 2022 02:18:37 +0800</pubDate><guid>https://jdhao.github.io/2022/12/02/lua-variadic-arguments/</guid><description><p>In Lua, to pass variable number of arguments, we can use <code>...</code> (three ellipses) syntax in function argument.</p></description></item><item><title>How to Enable Method Autocompletion for OpenCV</title><link>https://jdhao.github.io/2022/11/16/auto_completion_opencv/</link><pubDate>Wed, 16 Nov 2022 20:05:11 +0800</pubDate><guid>https://jdhao.github.io/2022/11/16/auto_completion_opencv/</guid><description><h2 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h2>
<p>In Python, some packages are written mainly or partially in C++,
and the Python interfaces are just wrappers around the binary C++ module.
Among these packages, there is <a href="https://github.com/opencv/opencv" target="_blank">OpenCV</a>.</p></description></item><item><title>How to Read Local CSV File to Table in MySQL</title><link>https://jdhao.github.io/2022/10/15/mysql_read_csv/</link><pubDate>Sat, 15 Oct 2022 10:31:18 +0800</pubDate><guid>https://jdhao.github.io/2022/10/15/mysql_read_csv/</guid><description><p>I am using MySQL server version <code>8.0.30</code> on my macOS.
I try to read a local csv file into a mysql table using <code>LOAD DATA LOCAL INFILE</code> following some post<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>,
but unfortunately I get the following error:</p></description></item><item><title>I read the nvim v0.8 release note so you do not have to</title><link>https://jdhao.github.io/2022/10/05/nvim-v08-release/</link><pubDate>Wed, 05 Oct 2022 15:55:49 +0800</pubDate><guid>https://jdhao.github.io/2022/10/05/nvim-v08-release/</guid><description><p>This is not a complete list of changes. Just what I have noticed.
Complete release note for nvim 0.8 is <a href="https://github.com/neovim/neovim/releases/tag/v0.8.0" target="_blank">here</a>.</p></description></item><item><title>Creating A Trigger in PostgreSQL</title><link>https://jdhao.github.io/2022/09/12/postgresql_trigger_function/</link><pubDate>Mon, 12 Sep 2022 18:12:51 +0800</pubDate><guid>https://jdhao.github.io/2022/09/12/postgresql_trigger_function/</guid><description><p>We can use trigger to automate oerations, for example, preventing insertion of a record if certain condition is met.
In this post, we show an example trigger function and its usage.</p></description></item><item><title>Cost of Living in Shenzhen</title><link>https://jdhao.github.io/2022/09/04/cost-of-living-shenzhen/</link><pubDate>Sun, 04 Sep 2022 13:01:37 +0800</pubDate><guid>https://jdhao.github.io/2022/09/04/cost-of-living-shenzhen/</guid><description><p>Here is how much I spend for living in <a href="https://en.wikipedia.org/wiki/Shenzhen" target="_blank">Shenzhen, China</a> as a non-local people.
Note the cost may vary a lot depending on various factors.</p>
<p>All numbers are in the unit of <a href="https://en.wikipedia.org/wiki/Renminbi" target="_blank">Chinese Yuan</a> (symbol <code>¥</code>).</p></description></item><item><title>You Do Not Need a Plugin for This Feature</title><link>https://jdhao.github.io/2022/08/21/you-do-not-need-a-plugin-for-this/</link><pubDate>Sun, 21 Aug 2022 11:56:35 +0800</pubDate><guid>https://jdhao.github.io/2022/08/21/you-do-not-need-a-plugin-for-this/</guid><description><p>I saw from the repo awesome neovim<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> a plugin that helps the user create the intermediate dir when they save a file.
I wondered why this feature even needs a whole plugin?
You can literally do this with a few lines of code.</p></description></item><item><title>Ctrl-left and Ctrl-right Not Working in macOS?</title><link>https://jdhao.github.io/2022/08/20/ctrl-left-right-not-work-mac/</link><pubDate>Sat, 20 Aug 2022 23:25:02 +0800</pubDate><guid>https://jdhao.github.io/2022/08/20/ctrl-left-right-not-work-mac/</guid><description><p>Recently, when I try to use <code>Ctrl-left</code> and <code>Ctrl-right</code> in <a href="https://github.com/neovim/neovim" target="_blank">Neovim</a>, I found that they are not received by Neovim.
I thought this is a Neovim issue.
However, when I test these two shortcuts using <code>cat</code> in the terminal (I tried both Kitty and wezterm),
it does not work either.</p></description></item><item><title>Benchmarking Your HTTP Service Using wrk</title><link>https://jdhao.github.io/2022/08/10/http_benchmark_wrk/</link><pubDate>Wed, 10 Aug 2022 00:53:18 +0800</pubDate><guid>https://jdhao.github.io/2022/08/10/http_benchmark_wrk/</guid><description><p>As a machine learning engineer/data scientist, after the model development process is finished,
we need to deploy the model as a web service using different web frameworks.
To achieve maximum performance and lower the hardware cost,
we often need to optimize the speed our service, including TensorRT acceleration, config tuning, etc.</p></description></item><item><title>How to Change Commit Author Info in Git</title><link>https://jdhao.github.io/2022/08/05/update_commit_author_info_git/</link><pubDate>Fri, 05 Aug 2022 00:22:34 +0800</pubDate><guid>https://jdhao.github.io/2022/08/05/update_commit_author_info_git/</guid><description><p>This post summarizes how to update author info of Git commits.</p></description></item><item><title>Monitoring Service Stat with uwsgitop</title><link>https://jdhao.github.io/2022/08/01/uwsgi_service_stat_monitor/</link><pubDate>Mon, 01 Aug 2022 22:12:54 +0800</pubDate><guid>https://jdhao.github.io/2022/08/01/uwsgi_service_stat_monitor/</guid><description><p>When we serve a HTTP service via uWSGI, we can monitor its stats via <a href="https://github.com/xrmx/uwsgitop#readme" target="_blank"><code>uwsgitop</code></a>.</p></description></item><item><title>A Dive into super() in Python</title><link>https://jdhao.github.io/2022/07/31/super_in_python/</link><pubDate>Sun, 31 Jul 2022 23:23:45 +0800</pubDate><guid>https://jdhao.github.io/2022/07/31/super_in_python/</guid><description><p>In Python, we often see the use of <a href="https://docs.python.org/3/library/functions.html#super" target="_blank">super()</a> in class initialization.</p></description></item><item><title>How to Pass List by Value as Parameter in Python</title><link>https://jdhao.github.io/2022/07/27/pass_list_by_value_python/</link><pubDate>Wed, 27 Jul 2022 01:35:30 +0800</pubDate><guid>https://jdhao.github.io/2022/07/27/pass_list_by_value_python/</guid><description><p>If we pass list as parameter to a function and change the parameter, the original list is also changed.
This is because list is a mutable type, when we pass list to a function, we are passing the same list.</p></description></item><item><title>在疫情的阴影下 (My Life under the Shadow of Covid19)</title><link>https://jdhao.github.io/2022/07/25/under_the_shadow_of_covid/</link><pubDate>Mon, 25 Jul 2022 15:24:01 +0800</pubDate><guid>https://jdhao.github.io/2022/07/25/under_the_shadow_of_covid/</guid><description><p>序:有感于无休无止的核酸检测,我觉得有必要写点什么,记录下正在发生的和已经发生的历史。</p>
<p>很多年后,回过头看 2020 年 1 月,我们无法预料到 Covid19 竟然对人类社会造成了如此大的影响。</p></description></item><item><title>我们为何工作?</title><link>https://jdhao.github.io/2022/07/07/thought_on_working/</link><pubDate>Thu, 07 Jul 2022 22:22:22 +0800</pubDate><guid>https://jdhao.github.io/2022/07/07/thought_on_working/</guid><description><p>工作的意义是什么?</p></description></item><item><title>Nvim 0.7.2 Released</title><link>https://jdhao.github.io/2022/06/29/nvim_v07-release/</link><pubDate>Wed, 29 Jun 2022 23:21:58 +0800</pubDate><guid>https://jdhao.github.io/2022/06/29/nvim_v07-release/</guid><description><p>Recently the <a href="https://github.com/neovim/neovim/commit/e8ee6733926db83ef216497a1d660a173184ff39" target="_blank">nvim 0.7.2 version</a> is released following the <a href="https://github.com/neovim/neovim/releases/tag/v0.7.0" target="_blank">0.7.0 release</a> two months ago.
Here are some of the updates in 0.7.0.</p></description></item><item><title>Learning SQL from Scratch(2): Setup and Preparations</title><link>https://jdhao.github.io/2022/06/04/sql_from_scratch_for_ml_s2/</link><pubDate>Sat, 04 Jun 2022 19:03:20 +0800</pubDate><guid>https://jdhao.github.io/2022/06/04/sql_from_scratch_for_ml_s2/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-10-12: add fake data generation website.</font></li>
<li><font color="blue">2022-10-11: add TUI client for MySQL and Postgres.</font></li>
<li><font color="blue">2022-09-24: add sample database we can try.</font></li>
</ul>
</details>
<p>In this post, I will talk about setting up SQL databases and also the tools needed to write SQL queries.</p></description></item><item><title>Learning SQL from Scratch(1): Do We Even Need to Start?</title><link>https://jdhao.github.io/2022/06/04/sql_from_scratch_for_ml_s1/</link><pubDate>Sat, 04 Jun 2022 01:19:17 +0800</pubDate><guid>https://jdhao.github.io/2022/06/04/sql_from_scratch_for_ml_s1/</guid><description><p>As a machine learning engineer who mainly deals with vision-based projects,
I have little opportunity in my work to actually use SQL (Structured Query Language.).
Even when I need it, I often just ask the data engineers for a favor.</p>
<p>However, I thought it would be an essential skill to learn even if I do not need it for now.</p></description></item><item><title>What Happened When Logging without Handlers in Python</title><link>https://jdhao.github.io/2022/05/27/logging_without_handlers_python/</link><pubDate>Fri, 27 May 2022 23:27:12 +0800</pubDate><guid>https://jdhao.github.io/2022/05/27/logging_without_handlers_python/</guid><description><p>I saw a post from stackoverflow asking why his logger does not work as expect?
The code is like:</p></description></item><item><title>How To Read and Write ply File in Python</title><link>https://jdhao.github.io/2022/05/26/read_write_ply_file_python/</link><pubDate>Thu, 26 May 2022 13:26:11 +0800</pubDate><guid>https://jdhao.github.io/2022/05/26/read_write_ply_file_python/</guid><description><p>In this post, I want to share how to generate <a href="https://en.wikipedia.org/wiki/PLY_%28file_format%29" target="_blank">ply files</a> in Python.</p></description></item><item><title>Lua Learning Notes</title><link>https://jdhao.github.io/2022/05/21/lua-learning-for-nvim/</link><pubDate>Sat, 21 May 2022 11:11:54 +0800</pubDate><guid>https://jdhao.github.io/2022/05/21/lua-learning-for-nvim/</guid><description><p>As a long time nvim user, I am learning Lua and slowly transition my nvim config to lua.
In this script, I will share some tips and lessons I have learned the hard way.</p></description></item><item><title>Fix Nvidia Apt Repository Public Key Error</title><link>https://jdhao.github.io/2022/05/05/nvidia-apt-repo-public-key-error-fix/</link><pubDate>Thu, 05 May 2022 22:37:59 +0800</pubDate><guid>https://jdhao.github.io/2022/05/05/nvidia-apt-repo-public-key-error-fix/</guid><description><p>When running <code>apt-get update</code> inside Ubuntu 18.04, I have the following error:</p></description></item><item><title>豆角焖面制作</title><link>https://jdhao.github.io/2022/05/01/doujiao_menmian/</link><pubDate>Sun, 01 May 2022 22:55:05 +0800</pubDate><guid>https://jdhao.github.io/2022/05/01/doujiao_menmian/</guid><description><p>今天总结一下“豆角焖面”的做法。</p>
<h1 class="relative group">材料
<div id="%E6%9D%90%E6%96%99" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#%E6%9D%90%E6%96%99" aria-label="Anchor">#</a>
</span>
</h1>
<p>四季豆,五花肉或瘦肉,大料,大蒜,姜,青椒,五香粉,酱油,老抽,料酒,鲜面条</p></description></item><item><title>Fix the Logitech Bluetooth Shit and Use Unifying Receiver</title><link>https://jdhao.github.io/2022/04/30/fix_logitech_bluetooth_shit_use_unifying_receiver/</link><pubDate>Sat, 30 Apr 2022 00:45:04 +0800</pubDate><guid>https://jdhao.github.io/2022/04/30/fix_logitech_bluetooth_shit_use_unifying_receiver/</guid><description><h1 class="relative group">Background
<div id="background" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#background" aria-label="Anchor">#</a>
</span>
</h1>
<p>The thing is that I have a Logitech pebble and mx keys mini keyboard, and I use Bluetooth to connect them to my mac,
but they randomly lost connection when I was using them, especially for the mx keys mini keyboard, this occurred on a daily basis.</p></description></item><item><title>How to Calculate Square Root without Using sqrt()?</title><link>https://jdhao.github.io/2022/04/28/sqrt_without_using_builtin_sqrt/</link><pubDate>Thu, 28 Apr 2022 21:45:01 +0800</pubDate><guid>https://jdhao.github.io/2022/04/28/sqrt_without_using_builtin_sqrt/</guid><description><p>I saw an interesting question that how to get square root of x
without using builtin function from your language. There are different
ways to approach this problem.</p></description></item><item><title>How to Match Non-greedily in Nvim/Vim</title><link>https://jdhao.github.io/2022/04/27/nvim_non_greedy_match/</link><pubDate>Wed, 27 Apr 2022 02:20:12 +0800</pubDate><guid>https://jdhao.github.io/2022/04/27/nvim_non_greedy_match/</guid><description><p>A short note on how to match <a href="https://blog.finxter.com/python-regex-greedy-vs-non-greedy-quantifiers/" target="_blank">non-greedily</a> in Nvim/Vim.</p></description></item><item><title>Push to GitHub with Personal Access Token (PAT)</title><link>https://jdhao.github.io/2022/04/23/github_access_token/</link><pubDate>Sat, 23 Apr 2022 14:30:06 +0800</pubDate><guid>https://jdhao.github.io/2022/04/23/github_access_token/</guid><description><p>To promote security, starting from Aug. 2021, many GitHub operations require use of personal access tokens (PAT).</p></description></item><item><title>How to Use Tensorboard in Pytorch</title><link>https://jdhao.github.io/2022/04/20/pytorch-tensorboard-use/</link><pubDate>Wed, 20 Apr 2022 20:53:51 +0800</pubDate><guid>https://jdhao.github.io/2022/04/20/pytorch-tensorboard-use/</guid><description><p>This is a brief note on how to use <a href="https://github.com/tensorflow/tensorboard" target="_blank">Tensorboard</a> in PyTorch.</p></description></item><item><title>How to Add Color Emoji to Image in Python</title><link>https://jdhao.github.io/2022/04/03/add_color_emoji_to_image_in_python/</link><pubDate>Sun, 03 Apr 2022 11:52:55 +0800</pubDate><guid>https://jdhao.github.io/2022/04/03/add_color_emoji_to_image_in_python/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202204031210116.png" width="500">
</p>
<p>In this post, I would like to share how to add <a href="https://en.wikipedia.org/wiki/Emoji" target="_blank">color emoji</a> to image with Python.</p></description></item><item><title>How to Do Image Alpha-compositing in Pillow</title><link>https://jdhao.github.io/2022/04/01/image_alpha_composite_pillow/</link><pubDate>Fri, 01 Apr 2022 23:40:04 +0800</pubDate><guid>https://jdhao.github.io/2022/04/01/image_alpha_composite_pillow/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202204020034075.jpg" width="800">
</p>
<h1 id="what-is-alpha-compositing">What is alpha-compositing</h1>
<p>If you have two images A and B, you <a
href="https://en.wikipedia.org/wiki/Alpha_compositing">alpha-composite</a>
A over B, it will create an effect that you can see both image A and B
in the resulting image, as if A has transparency and you can
<em>see</em> through A and also see B.</p></description></item><item><title>地道美味炸酱制作方法</title><link>https://jdhao.github.io/2022/03/28/how_to_make_zhajiang2/</link><pubDate>Mon, 28 Mar 2022 00:02:05 +0800</pubDate><guid>https://jdhao.github.io/2022/03/28/how_to_make_zhajiang2/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202203280008836.jpg" width="200">
</p>
<p>今天介绍另外一种风格的炸酱制作,区别于之前写过的 <a href="https://jdhao.github.io/2021/09/05/how_to_make_zhajiang_noodles/" target="_blank">老北京炸酱</a>.</p></description></item><item><title>Nonlinear Activations for Neural Networks</title><link>https://jdhao.github.io/2022/03/27/neural-network-nonlinear-activation/</link><pubDate>Sun, 27 Mar 2022 17:25:12 +0800</pubDate><guid>https://jdhao.github.io/2022/03/27/neural-network-nonlinear-activation/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202203271740705.png" width="600">
</p>
<p>Non-linear activations are important in deep neural networks. It is
important in the sense that without non-linear activation functions,
even if you have many linear layers, the end results is like you have
only one linear layer, and the approximation ability of the network is
very limited<a href="#fn1" class="footnote-ref" id="fnref1"
role="doc-noteref"><sup>1</sup></a>. Some of most commonly-used
nonlinear activation functions are Sigmoid, ReLU and Tanh.</p></description></item><item><title>Accelerate Batched Image Inference in PyTorch</title><link>https://jdhao.github.io/2022/03/18/torch_accelerate_batch_inference/</link><pubDate>Fri, 18 Mar 2022 22:59:33 +0800</pubDate><guid>https://jdhao.github.io/2022/03/18/torch_accelerate_batch_inference/</guid><description><p>I have a web service where the images come in a batch so I have to do inference for several images in PIL format at a time.
Initially, I use a naive approach and just transform the images one by one,
then combine them to form a single tensor and do the inference.
The inference becomes really slow when I have a batch with more than 30 images.
The inference time is about 1-2 seconds per batch.</p></description></item><item><title>Define A String Variable in LaTeX</title><link>https://jdhao.github.io/2022/03/14/latex_define_string_variable/</link><pubDate>Mon, 14 Mar 2022 12:56:48 +0800</pubDate><guid>https://jdhao.github.io/2022/03/14/latex_define_string_variable/</guid><description><p>Like other programming languages, the best way to to use a value multiple times in LaTeX is to define a variable for it.
Later when you want to change the value, you only need to change it once. Here is how to do it.</p></description></item><item><title>Merging Branches with Git Rebase</title><link>https://jdhao.github.io/2022/03/07/git_merge_branch_with_rebase/</link><pubDate>Mon, 07 Mar 2022 22:45:16 +0800</pubDate><guid>https://jdhao.github.io/2022/03/07/git_merge_branch_with_rebase/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202021114754.jpg" width="800">
</p>
<p>When merging branches, the most direct way we can use is to <code>git merge</code>.
However, with git-merge, the commit history and graph will be messy if there are a lot of branches.</p></description></item><item><title>Softmax with Temperature Explained</title><link>https://jdhao.github.io/2022/02/27/temperature_in_softmax/</link><pubDate>Sun, 27 Feb 2022 12:47:02 +0800</pubDate><guid>https://jdhao.github.io/2022/02/27/temperature_in_softmax/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202271549378.jpg" width="800">
</p>
<p>Softmax function is commonly used in classification tasks. Suppose
that we have an input vector <span class="math inline">\([z_1, z_2,
\ldots, z_N]\)</span>, after softmax, each element becomes:</p></description></item><item><title>A Curated List of File Explorers for Nvim</title><link>https://jdhao.github.io/2022/02/27/nvim_file_tree_explorer/</link><pubDate>Sun, 27 Feb 2022 00:10:22 +0800</pubDate><guid>https://jdhao.github.io/2022/02/27/nvim_file_tree_explorer/</guid><description><p>File explorer is one of the most widely-used types of plugin for Vim/Nvim.
Below are my curated list of file explorers for Nvim.
Some of these plugins are specifically written for Nvim and will not work for Vim.</p></description></item><item><title>关于正确提问技术问题</title><link>https://jdhao.github.io/2022/02/21/on_asking_tech_questions/</link><pubDate>Mon, 21 Feb 2022 22:18:20 +0800</pubDate><guid>https://jdhao.github.io/2022/02/21/on_asking_tech_questions/</guid><description><p>有个人 A 在 <a href="https://t.me/vimzh_real" target="_blank">Vim tg 群</a>,问了一个简单的 vim 问题,另外一位群友 B 给了间接的回答,告诉他应该多搜索一下。结果引发了大讨论,有人认为直接回答就好,没必要指教别人,没必要那么傲慢,居高临下,就炸锅了,引发了大讨论,还导致几个人退群。</p></description></item><item><title>Install pyav inside Ubuntu Docker</title><link>https://jdhao.github.io/2022/02/11/pyav_install_docker/</link><pubDate>Fri, 11 Feb 2022 20:48:46 +0800</pubDate><guid>https://jdhao.github.io/2022/02/11/pyav_install_docker/</guid><description><p>Building a usable Docker image with all the packages living peacefully is hard.
Here is how to install <a href="https://github.com/PyAV-Org/PyAV" target="_blank">pyav</a> using Docker.</p></description></item><item><title>Dependency Hell When Building A PyTorch GPU Docker Image</title><link>https://jdhao.github.io/2022/02/09/dependency-hell-build-torch-gpu-docker-container/</link><pubDate>Wed, 09 Feb 2022 21:30:00 +0800</pubDate><guid>https://jdhao.github.io/2022/02/09/dependency-hell-build-torch-gpu-docker-container/</guid><description><p>In order to for PyTorch to use host GPU inside a Docker container, their versions must match.</p></description></item><item><title>External Executable Not Allowed to Run after Hugo v0.91?</title><link>https://jdhao.github.io/2022/02/02/executable_not_allowed_to_run_in_hugo/</link><pubDate>Wed, 02 Feb 2022 13:20:20 +0800</pubDate><guid>https://jdhao.github.io/2022/02/02/executable_not_allowed_to_run_in_hugo/</guid><description><p>Today I upgrade <a href="https://github.com/gohugoio/hugo" target="_blank">Hugo</a> from v0.75 to the latest version (v0.92).
When I run the deployment script to build the site and push, I saw the following error:</p></description></item><item><title>凉菜调味汁制作方法</title><link>https://jdhao.github.io/2022/02/01/make_sauce_for_cold_dish/</link><pubDate>Tue, 01 Feb 2022 23:32:45 +0800</pubDate><guid>https://jdhao.github.io/2022/02/01/make_sauce_for_cold_dish/</guid><description><p>凉菜万能调料汁制作方法。</p></description></item><item><title>菜谱:蒜蓉炒虾</title><link>https://jdhao.github.io/2022/02/01/stir-fried-shrimp-with-garlic/</link><pubDate>Tue, 01 Feb 2022 23:07:13 +0800</pubDate><guid>https://jdhao.github.io/2022/02/01/stir-fried-shrimp-with-garlic/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202012330649.jpg" width="400">
</p>
<p>家常版蒜蓉炒虾🦐制作方法。</p></description></item><item><title>A Dig into PyTorch Model Loading</title><link>https://jdhao.github.io/2022/01/28/pytorch_model_load_error/</link><pubDate>Fri, 28 Jan 2022 23:17:45 +0800</pubDate><guid>https://jdhao.github.io/2022/01/28/pytorch_model_load_error/</guid><description><h1 class="relative group">Saving and loading PyTorch models
<div id="saving-and-loading-pytorch-models" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#saving-and-loading-pytorch-models" aria-label="Anchor">#</a>
</span>
</h1>
<p>Models in PyTorch are a subclass of <code>torch.nn.Module</code>. To save the model parameters,
we use <code>model.state_dict()</code> to get all the model parameters:</p></description></item><item><title>Selected Questions from LinkedIn Git Assessment</title><link>https://jdhao.github.io/2022/01/14/linkedin_git_assessment/</link><pubDate>Fri, 14 Jan 2022 19:06:57 +0800</pubDate><guid>https://jdhao.github.io/2022/01/14/linkedin_git_assessment/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202012337737.jpg" width="600">
</p>
<p>I took the <a href="https://github.com/Ebazhanov/linkedin-skill-assessments-quizzes/tree/master/git" target="_blank">LinkedIn Git assessment</a> and got a certificate<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>, but found that I am not super clear on some of the questions.
Here is an analysis of some of the questions and their answers.</p></description></item><item><title>Why do We Use LogSumExp in Machine Learning?</title><link>https://jdhao.github.io/2022/01/09/log_sum_exp_in_machine_learning/</link><pubDate>Sun, 09 Jan 2022 20:39:52 +0800</pubDate><guid>https://jdhao.github.io/2022/01/09/log_sum_exp_in_machine_learning/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202201092324184.jpg" width="600">
</p>
<p>LogSumExp is often used in machine learning. It has the following
form:</p></description></item><item><title>How to Squash Last N Commits in Git?</title><link>https://jdhao.github.io/2022/01/09/git_squash_last_n_commits/</link><pubDate>Sun, 09 Jan 2022 11:47:17 +0800</pubDate><guid>https://jdhao.github.io/2022/01/09/git_squash_last_n_commits/</guid><description><p>We often need to squash several related commits to make the commit history cleaner.
There are several different ways to achieve this.</p></description></item><item><title>How to Make An Impressive and Beautiful GitHub Profile</title><link>https://jdhao.github.io/2022/01/03/github_profile_readme/</link><pubDate>Mon, 03 Jan 2022 13:13:03 +0800</pubDate><guid>https://jdhao.github.io/2022/01/03/github_profile_readme/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-08-21: add section on profile visitor stat</font></li>
<li><font color="blue">2022-04-09: add section on Stack Overflow stats card.</font></li>
</ul>
</details>
<p>In this post, I will share how to customize your GitHub profile page,
and you can find the end result <a href="https://github.com/jdhao" target="_blank">here</a>.</p></description></item><item><title>Using Neovim after Three Years -- A Retrospect</title><link>https://jdhao.github.io/2021/12/31/using_nvim_after_three_years/</link><pubDate>Fri, 31 Dec 2021 14:54:38 +0800</pubDate><guid>https://jdhao.github.io/2021/12/31/using_nvim_after_three_years/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202031428905.jpg" width="800">
</p>
<p>I started using <a href="https://neovim.io/" target="_blank">Neovim</a> (nvim for short) about three years ago, in Sep. 2018.
At that time, nvim had just released <a href="https://github.com/neovim/neovim/releases/tag/v0.3.1" target="_blank">v0.3.1</a>. Over the years, I have been a staunch nvim user,
constantly learning new knowledge, and sharing tips, tricks and interesting plugins in <a href="https://jdhao.github.io/categories/Nvim/" target="_blank">my blog posts</a>.</p></description></item><item><title>How to Extract Key Frames from A Video with FFmpeg</title><link>https://jdhao.github.io/2021/12/25/ffmpeg-extract-key-frame-video/</link><pubDate>Sat, 25 Dec 2021 17:58:47 +0800</pubDate><guid>https://jdhao.github.io/2021/12/25/ffmpeg-extract-key-frame-video/</guid><description><p>In order to get enough information from videos, we often need to extract video frames.
However, we do not want to extract every frame from a video due to:</p>
<ul>
<li>information redundancy in successive video frames.</li>
<li>huge storage space needed by these video frames.</li>
</ul>
<p>In this post, I want to share how to extract <em>key</em> frames from video to reduce the storage,
but still capture enough information from a video.</p></description></item><item><title>Download Files to Local Storage in iPad</title><link>https://jdhao.github.io/2021/12/25/ipad-download-file-to-local-storage/</link><pubDate>Sat, 25 Dec 2021 10:56:57 +0800</pubDate><guid>https://jdhao.github.io/2021/12/25/ipad-download-file-to-local-storage/</guid><description><p>When downloading files using Safari browser in iPad, the files will be saved on your iCloud drive.
For me, I want to download the files locally without filling up my iCloud space.</p></description></item><item><title>Using STL Containers with pybind11</title><link>https://jdhao.github.io/2021/12/23/pybind11_stl_vector/</link><pubDate>Thu, 23 Dec 2021 23:21:38 +0800</pubDate><guid>https://jdhao.github.io/2021/12/23/pybind11_stl_vector/</guid><description><p>In my <a href="https://jdhao.github.io/2021/08/17/pybind11_first_impression/" target="_blank">old post</a>, I have shared how to use <a href="https://pybind11.readthedocs.io/" target="_blank">pybind11</a> to accelerate execution of Python code.</p></description></item><item><title>Sort lines based on a column in Vim/Nvim</title><link>https://jdhao.github.io/2021/12/21/sort_lines_based_on_a_column_nvim/</link><pubDate>Tue, 21 Dec 2021 23:01:41 +0800</pubDate><guid>https://jdhao.github.io/2021/12/21/sort_lines_based_on_a_column_nvim/</guid><description><p>I have a file where each line has several comma-separated items. I want to sort
the lines, based on a certain column. How do we do it inside Vim/Nvim?</p></description></item><item><title>Process video in a certain time range with FFmpeg?</title><link>https://jdhao.github.io/2021/12/16/ffmpeg-process-video-in-a-time-range/</link><pubDate>Thu, 16 Dec 2021 00:34:16 +0800</pubDate><guid>https://jdhao.github.io/2021/12/16/ffmpeg-process-video-in-a-time-range/</guid><description><p>When dealing with videos, we may want to process video in a specific time range,
for example, to only process video from 50 seconds to 70 seconds. How do we
specify the time range in ffmpeg?</p></description></item><item><title>回顾我的手机换代史</title><link>https://jdhao.github.io/2021/12/12/mobilephone_and_me_a_retrospect/</link><pubDate>Sun, 12 Dec 2021 22:20:19 +0800</pubDate><guid>https://jdhao.github.io/2021/12/12/mobilephone_and_me_a_retrospect/</guid><description><p>科技发展的这样快,常常让我们忘了以前是什么样的。手机现在已成了现代人的一部分,须臾离不开了,十几年前还不是这样。有时候我坐在地铁上,看着低头认真滑手机的人们,就在想没有手机之前大家的生活都是什么样的,竟然想不起来了。</p></description></item><item><title>【2021 年】iPad 安装 Shadowrocket</title><link>https://jdhao.github.io/2021/12/12/ipad_shadowrocket_install/</link><pubDate>Sun, 12 Dec 2021 13:33:41 +0800</pubDate><guid>https://jdhao.github.io/2021/12/12/ipad_shadowrocket_install/</guid><description><p>在苹果系统上安装一个工具真麻烦,简单总结如何在 iPad 上安装 Shadowrocket 小火箭。</p></description></item><item><title>Migration from Nvim 0.5.1 to Nvim 0.6.0</title><link>https://jdhao.github.io/2021/12/01/nvim_v06_released/</link><pubDate>Wed, 01 Dec 2021 22:25:30 +0800</pubDate><guid>https://jdhao.github.io/2021/12/01/nvim_v06_released/</guid><description><p>About five months ago, the biggest update of Nvim comes with its <a href="https://github.com/neovim/neovim/releases/tag/v0.5.0" target="_blank">v0.5.0
release</a>. With v0.5, we finally get the official LSP support in Nvim core and
better Lua support, among other features and bug fixes<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</p>
<p>TL;DR: My LSP-related config can be found <a href="https://github.com/jdhao/nvim-config/blob/master/lua/config/lsp.lua" target="_blank">here</a>.</p></description></item><item><title>How I Manage My Personal Blog</title><link>https://jdhao.github.io/2021/11/28/how_i_write_blog/</link><pubDate>Sun, 28 Nov 2021 18:37:48 +0800</pubDate><guid>https://jdhao.github.io/2021/11/28/how_i_write_blog/</guid><description><p>In this post-web2.0 age, people seem to blog less and less, and blogs seem to <a href="https://www.google.com/search?q=blogs&#43;are&#43;dying" target="_blank">be dying slowly</a>.
People are separated in different Apps where the content is not searchable by search engines.</p>
<p>However, I still prefer to write using a blog. In this post, I want to share how I manage my blog.</p></description></item><item><title>Git Learning Notes (4)</title><link>https://jdhao.github.io/2021/11/27/git_notes_s4/</link><pubDate>Sat, 27 Nov 2021 22:29:36 +0800</pubDate><guid>https://jdhao.github.io/2021/11/27/git_notes_s4/</guid><description><p>My Git learning notes.</p></description></item><item><title>Nifty Nvim/Vim Techniques That Make My Life Easier -- Series 11</title><link>https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</link><pubDate>Mon, 22 Nov 2021 23:27:57 +0800</pubDate><guid>https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</guid><description><p>This is the 11th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Fuzzy-switching Tmux Sessions with Ease</title><link>https://jdhao.github.io/2021/11/20/tmux_fuzzy_session_switch/</link><pubDate>Sat, 20 Nov 2021 23:21:30 +0800</pubDate><guid>https://jdhao.github.io/2021/11/20/tmux_fuzzy_session_switch/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202111211332634.png" width="400">
</p>
<p>During my work, I use multiple Tmux sessions to manage different projects. When
I create a new session, I usually give it unique name so that I know that the
project is about via the session name.</p></description></item><item><title>事情经常是 Now or Never</title><link>https://jdhao.github.io/2021/11/17/now-or-never/</link><pubDate>Wed, 17 Nov 2021 00:00:24 +0800</pubDate><guid>https://jdhao.github.io/2021/11/17/now-or-never/</guid><description><p>我平时用 chrome 浏览器,有时候查一个新东西,喜欢把有关系的网页都打开,所以浏览器就塞满了 tab,这些内容我不一定都有时间去看一遍,所以 tab 就一直留在那里,有时候不得已要重启浏览器或者重启系统,不想丢失这些 tab,就用 supertabs 插件把 tab 保存下来,期望有时间了再去看。</p></description></item><item><title>小米平板 5 Pro 体验</title><link>https://jdhao.github.io/2021/11/13/xiaomi_pad5_pro_handson/</link><pubDate>Sat, 13 Nov 2021 13:50:10 +0800</pubDate><guid>https://jdhao.github.io/2021/11/13/xiaomi_pad5_pro_handson/</guid><description><p>kindle voyage 看 PDF 格式电子书体验太差,正好八月份小米发布了小米平板 5 pro,小米平板 5 销售还挺火爆的,京东上一直断货,需要预约,遂从小米之家入手一台体验<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>。以下是使用小米平板 5 pro 两个多月的体验。</p></description></item><item><title>Audio Processing Using FFmpeg</title><link>https://jdhao.github.io/2021/11/10/ffmpeg_audio_processing/</link><pubDate>Wed, 10 Nov 2021 00:24:09 +0800</pubDate><guid>https://jdhao.github.io/2021/11/10/ffmpeg_audio_processing/</guid><description><p>Collected tips on audio processing with FFmpeg.</p></description></item><item><title>PyAV for video processing</title><link>https://jdhao.github.io/2021/11/04/pyav-video-processing/</link><pubDate>Thu, 04 Nov 2021 22:17:51 +0800</pubDate><guid>https://jdhao.github.io/2021/11/04/pyav-video-processing/</guid><description><p><a href="https://www.ffmpeg.org/" target="_blank">ffmpeg</a> is an excellent tool for video processing.
However, using ffmpeg directly inside Python is not convenient enough.
Previously, I have been using <a href="https://github.com/kkroening/ffmpeg-python" target="_blank">ffmpeg-python</a>, which is a thin wrapper around the <code>ffmpeg</code> command line executable.</p></description></item><item><title>茅海建 《天朝的崩溃》</title><link>https://jdhao.github.io/2021/10/31/collapse_of_the_heavenly_dynasty/</link><pubDate>Sun, 31 Oct 2021 18:02:25 +0800</pubDate><guid>https://jdhao.github.io/2021/10/31/collapse_of_the_heavenly_dynasty/</guid><description><p>花了一周的时间,看完了茅海建的<a href="https://book.douban.com/subject/1675478/" target="_blank">《天朝的崩溃》</a>,虽然中学历史书中简略讲过第一次鸦片战争,对这段历史了解却甚少,我甚至天真地以为鸦片战争就是虎门战争之后就和谈了,然后签订了《南京条约》。</p></description></item><item><title>Using Diffs in Vim</title><link>https://jdhao.github.io/2021/10/24/diff_in_vim/</link><pubDate>Sun, 24 Oct 2021 20:07:17 +0800</pubDate><guid>https://jdhao.github.io/2021/10/24/diff_in_vim/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202020040611.jpg" width="600">
</p>
<p><a href="https://man7.org/linux/man-pages/man1/diff.1.html" target="_blank">Diff</a> can be used to compare two versions of the same file to find the changes.
If you use vim, you can use <code>vimdiff</code> to compare files:</p></description></item><item><title>Git Diff Setup</title><link>https://jdhao.github.io/2021/10/24/git_diff_setup/</link><pubDate>Sun, 24 Oct 2021 01:39:09 +0800</pubDate><guid>https://jdhao.github.io/2021/10/24/git_diff_setup/</guid><description><p>When we run git-diff, git uses its internal diff algorithm to generate diff for
changed files.</p></description></item><item><title>Find Which Font is Used in A PDF</title><link>https://jdhao.github.io/2021/10/20/find_font_used_in_pdf/</link><pubDate>Wed, 20 Oct 2021 23:26:59 +0800</pubDate><guid>https://jdhao.github.io/2021/10/20/find_font_used_in_pdf/</guid><description><p>Sometimes, we are interested in which font is used for the main text in a PDF.
How do we find out?</p></description></item><item><title>Scheduling Your Tasks with Apscheduler</title><link>https://jdhao.github.io/2021/10/20/python_apsscheduler_intro/</link><pubDate>Wed, 20 Oct 2021 01:05:36 +0800</pubDate><guid>https://jdhao.github.io/2021/10/20/python_apsscheduler_intro/</guid><description><p>In Python, to run a task periodically, we can use the package <a href="https://github.com/agronholm/apscheduler" target="_blank">apscheduler</a>.</p></description></item><item><title>Why Use Cross Entropy in Classification Task?</title><link>https://jdhao.github.io/2021/10/16/why_cross_entropy_in_classification/</link><pubDate>Sat, 16 Oct 2021 09:54:49 +0800</pubDate><guid>https://jdhao.github.io/2021/10/16/why_cross_entropy_in_classification/</guid><description><p>In classification tasks, the de facto loss to use is the <a href="https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html" target="_blank">cross entropy loss</a>.</p></description></item><item><title>Setting up Yasnippet for Emacs</title><link>https://jdhao.github.io/2021/10/06/yasnippet_setup_emacs/</link><pubDate>Wed, 06 Oct 2021 15:15:05 +0800</pubDate><guid>https://jdhao.github.io/2021/10/06/yasnippet_setup_emacs/</guid><description><p>Unlike Vim/Neovim, where there are snippet engines like <a href="https://github.com/SirVer/ultisnips" target="_blank">ultisnips</a> and <a href="https://github.com/rockerBOO/awesome-neovim#snippet" target="_blank">other plugins</a>. In Emacs, the de facto snippet engine is <a href="https://github.com/joaotavora/yasnippet" target="_blank">yasnippet</a>.</p></description></item><item><title>Customize Tabline in Emacs</title><link>https://jdhao.github.io/2021/09/30/emacs_custom_tabline/</link><pubDate>Thu, 30 Sep 2021 00:32:50 +0800</pubDate><guid>https://jdhao.github.io/2021/09/30/emacs_custom_tabline/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202109300037148.jpg" width="400">
</p>
<p>A short note on how to set up a more beautiful tabline for Emacs.</p></description></item><item><title>中秋贵阳重庆行</title><link>https://jdhao.github.io/2021/09/22/chongqing_guiyang_travel/</link><pubDate>Wed, 22 Sep 2021 23:21:58 +0800</pubDate><guid>https://jdhao.github.io/2021/09/22/chongqing_guiyang_travel/</guid><description><p>趁着中秋节小长假,去重庆和贵阳玩了几天。</p></description></item><item><title>Straight.el Bootstrap and Package Install Issue</title><link>https://jdhao.github.io/2021/09/15/emacs_straight-el_bootstrap_install_issue/</link><pubDate>Wed, 15 Sep 2021 22:38:38 +0800</pubDate><guid>https://jdhao.github.io/2021/09/15/emacs_straight-el_bootstrap_install_issue/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-02-08: update fastgit URL</font></li>
</ul>
</details>
<p>I am using <a href="https://github.com/raxod502/straight.el" target="_blank">straight.el</a> to manage my Emacs packages.
However, due to GitHub access issues, the <a href="https://github.com/raxod502/straight.el#getting-started" target="_blank">bootstrap snippet</a> can not be downloaded successfully and run.
After staring Emacs, it hangs forever with high CPU usage.</p></description></item><item><title>Learning Emacs as A Nvimmer in One Day</title><link>https://jdhao.github.io/2021/09/12/learning_emacs_in_one_day/</link><pubDate>Sun, 12 Sep 2021 21:40:13 +0800</pubDate><guid>https://jdhao.github.io/2021/09/12/learning_emacs_in_one_day/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<p><font color="blue">2021-11-24: Add more detailed instructions for installing doom-modeline.</font></p>
</details>
<p>I have been using <a href="https://github.com/neovim/neovim" target="_blank">Neovim</a> for over three
years and I have been constantly hearing the greatness of its rival editor
<a href="https://www.gnu.org/s/emacs/" target="_blank">Emacs</a>. So today I am gonna to try it and see if
it is truly great.</p>
<p><strong>Edit: My final Emacs conf is <a href="https://github.com/jdhao/emacs-conf" target="_blank">here</a>.</strong></p></description></item><item><title>Hands on with Three Git TUI Clients</title><link>https://jdhao.github.io/2021/09/11/git_tui_clients_hands_on/</link><pubDate>Sat, 11 Sep 2021 00:33:12 +0800</pubDate><guid>https://jdhao.github.io/2021/09/11/git_tui_clients_hands_on/</guid><description><p>If you are not accustomed to typing git commands on the command line, there are
also some TUI clients for easing the use of git.</p></description></item><item><title>Using Virtual Text in Neovim</title><link>https://jdhao.github.io/2021/09/09/nvim_use_virtual_text/</link><pubDate>Thu, 09 Sep 2021 20:36:36 +0800</pubDate><guid>https://jdhao.github.io/2021/09/09/nvim_use_virtual_text/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202109150127349.png" width="800">
</p>
<p>In Neovim, we can use the <code>virtual text</code> feature to place virtual text anywhere in the current buffer,
which is not possible with normal text.</p></description></item><item><title>老北京炸酱面制作</title><link>https://jdhao.github.io/2021/09/05/how_to_make_zhajiang_noodles/</link><pubDate>Sun, 05 Sep 2021 12:50:33 +0800</pubDate><guid>https://jdhao.github.io/2021/09/05/how_to_make_zhajiang_noodles/</guid><description><p>总结一下老北京炸酱面的制作过程,备忘。</p></description></item><item><title>Integer Literal Type and Overflow In C++</title><link>https://jdhao.github.io/2021/09/03/cpp_integer_overflow/</link><pubDate>Fri, 03 Sep 2021 23:18:35 +0800</pubDate><guid>https://jdhao.github.io/2021/09/03/cpp_integer_overflow/</guid><description><p>I want to print the largest number that <code>unsigned int</code> can represent, which is
<code>2^32 - 1</code>. I use the following code:</p></description></item><item><title>GNU Make FAQ</title><link>https://jdhao.github.io/2021/08/29/gnu_make_learn_and_faq/</link><pubDate>Sun, 29 Aug 2021 23:17:12 +0800</pubDate><guid>https://jdhao.github.io/2021/08/29/gnu_make_learn_and_faq/</guid><description><p><a href="https://www.gnu.org/software/make/" target="_blank">GNU Make</a> is a <a href="https://en.wikipedia.org/wiki/Build_automation" target="_blank">build</a> <a href="https://en.wikipedia.org/wiki/List_of_build_automation_software" target="_blank">automation</a> tool typically used on Linux systems<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.
Below I will summarize a list of FAQs, which explain how Make works and how to use Make.</p></description></item><item><title>问题根源是什么?</title><link>https://jdhao.github.io/2021/08/20/the_root_cause/</link><pubDate>Fri, 20 Aug 2021 00:33:38 +0800</pubDate><guid>https://jdhao.github.io/2021/08/20/the_root_cause/</guid><description><p>一件关于思维的小事,值得记录。</p></description></item><item><title>Pybind11 hands on</title><link>https://jdhao.github.io/2021/08/17/pybind11_first_impression/</link><pubDate>Tue, 17 Aug 2021 00:24:37 +0800</pubDate><guid>https://jdhao.github.io/2021/08/17/pybind11_first_impression/</guid><description><p>To accelerate the execution of some performance critical code, we can write the
code in C++ with the help of <a href="https://github.com/pybind/pybind11" target="_blank">pybind11</a> and
export the C++ code as shared library<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>. Then we can import the shared
library as a module and enjoy speed boost.</p></description></item><item><title>给 Hugo even 主题添加 utterances 评论系统</title><link>https://jdhao.github.io/2021/08/15/hugo_even_add_utterance/</link><pubDate>Sun, 15 Aug 2021 22:24:01 +0800</pubDate><guid>https://jdhao.github.io/2021/08/15/hugo_even_add_utterance/</guid><description><p>建立博客以来,试用了多款评论系统,不过最终还是用了 disqus,但是 disqus 令人讨厌的是默认添加很多烦人的广告,牛皮癣一样,而且在国内无法加载,必须翻墙才能显示。<a href="https://utteranc.es/" target="_blank">utterances</a> 是一款基于 github issues 的评论系统,简洁,避免了 disqus 的广告以及加载问题。这篇文章总结如何给 <a href="https://github.com/olOwOlo/hugo-theme-even" target="_blank">Hugo-even</a> 主题添加 utterances 评论系统。</p></description></item><item><title>macOS Operation Not Permitted?</title><link>https://jdhao.github.io/2021/08/15/mac_operation_not_permitted/</link><pubDate>Sun, 15 Aug 2021 16:51:57 +0800</pubDate><guid>https://jdhao.github.io/2021/08/15/mac_operation_not_permitted/</guid><description><p>Some permission related issue on macOS.</p></description></item><item><title>Setting up Sumneko Lua Language Server for Nvim-lsp</title><link>https://jdhao.github.io/2021/08/12/nvim_sumneko_lua_conf/</link><pubDate>Thu, 12 Aug 2021 00:14:12 +0800</pubDate><guid>https://jdhao.github.io/2021/08/12/nvim_sumneko_lua_conf/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202020047792.jpg" width="600">
</p>
<details>
<summary><font size="2" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2022-08-13: update nvim lsp config for lua-language-server.</font></li>
</ul>
</details>
<p>In this post, I will share how to set up <a href="https://github.com/sumneko/lua-language-server" target="_blank">sumneko lua</a> for <a href="https://github.com/neovim/nvim-lspconfig" target="_blank">nvim-lspconfig</a>.</p></description></item><item><title>Is GitHub Down Today?</title><link>https://jdhao.github.io/2021/08/11/is_github_down/</link><pubDate>Wed, 11 Aug 2021 00:57:37 +0800</pubDate><guid>https://jdhao.github.io/2021/08/11/is_github_down/</guid><description>update:
On 2021-11-28, we expericence another GitHub outage which lasts more than two hours, see here. On 2021-08-10 23:30 CST, I observed that I cannot push to my GitHub repo even with --force. After checking the GitHub status site, it seems that the GitHub API is down1.
It is not the first time that GitHub is down. There has been several failure reports last year (2020), due to MySQL and other issues.</description></item><item><title>macOS 上常用工具</title><link>https://jdhao.github.io/2021/08/09/macos_work_tools/</link><pubDate>Mon, 09 Aug 2021 23:55:13 +0800</pubDate><guid>https://jdhao.github.io/2021/08/09/macos_work_tools/</guid><description><details>
<summary><font size="2" color="red">点击查看更新记录</font></summary>
<ul>
<li>2022-03-07:增加 shotrr</li>
<li>2022-02-10: 增加 wezterm 介绍</li>
</ul>
</details>
<p>记录我在 macOS 下常用到的工具。</p></description></item><item><title>Configure Windows Terminal in 2021</title><link>https://jdhao.github.io/2021/08/06/microsoft_windows_terminal_conf/</link><pubDate>Fri, 06 Aug 2021 00:23:42 +0800</pubDate><guid>https://jdhao.github.io/2021/08/06/microsoft_windows_terminal_conf/</guid><description><p>After updating my Windows system to the latest version, I can finally use the new <a href="https://github.com/microsoft/terminal" target="_blank">Windows Terminal</a>.</p></description></item><item><title>How Does The YouTube Content ID System Work?</title><link>https://jdhao.github.io/2021/08/02/the_youtube_content_id_system/</link><pubDate>Mon, 02 Aug 2021 01:27:05 +0800</pubDate><guid>https://jdhao.github.io/2021/08/02/the_youtube_content_id_system/</guid><description><p>Google introduced the <a href="https://support.google.com/youtube/answer/2797370?hl=en" target="_blank">content ID system</a> in 2007 to cope with the
unauthorized use of copyrighted music and video content. The content ID system
has successfully helped the copyright owners to find the pirated content and
paid billions of dollars to the copyright owners<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</p></description></item><item><title>基于内容的视频检索/视频指纹的应用</title><link>https://jdhao.github.io/2021/07/24/application_of_duplicate_video_retrieval/</link><pubDate>Sat, 24 Jul 2021 21:43:31 +0800</pubDate><guid>https://jdhao.github.io/2021/07/24/application_of_duplicate_video_retrieval/</guid><description><p>基于内容的视频检索(或视频指纹),是指根据视频内容,从数据库中找到和当前视频在画面上重复高的视频。</p></description></item><item><title>向量搜索引擎/工具</title><link>https://jdhao.github.io/2021/07/24/vector_search_tools/</link><pubDate>Sat, 24 Jul 2021 21:28:11 +0800</pubDate><guid>https://jdhao.github.io/2021/07/24/vector_search_tools/</guid><description><p>无论是推荐还是检索任务,都离不开向量检索引擎,当向量数量巨大(上千万或者上亿规模)的时候,使用精确搜索(exhaustive search)的时间成本对于用户来说无法接受,这时我们必须用到近似最邻近搜索(approximate nearest neighbor, 简称 ANN)。本文总结了一些常见的实现了 ANN 搜索的向量搜索引擎/工具。</p></description></item><item><title>Show Git Diff When Doing Git Commit</title><link>https://jdhao.github.io/2021/07/24/git_show_diff_when_commiting/</link><pubDate>Sat, 24 Jul 2021 11:07:16 +0800</pubDate><guid>https://jdhao.github.io/2021/07/24/git_show_diff_when_commiting/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20210724122638.jpg" width="800">
</p>
<p>I saw on YouTube <a href="https://www.youtube.com/watch?v=xv9cp7NyK5Y" target="_blank">a video</a> made by
<a href="https://github.com/tjdevries" target="_blank">TJ DeVries</a> on how to contribute to the <a href="https://neovim.io/" target="_blank">neovim
project</a>. There is a scene where he commit via <code>git commit</code>,
and whoa, a Neovim instance appeared with three split, with top left the commit
message area, top right the git-status area, and on the right the git-diff info,
which is really cool.</p></description></item><item><title>Delete Keys Matching A Pattern with py-redis-cluster</title><link>https://jdhao.github.io/2021/07/20/py_redis_cluster_delete_key_with_pattern/</link><pubDate>Tue, 20 Jul 2021 23:59:30 +0800</pubDate><guid>https://jdhao.github.io/2021/07/20/py_redis_cluster_delete_key_with_pattern/</guid><description><p>We have a Python web service where we store some <code>key-val</code> pairs in redis.
Occasionally, I want to delete some of the keys matching a certain pattern.
Current, we are using <a href="https://github.com/Grokzen/redis-py-cluster" target="_blank">redis-py-cluster</a> for redis-related operations.</p></description></item><item><title>Migrating from vim-plug to Packer.nvim</title><link>https://jdhao.github.io/2021/07/11/from_vim_plug_to_packer/</link><pubDate>Sun, 11 Jul 2021 23:05:22 +0800</pubDate><guid>https://jdhao.github.io/2021/07/11/from_vim_plug_to_packer/</guid><description><details>
<summary><font size="3" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2022-03-27: fix a typo in requiring lua modules</font></li>
<li><font color="blue">2022-02-08: change fastgit URL</font></li>
<li><font color="blue">2022-02-05: add new autocmd for auto-running command <code>PackerCompile</code>.</font></li>
</ul>
</details>
<p>Over the past two years, I have been using <a href="https://github.com/junegunn/vim-plug" target="_blank">vim-plug</a> as my plugin manager for Nvim.
Vim-plug is powerful, fast and amazing, especially considering that all its features are contained in a single vim script.
It uses the old way to manage plugins, i.e., it will manage the loading of plugins directly.</p></description></item><item><title>快排(quick sort) C++ 实现</title><link>https://jdhao.github.io/2021/07/10/quick_sort_impl/</link><pubDate>Sat, 10 Jul 2021 12:19:38 +0800</pubDate><guid>https://jdhao.github.io/2021/07/10/quick_sort_impl/</guid><description><p>快排是一种快速排序算法,原理是从数组中选择一个 pivot,数组中小于等于 pivot 的元素放到左边,大于 pivot 的元素放到右边。然后对左边和右边数组分别递归进行快速排序,最后整个数组就成为排序好的数组。</p></description></item><item><title>A CheatSheet of C++ Container/Adapter and Common Structure</title><link>https://jdhao.github.io/2021/07/04/cpp_container_cheatsheet/</link><pubDate>Sun, 04 Jul 2021 19:02:50 +0800</pubDate><guid>https://jdhao.github.io/2021/07/04/cpp_container_cheatsheet/</guid><description><p>I use Python in my work, and rarely need C++.
So I need to compile this C++ cheatsheet for common STL containers/adapters, just in case I need them.</p></description></item><item><title>Static and Dynamic Linkage in C++</title><link>https://jdhao.github.io/2021/07/04/static_and_dynamic_linking_cpp/</link><pubDate>Sun, 04 Jul 2021 01:02:33 +0800</pubDate><guid>https://jdhao.github.io/2021/07/04/static_and_dynamic_linking_cpp/</guid><description><p>In C++, we can build a library either statically or dynamically. In this post,
I want to summarize how to build a static and a shared/dynamic library<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</p></description></item><item><title>Pretty Output Format in C++</title><link>https://jdhao.github.io/2021/07/04/pretty_fmt_in_cpp/</link><pubDate>Sun, 04 Jul 2021 00:26:30 +0800</pubDate><guid>https://jdhao.github.io/2021/07/04/pretty_fmt_in_cpp/</guid><description><p>Although <code>std::cout</code> in C++ is powerful, it lacks the ease of use of <a href="https://docs.python.org/3/tutorial/inputoutput.html#the-string-format-method" target="_blank">format
string</a> in Python. Fortunately, the 3rd party package <a href="https://github.com/fmtlib/fmt" target="_blank">fmt</a>
provides a similar feature for C++.</p></description></item><item><title>Install LLVM/Clangd from Source on CentOS 7</title><link>https://jdhao.github.io/2021/07/03/install_clangd_on_linux/</link><pubDate>Sat, 03 Jul 2021 00:51:34 +0800</pubDate><guid>https://jdhao.github.io/2021/07/03/install_clangd_on_linux/</guid><description><p><a href="https://clangd.llvm.org/" target="_blank">Clangd</a> is a language server for C++/C etc.
I try to use clangd 12 for C++ code auto-completion on CentOS 7.</p></description></item><item><title>Empty Entry in LD_LIBRARY_PATH May Lead to Security Issues</title><link>https://jdhao.github.io/2021/07/03/ld_library_path_empty_item/</link><pubDate>Sat, 03 Jul 2021 00:44:08 +0800</pubDate><guid>https://jdhao.github.io/2021/07/03/ld_library_path_empty_item/</guid><description><p>When I want to build glibc using the provided configure script (<code>./configure --prefix=xxx</code>),
I saw the following error message:</p></description></item><item><title>A Guide on Squashing Commits with git-rebase</title><link>https://jdhao.github.io/2021/06/28/squash_commits_with_git_rebase/</link><pubDate>Mon, 28 Jun 2021 23:43:56 +0800</pubDate><guid>https://jdhao.github.io/2021/06/28/squash_commits_with_git_rebase/</guid><description><p>In this post, I would like to share how to squash commits using <a href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing" target="_blank">git-rebase</a>.</p></description></item><item><title>小米9 MIUI 12 系统开机界面无限重启</title><link>https://jdhao.github.io/2021/06/24/xiaomi9_inifite_reboot/</link><pubDate>Thu, 24 Jun 2021 01:36:41 +0800</pubDate><guid>https://jdhao.github.io/2021/06/24/xiaomi9_inifite_reboot/</guid><description>最近更新到了 MIUI 12.5 系统,晚上手机突然开始不停重启(bootloop),手机在不停重启,进入 MIUI logo,然后又开始重启,有时候能进入到系统,但是</description></item><item><title>电视盒子:当贝 B3 Pro 使用体验</title><link>https://jdhao.github.io/2021/06/20/dangbei_b3_pro_hands_on/</link><pubDate>Sun, 20 Jun 2021 20:47:00 +0800</pubDate><guid>https://jdhao.github.io/2021/06/20/dangbei_b3_pro_hands_on/</guid><description><p>在 <a href="https://jdhao.github.io/2021/06/13/android_tv_box_reviews/" target="_blank">之前的文章</a> 中,我介绍了几款试用的安卓外贸盒子,由于做工以及试用中发现的问题,最终都没有入手。其实品牌电视盒子,也有一个不错的选择,就是当贝 B3 Pro,趁着京东 6.18 活动,最终以 699 价格入手了这款盒子。</p></description></item><item><title>Nifty Nvim/Vim Techniques That Make My Life Easier -- Series 10</title><link>https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</link><pubDate>Thu, 17 Jun 2021 01:54:41 +0800</pubDate><guid>https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</guid><description><p>This is the 10th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>安卓外贸电视盒子体验</title><link>https://jdhao.github.io/2021/06/13/android_tv_box_reviews/</link><pubDate>Sun, 13 Jun 2021 13:49:14 +0800</pubDate><guid>https://jdhao.github.io/2021/06/13/android_tv_box_reviews/</guid><description><p>家里有一台闲置的电视,想平时用来看 YouTube,看电影,于是决定入手一款电视盒子。试用了几款价格比较低的品牌电视盒子(小米、当贝),发现都无法轻松观看 YouTube,安装安卓应用也经常装不了。在寻找合适的电视盒子过程中了解到外贸盒子这种品类,外贸盒子的特点是配置高,但是通常做工一般。最近一个月也试用了两款电视盒子,实际上手体验的确不佳。</p></description></item><item><title>Serving Concurrent Requests for LibreOffice Service</title><link>https://jdhao.github.io/2021/06/11/libreoffice_concurrent_requests/</link><pubDate>Fri, 11 Jun 2021 00:57:25 +0800</pubDate><guid>https://jdhao.github.io/2021/06/11/libreoffice_concurrent_requests/</guid><description><p>We have set up a server to convert pptx files to pdf files using LibreOffice
(version: 6.0.7.3 ). Libreoffice is started using <code>subprocess.run()</code> command in
Python. The external command I use is something like the following<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>:</p></description></item><item><title>Excel Processing using Pandas</title><link>https://jdhao.github.io/2021/06/11/pandas_read_write_excel/</link><pubDate>Fri, 11 Jun 2021 00:48:23 +0800</pubDate><guid>https://jdhao.github.io/2021/06/11/pandas_read_write_excel/</guid><description><p>A brief summary of how to read and write excel files using Pandas package.</p></description></item><item><title>How to Merge PDF Files</title><link>https://jdhao.github.io/2021/05/31/how_to_merge_pdfs/</link><pubDate>Mon, 31 May 2021 22:58:14 +0800</pubDate><guid>https://jdhao.github.io/2021/05/31/how_to_merge_pdfs/</guid><description><p>I have several PDF files that I want to merge to one file. Each page in the PDF
is actually an image. Here is what works best for me.</p></description></item><item><title>健康的公司和员工关系</title><link>https://jdhao.github.io/2021/05/23/how_company_should_treat_its_employee/</link><pubDate>Sun, 23 May 2021 00:04:09 +0800</pubDate><guid>https://jdhao.github.io/2021/05/23/how_company_should_treat_its_employee/</guid><description><p>加入公司快三年了,当初一起入职的同事最近几个月走了许多,我们组也有几位同事离职了,频繁的人事动荡多少也给其他人带来了冲击,正好来谈谈最近一直在思考的公司如何对待员工的问题。</p></description></item><item><title>当贝盒子 H1 使用体验</title><link>https://jdhao.github.io/2021/05/09/dangbei_h1_hands_on_experience/</link><pubDate>Sun, 09 May 2021 18:29:39 +0800</pubDate><guid>https://jdhao.github.io/2021/05/09/dangbei_h1_hands_on_experience/</guid><description><p>给老家的电视配了一个小米盒子 4s(安卓 6.0 系统,2g内存+8g存储,参考<a href="https://m.mi.com/commodity/detail/12924" target="_blank">这里</a>),感觉可以,回深以后也想给这边的电视配一个盒子。京东上当贝盒子 H1 的评价不错,就入手了当贝盒子 H1,以下是我的使用感受。</p></description></item><item><title>How to Use The Git-tag Feature</title><link>https://jdhao.github.io/2021/05/08/git_tag_notes/</link><pubDate>Sat, 08 May 2021 00:16:06 +0800</pubDate><guid>https://jdhao.github.io/2021/05/08/git_tag_notes/</guid><description><p>My notes on using tag feature of Git.</p></description></item><item><title>小米盒子 4s 初体验</title><link>https://jdhao.github.io/2021/04/30/xiaomi_mi_box_setup/</link><pubDate>Fri, 30 Apr 2021 14:02:32 +0800</pubDate><guid>https://jdhao.github.io/2021/04/30/xiaomi_mi_box_setup/</guid><description><p>小米盒子 4s 是小米在 2020 年推出的最新款盒子产品,颜值高,使用起来效果也不错。</p></description></item><item><title>广州之行</title><link>https://jdhao.github.io/2021/04/18/guangzhou_tour_202104/</link><pubDate>Sun, 18 Apr 2021 17:55:32 +0800</pubDate><guid>https://jdhao.github.io/2021/04/18/guangzhou_tour_202104/</guid><description><p>在周末跟着团队来广州团建,第二次来广州玩。</p></description></item><item><title>Notes on FFmpeg (1)</title><link>https://jdhao.github.io/2021/04/16/ffmpeg_notes_1/</link><pubDate>Fri, 16 Apr 2021 00:33:01 +0800</pubDate><guid>https://jdhao.github.io/2021/04/16/ffmpeg_notes_1/</guid><description>Install ffmpeg # If we have root rights, we can install FFmpeg via package manager. On CentOS 7, run the following command:
yum install epel-release yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm yum install ffmpeg ffmpeg-devel If you want to download binary releases, this site can help you. It has binary release for FFmpeg, ffprobe for different systems. It seems that the provided ffmpeg is statically linked, so all you need is that one file to get to work.</description></item><item><title>Post Nested Data Structure to the Server Using Requests</title><link>https://jdhao.github.io/2021/04/08/send_complex_data_in_python_requests/</link><pubDate>Thu, 08 Apr 2021 23:54:08 +0800</pubDate><guid>https://jdhao.github.io/2021/04/08/send_complex_data_in_python_requests/</guid><description><p>In this post, I will share how to post complex data and decode it in the server
side in Python.</p></description></item><item><title>菜谱: 茄子肉沫,糖醋排骨</title><link>https://jdhao.github.io/2021/04/05/my_recipe_20210405/</link><pubDate>Mon, 05 Apr 2021 13:43:30 +0800</pubDate><guid>https://jdhao.github.io/2021/04/05/my_recipe_20210405/</guid><description>少油版茄子肉沫 # 原料 # 茄子,小米辣,青椒,猪肉末,蒜,姜,生抽,酱油,醋,白糖 步骤 # 1,茄子切成 3-4 cm 条状,装盘,套上保鲜袋(留缝别封死),在</description></item><item><title>Why Are Some Logging Messages Missing in Python?</title><link>https://jdhao.github.io/2021/04/01/python_log_message_missing/</link><pubDate>Thu, 01 Apr 2021 23:10:56 +0800</pubDate><guid>https://jdhao.github.io/2021/04/01/python_log_message_missing/</guid><description><p>In my project, I use the <a href="https://docs.python.org/3/library/logging.html" target="_blank">Python logging package</a> for logging service.</p></description></item><item><title>Creating Beautiful Bash Prompts</title><link>https://jdhao.github.io/2021/03/31/bash_prompt_config/</link><pubDate>Wed, 31 Mar 2021 23:00:26 +0800</pubDate><guid>https://jdhao.github.io/2021/03/31/bash_prompt_config/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20210331231139.jpg" width="400">
</p>
<p>This post summarize how to change the Bash shell prompt to a better look. The
end result is shown in the title image.</p></description></item><item><title>How To Install Latest Version of Git on Linux</title><link>https://jdhao.github.io/2021/03/27/upgrade_git_on_linux/</link><pubDate>Sat, 27 Mar 2021 21:48:34 +0800</pubDate><guid>https://jdhao.github.io/2021/03/27/upgrade_git_on_linux/</guid><description><details>
<summary><font size="3" color="red">Update log</font></summary>
<p><font color="blue">2021-12-10: update endpoint rpm link for git</font></p>
</details>
<p>The version of the default git bundled with the Linux system is often too old,
and lacks certain features, which may <a href="https://github.com/lewis6991/gitsigns.nvim/issues/103" target="_blank">break some tools</a>.
This post summarizes how to install newer versions of Git on Linux.</p></description></item><item><title>Notes on Docker -- s3</title><link>https://jdhao.github.io/2021/03/25/docker_knowledge_s3/</link><pubDate>Thu, 25 Mar 2021 23:31:23 +0800</pubDate><guid>https://jdhao.github.io/2021/03/25/docker_knowledge_s3/</guid><description><p>Personal notes on docker usage.</p></description></item><item><title>Better Zsh history</title><link>https://jdhao.github.io/2021/03/24/zsh_history_setup/</link><pubDate>Wed, 24 Mar 2021 22:56:53 +0800</pubDate><guid>https://jdhao.github.io/2021/03/24/zsh_history_setup/</guid><description><p>My notes on setting up history-related features for zsh.</p></description></item><item><title>菜谱;芹菜牛肉,清炒生菜</title><link>https://jdhao.github.io/2021/03/22/my_recipe_20210321/</link><pubDate>Mon, 22 Mar 2021 00:37:52 +0800</pubDate><guid>https://jdhao.github.io/2021/03/22/my_recipe_20210321/</guid><description><p>个人菜谱备忘。</p></description></item><item><title>Set up true color for nvim and tmux in Zoc terminal and xshell</title><link>https://jdhao.github.io/2021/03/17/nvim_truecolor_tmux_windows/</link><pubDate>Wed, 17 Mar 2021 21:06:12 +0800</pubDate><guid>https://jdhao.github.io/2021/03/17/nvim_truecolor_tmux_windows/</guid><description><p>In my daily work, I often ssh to a remote server using a terminal emulator. My
local machine is a Windows 10 desktop. In this post, I want to share how to
make <a href="https://gist.github.com/XVilka/8346728" target="_blank">true color</a> work across terminal emulator, nvim and tmux.</p></description></item><item><title>print message not shown in nohup.out?</title><link>https://jdhao.github.io/2021/03/16/std_stream_buffering_in_python/</link><pubDate>Tue, 16 Mar 2021 22:54:16 +0800</pubDate><guid>https://jdhao.github.io/2021/03/16/std_stream_buffering_in_python/</guid><description><p>When starting a long-running Python program,
I often run it under <a href="https://en.wikipedia.org/wiki/Nohup" target="_blank">nohup</a> so I can redirect all the output to <code>nohup.out</code> for easier inspection.
I use <code>nohup python test.py&amp;</code> to run the process in the background.
Then I can run <code>tail -f nohup.out</code> to monitor the output message from this program.</p></description></item><item><title>Why is Wrong Stacktrace Printed for My Code?</title><link>https://jdhao.github.io/2021/03/13/python_wrong_stack_printed/</link><pubDate>Sat, 13 Mar 2021 21:02:47 +0800</pubDate><guid>https://jdhao.github.io/2021/03/13/python_wrong_stack_printed/</guid><description><p>The other day, when I was updating the source code with the project running, I
noticed that the exception stack trace printed is not right, i.e., the printed
error line is actually not the line that is triggering the exception.</p></description></item><item><title>腊汁肉制作</title><link>https://jdhao.github.io/2021/03/07/how_to_make_la_zhi_rou/</link><pubDate>Sun, 07 Mar 2021 22:38:53 +0800</pubDate><guid>https://jdhao.github.io/2021/03/07/how_to_make_la_zhi_rou/</guid><description><p>本文总结简易家庭版腊汁肉夹馍中的腊汁肉制作。</p></description></item><item><title>如何制作一碗美味的豌杂面</title><link>https://jdhao.github.io/2021/03/06/how_to_make_wan_za_mian/</link><pubDate>Sat, 06 Mar 2021 23:28:03 +0800</pubDate><guid>https://jdhao.github.io/2021/03/06/how_to_make_wan_za_mian/</guid><description><p>作为北方人 and 面食爱好者,周末尝试做了四川美食豌杂面,本文总结家庭版豌杂面的制作。</p></description></item><item><title>Vim 实现的输入法体验</title><link>https://jdhao.github.io/2021/02/26/ime_inside_vim/</link><pubDate>Fri, 26 Feb 2021 23:34:36 +0800</pubDate><guid>https://jdhao.github.io/2021/02/26/ime_inside_vim/</guid><description><p>文接<a href="https://jdhao.github.io/2021/02/25/nvim_ime_mode_auto_switch/" target="_blank">上回</a>,Vim 虽然贵为编辑器之神,有一个没有解决好的问题就是输入中文,以及中英文的切换问题。最近也尝试了一些试图利用 Vim 提供的功能,在 Vim 中实现输入法的插件。本文做一总结点评。</p></description></item><item><title>如何让 Neovim 中文输入时自动切换输入法</title><link>https://jdhao.github.io/2021/02/25/nvim_ime_mode_auto_switch/</link><pubDate>Thu, 25 Feb 2021 22:21:12 +0800</pubDate><guid>https://jdhao.github.io/2021/02/25/nvim_ime_mode_auto_switch/</guid><description><details>
<summary><font size="2" color="red">更新日志</font></summary>
<ul>
<li><font color="blue">2023-06-18:增加 macism 以及 im-select.nvim 使用。</font></li>
<li><font color="blue">2022-11-07:针对 macbook M1 CPU 设置添加说明,添加 smartim 插件使用。</font></li>
</ul>
</details>
<p>Vim/Neovim 下输入中文最大的痛,就是在 Normal 模式下,需要频繁从中文模式切换到英文模式,来输入 Vim 的各种命令。本文总结几款插件,可以帮助我们在 macOS、Windows 下,进入 Normal 模式的时候自动切换到英文输入。</p></description></item><item><title>Set up Inverse Search for LaTeX with VimTeX and Neovim</title><link>https://jdhao.github.io/2021/02/20/inverse_search_setup_neovim_vimtex/</link><pubDate>Sat, 20 Feb 2021 22:31:34 +0800</pubDate><guid>https://jdhao.github.io/2021/02/20/inverse_search_setup_neovim_vimtex/</guid><description><p><font size="5" color="red">2022-01-19: With the release of <a href="https://github.com/lervag/vimtex/releases/tag/v2.8" target="_blank">VimTeX v2.8</a>, all the hack here may not be needed anymore.</font></p>
<details>
<summary><font size="2" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2021-10-22: Update the script to write server name.</font></li>
<li><font color="blue">2021-10-10: Fix typo and minor tweak.</font></li>
</ul>
</details>
<p>Since <a href="https://github.com/neovim/neovim/issues/1750" target="_blank"><code>--remote</code> option hasn&rsquo;t been restored by Neovim</a>, it is actually not very
straightforward to set up inverse search for PDF files when we are editing
large LaTeX files with the help of <a href="https://github.com/lervag/vimtex" target="_blank">VimTeX</a>.</p>
<p>I spend some time figuring out how to do it on both Windows and macOS and
succeed. I thought it would be helpful for people looking for the solution.</p></description></item><item><title>Git Learning Notes (3)</title><link>https://jdhao.github.io/2021/02/17/git_notes_s3/</link><pubDate>Wed, 17 Feb 2021 15:24:46 +0800</pubDate><guid>https://jdhao.github.io/2021/02/17/git_notes_s3/</guid><description><p>Git learning notes.</p></description></item><item><title>如何制作饺子馅</title><link>https://jdhao.github.io/2021/02/13/how_to_make_dumpling_filling/</link><pubDate>Sat, 13 Feb 2021 17:08:23 +0800</pubDate><guid>https://jdhao.github.io/2021/02/13/how_to_make_dumpling_filling/</guid><description><p>如何制作美味的饺子馅。</p></description></item><item><title>记录我的 2020</title><link>https://jdhao.github.io/2021/02/11/life_in_2020/</link><pubDate>Thu, 11 Feb 2021 19:17:08 +0800</pubDate><guid>https://jdhao.github.io/2021/02/11/life_in_2020/</guid><description><p>用文字记录生活,给自己的生命留下印迹,我的 2020。</p></description></item><item><title>Using Proxy in Python Requests package</title><link>https://jdhao.github.io/2021/02/07/python_requests_with_proxy/</link><pubDate>Sun, 07 Feb 2021 23:34:47 +0800</pubDate><guid>https://jdhao.github.io/2021/02/07/python_requests_with_proxy/</guid><description><p>If we need to access the internet via a proxy server, we should set proxy
properly when making HTTP/HTTPS requests using the <a href="https://requests.readthedocs.io/en/master/" target="_blank">Requests</a> package.</p></description></item><item><title>How to Get or Set Clipboard Text in Python</title><link>https://jdhao.github.io/2021/02/03/get_or_set_system_clipboard_python/</link><pubDate>Wed, 03 Feb 2021 23:02:12 +0800</pubDate><guid>https://jdhao.github.io/2021/02/03/get_or_set_system_clipboard_python/</guid><description><p>There are several Python packages by which we can get and set the system
clipboard.</p></description></item><item><title>Bracketed Paste Mode in Terminal</title><link>https://jdhao.github.io/2021/02/01/bracketed_paste_mode/</link><pubDate>Mon, 01 Feb 2021 23:34:02 +0800</pubDate><guid>https://jdhao.github.io/2021/02/01/bracketed_paste_mode/</guid><description><p>A note on bracketed paste mode in terminal and Neovim.</p></description></item><item><title>Tmux Cheatsheet</title><link>https://jdhao.github.io/2021/01/25/tmux_cheatsheet/</link><pubDate>Mon, 25 Jan 2021 23:40:43 +0800</pubDate><guid>https://jdhao.github.io/2021/01/25/tmux_cheatsheet/</guid><description><p>In this post, I collect some useful tips for using Tmux.</p></description></item><item><title>Better Git log</title><link>https://jdhao.github.io/2021/01/25/better_git_log/</link><pubDate>Mon, 25 Jan 2021 23:04:12 +0800</pubDate><guid>https://jdhao.github.io/2021/01/25/better_git_log/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20210125233412.png" width="600">
</p>
<p>Some of the settings to make <code>git log</code> better.</p></description></item><item><title>Anaconda Python 和 pip 国内源/镜像</title><link>https://jdhao.github.io/2021/01/17/china_source_for_python/</link><pubDate>Sun, 17 Jan 2021 21:32:39 +0800</pubDate><guid>https://jdhao.github.io/2021/01/17/china_source_for_python/</guid><description><p>使用国外的源下载 Python 发行版和各种 Python 库,速度实在是太慢了😭😠,国内的源速度会快很多,权宜之计。</p></description></item><item><title>Install Python3 in Ubuntu Docker</title><link>https://jdhao.github.io/2021/01/17/install_python3_in_ubuntu_docker/</link><pubDate>Sun, 17 Jan 2021 01:41:06 +0800</pubDate><guid>https://jdhao.github.io/2021/01/17/install_python3_in_ubuntu_docker/</guid><description><p>Build a Ubuntu docker with Python3 and pip support.</p></description></item><item><title>Cross the Wall</title><link>https://jdhao.github.io/2021/01/10/fuck_gfw_forever/</link><pubDate>Sun, 10 Jan 2021 17:49:28 +0800</pubDate><guid>https://jdhao.github.io/2021/01/10/fuck_gfw_forever/</guid><description><p>To cross the fucking firewall, we need some handy tools.</p></description></item><item><title>解决 GitHub 资源无法下载的问题</title><link>https://jdhao.github.io/2021/01/08/github_access_issue_in_china/</link><pubDate>Fri, 08 Jan 2021 23:38:43 +0800</pubDate><guid>https://jdhao.github.io/2021/01/08/github_access_issue_in_china/</guid><description><details>
<summary><font size="2" color="red">更新记录</font></summary>
<ul>
<li>2022-02-08: <a href="https://t.me/fastgitchannel/81" target="_blank">fasgit hub 被 GFW 封了</a>,换一个地址。</li>
</ul>
</details>
<p>GitHub 虽然没被封,但是阻断严重,下载 GitHub 资源速度奇慢无比,总结一些验证可行的方法。</p></description></item><item><title>Nifty Nvim/Vim Techniques That Make My Life Easier -- Series 9</title><link>https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</link><pubDate>Thu, 07 Jan 2021 23:37:07 +0800</pubDate><guid>https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</guid><description><p>This is the 9th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Copy from Remote Server to Local Clipboard via OSC 52 in Neovim</title><link>https://jdhao.github.io/2021/01/05/nvim_copy_from_remote_via_osc52/</link><pubDate>Tue, 05 Jan 2021 22:55:51 +0800</pubDate><guid>https://jdhao.github.io/2021/01/05/nvim_copy_from_remote_via_osc52/</guid><description><p>In my daily work, I usually log into a remote server via a terminal emulator
and do my development work there. Sometimes, I need to copy text from remote
server to my local machine&rsquo;s clipboard. Previously, I use mouse to select and
copy the text, which I find to be quite cumbersome.</p></description></item><item><title>Using Concurrent.futures in Python</title><link>https://jdhao.github.io/2020/12/29/python_concurrent_futures/</link><pubDate>Tue, 29 Dec 2020 23:32:08 +0800</pubDate><guid>https://jdhao.github.io/2020/12/29/python_concurrent_futures/</guid><description><p>My notes on using <a href="https://docs.python.org/3/library/concurrent.futures.html" target="_blank"><code>concurrent.futures</code></a> in Python.</p></description></item><item><title>Git Directory and Work-Tree Explained</title><link>https://jdhao.github.io/2020/12/25/git_directory_work-tree_explained/</link><pubDate>Fri, 25 Dec 2020 22:39:22 +0800</pubDate><guid>https://jdhao.github.io/2020/12/25/git_directory_work-tree_explained/</guid><description><p>Git has two option <code>--git-dir</code> and <code>--work-tree</code>. What is the use for them?</p></description></item><item><title>Linux Tips and Tricks -- s3</title><link>https://jdhao.github.io/2020/12/22/linux_command_cheat_sheet_s3/</link><pubDate>Tue, 22 Dec 2020 23:04:48 +0800</pubDate><guid>https://jdhao.github.io/2020/12/22/linux_command_cheat_sheet_s3/</guid><description>Calculate the stat of a column of numbers # Suppose we have a file where each line a number, and we want to the get stat of these numbers on the command line.
Use python # If Python is installed in the system, we can use the following command:
cat data.log | python3 -c &#34;import fileinput as FI,statistics as STAT; i = [float(l.strip()) for l in FI.input()]; print(&#39;min:&#39;, min(i), &#39; max: &#39;, max(i), &#39; avg: &#39;, STAT.</description></item><item><title>Introducing better-esacape.vim: My First Vim/Neovim Plugin</title><link>https://jdhao.github.io/2020/12/18/my_first_vim_plugin/</link><pubDate>Fri, 18 Dec 2020 23:22:20 +0800</pubDate><guid>https://jdhao.github.io/2020/12/18/my_first_vim_plugin/</guid><description><p>After using and learning Neovim for over 2 years, I have finally published my
first plugin &ndash; better-escape.vim.</p></description></item><item><title>Build C++ Project with CMake -- A Simple Example</title><link>https://jdhao.github.io/2020/12/12/build_opencv_project_with_cmake/</link><pubDate>Sat, 12 Dec 2020 11:07:21 +0800</pubDate><guid>https://jdhao.github.io/2020/12/12/build_opencv_project_with_cmake/</guid><description><p>For small projects, people tend to directly invoke the compiler with the
suitable options to build the program. While it is feasible, it is tedious to
type those compilation options and flags. For projects with multiple source
files and header files, it becomes inefficient to build by hand. On Linux,
people may write <a href="http://web.mit.edu/gnu/doc/html/make_2.html" target="_blank">Makefile</a> and
build with <a href="https://www.gnu.org/software/make/" target="_blank">make</a>. On Windows, people may
use Visual Studio for writing and build their project.</p></description></item><item><title>Why Are Some Libraries Linked by Default in GCC?</title><link>https://jdhao.github.io/2020/12/10/gcc_library_link_issue/</link><pubDate>Thu, 10 Dec 2020 23:22:57 +0800</pubDate><guid>https://jdhao.github.io/2020/12/10/gcc_library_link_issue/</guid><description><p>Different behavior of linkage between Clang and GCC.</p></description></item><item><title>Building OpenCV from Source on Linux</title><link>https://jdhao.github.io/2020/12/07/build_opencv_cpp_library_linux/</link><pubDate>Mon, 07 Dec 2020 23:25:18 +0800</pubDate><guid>https://jdhao.github.io/2020/12/07/build_opencv_cpp_library_linux/</guid><description><p>In this post, I will summarize how to build OpenCV from source, and introduce
how to use it when writing C++ programs.</p></description></item><item><title>Get Pinyin Initials of Chinese characters</title><link>https://jdhao.github.io/2020/12/04/pinyin_initials_of_chinese_char/</link><pubDate>Fri, 04 Dec 2020 23:08:18 +0800</pubDate><guid>https://jdhao.github.io/2020/12/04/pinyin_initials_of_chinese_char/</guid><description><p>To get a reasonably large collection of traditional and simplified Chinese
characters in use toady, we may use <a href="https://zhon.readthedocs.io/en/latest/" target="_blank">zhon</a>:</p></description></item><item><title>Setting up Neovim for C++ Development with LSP</title><link>https://jdhao.github.io/2020/11/29/neovim_cpp_dev_setup/</link><pubDate>Sun, 29 Nov 2020 23:55:52 +0800</pubDate><guid>https://jdhao.github.io/2020/11/29/neovim_cpp_dev_setup/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-02-08: update fastgit URL</font></li>
</ul>
</details>
<p>In this post, I would like to share how to set up Neovim for writing simple C++ programs.</p></description></item><item><title>A Better Mapping to Leave Insert Mode than jk</title><link>https://jdhao.github.io/2020/11/23/neovim_better_mapping_for_leaving_insert_mode/</link><pubDate>Mon, 23 Nov 2020 22:26:19 +0800</pubDate><guid>https://jdhao.github.io/2020/11/23/neovim_better_mapping_for_leaving_insert_mode/</guid><description><p><font color="blue">Update 2021-01-14: I ended up writing a plugin called
<a href="https://github.com/jdhao/better-escape.vim" target="_blank">better-escape.vim</a> which aims at
solving this issue.</font></p>
<p>A <a href="https://vi.stackexchange.com/q/300/15292" target="_blank">very popular insert mode mapping</a>
for Neovim/Vim is to map <code>jk</code> or <code>kj</code> or <code>jj</code> to <code>&lt;ESC&gt;</code> for quicker escaping
from the insert mode. I have used the following mapping for quite some time:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-vim" data-lang="vim"><span class="line"><span class="cl"><span class="nx">inoremap</span> <span class="nx">jk</span> <span class="p">&lt;</span><span class="nx">ESC</span><span class="p">&gt;</span>
</span></span></code></pre></div></description></item><item><title>The Correct Way to Create List of Empty List in Python</title><link>https://jdhao.github.io/2020/11/22/python_list_of_empty_list_pitfall/</link><pubDate>Sun, 22 Nov 2020 14:57:00 +0800</pubDate><guid>https://jdhao.github.io/2020/11/22/python_list_of_empty_list_pitfall/</guid><description><p>TL;DR: do not use list multiplication to initialize an empty list of list, or
you will end up wasting hours debugging your program.</p></description></item><item><title>几种中文分词工具对比</title><link>https://jdhao.github.io/2020/11/20/chinese_text_seg_tools/</link><pubDate>Fri, 20 Nov 2020 23:01:15 +0800</pubDate><guid>https://jdhao.github.io/2020/11/20/chinese_text_seg_tools/</guid><description><details>
<summary><font size="2" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2021-10-23: fix typo,更新链接。</font></li>
</ul>
</details>
对几种中文分词工具进行了调研,简单总结一下。</description></item><item><title>Pillow/PIL 缩放索引图像时的一个问题</title><link>https://jdhao.github.io/2020/11/18/pillow_image_resize_pitfall/</link><pubDate>Wed, 18 Nov 2020 23:38:02 +0800</pubDate><guid>https://jdhao.github.io/2020/11/18/pillow_image_resize_pitfall/</guid><description><p>今天遇到了<a href="https://www.v2ex.com/t/726518" target="_blank">一个有趣的问题</a>,有人在 v2ex 上说自己的图片,经过 <a href="https://python-pillow.org/" target="_blank">PIL</a> 缩放到 800x600 以后,非常模糊,有什么办法可以解决。</p></description></item><item><title>Set up Fuzzy Completion for Vim-lsp</title><link>https://jdhao.github.io/2020/11/16/vim_lsp_fuzzy_completion/</link><pubDate>Mon, 16 Nov 2020 22:37:02 +0800</pubDate><guid>https://jdhao.github.io/2020/11/16/vim_lsp_fuzzy_completion/</guid><description><p><font color="red">Update 2021-07-15: Note that pyls has been deprecated. There
is new fork of it called <a href="https://github.com/python-lsp/python-lsp-server" target="_blank">pylsp</a>, which is maintained by the
community.</font></p>
<p>In my <a href="https://jdhao.github.io/2020/11/04/replace_deoplete_jedi_for_LSP/" target="_blank">older post</a>, I have shared how to set up
auto-completion for vim-lsp with the help of deoplete. One annoyance is that I
can not use fuzzy matching for auto-completion: the completion items in the
pop-up completion menu seems to be selected base on prefix matching.</p></description></item><item><title>A Beginner's Guide on Creating Your Own Text Objects from Scratch in Neovim/Vim</title><link>https://jdhao.github.io/2020/11/15/nvim_text_objects/</link><pubDate>Sun, 15 Nov 2020 15:00:06 +0800</pubDate><guid>https://jdhao.github.io/2020/11/15/nvim_text_objects/</guid><description><p>Shortly after I started using <a href="https://github.com/neovim/neovim" target="_blank">Neovim</a>, I learned about the concept of <a href="https://neovim.io/doc/user/motion.html#text-objects" target="_blank">text objects</a>.
For example, when the cursor is inside a pair of <code>[]</code>, we can use <code>ci]</code> to
change text inside them. This is definitely one of the greatest moments on my
road of learning Vim. However, I haven&rsquo;t really thought about how does text
object really work.</p></description></item><item><title>Nifty Nvim/Vim Techniques That Make My Life Easier -- Series 8</title><link>https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</link><pubDate>Wed, 11 Nov 2020 22:43:47 +0800</pubDate><guid>https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</guid><description><p>This is the 8th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Notes on Using Python Regex Package</title><link>https://jdhao.github.io/2020/11/09/python_regex_notes/</link><pubDate>Mon, 09 Nov 2020 22:16:22 +0800</pubDate><guid>https://jdhao.github.io/2020/11/09/python_regex_notes/</guid><description><p>Some notes on using regular expressions in Python.</p></description></item><item><title>Set Up Lisp Dev Environment in Neovim</title><link>https://jdhao.github.io/2020/11/08/nvim_lisp_env_setup/</link><pubDate>Sun, 08 Nov 2020 23:43:20 +0800</pubDate><guid>https://jdhao.github.io/2020/11/08/nvim_lisp_env_setup/</guid><description><p>A quick summary on how to set up Lisp Development environment in Neovim.</p></description></item><item><title>Profiling Python Code with line_profiler</title><link>https://jdhao.github.io/2020/11/06/profile_python_line_profiler/</link><pubDate>Fri, 06 Nov 2020 01:03:18 +0800</pubDate><guid>https://jdhao.github.io/2020/11/06/profile_python_line_profiler/</guid><description><p>To profile Python code line by line, we can use <a href="https://github.com/pyutils/line_profiler" target="_blank">line_profiler</a><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.</p></description></item><item><title>Flake8 Config in Pyls for Code Linting.</title><link>https://jdhao.github.io/2020/11/05/pyls_flake8_setup/</link><pubDate>Thu, 05 Nov 2020 00:27:36 +0800</pubDate><guid>https://jdhao.github.io/2020/11/05/pyls_flake8_setup/</guid><description><p><font color="red">Update 2021-07-15: Note that pyls has been deprecated. There
is new fork of it called <a href="https://github.com/python-lsp/python-lsp-server" target="_blank">pylsp</a>, which is maintained by the
community.</font></p>
<p>In my <a href="https://jdhao.github.io/2020/11/04/replace_deoplete_jedi_for_LSP/" target="_blank">previous post</a>, I have go over the basic setup to make vim-lsp work.
However, I haven&rsquo;t touch on an important part of writing code: linting. It
turns out that configure it correctly is harder than I thought.</p></description></item><item><title>Replace Deoplete-jedi with LSP Finally</title><link>https://jdhao.github.io/2020/11/04/replace_deoplete_jedi_for_lsp/</link><pubDate>Wed, 04 Nov 2020 00:10:03 +0800</pubDate><guid>https://jdhao.github.io/2020/11/04/replace_deoplete_jedi_for_lsp/</guid><description><p><font color="red">Update 2021-07-15: Note that pyls has been deprecated. There is new fork of it called <a href="https://github.com/python-lsp/python-lsp-server" target="_blank">pylsp</a>, which is maintained by the community.</font></p>
<p>After using deoplete along with deoplete-jedi for more than two years, I have
finally decided to try something new for code completion. Yeah, you guess it,
the <a href="https://langserver.org/" target="_blank">Language Server Protocol</a> (LSP in short).</p></description></item><item><title>解决不蒜子 (busuanzi) 文章计数出错问题</title><link>https://jdhao.github.io/2020/10/31/busuanzi_pv_count_error/</link><pubDate>Sat, 31 Oct 2020 21:48:44 +0800</pubDate><guid>https://jdhao.github.io/2020/10/31/busuanzi_pv_count_error/</guid><description><p>一个月之前,就发现自己的博客用的计数系统<a href="https://busuanzi.ibruce.info/" target="_blank">“不蒜子”</a>对每篇博客访问量的统计出现了问题,刚写的博文,访问量都是几十万,显然不正常,但是很神奇,整个博客的访问量统计似乎并没有问题。当时也在 <a href="https://v2ex.com/t/707052#reply7" target="_blank">v2ex</a> 发帖咨询了,不过没有人给出合理的答案,今天偶然间<a href="https://github.com/flysnow-org/maupassant-hugo/pull/121" target="_blank">发现了原因</a>,发文记录。</p></description></item><item><title>杨振宁的一个采访</title><link>https://jdhao.github.io/2020/10/30/cn_yang_interview/</link><pubDate>Fri, 30 Oct 2020 00:53:27 +0800</pubDate><guid>https://jdhao.github.io/2020/10/30/cn_yang_interview/</guid><description><p>在 YouTube 上看到了<a href="https://en.wikipedia.org/wiki/Yang_Chen-Ning" target="_blank">杨振宁</a>在 2006 年的<a href="https://www.youtube.com/watch?v=6d3hZ8jnqXg" target="_blank">一个采访</a>,挺不错。</p></description></item><item><title>Edit Multiple Files at once in Neovim</title><link>https://jdhao.github.io/2020/10/28/edit_multiple_files_nvim/</link><pubDate>Wed, 28 Oct 2020 00:21:30 +0800</pubDate><guid>https://jdhao.github.io/2020/10/28/edit_multiple_files_nvim/</guid><description><p>When I was in a folder and tried to edit multiple files using glob pattern with the
following Neovim command:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-vim" data-lang="vim"><span class="line"><span class="cl"><span class="p">:</span><span class="nx">edit</span> *.<span class="nx">vim</span>
</span></span></code></pre></div><p>I was surprised to find that Neovim gives the following error message:</p>
<blockquote>
<p>E77: Too many file names.</p>
</blockquote></description></item><item><title>Bash Emacs-style Shortcut Cheatsheet</title><link>https://jdhao.github.io/2020/10/26/bash_emacs_style_shortcut/</link><pubDate>Mon, 26 Oct 2020 22:44:21 +0800</pubDate><guid>https://jdhao.github.io/2020/10/26/bash_emacs_style_shortcut/</guid><description><p>In Bash shell, when editting in the command line.
There are two different modes, <a href="https://unix.stackexchange.com/q/85390/221410" target="_blank">vi mode or Emacs mode</a>. Emacs-mode is the default mode.
Below are some of the handy shortcuts in Emacs-mode.</p></description></item><item><title>Switching Buffers in Neovim with mapping</title><link>https://jdhao.github.io/2020/10/16/nvim_switch_buffer_with_mapping/</link><pubDate>Fri, 16 Oct 2020 23:31:37 +0800</pubDate><guid>https://jdhao.github.io/2020/10/16/nvim_switch_buffer_with_mapping/</guid><description><p>I usually use <code>{num}Ctrl-6</code> to switch buffers in Neovim, where <code>{num}</code> is the
number of buffer (see <a href="https://jdhao.github.io/2018/09/29/Switching_buffers_quickly_Neovim/" target="_blank">this post</a>).
Since Neovim has built-in <code>gt</code> mapping to switch between tabpages, I thought it
might be a good idea to use <code>gb</code> as buffer switching shortcut avoid strech when
pressing <code>Ctrl-6</code>.</p></description></item><item><title>How to Insert Unicode Characters in Neovim/Vim</title><link>https://jdhao.github.io/2020/10/07/nvim_insert_unicode_char/</link><pubDate>Wed, 07 Oct 2020 16:57:53 +0800</pubDate><guid>https://jdhao.github.io/2020/10/07/nvim_insert_unicode_char/</guid><description><p>Except for the ASCII characters, it is often not straightforward to insert Unicode characters into Vim/Neovim.
Below I will summarize a few ways to enter Unicode characters inside Neovim/Vim.</p></description></item><item><title>美国普罗米修斯--奥本海默传</title><link>https://jdhao.github.io/2020/10/03/american_prometheus_jro/</link><pubDate>Sat, 03 Oct 2020 00:26:45 +0800</pubDate><guid>https://jdhao.github.io/2020/10/03/american_prometheus_jro/</guid><description><p>最近一个月读了 Kai bird 和 Martin J. Sherwin 的<a href="https://www.goodreads.com/book/show/80571.American_Prometheus" target="_blank">《American prometheus》</a>,这本书是著名物理学家奥本海默的传记,详细讲述了奥本海默的一生。为了写这本书,作者花了 25 年的时间,做了很多采访,查看了很多 FBI 关于奥本海默的资料。这本书是关于奥本海默的权威著作,2005 甫一问世, 2006 年就获得了<a href="https://www.pulitzer.org/winners/kai-bird-and-martin-j-sherwin" target="_blank">普利策奖(传记类)</a>。</p></description></item><item><title>Nifty Nvim/Vim Techniques That Make My Life Easier -- Series 7</title><link>https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</link><pubDate>Tue, 22 Sep 2020 22:39:15 +0800</pubDate><guid>https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</guid><description><p>This is the 7th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Highlight Groups Cleared after Starting Neovim</title><link>https://jdhao.github.io/2020/09/22/highlight_groups_cleared_in_nvim/</link><pubDate>Tue, 22 Sep 2020 22:30:16 +0800</pubDate><guid>https://jdhao.github.io/2020/09/22/highlight_groups_cleared_in_nvim/</guid><description><p>I want to use a custom highlight group for <a href="https://neovim.io/doc/user/lua.html#lua-highlight" target="_blank">yank highlighting</a>.
Initially, I use the predefined highlight group <code>IncSearch</code>. I thought it a bit
dim and want something brighter. So I defined the following highlight group:</p></description></item><item><title>Grammar Check in Neovim with LanguageTool</title><link>https://jdhao.github.io/2020/09/20/nvim_grammar_check_languagetool/</link><pubDate>Sun, 20 Sep 2020 22:47:19 +0800</pubDate><guid>https://jdhao.github.io/2020/09/20/nvim_grammar_check_languagetool/</guid><description><p>As a Neovim user who writes frequently, I want to use Neovim to check my
grammar before posting it in my blog. In this post, I will compare several
plugins used for grammar checking. Under the hood, they all use the opensource
tool <a href="https://languagetool.org/" target="_blank">languagetool</a>.</p></description></item><item><title>Find Line History in Git</title><link>https://jdhao.github.io/2020/09/14/git_find_line_history/</link><pubDate>Mon, 14 Sep 2020 23:57:01 +0800</pubDate><guid>https://jdhao.github.io/2020/09/14/git_find_line_history/</guid><description><p>When we are working on a real project, we may want to know from which commit a particular line is introduced.</p></description></item><item><title>Tqdm Issues and Tips</title><link>https://jdhao.github.io/2020/09/05/tqdm_tips/</link><pubDate>Sat, 05 Sep 2020 00:23:28 +0800</pubDate><guid>https://jdhao.github.io/2020/09/05/tqdm_tips/</guid><description><p><a href="https://github.com/tqdm/tqdm" target="_blank">Tqdm</a> is a popular package to show a progress
bar. Here are a few tips when using tqdm.</p></description></item><item><title>A List of Common Git-branch Operations</title><link>https://jdhao.github.io/2020/09/03/git_branch_operations/</link><pubDate>Thu, 03 Sep 2020 23:41:00 +0800</pubDate><guid>https://jdhao.github.io/2020/09/03/git_branch_operations/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202021114754.jpg" width="800">
</p>
<details>
<summary><font size="2" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2022-08-20: Add how to remove remote tracking branches that does not exist anymore</font></li>
</ul>
</details>
<p>This post summarizes some commonly used Git commands related to branch operations.</p></description></item><item><title>My Settings for the Fuzzy-finder LeaderF</title><link>https://jdhao.github.io/2020/08/26/leaderf_nvim_settings/</link><pubDate>Wed, 26 Aug 2020 23:24:20 +0800</pubDate><guid>https://jdhao.github.io/2020/08/26/leaderf_nvim_settings/</guid><description><p><a href="https://github.com/Yggdroot/LeaderF" target="_blank">LeaderF</a> is Vim/Neovim plugin to fuzzy-search files, colorschemes, tags etc. quickly.
It works across different platforms flawlessly.
Here are some of its settings to address minor issues.</p></description></item><item><title>从产品猜测设计</title><link>https://jdhao.github.io/2020/08/24/thought_on_product_design/</link><pubDate>Mon, 24 Aug 2020 01:04:34 +0800</pubDate><guid>https://jdhao.github.io/2020/08/24/thought_on_product_design/</guid><description><p>关于产品设计的一些想法。</p></description></item><item><title>Measuring Code Running Time with contextmanager</title><link>https://jdhao.github.io/2020/08/18/context_manager_for_measuring_runtime/</link><pubDate>Tue, 18 Aug 2020 22:15:17 +0800</pubDate><guid>https://jdhao.github.io/2020/08/18/context_manager_for_measuring_runtime/</guid><description><p>In Python, context manager is a great way to handle the closing of resources. It
makes sure that resources are correctly closed after their use.</p></description></item><item><title>Create Outline Text in Python with Pillow</title><link>https://jdhao.github.io/2020/08/18/pillow_create_text_outline/</link><pubDate>Tue, 18 Aug 2020 22:12:11 +0800</pubDate><guid>https://jdhao.github.io/2020/08/18/pillow_create_text_outline/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-04-12: add warning about dangers of omitting stroke_fill parameter.</font></li>
</ul>
</details>
<p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20200818221311.png" width="400">
</p>
<p>Sometimes, we may want to add outline color to text strokes with Pillow.
Prior to version 6.2.0, we can not do this in Pillow.
Fortunately, starting from version 6.2.0, pillow supports text outlines natively in its <a href="https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.text" target="_blank"><code>ImageDraw.text()</code></a> method.</p></description></item><item><title>The Warmup Trick for Training Deep Neural Networks</title><link>https://jdhao.github.io/2020/08/14/warmup_maskrcnn_how_does_it_work/</link><pubDate>Fri, 14 Aug 2020 23:04:54 +0800</pubDate><guid>https://jdhao.github.io/2020/08/14/warmup_maskrcnn_how_does_it_work/</guid><description><p>Warmup is a training technique often used in training deep neural networks.
In this post, I will try to explain what is warmup, and how does it work.</p></description></item><item><title>MIUI 12 输入法无法复制文本到剪切板</title><link>https://jdhao.github.io/2020/08/06/miui12_clipboard_issue/</link><pubDate>Thu, 06 Aug 2020 23:45:44 +0800</pubDate><guid>https://jdhao.github.io/2020/08/06/miui12_clipboard_issue/</guid><description><p>MIUI 12 更新以后,新增了更加细致的权限管理和隐私保护功能。</p>
<p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20200806235442.jpeg" width="200">
</p></description></item><item><title>Note on font size</title><link>https://jdhao.github.io/2020/08/04/fontsize_point_pixel_relationship/</link><pubDate>Tue, 04 Aug 2020 23:01:55 +0800</pubDate><guid>https://jdhao.github.io/2020/08/04/fontsize_point_pixel_relationship/</guid><description>Relationship between point and pixel size # In digital typography, the size of text is commonly specified in points (pt). What is a point? A point is 1/72 of an inch (25.4 mm), i.e., 0.3528 mm (25.4/72). Therefor, point is a physical unit that has absolute value.
Pixels are the smallest unit on screen to display images and graphics. It is not a physical unit. So there is no fixed relationship between point and pixel.</description></item><item><title>pip bad interpreter issue</title><link>https://jdhao.github.io/2020/07/29/pip_bad_interpreter/</link><pubDate>Wed, 29 Jul 2020 23:23:45 +0800</pubDate><guid>https://jdhao.github.io/2020/07/29/pip_bad_interpreter/</guid><description><p>I am using pip installed via <a href="https://docs.conda.io/en/latest/miniconda.html" target="_blank">minconda</a>. I installed it
under <code>~/miniconda3</code> and then move the installation directory to
<code>~/tools/miniconda3</code>. After that, I changed the <code>PATH</code> accordingly. However,
when I use pip, I am seeing the following error:</p></description></item><item><title>Using Multiprocessing in Python</title><link>https://jdhao.github.io/2020/07/27/python_multiprocessing/</link><pubDate>Mon, 27 Jul 2020 23:58:56 +0800</pubDate><guid>https://jdhao.github.io/2020/07/27/python_multiprocessing/</guid><description><p>One way to achieve parallelism is to use multi-processing, where we can
execute tasks in different cores of the CPU to reduce the total processing
time. Python provides the <a href="https://docs.python.org/3/library/multiprocessing.html" target="_blank">multiprocessing</a> package to facilitate this.</p>
<p>This post summarizes some of the questions I have when I learn to use
multiprocessing in Python.</p></description></item><item><title>Linux Tips and Tricks -- s2</title><link>https://jdhao.github.io/2020/07/23/linux_command_cheat_sheet_s2/</link><pubDate>Thu, 23 Jul 2020 00:17:04 +0800</pubDate><guid>https://jdhao.github.io/2020/07/23/linux_command_cheat_sheet_s2/</guid><description><p>A list of Linux command for common operations.</p></description></item><item><title>Why Cannot I Get the Value of A Env Variable in Python?</title><link>https://jdhao.github.io/2020/07/15/python_can_got_env_variable_value/</link><pubDate>Wed, 15 Jul 2020 22:17:07 +0800</pubDate><guid>https://jdhao.github.io/2020/07/15/python_can_got_env_variable_value/</guid><description><p>I found a strange issue when I wanted to get the value of an env variable from
Python script.</p></description></item><item><title>Note on Using requests package</title><link>https://jdhao.github.io/2020/07/09/requests_notes/</link><pubDate>Thu, 09 Jul 2020 23:30:14 +0800</pubDate><guid>https://jdhao.github.io/2020/07/09/requests_notes/</guid><description>How to check request header and body? # When making requests, we may want to see exactly what are being requested. With requests, it is easy do access the request header and request body:
import requests url = &#34;http://httpbin.org/post&#34; payload = {&#34;apple&#34;: 10, &#34;pear&#34;: [20, 30], &#34;img&#34;: &#34;http://example.com/demo.jpg&#34;} r = requests.post(url, json=payload) print(f&#34;request headers: {r.request.headers}&#34;) print(f&#34;request body: {r.request.body}&#34;) A sample output is:
request headers: {&#39;User-Agent&#39;: &#39;python-requests/2.19.1&#39;, &#39;Accept-Encoding&#39;: &#39;gzip, deflate&#39;, &#39;Accept&#39;: &#39;*/*&#39;, &#39;Connection&#39;: &#39;keep-alive&#39;, &#39;Content-Length&#39;: &#39;69&#39;, &#39;Content-Type&#39;: &#39;application/json&#39;} request body: b&#39;{&#34;apple&#34;: 10, &#34;pear&#34;: [20, 30], &#34;img&#34;: &#34;http://example.</description></item><item><title>Set the Number of Threads to Use in PyTorch</title><link>https://jdhao.github.io/2020/07/06/pytorch_set_num_threads/</link><pubDate>Mon, 06 Jul 2020 23:15:25 +0800</pubDate><guid>https://jdhao.github.io/2020/07/06/pytorch_set_num_threads/</guid><description><p>In this post, I will share how PyTorch set the number of the threads to use for
its operations.</p></description></item><item><title>如何找到技术问题根源?</title><link>https://jdhao.github.io/2020/07/05/how_to_find_casue_of_technical_issues/</link><pubDate>Sun, 05 Jul 2020 00:35:48 +0800</pubDate><guid>https://jdhao.github.io/2020/07/05/how_to_find_casue_of_technical_issues/</guid><description><p>在实际编程中,我们总会遇到各种各样的代码运行问题,如何快速发现问题的根源需要一些系统的方法,构造一个最小的能够复现错误的环境至关重要,也就是所谓的 <a href="https://stackoverflow.com/help/minimal-reproducible-example" target="_blank">MWE</a>,minimal working example。</p></description></item><item><title>Switch Command with update-alternatives on Ubuntu</title><link>https://jdhao.github.io/2020/07/02/ubuntu_update_alternatives/</link><pubDate>Thu, 02 Jul 2020 23:06:40 +0800</pubDate><guid>https://jdhao.github.io/2020/07/02/ubuntu_update_alternatives/</guid><description><p>To build different projects, we may need to install different versions of the
same software. To use a specific version, we may need to create a sym link to
that version of the executable.</p></description></item><item><title>uWSGI Install and Use Issues</title><link>https://jdhao.github.io/2020/07/02/uwsgi_install_use_issue/</link><pubDate>Thu, 02 Jul 2020 01:02:17 +0800</pubDate><guid>https://jdhao.github.io/2020/07/02/uwsgi_install_use_issue/</guid><description><p>My notes on several issues when installing and running <a href="https://uwsgi-docs.readthedocs.io/en/latest/" target="_blank">uWSGI</a>.</p></description></item><item><title>Downloading Images Faster with requests Sessions</title><link>https://jdhao.github.io/2020/06/21/faster_im_download_with_requests/</link><pubDate>Sun, 21 Jun 2020 22:13:05 +0800</pubDate><guid>https://jdhao.github.io/2020/06/21/faster_im_download_with_requests/</guid><description><p>In my <a href="https://jdhao.github.io/2020/06/17/download_image_from_url_python/" target="_blank">previous post</a>,
I write about how to download an image from URL using <a href="https://github.com/psf/requests" target="_blank">requests</a>.
In this post, I want to share ways to make the download speed faster.</p></description></item><item><title>IrfanView Settings</title><link>https://jdhao.github.io/2020/06/20/irfanview_usage/</link><pubDate>Sat, 20 Jun 2020 00:53:59 +0800</pubDate><guid>https://jdhao.github.io/2020/06/20/irfanview_usage/</guid><description><p><a href="https://www.irfanview.com/" target="_blank">IrfanView</a> is a lightweight, fast and powerful
image viewer for Windows. Here are some settings to make it more useful.</p></description></item><item><title>Duplicate Logging Messages in Python</title><link>https://jdhao.github.io/2020/06/20/python_duplicate_logging_messages/</link><pubDate>Sat, 20 Jun 2020 00:45:12 +0800</pubDate><guid>https://jdhao.github.io/2020/06/20/python_duplicate_logging_messages/</guid><description><p>When I am working on a project, I find that the same message is printed twice.
The following minimal code can reproduce this issue:</p></description></item><item><title>How to Download Image from URL using Python</title><link>https://jdhao.github.io/2020/06/17/download_image_from_url_python/</link><pubDate>Wed, 17 Jun 2020 09:19:30 +0800</pubDate><guid>https://jdhao.github.io/2020/06/17/download_image_from_url_python/</guid><description><p>Recently, I want to download some images using Python.
This is what I&rsquo;ve learned after the survey.</p></description></item><item><title>Tmux: Open Terminal Failed in Kitty Terminal</title><link>https://jdhao.github.io/2020/06/14/kitty_tmux_open_terminal_fail/</link><pubDate>Sun, 14 Jun 2020 18:04:06 +0800</pubDate><guid>https://jdhao.github.io/2020/06/14/kitty_tmux_open_terminal_fail/</guid><description><p>I have several terminal emulators installed on my Mac: <a href="https://sw.kovidgoyal.net/kitty/" target="_blank">kitty</a>,
<a href="https://github.com/alacritty/alacritty" target="_blank">Alacritty</a> and <a href="https://www.iterm2.com/" target="_blank">iterm2</a>.
When I start a Tmux session in Alacritty and try to create another tmux session
in kitty, I noticed this strange error that I have never met before:</p></description></item><item><title>Serving Flask Applications with uWSGI</title><link>https://jdhao.github.io/2020/06/13/flask_serving_via_wsgi_server/</link><pubDate>Sat, 13 Jun 2020 21:44:44 +0800</pubDate><guid>https://jdhao.github.io/2020/06/13/flask_serving_via_wsgi_server/</guid><description><p>In my <a href="https://jdhao.github.io/2020/04/06/build_webapi_with_flask_s1/" target="_blank">older post</a>, I have shared how to run the built-in development server to serve Flask web service.
For production, we need to use more powerful web servers.
Flask complies to the <a href="https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface" target="_blank">WSGI</a> specification and can work with any web server that conforms to WSGI.</p>
<p>In this post, I want share how to run Flask applications using <a href="https://uwsgi-docs.readthedocs.io/en/latest/" target="_blank">uWSGI</a> &mdash; a popular WSGI-compliant server.</p></description></item><item><title>Virtual Environment Management with Conda</title><link>https://jdhao.github.io/2020/06/11/conda_env_management/</link><pubDate>Thu, 11 Jun 2020 00:10:43 +0800</pubDate><guid>https://jdhao.github.io/2020/06/11/conda_env_management/</guid><description><p><a href="https://docs.conda.io/projects/conda/en/latest/" target="_blank">Conda</a> is the default package
and environment management tool shipped with
<a href="https://www.anaconda.com/products/individual" target="_blank">Anaconda</a>.</p>
<p>This post logs my cheatsheet and notes for working with virtual environments
with conda.</p></description></item><item><title>Set Timezone inside Docker Container</title><link>https://jdhao.github.io/2020/06/11/linux_set_timezone/</link><pubDate>Thu, 11 Jun 2020 00:03:30 +0800</pubDate><guid>https://jdhao.github.io/2020/06/11/linux_set_timezone/</guid><description><p>After running a Ubuntu docker container, I found that the default time zone is
UTC. I want to change it to my local timezone.</p></description></item><item><title>How to Use Asyncio with Flask Applications</title><link>https://jdhao.github.io/2020/06/07/asyncio_inside_flask/</link><pubDate>Sun, 07 Jun 2020 20:02:18 +0800</pubDate><guid>https://jdhao.github.io/2020/06/07/asyncio_inside_flask/</guid><description><p>I was using <a href="https://docs.python.org/3/library/asyncio.html" target="_blank">asyncio</a> inside a
view function for Flask to run some asynchronous functions and met an error.</p></description></item><item><title>Markdown Writing Tricks</title><link>https://jdhao.github.io/2020/06/01/markdown_writing_tricks/</link><pubDate>Mon, 01 Jun 2020 22:44:14 +0800</pubDate><guid>https://jdhao.github.io/2020/06/01/markdown_writing_tricks/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-02-08: Add sections on using CSS with Markdown.</font></li>
</ul>
</details>
<p>In this post, I share some of the tricks that will Make the Markdown file better and more beautiful.</p></description></item><item><title>Why You Should Use Snippets in Vim/Neovim</title><link>https://jdhao.github.io/2020/05/27/why_you_should_use_snippets_in_vim/</link><pubDate>Wed, 27 May 2020 22:46:19 +0800</pubDate><guid>https://jdhao.github.io/2020/05/27/why_you_should_use_snippets_in_vim/</guid><description><p>If you find yourself repeatedly type some similar-structured text in Vim/Nvim,
you need to ask yourself if there is a better way to do it.</p></description></item><item><title>Highlight Yanked Region in Nvim/Vim</title><link>https://jdhao.github.io/2020/05/22/highlight_yank_region_nvim/</link><pubDate>Fri, 22 May 2020 20:48:26 +0800</pubDate><guid>https://jdhao.github.io/2020/05/22/highlight_yank_region_nvim/</guid><description><p><strong>update (2020-09-19): update the settings for Nvim to reflect the latest
changes in API.</strong></p>
<p>In Vim or Neovim, showing the yanked region in color gives use visual feedback
on what we have copied. Here is how you can highlight yanked region in Vim or
Neovim.</p></description></item><item><title>AI 的噱头</title><link>https://jdhao.github.io/2020/05/22/the_ai_hype/</link><pubDate>Fri, 22 May 2020 20:41:01 +0800</pubDate><guid>https://jdhao.github.io/2020/05/22/the_ai_hype/</guid><description><p>人工智能 (AI)甚嚣尘上,动则称颠覆,各家公司纷纷推出了自己的 AI 产品,但是这些产品真的有那么多人用吗?</p></description></item><item><title>Justmysocks 支持 v2ray 协议了!</title><link>https://jdhao.github.io/2020/05/22/v2ray_justmysocks/</link><pubDate>Fri, 22 May 2020 00:40:58 +0800</pubDate><guid>https://jdhao.github.io/2020/05/22/v2ray_justmysocks/</guid><description><p>two meetings 即将或者正在召开,上个谷歌也越来越难,最近墙对各种工具的阻断非常严重,连之前<a href="https://jdhao.github.io/2020/04/25/shadowsocks_obfs_setup/" target="_blank">使用了 obfs 的 ss</a> 都不行了,最近一段时间也处于时断时续的状态。</p>
<p>Justmysocks 之前一直用的都是 shadowsocks 协议,对墙的反制能力不行,每到关键时候就显露疲态。好消息是,justmysocks 终于在最近推出了基于 <a href="https://www.v2ray.com/en/" target="_blank">v2ray</a> 协议的线路。</p></description></item><item><title>Space for CJK Languages (CJK 语言中的空格)</title><link>https://jdhao.github.io/2020/05/16/space_for_cjk/</link><pubDate>Sat, 16 May 2020 22:04:23 +0800</pubDate><guid>https://jdhao.github.io/2020/05/16/space_for_cjk/</guid><description><p>I was doing some typograph for Chinese text and want to insert a space equal to
the width of a Chinese character.</p>
<p><font color="red">最近在做一些中文排版的工作,有一个需求是在中文字符之间插入空格,并且空格的宽度等于中文字符的宽度,在某些情况下这样排版显得更加美观。</font></p></description></item><item><title>如何高效使用搜索引擎解决技术问题</title><link>https://jdhao.github.io/2020/05/09/search_for_solution_with_web_engine/</link><pubDate>Sat, 09 May 2020 01:07:09 +0800</pubDate><guid>https://jdhao.github.io/2020/05/09/search_for_solution_with_web_engine/</guid><description><p>之前感叹过<a href="https://jdhao.github.io/2020/01/22/why_use_english_and_google/" target="_blank">使用中文搜索经常找不到想要的结果</a>,这篇文章总结我对于如何有效搜索的一些想法。</p></description></item><item><title>Git Learning Notes (2)</title><link>https://jdhao.github.io/2020/05/07/git_learning_notes_s2/</link><pubDate>Thu, 07 May 2020 00:35:45 +0800</pubDate><guid>https://jdhao.github.io/2020/05/07/git_learning_notes_s2/</guid><description><p>My Git learning notes.</p></description></item><item><title>Kitty Terminal Config on Mac</title><link>https://jdhao.github.io/2020/05/05/kitty_config_mac/</link><pubDate>Tue, 05 May 2020 20:52:40 +0800</pubDate><guid>https://jdhao.github.io/2020/05/05/kitty_config_mac/</guid><description><details>
<summary><font size="2" color="red">Changelog</font></summary>
<ul>
<li><font color="blue">2021-08-21: Update the part on how to open URLs since some options are removed.</font></li>
</ul>
</details>
<p><a href="https://github.com/kovidgoyal/kitty" target="_blank">Kitty</a> is a fast and lightweight terminal
emulator for Mac and Linux. In this post, I will summarize some of its
settings.</p></description></item><item><title>Docker 学习系列 --- 2</title><link>https://jdhao.github.io/2020/05/02/docker_knowledge_s2/</link><pubDate>Sat, 02 May 2020 16:18:30 +0800</pubDate><guid>https://jdhao.github.io/2020/05/02/docker_knowledge_s2/</guid><description><p>本文总结一些 Docker 使用以及 Docker 镜像构建过程中遇到的问题。</p></description></item><item><title>Docker 学习系列 --- 1</title><link>https://jdhao.github.io/2020/05/02/docker_knowledge_s1/</link><pubDate>Sat, 02 May 2020 15:23:59 +0800</pubDate><guid>https://jdhao.github.io/2020/05/02/docker_knowledge_s1/</guid><description><p>Docker 是一种类似虚拟机的机制,允许我们在 host 机器创建一个隔绝的小型操作系统环境,并且可以保存下这个环境(称为 Docker 镜像),把这个 Docker 镜像部署到其他 host 机器,各个机器上的环境完全一致。这样我们就不需要每次在部署新环境的时候,重复执行安装程序、配置环境的流程,大大简化了我们的工作,提升了工作效率。</p></description></item><item><title>Bash Script Note 1</title><link>https://jdhao.github.io/2020/04/27/bash_script_notes_s1/</link><pubDate>Mon, 27 Apr 2020 22:00:48 +0800</pubDate><guid>https://jdhao.github.io/2020/04/27/bash_script_notes_s1/</guid><description><h1 class="relative group">Writing robust scripts
<div id="writing-robust-scripts" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#writing-robust-scripts" aria-label="Anchor">#</a>
</span>
</h1>
<p>We should use the following options in our bash script for better quality:</p></description></item><item><title>解决 Windows 下文件管理器中右键单击无响应问题</title><link>https://jdhao.github.io/2020/04/26/windows_context_menu_hang_solution/</link><pubDate>Sun, 26 Apr 2020 22:44:37 +0800</pubDate><guid>https://jdhao.github.io/2020/04/26/windows_context_menu_hang_solution/</guid><description><h1 class="relative group">引子
<div id="%E5%BC%95%E5%AD%90" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#%E5%BC%95%E5%AD%90" aria-label="Anchor">#</a>
</span>
</h1>
<p>最近使用工作电脑的时候,不知道为什么,在文件资源管理器里面鼠标右键单击打开菜单(也叫<a href="https://en.wikipedia.org/wiki/Context_menu" target="_blank">context menu</a>)的时候,系统很大概率会卡顿,鼠标指针开始转圈,文件管理器白屏,然后会提示&quot;未响应&quot;,过一会儿,右键菜单才会出现。以至于我每次点击右键之前,都很烦躁,希望不要出现卡顿的情况。</p></description></item><item><title>Shadowsocks 配置 obfs</title><link>https://jdhao.github.io/2020/04/25/shadowsocks_obfs_setup/</link><pubDate>Sat, 25 Apr 2020 00:44:29 +0800</pubDate><guid>https://jdhao.github.io/2020/04/25/shadowsocks_obfs_setup/</guid><description><p>最近几个月在手机上使用 justmysocks,感觉速度很慢,经常断流,连接不上。通过搜索,发现原因是使用的线路问题。为了学习之用,我们可以通过配置 <a href="https://github.com/shadowsocks/simple-obfs" target="_blank">obfs</a> 增强服务稳定性。</p></description></item><item><title>How to Use Unified Logging Config Across Your Project</title><link>https://jdhao.github.io/2020/04/24/python_logging_for_multiple_modules/</link><pubDate>Fri, 24 Apr 2020 01:12:43 +0800</pubDate><guid>https://jdhao.github.io/2020/04/24/python_logging_for_multiple_modules/</guid><description><p>When we are working on a project, we often need to log some message for easier debugging.
How do we configure logging once and use it across the project?</p></description></item><item><title>Git Learning Notes (1)</title><link>https://jdhao.github.io/2020/04/23/git_learning_notes_s1/</link><pubDate>Thu, 23 Apr 2020 00:05:20 +0800</pubDate><guid>https://jdhao.github.io/2020/04/23/git_learning_notes_s1/</guid><description><p>This is my personal note on learning Git.</p></description></item><item><title>Set up for C++/C Development in Neovim</title><link>https://jdhao.github.io/2020/04/19/nvim_cpp_and_c_completion/</link><pubDate>Sun, 19 Apr 2020 18:17:56 +0800</pubDate><guid>https://jdhao.github.io/2020/04/19/nvim_cpp_and_c_completion/</guid><description><p>This post summarizes how to set up various plugins needed for C++/C code
editing, linting and formatting.</p></description></item><item><title>Get Current Time with Time Zone Info in Python</title><link>https://jdhao.github.io/2020/04/17/python_datetime_timezone/</link><pubDate>Fri, 17 Apr 2020 21:54:48 +0800</pubDate><guid>https://jdhao.github.io/2020/04/17/python_datetime_timezone/</guid><description><p>I am trying to generate a custom time format using the Python <code>datetime</code>
package. My original code is:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="cl"><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="nb">print</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span><span class="o">.</span><span class="n">strftime</span><span class="p">(</span><span class="s2">&#34;%Y-%m-</span><span class="si">%d</span><span class="s2"> %H:%M:%S%z&#34;</span><span class="p">))</span>
</span></span></code></pre></div></description></item><item><title>Build Web API with Flask --- Work with JSON-like Dict</title><link>https://jdhao.github.io/2020/04/13/build_webapi_with_flask_s3/</link><pubDate>Mon, 13 Apr 2020 22:29:23 +0800</pubDate><guid>https://jdhao.github.io/2020/04/13/build_webapi_with_flask_s3/</guid><description><p>This is a simple post about how to send JSON-like Dict data to a Flask server
via <a href="https://requests.readthedocs.io/en/master/" target="_blank">requests</a> package.</p></description></item><item><title>Build Web API with Flask -- Post and Receive Image</title><link>https://jdhao.github.io/2020/04/12/build_webapi_with_flask_s2/</link><pubDate>Sun, 12 Apr 2020 20:11:52 +0800</pubDate><guid>https://jdhao.github.io/2020/04/12/build_webapi_with_flask_s2/</guid><description><p>In this post, I want to write about how to build a simple image processing web
API that returns the size of an image. The topics include how to build this web
API with Flask and how to post image to this web API and get response.</p></description></item><item><title>Build A Web API Service Using Flask -- The Basics</title><link>https://jdhao.github.io/2020/04/06/build_webapi_with_flask_s1/</link><pubDate>Mon, 06 Apr 2020 22:05:07 +0800</pubDate><guid>https://jdhao.github.io/2020/04/06/build_webapi_with_flask_s1/</guid><description><p>Web API is a kind of web application. Simply put, web APIs are built for other
applications to get info from the web server. For Python,
<a href="https://flask.palletsprojects.com/en/1.1.x/" target="_blank">Flask</a> can be used to build web
applications. In this post, I want to share how to build web APIs with Flask.</p></description></item><item><title>Convert PPTX Document to JPEG Images on Ubuntu</title><link>https://jdhao.github.io/2020/03/30/pptx_to_image/</link><pubDate>Mon, 30 Mar 2020 22:30:20 +0800</pubDate><guid>https://jdhao.github.io/2020/03/30/pptx_to_image/</guid><description><details>
<summary><font size="2" color="red">Changelog</font></summary>
<ul>
<li><font color="blue">2020-12-24: Add how to convert pptx to pdf using unoconv.</font></li>
</ul>
</details>
<p>In this post, I will share how to convert PPTX file to images. There are two steps.
The first step is to convert PPTX to PDF, and the second step is to convert PDF to JPEG.</p></description></item><item><title>Conversion between base64 and OpenCV or PIL Image</title><link>https://jdhao.github.io/2020/03/17/base64_opencv_pil_image_conversion/</link><pubDate>Tue, 17 Mar 2020 23:08:32 +0800</pubDate><guid>https://jdhao.github.io/2020/03/17/base64_opencv_pil_image_conversion/</guid><description><p>When we are building web services using Python, we often send or receive images
in <a href="https://docs.python.org/3/library/base64.html" target="_blank">base64</a> encoded format.
However, when we are doing image processing tasks, we need to use PIL or
OpenCV. In this post, I will share how to convert between OpenCV or PIL image
and base64 encoded image.</p></description></item><item><title>腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名)</title><link>https://jdhao.github.io/2020/03/16/tencent_cos_cdn_setup/</link><pubDate>Mon, 16 Mar 2020 00:48:59 +0800</pubDate><guid>https://jdhao.github.io/2020/03/16/tencent_cos_cdn_setup/</guid><description><p>本文主要分享腾讯云对象存储开启 CDN 的方法,不需要购买额外的域名。</p></description></item><item><title>Search and Replace in Multiple Files in Vim/Neovim</title><link>https://jdhao.github.io/2020/03/14/nvim_search_replace_multiple_file/</link><pubDate>Sat, 14 Mar 2020 23:20:06 +0800</pubDate><guid>https://jdhao.github.io/2020/03/14/nvim_search_replace_multiple_file/</guid><description>In Sublime-Text and other editors, we can press Ctrl-Shift-F to invoke the search and replace UI. We can also accomplish this task easily in Vim or Neovim with the built-in features. Here is how.
There are two steps involved in this task. The first step is to find the files containing the search pattern under the current project or directory. The second step is to perform replacement for each file found in 1st step.</description></item><item><title>Change Table Column Width in LaTeX</title><link>https://jdhao.github.io/2020/03/08/change_table_column_width_latex/</link><pubDate>Sun, 08 Mar 2020 12:05:37 +0800</pubDate><guid>https://jdhao.github.io/2020/03/08/change_table_column_width_latex/</guid><description><p>When we <a href="https://jdhao.github.io/2019/08/27/latex_table_with_booktabs/" target="_blank">create tables in LaTeX</a>,
the table column width will be automatically decided based on the content in
the table cell. Sometimes, maybe we are not satisfied with the default column
width and want to customize the column width. In this post, we will explain how
to it in LaTeX.</p></description></item><item><title>Image or Table Side by Side in LaTeX</title><link>https://jdhao.github.io/2020/03/07/latex_figure_table_side_by_side_en/</link><pubDate>Sat, 07 Mar 2020 21:41:38 +0800</pubDate><guid>https://jdhao.github.io/2020/03/07/latex_figure_table_side_by_side_en/</guid><description><p>When we are writing articles using LaTeX, we often need to create side-by-side images or tables. In this post,
I summarize several methods to achieve that.</p></description></item><item><title>LaTeX 并排显示图像或表格</title><link>https://jdhao.github.io/2020/03/07/latex_figure_table_side_by_side_zh/</link><pubDate>Sat, 07 Mar 2020 19:46:03 +0800</pubDate><guid>https://jdhao.github.io/2020/03/07/latex_figure_table_side_by_side_zh/</guid><description><p>使用 LaTeX 写文章的时候,经常需要并排显示图片或者表格,本文总结几种实现方法。</p></description></item><item><title>Tips on Writing Papers in LaTeX</title><link>https://jdhao.github.io/2020/03/06/latex_writing_tips_s2/</link><pubDate>Fri, 06 Mar 2020 18:42:18 +0800</pubDate><guid>https://jdhao.github.io/2020/03/06/latex_writing_tips_s2/</guid><description><p>Some useful tips on writing papers in LaTeX.</p></description></item><item><title>Point to Line Distance in 2D Plane</title><link>https://jdhao.github.io/2020/02/23/point_to_line_dist_2d/</link><pubDate>Sun, 23 Feb 2020 18:36:27 +0800</pubDate><guid>https://jdhao.github.io/2020/02/23/point_to_line_dist_2d/</guid><description><p>Suppose that we have a straight line formed by point B and C, and we
have another point A. What is the distance from point A to line BC?</p></description></item><item><title>解决 Matplotlib 使用中文乱码问题</title><link>https://jdhao.github.io/2020/02/22/guide-on-how-to-use-chinese-with-matplotlib_zh/</link><pubDate>Sat, 22 Feb 2020 11:41:09 +0800</pubDate><guid>https://jdhao.github.io/2020/02/22/guide-on-how-to-use-chinese-with-matplotlib_zh/</guid><description><p>注:这是一篇<a href="https://jdhao.github.io/2017/05/13/guide-on-how-to-use-chinese-with-matplotlib/" target="_blank">旧文</a>的中文翻译版本。</p>
<p>前不久,我在使用 Matplotlib 画图的时候,发现一些 Unicode 字符(例如,汉字) 无法正常显示:在生成的图片中,汉字是乱码的,显示为一个方框。经过大量的查找和阅读,我终于明白了如何在使用 Matplotlib 时,正确渲染 Unicode 字符<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>。</p></description></item><item><title>疫情时期的食物</title><link>https://jdhao.github.io/2020/02/21/food_during_sars-cov-2/</link><pubDate>Fri, 21 Feb 2020 17:50:10 +0800</pubDate><guid>https://jdhao.github.io/2020/02/21/food_during_sars-cov-2/</guid><description><p>新型冠状病毒疫情已经持续了差不多一个月,一切还没有恢复正常,3 号从家里回到深圳,正是疫情严重的时刻,大家都如临大敌。住处附近的餐馆都关了门,想在外面吃饭也不行了。为了减少外出,降低感染的风险,于是尽量从网上买菜。疫情之前,已经开始用<a href="http://www.dingdongmc.com/" target="_blank">叮咚买菜</a>和<a href="https://www.pupumall.com/" target="_blank">朴朴超市</a>,不过用的频率不高,疫情来了,更依赖这些在线服务,感谢这些疫情期间仍然开张的在线服务和送菜的小哥们。</p></description></item><item><title>Ripgrep Searching CheatSheet</title><link>https://jdhao.github.io/2020/02/16/ripgrep_cheat_sheet/</link><pubDate>Sun, 16 Feb 2020 22:55:50 +0800</pubDate><guid>https://jdhao.github.io/2020/02/16/ripgrep_cheat_sheet/</guid><description><p><a href="https://github.com/BurntSushi/ripgrep" target="_blank">Ripgrep</a> is a command line tools that searches patterns under your current directory, like the good old <a href="https://en.wikipedia.org/wiki/Grep" target="_blank">grep</a>, but <a href="https://blog.burntsushi.net/ripgrep/" target="_blank">with faster speed</a>. In this post, I list some of the commonly-used flags for ripgrep.</p></description></item><item><title>Mac 系统如何远程连接控制 Windows 电脑</title><link>https://jdhao.github.io/2020/02/09/mac_connect_windows_remotely/</link><pubDate>Sun, 09 Feb 2020 21:43:35 +0800</pubDate><guid>https://jdhao.github.io/2020/02/09/mac_connect_windows_remotely/</guid><description><p>本文简单总结 macOS 系统远程连接 Windows 系统需要的工具以及简单设置。</p></description></item><item><title>为什么要用英语以及谷歌?</title><link>https://jdhao.github.io/2020/01/22/why_use_english_and_google/</link><pubDate>Wed, 22 Jan 2020 16:53:09 +0800</pubDate><guid>https://jdhao.github.io/2020/01/22/why_use_english_and_google/</guid><description><p><a href="https://www.v2ex.com/" target="_blank">V2ex</a> 是一个程序员聚集的论坛,也是我经常访问的一个论坛,经常有人在论坛上提问技术问题。前两天遇到<a href="https://v2ex.com/t/637584" target="_blank">一个帖子</a>,问的是 vscode 如何取消按下点以后自动补全第一个候选项。</p></description></item><item><title>Missing Level 1 Header in TOC in Latest Hugo</title><link>https://jdhao.github.io/2020/01/19/hugo_toc_header_missing/</link><pubDate>Sun, 19 Jan 2020 21:56:34 +0800</pubDate><guid>https://jdhao.github.io/2020/01/19/hugo_toc_header_missing/</guid><description><p>After updating Hugo to the latest version (v0.62), apart from the issue of
<a href="https://jdhao.github.io/2019/12/29/hugo_html_not_shown/" target="_blank">missing HTML code</a>, I
have also observed that level 1 header written in Markdown is not rendered in
the generated <abbr title="Table of Content">TOC</abbr>.</p></description></item><item><title>Vim 和 Neovim 的前世今生</title><link>https://jdhao.github.io/2020/01/12/vim_nvim_history_development/</link><pubDate>Sun, 12 Jan 2020 11:48:43 +0800</pubDate><guid>https://jdhao.github.io/2020/01/12/vim_nvim_history_development/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/202202021242998.jpg" width="800">
</p>
<h1 class="relative group">引子
<div id="%E5%BC%95%E5%AD%90" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#%E5%BC%95%E5%AD%90" aria-label="Anchor">#</a>
</span>
</h1>
<p>从完全使用 <a href="https://neovim.io/" target="_blank">Neovim</a> 进行日常<a href="https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/" target="_blank">项目开发</a>与<a href="https://jdhao.github.io/2019/01/15/markdown_edit_preview_nvim/" target="_blank">文档写作</a>到现在,已经过去大约一年半的时间。一年半以前,我对 Vim 的了解还处在非常初级的阶段,甚至还不知道 Neovim,经过长时间的<a href="https://jdhao.github.io/categories/Nvim/" target="_blank">使用与学习</a>,目前已经达到了熟练使用的程度。当然,Vim 的知识过于庞大,即便我已经使用了一年半的时间,还有很多 Vim/Neovim 的特性或者知识仍然有待了解与发掘。</p>
<p>在使用 Neovim 的过程中,我对 Neovim 和 Vim 的历史以及它们之间的<em>恩怨情仇</em>也产生了兴趣,散布在互联网上各处的博客、视频以及论坛讨论让我对过去的历史有了一定了解。</p>
<p>P.S., 我建立了一个 <a href="https://t.me/nvim_zh" target="_blank">nvim 中文用户 tg 群</a>,有兴趣可以加入。</p></description></item><item><title>Hugo Post Missing (Hugo 博客文章缺失问题)</title><link>https://jdhao.github.io/2020/01/11/hugo_post_missing/</link><pubDate>Sat, 11 Jan 2020 22:04:56 +0800</pubDate><guid>https://jdhao.github.io/2020/01/11/hugo_post_missing/</guid><description><p>Recently, when I was trying to generate my blog site using <a href="https://gohugo.io/" target="_blank">Hugo</a>,
I found that all my posts were successfully rendered, except for one new post.
This was rather strange.</p>
<p><font color="red">最近在使用 <a href="https://gohugo.io/" target="_blank">Hugo</a> 生成博客文章的时候,发现有一篇新写的文章无法生成,而其他博文都可以成功渲染,非常奇怪。</font></p></description></item><item><title>我的 2019 阅读清单</title><link>https://jdhao.github.io/2020/01/11/my_reading_list_2019/</link><pubDate>Sat, 11 Jan 2020 20:04:27 +0800</pubDate><guid>https://jdhao.github.io/2020/01/11/my_reading_list_2019/</guid><description><p>2019 年年末的这三个月过得很快,最近一个月都在紧张忙碌中度过,以至于错过了年末的时间,没有写一篇 2019 年的阅读总结。</p></description></item><item><title>Doing Number Arithmetics in Vim/Neovim Substitutions</title><link>https://jdhao.github.io/2020/01/10/nvim_number_arithmetic_in_substitute/</link><pubDate>Fri, 10 Jan 2020 23:48:25 +0800</pubDate><guid>https://jdhao.github.io/2020/01/10/nvim_number_arithmetic_in_substitute/</guid><description><p>In this post, I want to share how to do number arithmetic quickly and get what
you want in specified format. More specifically, the topic is:</p>
<blockquote>
<p>How do we add, subtract, multiply or divide a value to each number in a
range?</p>
</blockquote></description></item><item><title>Regex Keyword and Python Interpolation in Ultisnips</title><link>https://jdhao.github.io/2020/01/05/ultisnips_python_interpolation/</link><pubDate>Sun, 05 Jan 2020 18:52:03 +0800</pubDate><guid>https://jdhao.github.io/2020/01/05/ultisnips_python_interpolation/</guid><description><p><a href="">Vim-snippet</a> provides a lot of useful Ultisnips snippets for various
filetypes. For example, for Markdown, to insert level 1 header, the snippet
trigger is <code>sec</code>, and for level 2 and 3 header, the triggers are <code>ssec</code> and
<code>sssec</code> respectively. These triggers are non-intuitive and hard to remember and
type.</p></description></item><item><title>Firenvim: Neovim inside Your Browser</title><link>https://jdhao.github.io/2020/01/01/firenvim_nvim_inside_browser/</link><pubDate>Wed, 01 Jan 2020 23:51:12 +0800</pubDate><guid>https://jdhao.github.io/2020/01/01/firenvim_nvim_inside_browser/</guid><description><p align="center">
<img
src="https://blog-resource-1257868508.file.myqcloud.com/firenvim.gif">
</p>
<details>
<summary><font size="2" color="red">Update log</font></summary>
<p><font color="blue">2022-08-15: update firenvim conf; add install setting for packer.nvim </font></p>
</details>
<h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>Last year, I have written <a href="https://jdhao.github.io/2019/05/11/nvim_text_input_browser/" target="_blank">a post</a> on how to edit texts inside the browser
using Vim/Nvim or browser extensions that have Vim emulations.
However, none of them is good enough, since they are either not convenient to use
or lacking features compared to real Neovim empowered by various plugins.</p></description></item><item><title>Content inside HTML tags missing in Latest Hugo?</title><link>https://jdhao.github.io/2019/12/29/hugo_html_not_shown/</link><pubDate>Sun, 29 Dec 2019 17:57:05 +0800</pubDate><guid>https://jdhao.github.io/2019/12/29/hugo_html_not_shown/</guid><description><p>Due to Markdown&rsquo;s inability to center and resize image properly,
I use the raw HTML tags inside markdown file to include images:</p>
<p><font color="red">由于 Markdown 格式无法很好居中和设定图像尺寸,我使用 HTML tags 来添加图像(图像可以很好居中以及设定显示大小):</font></p></description></item><item><title>Creating Markdown Front Matter with Ultisnips</title><link>https://jdhao.github.io/2019/12/22/ultisnips_avoid_content_update/</link><pubDate>Sun, 22 Dec 2019 13:45:25 +0800</pubDate><guid>https://jdhao.github.io/2019/12/22/ultisnips_avoid_content_update/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>Currently, I write my blog posts in Markdown and build the blog using
<a href="https://gohugo.io/" target="_blank">Hugo</a>. Hugo supports <a href="https://gohugo.io/content-management/front-matter/" target="_blank">front matter</a> for Markdown so that you can
attach metadata for a post, such as title, date, tags, categories, etc.</p></description></item><item><title>Labelme JSON 标注格式转 voc XML 格式</title><link>https://jdhao.github.io/2019/12/21/labelme_json_to_voc_xml/</link><pubDate>Sat, 21 Dec 2019 23:37:49 +0800</pubDate><guid>https://jdhao.github.io/2019/12/21/labelme_json_to_voc_xml/</guid><description><p>Labelme 是一款常用的计算机视觉任务标注工具,可以用来标注分类,检测,分割等任务的数据。对于检测任务,labelme 生成的标注文件是 json 格式,每个图像对应一个相应的 json 文件。但是很多任务都使用 PASCAL VOC 的 xml 格式标注,例如 <a href="https://github.com/facebookresearch/maskrcnn-benchmark" target="_blank">maskrcnn-benchmark</a> 任务中的 <a href="https://github.com/facebookresearch/maskrcnn-benchmark/blob/master/maskrcnn_benchmark/data/datasets/voc.py" target="_blank">voc 数据集</a>。</p></description></item><item><title>Nifty Nvim Techniques That Make My Life Easier -- Series 6</title><link>https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</link><pubDate>Sat, 21 Dec 2019 23:18:00 +0800</pubDate><guid>https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</guid><description><p>This is the 6th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>macOS 下如何为视频制作字幕</title><link>https://jdhao.github.io/2019/12/15/mac_video_subtitle_make/</link><pubDate>Sun, 15 Dec 2019 18:24:34 +0800</pubDate><guid>https://jdhao.github.io/2019/12/15/mac_video_subtitle_make/</guid><description><p>几周之前,在 YouTube 上看到了 Vim 创始人 Bram Moolenaar 在 <a href="https://vimconf.org/2018/" target="_blank">Vim Conf 2018</a> 上的<a href="https://www.youtube.com/watch?v=ES1L2SPgIDI" target="_blank">主题报告</a>,介绍了 Vim 的历史以及可能要添加的一些新特性,萌生了给这个视频配字幕的想法。</p></description></item><item><title>Running Command Asynchronously inside Neovim</title><link>https://jdhao.github.io/2019/12/09/vim_asynchronous_command_run/</link><pubDate>Mon, 09 Dec 2019 23:27:10 +0800</pubDate><guid>https://jdhao.github.io/2019/12/09/vim_asynchronous_command_run/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>When I am writing some prototyping code inside Neovim, I want to run the script
without going to the terminal and typing <code>python toy_script.py</code>. Of course, we
can use <code>:!python %</code> in the command line to run the script (see <code>:h :!</code>). The
problem is that running external command will block Nvim/Vim, and we can not
move the cursor until the script finishes running.</p></description></item><item><title>Resolving Merge Conflict after Git Stash Pop</title><link>https://jdhao.github.io/2019/12/03/git_stash_merge_conflict_handling/</link><pubDate>Tue, 03 Dec 2019 00:57:11 +0800</pubDate><guid>https://jdhao.github.io/2019/12/03/git_stash_merge_conflict_handling/</guid><description><p>Sometimes, when we are working with our local changes in a Git repo, we may
want to pull the latest updates from the remote repository. To avoid code
conflict between remote files and local files. We can use <code>git stash</code> to store
the unfinished local work temporarily.</p></description></item><item><title>Pylint: command not found?</title><link>https://jdhao.github.io/2019/11/28/pylint_command_not_found/</link><pubDate>Thu, 28 Nov 2019 01:21:54 +0800</pubDate><guid>https://jdhao.github.io/2019/11/28/pylint_command_not_found/</guid><description><p>The system I am currently using has Anaconda pre-installed by root under system
locations.</p></description></item><item><title>A Hands-on Experience with Neovim's Built-in LSP Support</title><link>https://jdhao.github.io/2019/11/20/neovim_builtin_lsp_hands_on/</link><pubDate>Wed, 20 Nov 2019 22:41:16 +0800</pubDate><guid>https://jdhao.github.io/2019/11/20/neovim_builtin_lsp_hands_on/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2021-07-15: use pylsp instead of pyls since pyls is obsolete.</font></li>
<li><font color="blue">2021-04-08: update post based on latest version of Neovim-lsp.</font></li>
<li><font color="blue">2020-09-14: update lsp config to reflect the latest changes and add more plugins.</font></li>
</ul>
</details>
<p>Just a few days ago, the built-in <a href="https://microsoft.github.io/language-server-protocol/" target="_blank">Language Server Protocol</a>
support <a href="https://github.com/neovim/neovim/pull/11336" target="_blank">has been merged</a> into Neovim master.</p>
<p>This post is a hands-on experience of setting up LSP support for Python with
the <a href="https://github.com/python-lsp/python-lsp-server" target="_blank">python-lsp-server</a>.</p>
<p>Note that settings here may be obsolete due to rapid evolving of the built-in lsp.</p></description></item><item><title>How to Convert PDF to Images with Imagemagick</title><link>https://jdhao.github.io/2019/11/20/convert_pdf_to_image_imagemagick/</link><pubDate>Wed, 20 Nov 2019 22:20:41 +0800</pubDate><guid>https://jdhao.github.io/2019/11/20/convert_pdf_to_image_imagemagick/</guid><description><p>Previously, I have talked about how to convert PDF to images using pdftoppm
<a href="https://jdhao.github.io/2019/11/14/convert_pdf_to_images_pdftoppm/" target="_blank">here</a>.
In this post, I want to share how to accomplish this task with
<a href="https://imagemagick.org/index.php" target="_blank">Imagemagick</a>.</p></description></item><item><title>互联网上常用缩略语集锦</title><link>https://jdhao.github.io/2019/11/18/acronym_on_internet_and_forum/</link><pubDate>Mon, 18 Nov 2019 23:46:54 +0800</pubDate><guid>https://jdhao.github.io/2019/11/18/acronym_on_internet_and_forum/</guid><description><p>上 <a href="https://www.reddit.com/" target="_blank">Reddit</a> 或 GitHub 时,在讨论中,经常会碰到一些缩略词,作为一名非 native speaker,我经常有点摸不着头脑,不知道这些缩略语啥意思。这篇文章总结一些常用缩略语以及中文含义。</p></description></item><item><title>File Backup in Neovim</title><link>https://jdhao.github.io/2019/11/16/nvim_file_backup/</link><pubDate>Sat, 16 Nov 2019 19:56:18 +0800</pubDate><guid>https://jdhao.github.io/2019/11/16/nvim_file_backup/</guid><description><p>There are several options related to file backup behavior in Vim/Nvim.</p>
<ul>
<li><code>backup</code></li>
<li><code>writebackup</code></li>
<li><code>backupdir</code></li>
<li><code>backupcopy</code></li>
<li><code>backupext</code></li>
</ul>
<p>In this post, I will explain how these options are related to each other.</p></description></item><item><title>Converting PDF Pages to Images with Poppler</title><link>https://jdhao.github.io/2019/11/14/convert_pdf_to_images_pdftoppm/</link><pubDate>Thu, 14 Nov 2019 22:44:21 +0800</pubDate><guid>https://jdhao.github.io/2019/11/14/convert_pdf_to_images_pdftoppm/</guid><description><p>In this post, I want to share how to convert PDF to images using the command
line tool <a href="https://www.xpdfreader.com/pdftoppm-man.html" target="_blank">pdftoppm</a>.</p></description></item><item><title>Nifty Nvim Techniques That Make My Life Easier -- Series 5</title><link>https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</link><pubDate>Mon, 11 Nov 2019 22:55:02 +0800</pubDate><guid>https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</guid><description><p>This is the 5th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Neovim Configuration for System-wide Use</title><link>https://jdhao.github.io/2019/11/10/install_config_neovim_system_wide/</link><pubDate>Sun, 10 Nov 2019 10:33:29 +0800</pubDate><guid>https://jdhao.github.io/2019/11/10/install_config_neovim_system_wide/</guid><description><p>I have been using Neovim for personal projects for over a year.
Recently, I want to set up Neovim system wide so that other users in the server can also use my config if they want.
In this post, I will summarize the necessary configurations.</p></description></item><item><title>How to sort a list of tuple or list in Python -- lambda or itemgetter?</title><link>https://jdhao.github.io/2019/11/06/python_sort_list_of_list/</link><pubDate>Wed, 06 Nov 2019 22:43:59 +0800</pubDate><guid>https://jdhao.github.io/2019/11/06/python_sort_list_of_list/</guid><description><p>In Python, when we want to sort a list of tuples or lists, we may want to sort
it based on certain element in each sub-list, for example, sort the list based
on the first element in each sub-list.</p></description></item><item><title>Building A Vim Statusline from Scratch</title><link>https://jdhao.github.io/2019/11/03/vim_custom_statusline/</link><pubDate>Sun, 03 Nov 2019 14:22:20 +0800</pubDate><guid>https://jdhao.github.io/2019/11/03/vim_custom_statusline/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20191103144006.png">
</p>
<p>I have been using <a href="https://github.com/vim-airline/vim-airline" target="_blank">vim-airline</a> to
customize my statusline ever since I started using Neovim. It works great.
Recently, I started <a href="https://github.com/jdhao/minimal_vim" target="_blank">a repo</a> named
<code>minimal_vim</code> to create a minimal configuration without external plugins for
both Vim and Neovim. During the process, I learned how to build a custom
statusline from scratch.</p></description></item><item><title>人类第一颗原子弹爆炸始末</title><link>https://jdhao.github.io/2019/11/02/thought_on_making_of_atomic_bomb/</link><pubDate>Sat, 02 Nov 2019 16:45:17 +0800</pubDate><guid>https://jdhao.github.io/2019/11/02/thought_on_making_of_atomic_bomb/</guid><description><p>花了差不多两个月时间,于上周看完了《The making of the atomic bomb》(中文名叫<a href="https://book.douban.com/subject/3449736//" target="_blank">《原子弹秘史》</a>),这本书是 1988 年美国普利策非虚构类最佳图书奖获奖作品。整本书很长,上百万字,作者在书中全景式展现了人类第一颗原子弹爆炸的完整历史,把原子物理学、核物理发现,犹太人的历史,原子弹的制造,还有科学家的成长历程,融为一体讲述,考证详实,虽然有大量的历史细节,读起来却很过瘾,一点也不枯燥。</p></description></item><item><title>Distributed Training in PyTorch with Horovod</title><link>https://jdhao.github.io/2019/11/01/pytorch_distributed_training/</link><pubDate>Fri, 01 Nov 2019 22:26:53 +0800</pubDate><guid>https://jdhao.github.io/2019/11/01/pytorch_distributed_training/</guid><description><p><a href="https://github.com/horovod/horovod" target="_blank">Horovod</a> is the distributed training
framework developed by Uber. It support training distributed programs with
little modification for both TensorFlow, PyTorch, MXNet and keras.</p></description></item><item><title>Learning Expect Programming</title><link>https://jdhao.github.io/2019/10/29/expect_script_learning/</link><pubDate>Tue, 29 Oct 2019 01:42:59 +0800</pubDate><guid>https://jdhao.github.io/2019/10/29/expect_script_learning/</guid><description><p>In <a href="https://jdhao.github.io/2018/10/08/server_autologin_with_expect/" target="_blank">my previous post</a>,
I talked about how to automate the server login process with the help of Expect
programming language. This post continues my learning process.</p></description></item><item><title>Essential Knowledge about SSH</title><link>https://jdhao.github.io/2019/10/27/ssh_essential_knowledge/</link><pubDate>Sun, 27 Oct 2019 22:43:12 +0800</pubDate><guid>https://jdhao.github.io/2019/10/27/ssh_essential_knowledge/</guid><description><p>Although I use SSH (secure shell) every day, I seem to know little about it
except the fact that I can use <code>ssh</code> command to log into my remote servers.
Recently, I found myself some time to learn how does it work.</p></description></item><item><title>Nifty LaTeX Techniques -- Series 1</title><link>https://jdhao.github.io/2019/10/22/latex_techniques_s1/</link><pubDate>Tue, 22 Oct 2019 22:06:14 +0800</pubDate><guid>https://jdhao.github.io/2019/10/22/latex_techniques_s1/</guid><description><h1 class="relative group">Change font size
<div id="change-font-size" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#change-font-size" aria-label="Anchor">#</a>
</span>
</h1>
<p>By default, LaTeX provides several command to change the font size to
predefined size. Those command include <code>\scriptsize</code>, <code>\large</code>, <code>\Huge</code> etc.
However, even the font size provided by the <code>\Huge</code> command may not be large
enough.</p></description></item><item><title>更改 Adsense 邮寄地址,重新寄送 PIN</title><link>https://jdhao.github.io/2019/10/22/adsense_change_address_resend_pin/</link><pubDate>Tue, 22 Oct 2019 00:22:33 +0800</pubDate><guid>https://jdhao.github.io/2019/10/22/adsense_change_address_resend_pin/</guid><description><p><a href="https://jdhao.github.io/2019/09/22/google_adsense_hugo_config/#%E5%85%B6%E4%BB%96" target="_blank">之前的文章</a>提到过,当 Adsense 帐号的收入达到 10 美元阈值的时候,谷歌会向你注册 Adsense 登记的地址发送一封邮件,里面有验证的 PIN 码,只有验证了 PIN 码,后续才能收到谷歌的付款。</p></description></item><item><title>Mintty Tips and Configurations</title><link>https://jdhao.github.io/2019/10/16/useful_mintty_tips_configs/</link><pubDate>Wed, 16 Oct 2019 23:24:35 +0800</pubDate><guid>https://jdhao.github.io/2019/10/16/useful_mintty_tips_configs/</guid><description><p>In this post, I want to share some useful tips and configurations about <a href="https://github.com/mintty/mintty" target="_blank">mintty</a>.</p></description></item><item><title>Generating Table of Contents for Markdown with Tagbar</title><link>https://jdhao.github.io/2019/10/15/tagbar_markdown_setup/</link><pubDate>Tue, 15 Oct 2019 01:01:01 +0800</pubDate><guid>https://jdhao.github.io/2019/10/15/tagbar_markdown_setup/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20191015001602.png">
</p>
<p>I have been using Vim plugin Tagbar for viewing and navigating tags inside my
source file. However, for Markdown files, there is no support out of the box.
In this post, I would like to share how to set up tagbar to show tags for
Markdown.</p></description></item><item><title>Convert Python Script to Exe on Windows with Pyinstaller</title><link>https://jdhao.github.io/2019/10/14/python_script_to_exe/</link><pubDate>Mon, 14 Oct 2019 21:46:55 +0800</pubDate><guid>https://jdhao.github.io/2019/10/14/python_script_to_exe/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>I have a use case where I want to convert my Python script to standalone
executable so that I do not need to type <code>python</code> before it to run the script.
On Linux, it is easy to achieve with the help of
<a href="https://stackoverflow.com/questions/6908143/should-i-put-shebang-in-python-scripts-and-what-form-should-it-take" target="_blank">shebang</a>.
However, on Windows, it does not work. Then I thought I might convert the
script to Windows executable.</p></description></item><item><title>Ubuntu on Windows Missing after Windows Update</title><link>https://jdhao.github.io/2019/10/11/wsl_distro_deleted_after_windows_update/</link><pubDate>Fri, 11 Oct 2019 22:55:01 +0800</pubDate><guid>https://jdhao.github.io/2019/10/11/wsl_distro_deleted_after_windows_update/</guid><description><p>I have been using Ubuntu on Windows via WSL for about a year and it works quite
well.</p>
<p>The terminal I use for Ubuntu on Windows is
<a href="https://github.com/mintty/wsltty" target="_blank">wsltty</a>, which is a thin wrapper around
<a href="https://github.com/mintty/mintty" target="_blank">mintty</a> and other tools for starting WSL
sessions. Recently, when I start clicking the WSL Terminal icon, it start a
Window and then quit silently.</p></description></item><item><title>使用代理加速 Mac 终端下载速度</title><link>https://jdhao.github.io/2019/10/10/mac_proxy_in_terminal/</link><pubDate>Thu, 10 Oct 2019 23:17:29 +0800</pubDate><guid>https://jdhao.github.io/2019/10/10/mac_proxy_in_terminal/</guid><description><p>在 Mac 的终端 (terminal) 下载文件或者 clone git 仓库的时候,明显感觉速度特别慢,即使把梯子的全局模式打开也无济于事,需要在终端设置代理才能加快下载速度,本文简要总结需要的配置。</p></description></item><item><title>My Experience with Several Zsh Plugin Managers</title><link>https://jdhao.github.io/2019/10/08/zsh_plugin_managers_compare/</link><pubDate>Tue, 08 Oct 2019 00:02:01 +0800</pubDate><guid>https://jdhao.github.io/2019/10/08/zsh_plugin_managers_compare/</guid><description><p>In this post, I share my experience and opinions on several popular Zsh plugin
managers.</p></description></item><item><title>深圳租房小记</title><link>https://jdhao.github.io/2019/10/02/shenzhen_house_rent/</link><pubDate>Wed, 02 Oct 2019 14:20:16 +0800</pubDate><guid>https://jdhao.github.io/2019/10/02/shenzhen_house_rent/</guid><description><p>作为深漂,大概每个人都要为租房费一番功夫。</p></description></item><item><title>How to Install zplug inside Docker Container</title><link>https://jdhao.github.io/2019/10/01/zplug_install_docker_container/</link><pubDate>Tue, 01 Oct 2019 00:01:25 +0800</pubDate><guid>https://jdhao.github.io/2019/10/01/zplug_install_docker_container/</guid><description><p>In the past few days, I tried to dockerize my development environment and put
my daily programming tools inside
<a href="https://www.docker.com/resources/what-container" target="_blank">container</a>. I tried to
install zplug inside docker container and met some issues. In this post, I want
to share how to install <a href="https://github.com/zplug/zplug" target="_blank">zplug</a> and other
plugins inside the Docker container.</p></description></item><item><title>Why don't settings inside bashrc or bash_profile take effect?</title><link>https://jdhao.github.io/2019/09/29/linux_login_setup/</link><pubDate>Sun, 29 Sep 2019 21:40:28 +0800</pubDate><guid>https://jdhao.github.io/2019/09/29/linux_login_setup/</guid><description><p>In this post, I would like to share causes and solutions to a few issues
related to login shell.</p></description></item><item><title>Setting Up Locale in Linux</title><link>https://jdhao.github.io/2019/09/27/linux_locale_settings/</link><pubDate>Fri, 27 Sep 2019 23:56:47 +0800</pubDate><guid>https://jdhao.github.io/2019/09/27/linux_locale_settings/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>When I logged into a Ubuntu server, the system interface and messages are all
shown in Chinese. I want them to be displayed in English. After some searching,
I found out that we can change the <a href="https://en.wikipedia.org/wiki/Locale_%28computer_software%29" target="_blank">locale</a> settings.</p></description></item><item><title>谷歌 Adsense 申请及在 Hugo 中的配置</title><link>https://jdhao.github.io/2019/09/22/google_adsense_hugo_config/</link><pubDate>Sun, 22 Sep 2019 12:11:18 +0800</pubDate><guid>https://jdhao.github.io/2019/09/22/google_adsense_hugo_config/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/GA-L.jpg", width="600">
</p>
<p>我的博客目前利用 GitHub pages 服务托管,不需要付费,但是博客的图床选用了腾讯云的对象存储,每个月还需要付一笔流量费用。为了保持收支平衡,也为了好玩,决定申请谷歌的 Adsense 一试。本文记录申请 Adsense 以及在 Hugo 博客中配置 Adsense 的过程。</p></description></item><item><title>How to Write Algorithm Pseudo Code in LaTeX</title><link>https://jdhao.github.io/2019/09/21/latex_algorithm_pseudo_code/</link><pubDate>Sat, 21 Sep 2019 22:44:19 +0800</pubDate><guid>https://jdhao.github.io/2019/09/21/latex_algorithm_pseudo_code/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20190921212617.png">
</p>
<p>In this post, I want to summarize what I have learned about creating
algorithmic pseudo code in LaTeX.</p></description></item><item><title>Nifty Nvim Techniques That Make My Life Easier -- Series 4</title><link>https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</link><pubDate>Tue, 17 Sep 2019 23:04:55 +0800</pubDate><guid>https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</guid><description><p>This is the 4th post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>A Few Grammar Questions in Writing</title><link>https://jdhao.github.io/2019/09/17/writing_grammar_s1/</link><pubDate>Tue, 17 Sep 2019 00:02:16 +0800</pubDate><guid>https://jdhao.github.io/2019/09/17/writing_grammar_s1/</guid><description><p>A few grammar-related questions in writing scientific papers.</p></description></item><item><title>How to Read and Write Images with Unicode Paths in OpenCV</title><link>https://jdhao.github.io/2019/09/11/opencv_unicode_image_path/</link><pubDate>Wed, 11 Sep 2019 00:23:41 +0800</pubDate><guid>https://jdhao.github.io/2019/09/11/opencv_unicode_image_path/</guid><description><p>The other day, when I was using OpenCV to read some images and print the image
shape, I got an error:</p>
<blockquote>
<p>&lsquo;NoneType&rsquo; object has no attribute &lsquo;shape&rsquo;.</p>
</blockquote>
<p>I was confused and do not know why since the image path is valid. It tooks me a
while to understand the cause.</p></description></item><item><title>Tips on Writing Papers in LaTeX</title><link>https://jdhao.github.io/2019/08/28/latex_writing_tips_s1/</link><pubDate>Wed, 28 Aug 2019 14:36:31 +0800</pubDate><guid>https://jdhao.github.io/2019/08/28/latex_writing_tips_s1/</guid><description><p>In this post, I want to share some tips on writing papers using $\LaTeX$.</p></description></item><item><title>Creating A Professional Table in LaTeX with booktabs</title><link>https://jdhao.github.io/2019/08/27/latex_table_with_booktabs/</link><pubDate>Tue, 27 Aug 2019 21:31:12 +0800</pubDate><guid>https://jdhao.github.io/2019/08/27/latex_table_with_booktabs/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20190827223626.png">
</p>
<p>The default table style provided by LaTeX is not good-looking and professional.
In this post, I would like to talk about how to create professional table with
the help of <a href="https://ctan.org/pkg/booktabs?lang=en" target="_blank">booktabs</a> package. We will
create the table shown in the title image.</p></description></item><item><title>How to Create Proper Folding for Vim/Nvim Configuration</title><link>https://jdhao.github.io/2019/08/16/nvim_config_folding/</link><pubDate>Fri, 16 Aug 2019 22:56:20 +0800</pubDate><guid>https://jdhao.github.io/2019/08/16/nvim_config_folding/</guid><description><p>
<figure>
<img class="my-0 rounded-md" loading="lazy" src="https://blog-resource-1257868508.file.myqcloud.com/20190817223054.png" alt="Folded config" />
</figure>
</p></description></item><item><title>Linux Tips and Tricks -- s1</title><link>https://jdhao.github.io/2019/08/09/linux_command_cheat_sheet_s1/</link><pubDate>Fri, 09 Aug 2019 00:02:27 +0800</pubDate><guid>https://jdhao.github.io/2019/08/09/linux_command_cheat_sheet_s1/</guid><description><p>In this post, I list some of the often-used Linux command in my daily life.</p></description></item><item><title>JPEG Image Orientation and Exif</title><link>https://jdhao.github.io/2019/07/31/image_rotation_exif_info/</link><pubDate>Wed, 31 Jul 2019 23:19:35 +0800</pubDate><guid>https://jdhao.github.io/2019/07/31/image_rotation_exif_info/</guid><description><p>The other day I came across a strange bug during work. My colleagues gave me
some photographs taken with a smartphone. On their machines (Windows 7), all
the photos were shown correctly in landscape mode. However, when I checked
those photos, I found that some of those photos were shown in portrait mode
(rotated 90 or 270 degrees) or upside-down (rotated 180 degrees).</p>
<p>I was curious what happened and learned about
<a href="https://en.wikipedia.org/wiki/Exif" target="_blank">Exif</a> and all its related stuff.</p></description></item><item><title>How Do I Show the Current File Path In Neovim?</title><link>https://jdhao.github.io/2019/07/31/nvim_show_file_path/</link><pubDate>Wed, 31 Jul 2019 23:10:27 +0800</pubDate><guid>https://jdhao.github.io/2019/07/31/nvim_show_file_path/</guid><description><p>I saw on <a href="https://vi.stackexchange.com/questions/104/how-can-i-see-the-full-path-of-the-current-file/20768#20768" target="_blank">StackExchange</a>
that someone asked about how to see the full path of current file in Vim. I
think it would be helpful to write about how I do it.</p></description></item><item><title>JPEG Image Quality in PIL</title><link>https://jdhao.github.io/2019/07/20/pil_jpeg_image_quality/</link><pubDate>Sat, 20 Jul 2019 21:19:39 +0800</pubDate><guid>https://jdhao.github.io/2019/07/20/pil_jpeg_image_quality/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>The other day, I was haunted by a bug and found that it was an issue with the
image quality saved by <a href="https://pillow.readthedocs.io/en/stable/" target="_blank">Pillow</a> after
spending a few hours debugging the code.</p></description></item><item><title>Difference between view, reshape, transpose and permute in PyTorch</title><link>https://jdhao.github.io/2019/07/10/pytorch_view_reshape_transpose_permute/</link><pubDate>Wed, 10 Jul 2019 23:21:48 +0800</pubDate><guid>https://jdhao.github.io/2019/07/10/pytorch_view_reshape_transpose_permute/</guid><description><p>PyTorch provides a lot of methods for the Tensor type. Some of these methods
may be confusing for new users. Here, I would like to talk about
<a href="https://pytorch.org/docs/stable/tensors.html#torch.Tensor.view" target="_blank"><code>view()</code></a> vs
<a href="https://pytorch.org/docs/stable/torch.html#torch.reshape" target="_blank"><code>reshape()</code></a>,
<a href="https://pytorch.org/docs/stable/torch.html#torch.transpose" target="_blank"><code>transpose()</code></a> vs
<a href="https://pytorch.org/docs/stable/tensors.html#torch.Tensor.permute" target="_blank"><code>permute()</code></a>.</p></description></item><item><title>Convert PIL or OpenCV Image to Bytes without Saving to Disk</title><link>https://jdhao.github.io/2019/07/06/python_opencv_pil_image_to_bytes/</link><pubDate>Sat, 06 Jul 2019 22:18:22 +0800</pubDate><guid>https://jdhao.github.io/2019/07/06/python_opencv_pil_image_to_bytes/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>Sometimes, we may want an in-memory jpg or png image that is represented as
binary data. But often, what we have got is image in OpenCV (Numpy ndarray) or
PIL Image format. In this post, I will share how to convert Numpy image or PIL
Image object to binary data without saving the underlying image to disk.</p></description></item><item><title>Fast Movement and Navigation Inside Vim or Neovim</title><link>https://jdhao.github.io/2019/06/26/movement_navigation_inside_nvim/</link><pubDate>Wed, 26 Jun 2019 22:51:43 +0800</pubDate><guid>https://jdhao.github.io/2019/06/26/movement_navigation_inside_nvim/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>One key spirit of Vim is to accomplish something in as fewer key strokes as
possible. When we repeat a command several times to perform an action, we need
to ask ourselves if there is a better way to do it. Only in this way, can we
make progress in mastering Vim. For example, to delete five lines of texts, if
we press <code>dd</code> five times, we are certainly doing it the wrong way. After
looking up the Vim manual, we know that we can use <code>5dd</code> or <code>d4j</code>: only three
keystrokes are needed instead of ten!</p></description></item><item><title>Unintuitive Behaviour of Case Sensitivity in Python glob</title><link>https://jdhao.github.io/2019/06/24/python_glob_case_sensitivity/</link><pubDate>Mon, 24 Jun 2019 17:19:33 +0800</pubDate><guid>https://jdhao.github.io/2019/06/24/python_glob_case_sensitivity/</guid><description><p>tl;dr: <code>glob.glob()</code> is case sensitive in Linux, but case insensitive in Windows.</p>
<p>Recently, I was bitten by the unintuitive behaviour of <code>glob.glob()</code>.
I think it would be beneficial to write down what I have found.</p></description></item><item><title>Binding Keys in Zsh</title><link>https://jdhao.github.io/2019/06/13/zsh_bind_keys/</link><pubDate>Thu, 13 Jun 2019 22:55:06 +0800</pubDate><guid>https://jdhao.github.io/2019/06/13/zsh_bind_keys/</guid><description><p>In this post, I want to share how to use <code>bindkeys</code> command to solve a few
issues when using Zsh.</p></description></item><item><title>几把机械键盘试用体验</title><link>https://jdhao.github.io/2019/06/10/mechanical_keyboard_try/</link><pubDate>Mon, 10 Jun 2019 21:29:44 +0800</pubDate><guid>https://jdhao.github.io/2019/06/10/mechanical_keyboard_try/</guid><description><p>6.18 快到了,加上在家里使用的 IKBC C87 青轴声音太大,敲击费力,所以动了换一把更加静音,触发力度更小的键盘的心思。在京东和淘宝上入手了多款键盘试用,不得不说,一把好的键盘真的是难选啊。自从去年双十一入手了一把 Leopold 红轴键盘以后,其他的键盘真的很难入我的眼睛了。试用过的几把键盘以及感受如下:</p></description></item><item><title>Nvim Autocompletion with Deoplete</title><link>https://jdhao.github.io/2019/06/06/nvim_deoplete_settings/</link><pubDate>Thu, 06 Jun 2019 16:40:51 +0800</pubDate><guid>https://jdhao.github.io/2019/06/06/nvim_deoplete_settings/</guid><description><p><strong>Note: this post is deprecated, I use <a href="https://github.com/hrsh7th/nvim-cmp" target="_blank">nvim-cmp</a> for auto-completion now.</strong></p>
<p><a href="https://github.com/Shougo/deoplete.nvim" target="_blank">Deoplete</a> is a good auto-completion plugin for Neovim.
In this post, I introduce how to set up auto-completion for Nvim with the help of deoplete.</p></description></item><item><title>Converting Markdown to Beautiful PDF with Pandoc</title><link>https://jdhao.github.io/2019/05/30/markdown2pdf_pandoc/</link><pubDate>Thu, 30 May 2019 17:02:57 +0800</pubDate><guid>https://jdhao.github.io/2019/05/30/markdown2pdf_pandoc/</guid><description><details>
<summary><font size="2" color="red">update log</font></summary>
<ul>
<li><font color="blue">2022-07-19: Add build method via neovim</font></li>
</ul>
</details>
<p>本文的中文版本参见 <a href="https://jdhao.github.io/2017/12/10/pandoc-markdown-with-chinese/" target="_blank">这里</a>。</p>
<p>Over the past few years, I have been using some dedicated note-taking software to manage my notes.
However, all these tools I have tried are unsatisfactory: they are either slow or cumbersome in terms of note searching.
Finally, I decided to take my notes in Markdown and convert them to PDF using Pandoc for reading.
In this post, I will summarize how I do it.</p></description></item><item><title>Exclusive and Inclusive Motion in Neovim/Vim</title><link>https://jdhao.github.io/2019/05/18/nvim_exclusive_inclusive_motion/</link><pubDate>Sat, 18 May 2019 01:18:28 +0800</pubDate><guid>https://jdhao.github.io/2019/05/18/nvim_exclusive_inclusive_motion/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>Suppose that we have the following text in normal mode (cursor is indicated by
<code>^</code>):</p>
<pre tabindex="0"><code>hello world
^
</code></pre><p>If we use <code>dw</code>, we delete <code>hello&lt;Space&gt;</code><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> and only <code>world</code> is left; if we
use <code>de</code>, <code>hello</code> is deleted and <code>&lt;Space&gt;world</code> is left. Have you ever wondered
about why <code>dw</code> do not delete <code>w</code> while <code>de</code> will delete the <code>o</code> in <code>hello</code>? It
seems that motion <code>e</code> and <code>w</code> are somewhat inconsistent in their behaviours. It
turns out that it has something to do with the exclusivity of motions in Vim.</p></description></item><item><title>Nifty Nvim Techniques Which Make My Life Easier -- Series 3</title><link>https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</link><pubDate>Tue, 14 May 2019 22:37:04 +0800</pubDate><guid>https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</guid><description><p>This is the 3rd post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 2: <a href="https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/" target="_blank">https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Why Doesn't Jedi Autocompletion Work for Some Methods</title><link>https://jdhao.github.io/2019/05/13/jedi_autocomplete_type_hints/</link><pubDate>Mon, 13 May 2019 20:36:10 +0800</pubDate><guid>https://jdhao.github.io/2019/05/13/jedi_autocomplete_type_hints/</guid><description><p>Currently I am writing all my Python code using Neovim and <a href="https://jdhao.github.io/2018/12/24/centos_nvim_install_use_guide_en/#plugin-install-and-settings" target="_blank">a couple of
plugins</a>
to provide auto-completion, linting, etc.</p></description></item><item><title>Vim-like Editing inside Browser</title><link>https://jdhao.github.io/2019/05/11/nvim_text_input_browser/</link><pubDate>Sat, 11 May 2019 12:14:06 +0800</pubDate><guid>https://jdhao.github.io/2019/05/11/nvim_text_input_browser/</guid><description><p>Vim/Nvim has powerful ability in editing texts. But if you are in a browser and
want to input some text, can we somehow utilize the editing power of Vim? In
this post, I would like to share several ways to use Vim or Vim-like editing
when you are working inside a browser.</p></description></item><item><title>Markdown 生成 HTML 时汉字之间出现多余空格问题</title><link>https://jdhao.github.io/2019/05/04/markdown_extra_space/</link><pubDate>Sat, 04 May 2019 23:26:14 +0800</pubDate><guid>https://jdhao.github.io/2019/05/04/markdown_extra_space/</guid><description><p>在过去很长一段时间,我都在<a href="https://jdhao.github.io/2017/03/04/Sublime-Windows-Markdown/" target="_blank">使用 Sublime Text 来编辑 Markdown 文件</a>,Sublime Text有一个非常实用的功能,<a href="https://stackoverflow.com/q/25900954/6064933" target="_blank">可以设定 <code>wrap_width</code> 和 <code>word_wrap</code> 选项</a>,自动在设定的 80个字符长度处 softwrap 文本。所以即使一个段落写成一行,编辑起来或者看起来都不违和。</p></description></item><item><title>小米 9 安装谷歌商店(Google Play Store)与相关配置</title><link>https://jdhao.github.io/2019/05/04/mi9_google_play_configure/</link><pubDate>Sat, 04 May 2019 15:53:29 +0800</pubDate><guid>https://jdhao.github.io/2019/05/04/mi9_google_play_configure/</guid><description><p>五一假期入手了<a href="https://zh.wikipedia.org/wiki/%E5%B0%8F%E7%B1%B39" target="_blank">小米9</a>,在安装谷歌 Play 商店以及启用过程中遇到了一些问题,特此记录解决方法。</p></description></item><item><title>Create Mappings That Take A Count in Neovim</title><link>https://jdhao.github.io/2019/04/29/nvim_map_with_a_count/</link><pubDate>Mon, 29 Apr 2019 23:08:16 +0800</pubDate><guid>https://jdhao.github.io/2019/04/29/nvim_map_with_a_count/</guid><description><p>
<figure>
<img class="my-0 rounded-md" loading="lazy" src="https://blog-resource-1257868508.file.myqcloud.com/20190503204410.png" alt="Mappings" />
</figure>
</p>
<p>Many normal mode commands accept a <code>count</code>, which means to repeat the motion
<code>count</code> times. For example, <code>3j</code> moves the cursor 3 lines below the current
line and <code>4w</code> will move the cursor four words forward. Usually, the
user-defined mappings can not take a count. Even if they can, they will most
probably not work the way you expect them to. In this post, I will describe
what I have learned to make a fairly complex mapping repeatable with a count.</p></description></item><item><title>Spell Checking in Nvim</title><link>https://jdhao.github.io/2019/04/29/nvim_spell_check/</link><pubDate>Mon, 29 Apr 2019 22:35:54 +0800</pubDate><guid>https://jdhao.github.io/2019/04/29/nvim_spell_check/</guid><description><details>
<summary><font size="2" color="red">Update log</font></summary>
<ul>
<li><font color="blue">2021-10-17: add <code>spellsuggest</code> option.</font></li>
</ul>
</details>
<p>In this post, I want to talk about how to enable the built-in spell checking
feature in Nvim.</p></description></item><item><title>English Words Completion inside Neovim/Vim</title><link>https://jdhao.github.io/2019/04/26/words_completion_nvim/</link><pubDate>Fri, 26 Apr 2019 02:15:05 +0800</pubDate><guid>https://jdhao.github.io/2019/04/26/words_completion_nvim/</guid><description><p align="center">
<img src="https://blog-resource-1257868508.file.myqcloud.com/20190430093054.png" alt="">
</p>
<p>Some words are hard to type, it is handy if Neovim can provide auto-completion
for the words we are typing. We can achieve word completion in Neovim in two
ways.</p></description></item><item><title>How to Use Python Inside Vim Script with Neovim</title><link>https://jdhao.github.io/2019/04/22/mix_python_and_vim_script/</link><pubDate>Mon, 22 Apr 2019 16:05:10 +0800</pubDate><guid>https://jdhao.github.io/2019/04/22/mix_python_and_vim_script/</guid><description><h1 class="relative group">Introduction
<div id="introduction" class="anchor"></div>
<span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
<a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700"
style="text-decoration-line: none !important;" href="#introduction" aria-label="Anchor">#</a>
</span>
</h1>
<p>I have been using <a href="https://github.com/vim-airline/vim-airline" target="_blank">Vim-airline</a> for
a while to customize my statusline. We can change the theme used for statusline
with the many themes available in
<a href="https://github.com/vim-airline/vim-airline-themes" target="_blank">vim-airline-themes</a>. Not
all these themes looks good since it depends on the background color you use
for Neovim and certainly your aesthetics.</p></description></item><item><title>Nifty Little Nvim Techniques to Make My Life Easier -- Series 2</title><link>https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</link><pubDate>Wed, 17 Apr 2019 00:49:06 +0800</pubDate><guid>https://jdhao.github.io/2019/04/17/nifty_nvim_techniques_s2/</guid><description><p>This is the 2nd post of my post series on nifty Nvim/Vim techniques that will make my editing experience easier.</p>
<details>
<summary><font size="3" color="red">Click here to check other posts in this series.</font></summary>
<ul>
<li>Series 11: <a href="https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/" target="_blank">https://jdhao.github.io/2021/11/22/nifty_nvim_techniques_s11/</a></li>
<li>Series 10: <a href="https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/" target="_blank">https://jdhao.github.io/2021/06/17/nifty_nvim_techniques_s10/</a></li>
<li>Series 9: <a href="https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/" target="_blank">https://jdhao.github.io/2021/01/07/nifty_nvim_techniques_s9/</a></li>
<li>Series 8: <a href="https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/" target="_blank">https://jdhao.github.io/2020/11/11/nifty_nvim_techniques_s8/</a></li>
<li>Series 7: <a href="https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/" target="_blank">https://jdhao.github.io/2020/09/22/nifty_nvim_techniques_s7/</a></li>
<li>Series 6: <a href="https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/" target="_blank">https://jdhao.github.io/2019/12/21/nifty_nvim_techniques_s6/</a></li>
<li>Series 5: <a href="https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/" target="_blank">https://jdhao.github.io/2019/11/11/nifty_nvim_techniques_s5/</a></li>
<li>Series 4: <a href="https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/" target="_blank">https://jdhao.github.io/2019/09/17/nifty_nvim_techniques_s4/</a></li>
<li>Series 3: <a href="https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/" target="_blank">https://jdhao.github.io/2019/05/14/nifty_nvim_techniques_s3/</a></li>
<li>Series 1: <a href="https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/" target="_blank">https://jdhao.github.io/2019/03/28/nifty_nvim_techniques_s1/</a></li>
</ul>
</details></description></item><item><title>Setting up Ultisnips for Neovim</title><link>https://jdhao.github.io/2019/04/17/neovim_snippet_s1/</link><pubDate>Wed, 17 Apr 2019 00:28:45 +0800</pubDate><guid>https://jdhao.github.io/2019/04/17/neovim_snippet_s1/</guid><description><p>If you have used Sublime Text before, you may be familiar with its
<a href="http://sublimetext.info/docs/en/extensibility/snippets.html" target="_blank">snippet</a> feature.
<a href="https://en.wikipedia.org/wiki/Snippet_%28programming%29" target="_blank">Snippets</a> let us type a
trigger word and expand it to some boilerplate code or texts that we do not
want to repeat typing. We will increase our efficiency dramatically with the