文章

顯示從 11月, 2025 起發佈的文章

中文字加拼音

用字型的解法: https://toneoz.com/blog/download-pinyin/ 多款字型內帶拼音, 換字體即有拼音在上方, 適用任何系統/軟件. 更有 web app 智能處理多音字情況, 適用任何系統. (目前發現 "校" jiao4 音空缺不知何故) 粵拼字體: https://canto.hk/

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: 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. At Github, create a new branch: dev . 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 Actio...

8 Char Indentation

Linux 內核代碼風格: 制表符是 8 個字符,所以縮進也是 8 個字符。有些異端運動試圖將縮進變爲 4 (甚至 2!) 字符深,這幾乎相當於嘗試將圓周率的值定義爲 3。 理由:縮進的全部意義就在於清楚的定義一個控制塊起止於何處。尤其是當你盯著你的屏幕連續看了 20 小時之後,你將會發現大一點的縮進會使你更容易分辨縮進。 現在,有些人會抱怨 8 個字符的縮進會使代碼向右邊移動的太遠,在 80 個字符的終端屏幕上就很難讀這樣的代碼。這個問題的答案是,如果你需要 3 級以上的縮進,不管用何種方式你的代碼已經有問題了,應該修正你的程序。 簡而言之,8 個字符的縮進可以讓代碼更容易閱讀,還有一個好處是當你的函數嵌套太深的時候可以給你警告。留心這個警告。