Skip to content

Blog

Hello, world!

\[ \LaTeX: \text{Hello, world!} \] main.c 1 puts("Hello, world!"); main.cpp 1 std::println("Hello, world!"); main.go 1 fmt.Println("Hello, world!") main.rs 1 println!("Hello, world!") main.cpp 1 IO.println("Hello, world!"); main.kt 1 println("Hello, world!"); Program.cs 1 Console.WriteLine("Hello, world!"); main.py 1 print("Hello, world!") index.js 1 console.log("Hello, world!"); query.sql 1 SELECT 'Hello, world!';

Read more →

Self-hosted RustDesk Service

Docker compose: docker-compose.yml 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 services: hbbs: container_name: hbbs image: rustdesk/rustdesk-server:latest command: hbbs volumes: - ./data:/root network_mode: "host" depends_on: - hbbr restart: unless-stopped hbbr: container_name: hbbr image: rustdesk/rustdesk-server:latest command: hbbr volumes: - ./data:/root network_mode: "host" restart: unless-stopped Firewall TCP 21115/21118 UCP 21116

Read more →

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

Read more →

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

Read more →

Arch Linux Installation

Note KDE (Wayland) + Intel + NVIDIA Note

Read more →

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.

Read more →

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

Read more →

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.

Read more →

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

Read more →

OpenMVS Hands-on Experience

Environment Preparation Install Docker (Windows platform will be used as an example below) Pull images 1 2 docker pull colmap/colmap docker pull openmvs/openmvs-ubuntu Prepare several photos (You can use https://github.com/cdcseacave/openMVS_sample/tree/master/images ) Create a project folder C:\Users\mioyi\project images 00000.jpg 00001.jpg … Steps Use COLMAP to generate sparse point clouds 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 # Start Docker container docker run -it --rm \ --gpus=all \ # Mount GPU, optional -v C:\Users\mioyi\project:/data \ # Mount project folder colmap/colmap # colmap container # Reconstruction cd /data colmap automatic_reconstructor \ --workspace_path . \ --image_path ./images \ --sparse 1 --dense 0 # Run undistortion (to adapt for OpenMVS) mkdir dense colmap image_undistorter \ --image_path /data/images \ --input_path /data/sparse/0 \ --output_path /data/dense \ --output_type COLMAP \ --max_image_size 2000 # Convert to TXT format (to adapt for OpenMVS) colmap model_converter \ --input_path /data/dense/sparse \ --output_path /data/dense/sparse \ --output_type TXT # Exit container exit Use OpenMVS to generate textures 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # Start Docker container docker run -it --rm \ -v C:\Users\mioyi\project:/data \ # Mount project folder openmvs/openmvs-ubuntu cd /data/dense # Convert to OpenMVS format /openMVS_build/bin/InterfaceCOLMAP -i . -o scene.mvs --image-folder images # 1. Densify point cloud /openMVS_build/bin/DensifyPointCloud scene.mvs # 2. Reconstruct mesh /openMVS_build/bin/ReconstructMesh scene_dense.mvs # 3. Refine mesh (optional) /openMVS_build/bin/RefineMesh scene_dense_mesh.mvs # 4. Texture mesh /openMVS_build/bin/TextureMesh scene_dense_mesh.mvs # Exit container exit The texture result is located at C:\Users\mioyi\project\dense\scene_dense_mesh_texture.png

Read more →