2025-11-24

中文字加拼音

用字型的解法:

https://toneoz.com/blog/download-pinyin/

  • 多款字型內帶拼音, 換字體即有拼音在上方, 適用任何系統/軟件.
  • 更有 web app 智能處理多音字情況, 適用任何系統. (目前發現 "校" jiao4 音空缺不知何故)

粵拼字體:

https://canto.hk/

2025-11-22

Xcode Cloud and Github

I practiced this and I could easily release builds to TestFilght for internal testing, and few clicks on Github to have new build for App Store submission.

Preparation:

  1. Once created new project in Xcode, immediately push it to Github to create a new repository as origin. Here we can use the default main branch.
  2. At Github, create a new branch: dev.
  3. At Xcode, switch to dev, and we will always push changes to dev.

At Xcloud Cloud, we will define two workflows. We will trigger them with different conditions for different purposes.

Workflow 1: For track dev branch change, and for TestFlight

  • Trigger: any file change at dev branch.
  • Action is to build, and distribute for TestFlight (internal test)
  • Post action is TestFlight internal test, choose the tester group (define separately)

So, whenever you push to dev branch, will have a new build delivered to TestFlight for your internal testing. Very convenient.

Workflow 2 - For app store distribution

  • Trigger: any file change at main branch
  • Action is build: app store connect.
  • No post action

Usually you don't trigger this. If you want to release it to App Store after some nice build, you:

  1. At Github, create a Pull Request to merge dev into main.
  2. When reply, use Merge.

When dev branch is merged into main, it will trigger Workflow 2. Result is that a new build is created for app store.

You go to App Store Connect page, at release page, pick up this build and assign it to release. 

Happy coding!



2025-11-04

8 Char Indentation

Linux 內核代碼風格:

制表符是 8 個字符,所以縮進也是 8 個字符。有些異端運動試圖將縮進變爲 4 (甚至 2!) 字符深,這幾乎相當於嘗試將圓周率的值定義爲 3。

理由:縮進的全部意義就在於清楚的定義一個控制塊起止於何處。尤其是當你盯著你的屏幕連續看了 20 小時之後,你將會發現大一點的縮進會使你更容易分辨縮進。

現在,有些人會抱怨 8 個字符的縮進會使代碼向右邊移動的太遠,在 80 個字符的終端屏幕上就很難讀這樣的代碼。這個問題的答案是,如果你需要 3 級以上的縮進,不管用何種方式你的代碼已經有問題了,應該修正你的程序。

簡而言之,8 個字符的縮進可以讓代碼更容易閱讀,還有一個好處是當你的函數嵌套太深的時候可以給你警告。留心這個警告。