Life Wiki Selfhosted on Your NAS

Introduction I used Notion for a couple of years and found it to be one of the best tools for note-taking and building a personal wiki. Why did I stop using it? It wasn’t about the cost—Notion’s freemium plan is perfectly sufficient for personal use. Instead, there were two main issues that drove me away. First, typing math equations in Notion is cumbersome because you have to use a dedicated “Block” for them. Second, it’s difficult to export or migrate your data to other platforms, which, while not entirely Notion’s fault, still concerns me. Most importantly, I realized I should make better use of my Synology NAS. That’s why I decided to explore open-source, self-hosted alternatives. ...

January 10, 2025 · 7 min · 1338 words · Me

Building a Single Page Application (SPA) with Quarkus and Quinoa

Quarkus is an exciting framework for building modern Java applications, and Quinoa takes it up a notch by streamlining Single Page Application (SPA) development. Together, they enable a seamless workflow for both frontend and backend developers. This guide walks through setting up a Quarkus-based SPA using React as an example, although the process works just as well for other frameworks. Why Quinoa Matters Quinoa elegantly integrates frontend development into Quarkus projects. Here’s why you should care: ...

December 21, 2024 · 3 min · 479 words · Me

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. Everyone wants a cool terminal, and WezTerm is the coolest one in my opinion. It’s easy to manage and we can set up a new environment within minutes using GNU Stow - a symlink manager. ...

July 9, 2024 · 5 min · 938 words · Me

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’s 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. Cue the dramatic music. This simply would not do! So, armed with determination and copious amounts of coffee, I embarked on a quest to master web app development and fill in the gaping holes in my skill set. ...

July 5, 2024 · 4 min · 652 words · Me

Coding Pattern: Kadane's Algo

Imagine you’re 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: ...

November 30, 2023 · 3 min · 476 words · Me

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’s fundamentally about simplifying complex problems into manageable segments. Here’s my journey into understanding DP and why it’s a crucial tool in a programmer’s toolkit. Unraveling Dynamic Programming The Essence of DP ...

November 30, 2023 · 9 min · 1764 words · Me

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). To solve a big problem, you take apart the big block to find smaller blocks inside, and then, if needed, you take apart those smaller blocks to find even tinier blocks inside them, and so on, until you reach the tiniest blocks that you can easily understand and solve. ...

November 5, 2023 · 4 min · 724 words · Me

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. ...

October 22, 2023 · 7 min · 1381 words · Me

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. Classic Patterns: a. Converging Pointers (often used in sorted arrays): - Start one pointer at the beginning (left) and another at the end (right). - Move them toward each other until they meet or until some condition is satisfied. - Example: Checking if a sorted array has two numbers that sum up to a target. b. Sliding Window: - Use two pointers to represent the start and end of a window, then “slide” the window through the array/sequence. - Example: Finding the longest substring without repeating characters. c. Fast and Slow Pointers (often used in linked lists): - One pointer moves twice (or more times) as fast as the other. - Useful for detecting cycles in a linked list (Floyd’s Cycle Detection Algorithm) or finding the middle element. Usage Scenarios: Finding a Pair with a Given Sum/Target: Given a sorted array, determine if there’s a pair that sums up to a target. Move the left and right pointers based on the sum comparison to the target. Removing Duplicates: Two pointers can be used to remove duplicates from a sorted array or linked list, with one pointer iterating through and another pointing to the last non-duplicate item. Palindrome Checking: To determine if a string or linked list is a palindrome, you can use two pointers moving from the two ends towards the center. Max/Min Subarray/Sublist: Using the sliding window variant, find the subarray with the maximum/minimum sum or other properties. Advantages: Efficiency: The two-pointer technique can sometimes convert a brute force solution with time complexity O(n^2) to a more efficient O(n) solution. Space: This method is in-place and typically uses O(1) extra space. Example Questions 88. Merge Sorted Array You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. ...

October 12, 2023 · 8 min · 1620 words · Me

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. Key to this approach is ensuring the main problem can be independently segmented and the derived solutions can be seamlessly merged. ...

October 8, 2023 · 6 min · 1257 words · Me