前提 大家應該都跟我一樣,經常使用 ChatGPT 來協助一些 coding 上的問題。尤其是對於 Regular Expression 的問題。最近在處理上發現,需要透過「正向表列」,而非跟他講哪些不可以的方向比較容易成功。也應該說, Regular Expression 本來就要透過正向表來才對。 原本: // AddLineBreaksAroundURLs takes a string as input, finds URLs, // and inserts a newline character before and after each URL. // It returns the modified string. func AddLineBreaksAroundURLs(input string) string { re := regexp.MustCompile(`(https?:\/\/[^\s\p{Han}]+)`) return re.ReplaceAllString(input, "\n$1\n") } 發現無法處理: https://voyager.minedojo.org/。 當我發現我一直跟 ChatGPT 講要排除 ` https://voyager.minedojo.org/。` 這個案例的時候,往往會一直卡住無法向前。 但是寫多個測試案例倒是真的蠻好的。 Unit Testing code func TestAddLineBreaksAroundURLs(t *testing.T) { tests := []struct { input string expected string }{ { input: "Check out this website https://example.com and this one http://another-example.com", expected: "Check out this website \nhttps://example.com\n and this one \nhttp://another-example.com\n", }, { input: "Here is an URL with dot at the end https://voyager.minedojo.org/。", expected: "Here is an URL with dot at the end \nhttps://voyager.minedojo.org/\n。", }, { input: "This is another test 可在https://voyager.minedojo.org/上訪問。", expected: "This is another test 可在\nhttps://voyager.minedojo.org/\n上訪問。", }, // Add more test cases here as needed } for _, tt := range...
我如何看待 WWDC23 ?
身為技術研討會主辦人,我看的是:
整體錄影方式與收音技巧
每一個講者的職稱(可以看出內部分工與架構)
平台想要規劃出的生態圈
職稱相關
應該跟許多公司一樣:
Engineering Progam Manager - 技術專案經理
Engineering Manage - 技術開發的經理
職稱其實也代表部門的多寡,對外部而言很嶄新的 visionOS 部門卻有那麼多清楚分工,而且能演講的人還蠻多的。不愧是 Apple 。
硬體相關
New Mac Studio 可以有六顆螢幕(原來之前的不行啊?!)
iOS 17 帶來軟體開發新變化
Name Drop 近場溝通新應用
取代掉所有名片應用 (LINE OA 其實有類似做法)
不知道會用到哪個 SDK ,應該會開放給其他 App 使用。
更智能的鍵盤輸入
可能是使用 local 「In-line predictive text API」
TV OS 相關變革
透過 iPhone 直接在 Apple TV 開會
走 Continuity Camera API
Vision Pro 帶來的軟體開發變化
(要接線~~~~~ Orz)
果然要另外接電池
Apple Vision Pro 帶來新的生物識別系統「Optic ID」
可能帶來影響:
虹膜辨識會變成是基本 OAuth 的認證設備(搭配 Passkey (a.k.a. FiDO2)
比起 WorldCoin 可能因為 AirDrop 產生盜用 ,但是 Vision Pro 更可以取得更多人的虹膜資訊。
雖然依照 Apple 的個性,不可能有任何取得方式。但是代表 Optic ID 可以更加的準確, Passkey 的未來更令人期待。
iOS SDK
Accessibility SDK
Privacy API