How I Upgraded My Mac Mini Storage with an External SSD and Solved the Home Directory Issue
A couple of months ago, I had the brilliant idea to upgrade my Mac mini M2 by installing MacOS on an external M.2 SSD. For under 200 bucks, I went from a measly 250GB to a whopping 2TB. I was on cloud nine, reveling in my newfound digital real estate, until the other weekend when the system decided to crash my party by refusing to download upgrades due to a lack of space....
How to Build an Amazing and Productive Terminal
Everyone wants a cool terminal and WezTerm is the coolest one in my opinion. It is easy to manage and we can setup a new environment with minutes in association with GNS stow - a symlink manager. WezTerm is easy to configure since it is using lua and very friendly to read and learn. I am dumb at iTerm2 and Tmux, but it only took me 30 mins to start tweaking the config....
Building a WebApp using React and Quarkus
My first website was an adventure straight out of 2014, built with Dreamweaver and some basic HTML and CSS. Picture a static site, lovingly crafted to display the research and papers from our lab. The end product was, well, let鈥檚 just say not exactly internet-breaking. But hey, it was my first foray into the wild world of web development! Fast forward 10 years, after diving deep into data science, machine learning, and platform engineering, I realized something horrifying: I was still a web development noob....
Coding Pattern: Kadane's Algo
Imagine you鈥檙e walking along a path that has treasure chests and traps. Some chests have gold coins, and some traps take away coins. You want to find the part of the path where you can get the most coins. The key idea: It is a dynamic programming algorithm for finding the maximum contiguous sum subarray in a given array. It is a simple and efficient algorithm that works by maintaining two variables:...
Coding Pattern: Dynamic Programming
Preface Facing the Dynamic Programming Challenge Like many others, I initially found Dynamic Programming (DP) on LeetCode daunting and perplexing. However, this challenging journey led to profound insights. My initial misconception was that DP was all about complexity, but I learned it鈥檚 fundamentally about simplifying complex problems into manageable segments. Here鈥檚 my journey into understanding DP and why it鈥檚 a crucial tool in a programmer鈥檚 toolkit. Unraveling Dynamic Programming The Essence of DP...
Coding Pattern: Recursion
Overview Recursion is a way of solving a problem by breaking it down into smaller problems of the same type. The smaller problems are then solved recursively, until a base case is reached. The base case is a simple problem that can be solved without recursion. Imagine you have a big box of toy blocks, and each block represents a problem you need to solve. Some blocks are big (complex problems), and some are tiny (simple problems)....
Coding Pattern: Trie
Overview The union-find algorithm is a data structure and algorithm that maintains a collection of disjoint sets. A disjoint set is a set of elements that are not connected to each other. The union-find algorithm can be used to perform the following operations: Find:聽Find the set that an element belongs to. Union:聽Merge two sets together. The union-find algorithm is often used to solve problems that involve graph connectivity. For example, the union-find algorithm can be used to determine whether two nodes in a graph are connected, or to find all of the connected components in a graph....
Coding Pattern: Two Pointers
Overview It is not easy to summarize the pattern of Two Pointers, but most likely it is used for list and linked list and the required time complexity is O(N) - the underlying pattern allows us to use Two Pointers to go through the list once to get the results. Common usage: Linear Structure: Typically applied to a sorted array or linked list. Two pointers might move in the same direction or in opposite directions....
Coding Pattern: Divide & Conquer
Overview The Divide-n-Conquer strategy often employs recursion, as it relies on applying the same method to reduce the problem size by half and subsequently combining the outcomes for the ultimate solution. I view Divide-n-Conquer in a light similar to MapReduce, particularly when the task involves transformation. MapReduce breaks down a large problem into more manageable, independent sub-problems. Since each of these sub-problems operates autonomously, we can address them sequentially and still integrate their solutions....
Coding Pattern: Binary Search
Overview In one word, binary search is to search for a target in a sorted array. The idea is to shrink the search space to empty. It must be sorted because we can be sure how to shrink the search space and we normally reduce the search space by half so the time complexity is O(logN) where N is the size of entire search space. One common problem to understand Binary Search is how to identify the boundary of the search space....