Skip to content

Blog — page 4

664 posts on software development, newest first. Browse by topic:Rust, Go, Python, JavaScript & web, AI & data, DevOps & tooling, Mobile & Android, .NET & C#, C++ & systems, LaTeX, Investing, Everything else.

  1. InvestingComputing CAGR, volatility, Sharpe ratio and max drawdown in PythonCompute CAGR, annualised volatility, the Sharpe ratio and maximum drawdown from daily prices with pandas, and avoid the annualisation and return-type mistakes.
  2. PythonChange data capture in Postgres with logical replication slotsStream inserts, updates and deletes out of Postgres: wal_level=logical, slots with test_decoding and pgoutput, REPLICA IDENTITY, publications, and a Python consumer.
  3. AI & dataSemantic search in Postgres with pgvectorStore embeddings in Postgres with pgvector: vector columns, distance operators, HNSW and IVFFlat indexes, and filtered queries that still return enough rows.
  4. JavaScript & webPage animations with the View Transitions APIAnimate DOM updates and page navigations: startViewTransition, view-transition-name, the pseudo-element tree, cross-document opt-in and reduced motion.
  5. PythonLinting and formatting Python with RuffConfigure Ruff in pyproject.toml, pick rule sets (E, F, I, UP, B), apply safe and unsafe fixes, compare ruff format with Black, and run both checks in CI.
  6. .NET & C#Single-file C# apps with dotnet run app.cs.NET 10 runs a lone .cs file with no project: dotnet run app.cs, #:package, #:sdk and #:property directives, shebang scripts on Unix, and converting to a project.
  7. GoType-safe SQL in Go with sqlcGenerate typed Go code from plain SQL with sqlc: a version 2 sqlc.yaml, :one, :many and :exec queries, using pgx or database/sql, and transactions with WithTx.
  8. RustProperty-based testing in Rust with proptestUse proptest to test a Rust run-length encoder: the proptest! macro, strategies, prop_assert, how shrinking finds a minimal failing input, and regression files.
  9. DevOps & toolingKubernetes Liveness, Readiness and Startup Probes ExplainedWhat each Kubernetes probe does, the four probe types, how the timing fields add up, why liveness should not check dependencies, and a Deployment that gets it right.
  10. AI & dataStreaming LLM responses to the browser with server-sent eventsRelay a streamed Claude response through a FastAPI endpoint as server-sent events, read it in the browser with fetch, and handle proxy buffering and cancellation.
  11. JavaScript & webThe CSS :has() selector: styling parents and siblings without JavaScriptPractical :has() patterns: form validation states, cards with images, previous-sibling and quantity queries, plus the selector's rules, performance notes and support.
  12. PythonProperty-based testing in Python with HypothesisProperty-based tests with Hypothesis and pytest: strategies, @given, a real bug in a run-length encoder, shrinking, @example, settings and the example database.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)