<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Ryan&#39;s Grimoire</title>
  <icon>https://jtr109.com/icon.png</icon>
  
  <link href="https://jtr109.com/atom.xml" rel="self"/>
  
  <link href="https://jtr109.com/"/>
  <updated>2026-08-07T10:20:31.955Z</updated>
  <id>https://jtr109.com/</id>
  
  <author>
    <name>Ryan Li</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>Be Careful When Defining Singleton Using Double-Checked Locking</title>
    <link href="https://jtr109.com/2024/03/28/Be-Careful-When-Defining-Singleton-Using-Double-Checked-Locking/"/>
    <id>https://jtr109.com/2024/03/28/Be-Careful-When-Defining-Singleton-Using-Double-Checked-Locking/</id>
    <published>2024-03-28T22:17:07.000Z</published>
    <updated>2026-08-07T10:20:31.955Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;Initializing instance must be an atomic method. Otherwise, there should be some unexpected behaviors.&lt;/p&gt;
&lt;p&gt;For example, let’s say that</summary>
        
      
    
    
    
    
    <category term="CSharp" scheme="https://jtr109.com/tags/CSharp/"/>
    
    <category term="DCL" scheme="https://jtr109.com/tags/DCL/"/>
    
    <category term="Singleton" scheme="https://jtr109.com/tags/Singleton/"/>
    
  </entry>
  
  <entry>
    <title>Preview Image in Both VSCode And Hexo</title>
    <link href="https://jtr109.com/2024/03/23/Preview-Image-in-Both-VSCode-And-Hexo/"/>
    <id>https://jtr109.com/2024/03/23/Preview-Image-in-Both-VSCode-And-Hexo/</id>
    <published>2024-03-23T22:42:54.000Z</published>
    <updated>2026-08-07T10:20:31.955Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;When following &lt;a href=&quot;https://hexo.io/docs/asset-folders#Embedding-an-image-using-markdown&quot;&gt;Assert Folders document of Hexo&lt;/a&gt; to</summary>
        
      
    
    
    
    
    <category term="Hexo" scheme="https://jtr109.com/tags/Hexo/"/>
    
    <category term="Markdown" scheme="https://jtr109.com/tags/Markdown/"/>
    
    <category term="VSCode" scheme="https://jtr109.com/tags/VSCode/"/>
    
  </entry>
  
  <entry>
    <title>Paste Image in VSCode</title>
    <link href="https://jtr109.com/2022/10/24/paste-image-in-vscode/"/>
    <id>https://jtr109.com/2022/10/24/paste-image-in-vscode/</id>
    <published>2022-10-24T03:10:41.000Z</published>
    <updated>2026-08-07T10:20:31.989Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;Preface&quot;&gt;&lt;a href=&quot;#Preface&quot; class=&quot;headerlink&quot; title=&quot;Preface&quot;&gt;&lt;/a&gt;Preface&lt;/h2&gt;&lt;p&gt;You may know I used &lt;a</summary>
        
      
    
    
    
    
    <category term="Markdown" scheme="https://jtr109.com/tags/Markdown/"/>
    
    <category term="VSCode" scheme="https://jtr109.com/tags/VSCode/"/>
    
    <category term="Hugo" scheme="https://jtr109.com/tags/Hugo/"/>
    
    <category term="Image" scheme="https://jtr109.com/tags/Image/"/>
    
  </entry>
  
  <entry>
    <title>Golang LeetCode 工具集</title>
    <link href="https://jtr109.com/2021/12/08/lcutils/"/>
    <id>https://jtr109.com/2021/12/08/lcutils/</id>
    <published>2021-12-08T07:51:43.000Z</published>
    <updated>2026-08-07T10:20:31.979Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;在使用 LeetCode 进行算法练习的过程中，我通常会把代码复制到本地编辑，这样我可以更方便地使用编辑器提供的语法校验能力。&lt;/p&gt;
&lt;h2 id=&quot;类型定义&quot;&gt;&lt;a href=&quot;#类型定义&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
    <category term="LeetCode" scheme="https://jtr109.com/tags/LeetCode/"/>
    
    <category term="TreeNode" scheme="https://jtr109.com/tags/TreeNode/"/>
    
    <category term="ListNode" scheme="https://jtr109.com/tags/ListNode/"/>
    
  </entry>
  
  <entry>
    <title>如何优雅地关闭 Pods</title>
    <link href="https://jtr109.com/2021/11/23/terminate-pods-gracefully/"/>
    <id>https://jtr109.com/2021/11/23/terminate-pods-gracefully/</id>
    <published>2021-11-23T01:41:31.000Z</published>
    <updated>2026-08-07T10:20:32.056Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;理论&quot;&gt;&lt;a href=&quot;#理论&quot; class=&quot;headerlink&quot; title=&quot;理论&quot;&gt;&lt;/a&gt;理论&lt;/h2&gt;&lt;p&gt;当我们在 Kubernetes 中触发停止一个 Pod 时，它会向每个容器中的进程发送一个 SIGTERM</summary>
        
      
    
    
    
    
    <category term="Kubernetes" scheme="https://jtr109.com/tags/Kubernetes/"/>
    
    <category term="CloudNative" scheme="https://jtr109.com/tags/CloudNative/"/>
    
    <category term="Pod" scheme="https://jtr109.com/tags/Pod/"/>
    
    <category term="SIGTERM" scheme="https://jtr109.com/tags/SIGTERM/"/>
    
    <category term="timeout" scheme="https://jtr109.com/tags/timeout/"/>
    
  </entry>
  
  <entry>
    <title>Golang 中切片的浅拷贝和深拷贝</title>
    <link href="https://jtr109.com/2021/11/18/golang-copy/"/>
    <id>https://jtr109.com/2021/11/18/golang-copy/</id>
    <published>2021-11-18T07:54:43.000Z</published>
    <updated>2026-08-07T10:20:31.963Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;本文将介绍 slice 的底层原理，在此基础上，我们能更好地了解深拷贝和浅拷贝具体做了什么。根据示例解释各种特殊情况下两种拷贝方式的影响。&lt;/p&gt;
&lt;h2 id=&quot;基础知识&quot;&gt;&lt;a href=&quot;#基础知识&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
  </entry>
  
  <entry>
    <title>Golang 中控制 print formatting 的结果</title>
    <link href="https://jtr109.com/2021/11/17/golang-print-format/"/>
    <id>https://jtr109.com/2021/11/17/golang-print-format/</id>
    <published>2021-11-17T09:54:25.000Z</published>
    <updated>2026-08-07T10:20:31.963Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;问题&quot;&gt;&lt;a href=&quot;#问题&quot; class=&quot;headerlink&quot; title=&quot;问题&quot;&gt;&lt;/a&gt;问题&lt;/h2&gt;&lt;p&gt;如果对 Golang</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
    <category term="formatting" scheme="https://jtr109.com/tags/formatting/"/>
    
    <category term="print" scheme="https://jtr109.com/tags/print/"/>
    
  </entry>
  
  <entry>
    <title>Golang 中的匿名字段和提升字段</title>
    <link href="https://jtr109.com/2021/11/17/anonymous-and-promoted-fields-in-golang/"/>
    <id>https://jtr109.com/2021/11/17/anonymous-and-promoted-fields-in-golang/</id>
    <published>2021-11-17T09:09:11.000Z</published>
    <updated>2026-08-07T10:20:31.955Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;有时你会看到在 Golang 中定义结构体时，有种写法是只定义类型而不定义字段名。下面将介绍这种被称为匿名字段的语法，以及它能够实现的作用。&lt;/p&gt;
&lt;h2 id=&quot;匿名字段&quot;&gt;&lt;a href=&quot;#匿名字段&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
    <category term="struct" scheme="https://jtr109.com/tags/struct/"/>
    
  </entry>
  
  <entry>
    <title>江苏中国移动更换为 8 元自由选套餐的方法</title>
    <link href="https://jtr109.com/2021/11/03/change-10086-package/"/>
    <id>https://jtr109.com/2021/11/03/change-10086-package/</id>
    <published>2021-11-03T03:53:51.000Z</published>
    <updated>2026-08-07T10:20:31.960Z</updated>
    
    
    <summary type="html">本文将介绍我如何申请江苏中国移动每月8元的保号套餐的方法，以及我如何使用手机卡避免被特定运营商裹挟在特定套餐中的思路，希望对你有帮助。·</summary>
    
    
    
    <category term="life" scheme="https://jtr109.com/categories/life/"/>
    
    
    <category term="China Mobile" scheme="https://jtr109.com/tags/China-Mobile/"/>
    
    <category term="mobile" scheme="https://jtr109.com/tags/mobile/"/>
    
  </entry>
  
  <entry>
    <title>修复 Golang 更新后 VSCode 中自动填充失败问题</title>
    <link href="https://jtr109.com/2021/11/03/go-tools-update/"/>
    <id>https://jtr109.com/2021/11/03/go-tools-update/</id>
    <published>2021-11-03T03:41:54.000Z</published>
    <updated>2026-08-07T10:20:31.961Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;p&gt;Go 更新后，VSCode 中的自动填充有概率会失效。这时候需要对 VSCode 的 Go tools 进行更新。&lt;/p&gt;
&lt;p&gt;使用 &lt;kbd&gt;Ctrl&lt;/kbd&gt;+&lt;kbd&gt;Shift&lt;/kbd&gt;+&lt;kbd&gt;p&lt;/kbd&gt; 命令打开菜单，选择 Go:</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="VSCode" scheme="https://jtr109.com/tags/VSCode/"/>
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
  </entry>
  
  <entry>
    <title>在一维数组算法题中使用双指针</title>
    <link href="https://jtr109.com/2021/10/20/two-pointers/"/>
    <id>https://jtr109.com/2021/10/20/two-pointers/</id>
    <published>2021-10-20T06:15:41.000Z</published>
    <updated>2026-08-07T10:20:32.056Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;什么是双指针&quot;&gt;&lt;a href=&quot;#什么是双指针&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="algorithm" scheme="https://jtr109.com/tags/algorithm/"/>
    
    <category term="array" scheme="https://jtr109.com/tags/array/"/>
    
    <category term="list" scheme="https://jtr109.com/tags/list/"/>
    
    <category term="pointer" scheme="https://jtr109.com/tags/pointer/"/>
    
  </entry>
  
  <entry>
    <title>使用 Mac 抢救变砖的小米路由器</title>
    <link href="https://jtr109.com/2021/09/01/restore-mi-router/"/>
    <id>https://jtr109.com/2021/09/01/restore-mi-router/</id>
    <published>2021-09-01T15:21:47.000Z</published>
    <updated>2026-08-07T10:20:31.999Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;背景&quot;&gt;&lt;a href=&quot;#背景&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    
    <category term="Router" scheme="https://jtr109.com/tags/Router/"/>
    
    <category term="Wi-Fi" scheme="https://jtr109.com/tags/Wi-Fi/"/>
    
    <category term="OpenWrt" scheme="https://jtr109.com/tags/OpenWrt/"/>
    
    <category term="Debrick" scheme="https://jtr109.com/tags/Debrick/"/>
    
    <category term="DHCP" scheme="https://jtr109.com/tags/DHCP/"/>
    
    <category term="TFTP" scheme="https://jtr109.com/tags/TFTP/"/>
    
  </entry>
  
  <entry>
    <title>记录一次 Golang 二维 slice 处理问题</title>
    <link href="https://jtr109.com/2021/08/04/go-memory-allocation/"/>
    <id>https://jtr109.com/2021/08/04/go-memory-allocation/</id>
    <published>2021-08-04T07:00:39.000Z</published>
    <updated>2026-08-07T10:20:31.961Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;问题描述&quot;&gt;&lt;a href=&quot;#问题描述&quot; class=&quot;headerlink&quot; title=&quot;问题描述&quot;&gt;&lt;/a&gt;问题描述&lt;/h2&gt;&lt;p&gt;在编写一个算法代码的过程中遇到了异常现象。精简成如下代码：&lt;/p&gt;
&lt;figure class=&quot;highlight</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Golang" scheme="https://jtr109.com/tags/Golang/"/>
    
  </entry>
  
  <entry>
    <title>将 minikube 的服务暴露到宿主机外</title>
    <link href="https://jtr109.com/2021/06/24/expose-minikube-services-out-of-host/"/>
    <id>https://jtr109.com/2021/06/24/expose-minikube-services-out-of-host/</id>
    <published>2021-06-24T14:45:45.000Z</published>
    <updated>2026-08-07T10:20:31.961Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;背景&quot;&gt;&lt;a href=&quot;#背景&quot; class=&quot;headerlink&quot; title=&quot;背景&quot;&gt;&lt;/a&gt;背景&lt;/h2&gt;&lt;p&gt;&lt;a href=&quot;https://minikube.sigs.k8s.io/&quot;&gt;minikube&lt;/a&gt; 是一款基于 Kubernetes</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Kubernetes" scheme="https://jtr109.com/tags/Kubernetes/"/>
    
    <category term="minikube" scheme="https://jtr109.com/tags/minikube/"/>
    
  </entry>
  
  <entry>
    <title>查看 Rust Crates 的 Features</title>
    <link href="https://jtr109.com/2021/05/29/crate-feature-flags/"/>
    <id>https://jtr109.com/2021/05/29/crate-feature-flags/</id>
    <published>2021-05-29T08:24:18.000Z</published>
    <updated>2026-08-07T10:20:31.960Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;背景&quot;&gt;&lt;a href=&quot;#背景&quot; class=&quot;headerlink&quot; title=&quot;背景&quot;&gt;&lt;/a&gt;背景&lt;/h2&gt;&lt;p&gt;在 Rust 学习过程中，我发现很多库的示例中会制定 &lt;code&gt;features&lt;/code&gt; flag，我理解 features</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Rust" scheme="https://jtr109.com/tags/Rust/"/>
    
    <category term="Cargo" scheme="https://jtr109.com/tags/Cargo/"/>
    
  </entry>
  
  <entry>
    <title>多种 Git Pull 模式差异分析</title>
    <link href="https://jtr109.com/2021/05/08/git-pull/"/>
    <id>https://jtr109.com/2021/05/08/git-pull/</id>
    <published>2021-05-08T03:37:09.000Z</published>
    <updated>2026-08-07T10:20:31.961Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;背景&quot;&gt;&lt;a href=&quot;#背景&quot; class=&quot;headerlink&quot; title=&quot;背景&quot;&gt;&lt;/a&gt;背景&lt;/h2&gt;&lt;p&gt;在执行 &lt;code&gt;git pull&lt;/code&gt; 命令时，我们可能会看到这样的提示信息：&lt;/p&gt;
&lt;figure</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="Git" scheme="https://jtr109.com/tags/Git/"/>
    
  </entry>
  
  <entry>
    <title>TCP 挥手动作大赏</title>
    <link href="https://jtr109.com/2021/04/22/tcp-termination/"/>
    <id>https://jtr109.com/2021/04/22/tcp-termination/</id>
    <published>2021-04-22T07:43:41.000Z</published>
    <updated>2026-08-07T10:20:32.052Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;四次挥手还是三次挥手&quot;&gt;&lt;a href=&quot;#四次挥手还是三次挥手&quot; class=&quot;headerlink&quot;</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="TCP" scheme="https://jtr109.com/tags/TCP/"/>
    
  </entry>
  
  <entry>
    <title>通过 Wireshark 学习 TCP 序号和确认号</title>
    <link href="https://jtr109.com/2021/04/22/tcp-seq/"/>
    <id>https://jtr109.com/2021/04/22/tcp-seq/</id>
    <published>2021-04-22T02:31:46.000Z</published>
    <updated>2026-08-07T10:20:32.011Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;概述&quot;&gt;&lt;a href=&quot;#概述&quot; class=&quot;headerlink&quot; title=&quot;概述&quot;&gt;&lt;/a&gt;概述&lt;/h2&gt;&lt;p&gt;我们知道 TCP 连接通过序号（sequence number）和确认号（acknowledgment</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="network" scheme="https://jtr109.com/tags/network/"/>
    
    <category term="TCP" scheme="https://jtr109.com/tags/TCP/"/>
    
  </entry>
  
  <entry>
    <title>HTTP 消息结束的标志</title>
    <link href="https://jtr109.com/2021/04/21/http-end-identity/"/>
    <id>https://jtr109.com/2021/04/21/http-end-identity/</id>
    <published>2021-04-21T08:46:17.000Z</published>
    <updated>2026-08-07T10:20:31.966Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;请求和响应&quot;&gt;&lt;a href=&quot;#请求和响应&quot; class=&quot;headerlink&quot; title=&quot;请求和响应&quot;&gt;&lt;/a&gt;请求和响应&lt;/h2&gt;&lt;p&gt;首先需要明确的一点是，无论是 HTTP 请求还是 HTTP 响应，都是由相同的 HTTP</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="network" scheme="https://jtr109.com/tags/network/"/>
    
    <category term="HTTP" scheme="https://jtr109.com/tags/HTTP/"/>
    
  </entry>
  
  <entry>
    <title>TCP 滑动窗口</title>
    <link href="https://jtr109.com/2021/04/21/tcp-sliding-window/"/>
    <id>https://jtr109.com/2021/04/21/tcp-sliding-window/</id>
    <published>2021-04-21T06:08:01.000Z</published>
    <updated>2026-08-07T10:20:32.052Z</updated>
    
    
      
      
        
        
    <summary type="html">&lt;h2 id=&quot;背景&quot;&gt;&lt;a href=&quot;#背景&quot; class=&quot;headerlink&quot; title=&quot;背景&quot;&gt;&lt;/a&gt;背景&lt;/h2&gt;&lt;p&gt;TCP 滑动窗口协议是为了帮助发送端了解数据处理的带宽或者数据处理速度，避免拥塞，从而解决包乱序问题，提供可靠传输&lt;a</summary>
        
      
    
    
    
    <category term="tech" scheme="https://jtr109.com/categories/tech/"/>
    
    
    <category term="network" scheme="https://jtr109.com/tags/network/"/>
    
    <category term="TCP" scheme="https://jtr109.com/tags/TCP/"/>
    
  </entry>
  
</feed>
