Q's Blog

Array Algorithms

3 minute read Published: 2022-07-12

Arrays store elements in contiguous memory. Access is O(1). Search and modification require iterating. This guide covers six algorithms that appear repeatedly in array problems: binary search, two pointers, sliding window, prefix sums, divide and conquer, and the Dutch national flag.

Recursion and Iteration

3 minute read Published: 2022-07-08

Recursion and iteration are interchangeable. Any loop can be rewritten as recursion, and any recursion can be rewritten as a loop using an explicit stack. The difference is cost. Recursion consumes the call stack and adds per-call overhead. Iteration does neither. The right choice depends on the problem structure and the language.

Docker and Containers: Security, Rootless Mode, and Podman

3 minute read Published: 2022-07-07

A container is not a virtual machine. VMs emulate hardware and run a full OS kernel. Containers share the host kernel and isolate processes using namespaces (which partition what a process sees: filesystem, network, PIDs, users) and cgroups (which cap what it uses: CPU, memory, I/O).

Step-by-Step Jekyll Blog Setup Guide

2 minute read Published: 2022-07-06

Jekyll, an elegant and efficient static site generator, serves as an ideal platform for bloggers and developers looking for simplicity and power in their web projects. In this guide, I’ll take you through the process of setting up a Jekyll blog on a Macbook Air M1, leveraging the latest macOS environment. My aim is to provide a clear and concise path to get your Jekyll blog up and running, ensuring a smooth and straightforward experience. Let’s get started on this exciting journey of blogging with Jekyll on a powerful yet user-friendly setup!

First Blog

1 minute read Published: 2022-07-06

业精于勤荒于嬉,行成于思毁于随。
Achievements are reached by hard work rather than recreation. Actions are done after thorough consideration rather than casual decisions.