Skip to content

Journal⚓︎

Thoughts, interests, brain storms, learning... All the blog article posts will start from the topic shown in this section.

Look back on linq

A long time ago, when I touched keywords like map/filter/reduce in Swift.

At that time, I generally called it Syntax Sugar. Today, I got a chance to continue digging into this concept as I am touching LINQ in C#.

Story begins

My learning started from this fun pic:

image

After some investigation, I got this mapping from Swift to C#:

  • map -> Select -> projection -> SELECT (SQL)
  • filter -> Where -> selection -> WHERE
  • reduce -> Aggregate ->
  • Ordering (ORDER BY)?
  • Grouping (GROUP BY)?

PRIVATE source repo → PUBLIC site repo

More secure way to deploy GitHub Page with repo in resource-public.

With the security concerns of exposing source Markdown files and Git history, I recently switched my previous public GitHub Pages repository to a private source repository, which will only be responsible for building and deploying to a separate public repository.

Let's check the best practices for this private-to-public deployment setup!

Practice Background

Let's take my old mkdown blog repo ytianle.github.io as an example, which was public and contained both the MkDocs source files and the generated static site. This meant that anyone could view the Markdown sources, commit history, and author information directly on GitHub.

  • Public repo (old): ytianle.github.io (public, contains both source and generated files)

Migration Target

  • Private repo (old): ytianle.github.ioytianle.github.io_private (MkDocs source, scripts, images, raw notes, build tooling)
  • Public repo (new): ytianle.github.io (public, contains generated static files only)

VS Code Extension Bisect

A powerful tool to identify which extension is causing issues in your VS Code setup.

Found an interesting VS Code feature: Extension Bisect. It helps you find out which extension is causing problems in your VS Code environment using binary search. This is especially useful when you have many extensions installed and are experiencing performance issues, crashes, or other unexpected behavior.

Extension Bisect Figure: VS Code's Extension Bisect disables half of the installed extensions at a time to narrow down which one is causing the issue.

Desktop App Arch: FastAPI + Web + pywebview

A creative architecture for building desktop applications with shorter delivery time for a certain class of desktop tools.

Recently got a new way to build desktop applications. This is not a typical Qt desktop application. The core idea is:

  • BE: local FastAPI backend service
  • FE: Web pages with HTML, CSS, and JavaScript
  • Shell: open it inside pywebview to make it a desktop app.

The interesting part is that this is still a real installable desktop application, not “just a website in a browser”. In practice, the release pipeline can use:

  • GitHub Actions builds the app.
  • PyInstaller produces the executable.
  • Inno Setup creates the corresponding installer.

Goal of using Try-catch

"Try-catch should never replace proper control flow. Don’t use it to handle null references or check for empty lists. It’s not meant for regular logic — it’s meant for unpredictable failures like file I/O, networking, reflection, or untrusted input."