<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kailun's Blog</title><link>https://elated-hopper-5c0cb3.netlify.app/</link><description>Recent content on Kailun's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 01 Dec 2025 09:10:16 +0800</lastBuildDate><atom:link href="https://elated-hopper-5c0cb3.netlify.app/index.xml" rel="self" type="application/rss+xml"/><item><title>Visualizing Go Scheduler Events at Runtime</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/go-slowmo/</link><pubDate>Mon, 01 Dec 2025 09:10:16 +0800</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/go-slowmo/</guid><description>&lt;p&gt;Being a Go dev for some time, my curiosity in Go&amp;rsquo;s runtime has been gradually built up to the point where I long for more mental grasp than roughly knowing a concept or two. With this in mind, I spent the past few months building &lt;a href="https://kailunli.me/go-slowmo"&gt;go-slowmo&lt;/a&gt;, some simple visualization around Go&amp;rsquo;s GMP scheduling model, which hopefully provides myself and others another way to look into that part of the Go runtime.&lt;/p&gt;</description></item><item><title>Index Fundamentals of Relational Database</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/indexes/</link><pubDate>Sun, 21 Feb 2021 19:45:34 -0800</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/indexes/</guid><description>&lt;p&gt;Knowledge of database systems is essential to software engineers, and it&amp;rsquo;s unfortunate that I don&amp;rsquo;t have much exposure to databases (especially relational ones) at work. Luckily, there&amp;rsquo;s this &lt;a href="https://15445.courses.cs.cmu.edu/fall2020/"&gt;highly rated database course&lt;/a&gt; from CMU with quite a lot of learning materials, which provides me with a good chance to catch up on this area.&lt;/p&gt;
&lt;p&gt;My current plan is to go over indexing and transactions first and this particular post will be grouping some index related notes. The major reason behind this this is that I have recently just gain some high-level understanding of these 2 topics by reading &lt;a href="https://www.amazon.com/Designing-Data-Intensive-Applications-Reliable-Maintainable/dp/1449373321"&gt;Designing Data-Intensive Applications&lt;/a&gt; book, and going over them in more details again could facilitate my understanding of them.&lt;/p&gt;</description></item><item><title>Very Brief Q&amp;A on Raft</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/raft/</link><pubDate>Fri, 29 Jan 2021 11:09:50 -0800</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/raft/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;A year ago (how time flies!) I got to learn Raft when trying to finish &lt;a href="http://nil.csail.mit.edu/6.824/2018/schedule.html"&gt;a distributed system course&lt;/a&gt; made by MIT. It&amp;rsquo;s overall a consensus algorithem targeting strong consistency, and it&amp;rsquo;s designed for understandability and the ease for implementation. Recently there&amp;rsquo;s a need to review it again and I&amp;rsquo;m making this post so that I don&amp;rsquo;t forget as fast in the future.&lt;/p&gt;
&lt;h1 id="resources"&gt;Resources&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://raft.github.io/raft.pdf"&gt;Raft paper&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://thesecretlivesofdata.com/raft/"&gt;A nice visualization on Raft concepts&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Pictures used for illustration in this post are gratefully borrowed from the resources above.&lt;/p&gt;</description></item><item><title>Wrapping up Fundamentals of Go Interface: Representation, Reflection and More</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/go-interface/</link><pubDate>Fri, 31 Jul 2020 21:21:33 -0700</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/go-interface/</guid><description>&lt;p&gt;Interface is, in many&amp;rsquo;s opinion, the shiniest part of the design of Go, and it adds flexibility to this statically typed language. As a noob gopher, I feel that leveraging interfaces does help deliver elegant and maintainable code. However, when not fully understood, interface might also be a great source of confusion. In this post, we will target some fundamental yet a bit complex part of Go interface, namely, its representation, its metaprogramming in reflection, and the role it plays in the new proposal of Go generics.&lt;/p&gt;</description></item><item><title>Docker Network and Linux Network Namespace</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/docker-network/</link><pubDate>Sat, 23 May 2020 19:29:09 -0700</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/docker-network/</guid><description>&lt;p&gt;In Docker we can create a new network using &lt;code&gt;docker network create&lt;/code&gt; with several options. In this post we will take a look at some Linux networking concepts that are used, the basic Docker networking concepts, and how we can use these to construct a custom container network.&lt;/p&gt;
&lt;h1 id="network-namespaces"&gt;Network Namespaces&lt;/h1&gt;
&lt;p&gt;Docker leverages Linux network namespaces for network isolation, like the way it uses other namespaces (e.g. process namespaces, user namespaces). A network namespace provides a shared set of network interfaces, routing table, and firewall rules. Each Docker container has its own network namespace.&lt;/p&gt;</description></item><item><title>Quick Review of KMP Algorithm</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/kmp/</link><pubDate>Sat, 02 May 2020 23:40:40 -0700</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/kmp/</guid><description>&lt;p&gt;Published in 1977, the Knuth-Morris-Pratt algorithm can search substring pattern in time linear to the total string length. Recently I encountered 2 Leetcode questions (1367, 1392) that can be effectively solved by KMP, and therefore want to use this post as a quick refresher and go through the basic mechanism and some concrete examples of this algorithm. (A nice video explanation of KMP can be found &lt;a href="https://www.youtube.com/watch?v=uKr9qIZMtzw&amp;amp;t=764s"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="intuition"&gt;Intuition&lt;/h1&gt;
&lt;p&gt;In a naive substring search approach, when we find a mismatch between the pattern and the string, we shift the pattern by 1 character to start a new round of comparison (in the example below, we shift the starting &lt;code&gt;B&lt;/code&gt; to index 1 after we detect the mismatch at index 4). But we already know the portion before &lt;code&gt;C&lt;/code&gt; in the pattern, and we know that we&amp;rsquo;re gonna compare &lt;code&gt;BAAAA&lt;/code&gt; against &lt;code&gt;AAACB...&lt;/code&gt;. This means we are doing some kind of &amp;ldquo;backup&amp;rdquo; after a mismatch. KMP avoids this backup by using deterministic finite state machine, which will be shown in detail in next section.&lt;/p&gt;</description></item><item><title>Revisit Concurrent Programming in Java -- Threads and Locks</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/java-concurrent/</link><pubDate>Sat, 28 Dec 2019 12:38:25 -0500</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/java-concurrent/</guid><description>&lt;p&gt;Not long ago I went through the &amp;ldquo;Concurrent Programming in Java&amp;rdquo; course on Coursera. Though the contents involved are very fundamental, I felt it&amp;rsquo;s necessary to give them a revisit since they are building blocks of more advanced contents in concurrent world.&lt;/p&gt;
&lt;h1 id="overview"&gt;Overview&lt;/h1&gt;
&lt;p&gt;Overall, I figured this course followed a bottom-up approach. It first introduces low-level Java concurrent primitives, and then go through some of the higher-level approaches that solve some of the problems when programming with the low-level concepts. From that end, it discussed some of the concurrent data structures, and formally introduced linearizability, which is the correctness requirement of any concurrent data structure.&lt;/p&gt;</description></item><item><title>Blog Set Up</title><link>https://elated-hopper-5c0cb3.netlify.app/posts/my-first-post/</link><pubDate>Sun, 15 Dec 2019 16:18:54 -0500</pubDate><guid>https://elated-hopper-5c0cb3.netlify.app/posts/my-first-post/</guid><description>&lt;h1 id="framework"&gt;Framework&lt;/h1&gt;
&lt;p&gt;This blog is set up using &lt;a href="https://gohugo.io/"&gt;Hugo&lt;/a&gt; framework. It&amp;rsquo;s a fast and flexible framework written in Golang, and is a popular static site generator. There are various types of themes that are avaiable for use in Hugo, and the one I&amp;rsquo;m using is called &lt;a href="https://themes.gohugo.io/hugo-theme-m10c/"&gt;m10c&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hugo is fairly easy to get started with, and the basic use of it might only involve a few CLI command. Most of the configurations and contents can be edited by adding key-value pairs in the &lt;code&gt;config.toml&lt;/code&gt; file. More flexible content management done through Hugo variables and functions in extra HTML files. I&amp;rsquo;m yet very new to Hugo, so hopefully I can dive deeper later while mataining this blog and share more of it here (stay tuned!).&lt;/p&gt;</description></item></channel></rss>