<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kevingt on Medium]]></title>
        <description><![CDATA[Stories by Kevingt on Medium]]></description>
        <link>https://medium.com/@kevingtsteven?source=rss-f703ad62f096------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RJLhvqcbPar6d-fTFNIANw.jpeg</url>
            <title>Stories by Kevingt on Medium</title>
            <link>https://medium.com/@kevingtsteven?source=rss-f703ad62f096------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 01:52:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kevingtsteven/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[在Mac上把文字輸出語音: (by KOKORO AI model)]]></title>
            <link>https://medium.com/@kevingtsteven/%E5%9C%A8mac%E4%B8%8A%E6%8A%8A%E6%96%87%E5%AD%97%E8%BC%B8%E5%87%BA%E8%AA%9E%E9%9F%B3-by-kokoro-ai-model-613cc3f42544?source=rss-f703ad62f096------2</link>
            <guid isPermaLink="false">https://medium.com/p/613cc3f42544</guid>
            <category><![CDATA[kokorottsmodel]]></category>
            <dc:creator><![CDATA[Kevingt]]></dc:creator>
            <pubDate>Fri, 28 Nov 2025 08:57:30 GMT</pubDate>
            <atom:updated>2025-11-28T09:01:35.033Z</atom:updated>
            <content:encoded><![CDATA[<h3>在Mac上把文字輸出語音: (by KOKORO AI model)</h3><p># Ref: <a href="https://huggingface.co/hexgrad/Kokoro-82M#usagefugashi">https://huggingface.co/hexgrad/Kokoro-82M#usagefugashi</a></p><p><strong>啟動python env(p.s. 需指定python3.10)<br></strong># Launch python env<br>python3.10 -m venv kokoro-env<br>source kokoro-env/bin/activate</p><p><strong>安裝library<br></strong>#日文語音<br>pip install -q kokoro<br>pip install soundfile<br>pip install IPython<br>pip install pyopenjtalk<br>pip install “fugashi==1.3.0” “unidic-lite==1.0.8” — force-reinstall<br>pip install jaconv<br>pip install mojimoji</p><p>#中文語音<br>pip install ordered_set<br>pip install pypinyin<br>pip install cn2an<br>pip install jieba</p><p><strong>執行產生語音的python file</strong>(記得修改想產生的語言和文字):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7421b5885281b08556f5c5592962f59c/href">https://medium.com/media/7421b5885281b08556f5c5592962f59c/href</a></iframe><p>Ref:</p><p>線上測試Kokoro TTS Model: <a href="https://kokorotts.net/models/Kokoro/Kokoro-ai">https://kokorotts.net/models/Kokoro/Kokoro-ai</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=613cc3f42544" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cocoapods issue: build code error when migrates an iOS project from Intel CPU mac to M1 mac]]></title>
            <link>https://medium.com/@kevingtsteven/cocoapods-issue-build-code-error-when-migrates-an-ios-project-from-intel-cpu-mac-to-m1-mac-91a337f3dde1?source=rss-f703ad62f096------2</link>
            <guid isPermaLink="false">https://medium.com/p/91a337f3dde1</guid>
            <dc:creator><![CDATA[Kevingt]]></dc:creator>
            <pubDate>Mon, 06 Jun 2022 14:40:21 GMT</pubDate>
            <atom:updated>2022-06-06T14:40:21.734Z</atom:updated>
            <content:encoded><![CDATA[<p>今天在M1的mac上編譯原本在Intel mac上能正常編譯的iOS project時，發現以下錯誤訊息:</p><pre>LoadError — dlopen(/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle — /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.0/lib/ffi_c.bundle</pre><p>Google搜尋之後，發現也有人遇到一樣的問題(<a href="https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1?fbclid=IwAR2ornA22ONHXvYwO6mZl99btu1euWdhK6iTi3Nn3J0--oRIuOmU-EbQ2fk">Ref 1</a>)。看完底下的回覆後，發現是因為M1 mac上的Ruby的設定檔案(<strong>rbconfig.rb</strong>)內的設定有問題，導致使用pod install後，在build code時發生錯誤。下面是<strong>rbconfig.rb</strong>檔案部分內容:</p><pre>......<br>CONFIG[&quot;target_os&quot;] = &quot;darwin21&quot;</pre><pre>CONFIG[&quot;target_vendor&quot;] = &quot;apple&quot;</pre><pre>CONFIG[&quot;target_cpu&quot;] = &quot;universal&quot;</pre><pre>CONFIG[&quot;target&quot;] = &quot;universal-apple-darwin21&quot;</pre><pre>CONFIG[&quot;host_os&quot;] = &quot;darwin21&quot;</pre><pre>CONFIG[&quot;host_vendor&quot;] = &quot;apple&quot;</pre><pre>CONFIG[&quot;host_cpu&quot;] = &quot;x86_64&quot;</pre><pre>CONFIG[&quot;host&quot;] = &quot;x86_64-apple-darwin21&quot;</pre><pre>......</pre><pre>CONFIG[&quot;build_os&quot;] = &quot;darwin21&quot;</pre><pre>CONFIG[&quot;build_vendor&quot;] = &quot;apple&quot;</pre><pre>CONFIG[&quot;build_cpu&quot;] = &quot;x86_64&quot;</pre><pre>CONFIG[&quot;build&quot;] = &quot;x86_64-apple-darwin21&quot;<br>......</pre><p>從上面內容我們可以知道，用RbConfig 來編譯程式的target CPU是「universal」 ，但它自己本身卻是用「x86 CPU」來編譯的。所以會產生上面的錯誤訊息。(p.s. 更詳細的說明請參考<a href="https://www.linkedin.com/pulse/surprise-when-moving-mac-m1-khang-vu-tien/?trk=pulse-article_more-articles_related-content-card">Ref 2</a>)</p><p>參考<a href="https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1?fbclid=IwAR2ornA22ONHXvYwO6mZl99btu1euWdhK6iTi3Nn3J0--oRIuOmU-EbQ2fk">Ref 1</a>中底下人提出的解法，輸入以下指令來解決這個問題:</p><pre># Uninstall the local cocoapods gem<br>sudo gem uninstall cocoapods<br><br># Reinstall cocoapods via Homebrew<br>brew install cocoapods</pre><p><strong>Ref:</strong></p><p>(1)<a href="https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1?fbclid=IwAR2ornA22ONHXvYwO6mZl99btu1euWdhK6iTi3Nn3J0--oRIuOmU-EbQ2fk">https://stackoverflow.com/questions/64901180/how-to-run-cocoapods-on-apple-silicon-m1?fbclid=IwAR2ornA22ONHXvYwO6mZl99btu1euWdhK6iTi3Nn3J0--oRIuOmU-EbQ2fk</a></p><p>(2)<a href="https://www.linkedin.com/pulse/surprise-when-moving-mac-m1-khang-vu-tien/?trk=pulse-article_more-articles_related-content-card">https://www.linkedin.com/pulse/surprise-when-moving-mac-m1-khang-vu-tien/?trk=pulse-article_more-articles_related-content-card</a></p><p>(3)<a href="https://dev.to/staceypyee/installing-cocoapods-on-m1-macbook-air-big-sur-h0l">https://dev.to/staceypyee/installing-cocoapods-on-m1-macbook-air-big-sur-h0l</a></p><p>(4)<a href="https://formulae.brew.sh/formula/cocoapods">https://formulae.brew.sh/formula/cocoapods</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91a337f3dde1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Swift之讓人搞不懂的closure]]></title>
            <link>https://medium.com/@kevingtsteven/swift%E4%B9%8B%E8%AE%93%E4%BA%BA%E6%90%9E%E4%B8%8D%E6%87%82%E7%9A%84closure-a0c633d33c72?source=rss-f703ad62f096------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0c633d33c72</guid>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Kevingt]]></dc:creator>
            <pubDate>Wed, 22 Aug 2018 13:23:15 GMT</pubDate>
            <atom:updated>2018-08-22T13:35:35.581Z</atom:updated>
            <content:encoded><![CDATA[<h4>官方文件說明:<br><a href="https://docs.swift.org/swift-book/LanguageGuide/Closures.html">https://docs.swift.org/swift-book/LanguageGuide/Closures.html</a></h4><h3><strong>Closures是function的一種,他有三種型式:<br>1. Global functions<br>2. Nested functions<br>3. Closure</strong></h3><h3><strong>closure跟平常用的function不一樣的地方:</strong></h3><p>1. closure如果用@escaping的話,讓我們可以在function return回去的地方,去做我們希望做的事,通常用在不知道什麼時候執行結束的時候,例如long time task,等待server response……等</p><p>2.簡化function語法,省去function名稱,或更多</p><p>3. 用來定義常用的行為,而不是每次都要用for or while等語言提供的基本語法去撰寫,<br> 也就是讓常用的行為變成像是語言提供的語法,達成讓程式碼更簡潔更容易重複使用</p><h3>Case說明:</h3><h3><strong>Case 1: Long time task</strong></h3><p>ref: <a href="https://medium.com/@kumarpramod017/what-do-mean-escaping-and-nonescaping-closures-in-swift-d404d721f39d">https://medium.com/@kumarpramod017/what-do-mean-escaping-and-nonescaping-closures-in-swift-d404d721f39d</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86e86a00b94ea3152466b8849923b853/href">https://medium.com/media/86e86a00b94ea3152466b8849923b853/href</a></iframe><h3><strong>Case 2: 比較 a,b大小來當作assert的條件</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1009086ceced4ef3a7898255dcac9d37/href">https://medium.com/media/1009086ceced4ef3a7898255dcac9d37/href</a></iframe><h3><strong>3. 找出陣列中的奇數和偶數</strong></h3><p>ref: <a href="https://airspeedvelocity.net/2014/06/28/extending-the-swift-language-is-cool-but-be-careful/">https://airspeedvelocity.net/2014/06/28/extending-the-swift-language-is-cool-but-be-careful/</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0bd631294754806137c2c717eef6127/href">https://medium.com/media/b0bd631294754806137c2c717eef6127/href</a></iframe><h4><strong>說明:</strong></h4><p>用語言基本語法的方式,須針對每個case(奇數和偶數),都需要去撰寫一個function,<br>但是用closure,只要傳入的參數和回傳值是相同型態,則只需定義要做的”行為”(在這裡是判斷數字是奇數或是偶數),並把行為傳入實際執行的function即可</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0c633d33c72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>