Blog
A Quick Guide to UUID Versions
UUID Versions: v1, v2: obsolete; v6 improves upon and is compatible with v1 v3, v5: hash-based (the former has security issues) v4: Random numbers v7: Timestamp + Random numbers v8: Custom-defined by the user
Advanced Svelte
Advanced Reactivity Raw State Characteristics: Changes to properties and content will not trigger updates 1 let data = $state.raw(poll()); Reactive Classes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 class Box { width = $state(0); height = $state(0); area = $derived(this.width * this.height); constructor(width, height) { this.width = width; this.height = height; } embiggen(amount) { this.width += amount; this.height += amount; } } class Box { #width = $state(0); #height = $state(0); area = $derived(this.#width * this.#height); constructor(width, height) { this.#width = width; this.#height = height; } get width() { return this.#width; } get height() { return this.#height; } set width(value) { this.#width = Math.max(0, Math.min(MAX_SIZE, value)); } set height(value) { this.#height = Math.max(0, Math.min(MAX_SIZE, value)); } embiggen(amount) { this.width += amount; this.height += amount; } } Built-in Reactive Classes Supports Map, Set, Date, URL, URLSearchParams
Anxiety Over Social Control and Work
Recently, I have often been enveloped by an overwhelming sense of anxiety. The thought of young students being disciplined and “controlled” by society through the education system makes me deeply uncomfortable. The realization that upon adulthood, we seem destined to work for others, controlled and constrained, as if we are inevitably alienated into mere cogs in a colossal machine or slaves to the system, is incredibly suffocating. Even the thought of myself or my future partner facing this same fate fills me with an indescribable sorrow.
Auto Website Language Switching with Caddy
I implemented an automatic language switching feature for my blog using Caddy. At first, I thought it would be simple, but I kept running into obstacles. It must determine whether it is the first visit; otherwise, if a user manually switches the language, Caddy cannot distinguish that type of request and will redirect indiscriminately. Then, it needs to check if the user’s language matches the page language; if they match, no switching should occur. Switching must only apply to HTML files (not path_regexp \.[a-zA-Z0-9]+$); otherwise, requesting other types of files will result in “Too Many Redirects.” Furthermore, Hugo’s multilingual setup only generates HTML files and no other files. For English scenarios, the /zh-cn prefix needs to be removed. Caddyfile 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 *.mioyi.net { encode @www host www.mioyi.net handle @www { # Whether it is the first visit @first_visit { not header_regexp Cookie (?i)first=0 } # User is Chinese, page is English @to_zh { header_regexp al Accept-Language (?i)\bzh not path /zh-cn* not path_regexp \.[a-zA-Z0-9]+$ } # User is English, page is Chinese @to_en { not header_regexp al Accept-Language (?i)\bzh path_regexp en_path ^/zh-cn(?:/)?(.*)$ not path_regexp \.[a-zA-Z0-9]+$ } # Automatic language switching route @first_visit { # Mark as not the first visit header Set-Cookie "first=0; Path=/; Max-Age=604800" # Switch to Chinese redir @to_zh /zh-cn{uri} # Switch to English redir @to_en /{re.en_path.1} } # Handle requests root * /var/www/blog file_server { precompressed zstd } } }
Backend Development: Why I'm Betting on These Four Languages/Platforms
TypeScript Frontend is JS DX (Developer Experience) Async/Concurrency performance JVM (Java/Kotlin) Ecosystem, community, resources DX (Spring Boot) The only drawback is memory consumption, but the strengths far outweigh the weaknesses. Go cloud native cloud infrastructure (Kubernetes, Docker, Terraform, Prometheus) Rust Pure performance Why other languages won’t work C#: Beaten by JVM in almost every aspect except performance. The stereotype of Microsoft and Windows is impossible to change. Python: Beaten by JS in every aspect. PHP/Ruby: Full-stack languages, not pure backend. Zig: Backend development is about engineering; being too low-level (such as manual memory management) excessively reduces development efficiency.
C++ static linking
MSVC CMakeLists.txt 1 2 3 4 5 6 7 set(VCPKG_TARGET_TRIPLET "x64-windows-static") # ... if(MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") endif() MinGW Note
Codex Config
https://chatgpt.com/share/6a1a5336-a6a8-83ea-add7-78820e1c75b8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 #:schema https://developers.openai.com/codex/config-schema.json # ================ Model, Reasoning & Provider ================ model = "gpt-5.5" review_model = "gpt-5.5" personality = "pragmatic" model_reasoning_effort = "high" plan_mode_reasoning_effort = "xhigh" model_reasoning_summary = "detailed" model_verbosity = "high" model_supports_reasoning_summaries = true # ================ Approval, Sandbox, Permissions & Project Trust ================ approval_policy = "on-request" approvals_reviewer = "auto_review" sandbox_mode = "workspace-write" sandbox_workspace_write.network_access = true sandbox_workspace_write.exclude_slash_tmp = false sandbox_workspace_write.exclude_tmpdir_env_var = false windows.sandbox = "elevated" windows.sandbox_private_desktop = true default_permissions = ":workspace" # ================ Network & Web Search ================ web_search = "live" tools.web_search.context_size = "high" # ================ Shell, Execution Environment & Local Tools ================ # ================ Apps, Connectors, Plugins & Skills ================ features.apps = false features.plugins = false # ================ MCP Servers & OAuth ================ features.enable_mcp_apps = false # ================ Hooks Lifecycle ================ features.hooks = false # ================ Multi-Agent ================ features.multi_agent = true # ================ Memories ================ features.memories = true # ================ General Behavior, Project Docs & Feature Toggles ================ check_for_update_on_startup = false features.codex_git_commit = true features.js_repl = true features.terminal_resize_reflow = true features.mentions_v2 = true features.undo = true features.fast_mode = false features.prevent_idle_sleep = true # ================ Logs, History, Feedback & Telemetry ================ analytics.enabled = false feedback.enabled = false history.persistence = "save-all" # ================ TUI, Notifications, Appearance & Prompt Status ================ tui.status_line = [ "model-with-reasoning", "current-dir", "permissions", "context-used", ] tui.status_line_use_colors = true notice.hide_full_access_warning = false notice.hide_world_writable_warning = false notice.hide_rate_limit_model_nudge = false show_raw_agent_reasoning = true hide_agent_reasoning = false tui.show_tooltips = false tui.model_availability_nux."gpt-5.5" = 4 Custom provider (using OpenRouter as an example):
Deep Dive: Why Does C/C++ Frequently Encounter Chinese Garbled Characters Under Windows?
1. Core Concept: The Misalignment of Characters and Bytes To understand the root cause of encoding corruption, one must first distinguish between “Characters” and “Bytes.” Character: A human-readable symbol (such as ‘A’ or ‘你’). Byte: A binary value stored by a computer. The legacy design of the C/C++ language (originating in the 1970s) led to a core misunderstanding: the char type essentially stores bytes rather than characters.
Dual Boot
How it works Booting No matter what operating system is being started, a Boot file and a Boot Loader are required. The former tells the Boot Loader about the system components and how to start the system; The latter loads the Boot file and directs the hardware to start the system. System Every system can be divided into at least two parts: the Boot file and the main space (C: for Windows or / for Linux).