Skip to content

Eric Liu's Learning Journal

    Eric Liu's Learning Journal
    • Software Engineering

      Frequency map in Go

      ByEric Liu 8 October 20268 October 2026

      A frequency map is just a fancy word for a hash map that tracks the number of occurrences of an element in a collection. If we have a slice in Go and we want to know exactly how many times each element in the slice occurs in the slice, we can build a frequency map…

      Read More Frequency map in GoContinue

    • Software Engineering

      Map-as-Set in Go

      ByEric Liu 7 October 20268 October 2026

      In programming languages like Go, there is no built-in type for set. A set essentially answers yes or no: is a given element present? We can use the built-in map type to implement sets. I used to implement map-as-set like this: Apparently, Gemini thinks there’s a better way: Gemini thinks this is better because it…

      Read More Map-as-Set in GoContinue

    • Renovation & DIY

      KompacPlus

      ByEric Liu 12 April 20247 October 2026

      KompacPlus is marketed as a counter top material, and sometimes wall material. The sellers often claim it’s comparable to quartz and sintered stone. KompacPlus is made in Italy, but only sold in Singapore and Malaysia. It’s essentially “made from layers of resin-soaked kraft paper” and compressed with extremely high heat and pressure. It’s non-porous, somewhat…

      Read More KompacPlusContinue

    • Software Engineering

      Let’s Encrypt! certificate always expires

      ByEric Liu 9 April 20249 April 2024

      I usually don’t SSH into the server that runs this blog. When I do, it’s because the free SSL certificate by Let’s Encrypt! has expired. Every time this happens, I just google to find a quick solution, and I’ll quickly forget the steps within days. So this time, I’m going to write the steps down….

      Read More Let’s Encrypt! certificate always expiresContinue

    • Software Engineering

      Interface implementation in Go is implicit

      ByEric Liu 7 February 20218 February 2021

      I’m quite familiar with the concept of interface in Java; but on my first day reading my colleague’s Go code, I was a little confused. Here’s how: In Java, implementing an interface is explicitly declared with the keyword implements, followed by the names of the interfaces being implemented. For example: By looking at the class…

      Read More Interface implementation in Go is implicitContinue

    • Software Engineering

      Best MySQL data types for storing date & time

      ByEric Liu 4 February 20217 February 2021

      When it comes to storing date/time in MySQL, several data types are commonly used. My colleagues and I had a brief discussion today on which type we should use for storing created and last updated date/time. Folks were divided into two camps. Those who preferred to work directly with UNIX timestamp wanted bigint, while people…

      Read More Best MySQL data types for storing date & timeContinue

    © 2026 Eric Liu's Learning Journal - WordPress Theme by Kadence WP