<?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 Brad Chou on Medium]]></title>
        <description><![CDATA[Stories by Brad Chou on Medium]]></description>
        <link>https://medium.com/@bradchou?source=rss-ad67c0127be7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2pvO_vqS4vvPlJGG.jpg</url>
            <title>Stories by Brad Chou on Medium</title>
            <link>https://medium.com/@bradchou?source=rss-ad67c0127be7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 23:36:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bradchou/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[[投資] 定期定額過程中改變投資標的]]></title>
            <link>https://bradchou.medium.com/%E6%8A%95%E8%B3%87-%E5%AE%9A%E6%9C%9F%E5%AE%9A%E9%A1%8D%E9%81%8E%E7%A8%8B%E4%B8%AD%E6%94%B9%E8%AE%8A%E6%8A%95%E8%B3%87%E6%A8%99%E7%9A%84-3cb6d0d1fe1d?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cb6d0d1fe1d</guid>
            <category><![CDATA[定期定額]]></category>
            <category><![CDATA[salt]]></category>
            <category><![CDATA[投資]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[arkw]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 15 Jun 2024 02:48:46 GMT</pubDate>
            <atom:updated>2024-06-15T02:48:46.873Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KqHbeJnla3iQOztL.jpg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/cheerful-couple-with-laptop-and-carton-box-4245924/">Ketut Subiyanto</a></figcaption></figure><p>投資標的裡有包含一些高風險的像是 TSLA &amp; ARKW，在心裡想了一套適合自己的做法，想要在未來慢慢的減少佔比，做到持續不影響心情和不增加研究投資時間</p><p><strong>賠錢時繼續定期定額</strong></p><p>未來會如何真的不確定，能確定的只有我不想賠錢 😂，既然已經定期定額一段時間了，就繼續在賠錢時投入，讓虧損平滑一些，也能持續參與</p><p><strong>賺錢時把部份賣出換成其他標的</strong></p><p>有賺錢的時候，把定期定額的金額從這些標的裡賣出，直接轉換成其他標的，以我為例，就是轉到 QQQ</p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2024/06/blog-post.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cb6d0d1fe1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[scrapy] 實戰記錄 — 台北 101 網站]]></title>
            <link>https://bradchou.medium.com/scrapy-%E5%AF%A6%E6%88%B0%E8%A8%98%E9%8C%84-%E5%8F%B0%E5%8C%97-101-%E7%B6%B2%E7%AB%99-aef9b8fe76c2?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/aef9b8fe76c2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[爬蟲]]></category>
            <category><![CDATA[百貨公司]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[中文]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 09:12:55 GMT</pubDate>
            <atom:updated>2024-02-25T09:12:55.858Z</atom:updated>
            <content:encoded><![CDATA[<h3>[scrapy] 實戰記錄 — 台北 101 網站</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSESCUufro-w06O6CXg9NA.jpeg" /><figcaption>攝影師：<a href="https://www.pexels.com/zh-tw/photo/260566/">Pixabay</a></figcaption></figure><p>為了增加 <a href="https://github.com/bradchow/department_store_brands">百貨公司品牌爬蟲</a>的內容， 近期開始研究台北 101 網站，找到 <a href="https://www.taipei-101.com.tw/tw/shopping/brandsearch">這裡</a> 可以看到全部的品牌，把這些都爬出來就行了</p><h4>先找出正確的 element</h4><p>從下圖可看出，這些品牌存在於 “listarea logo” class 下面的 “cardobj lazyload show” class 中</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*yAYBE57MAN1Vr8hs.png" /></figure><p>準備好 request <a href="https://www.taipei-101.com.tw/tw/shopping/brandsearch">https://www.taipei-101.com.tw/tw/shopping/brandsearch</a> 然後去拿 “cardobj lazyload show” class 裡的資料，但會發現抓不到資料，將 response.text 印出來後存成檔案才發現，”listarea logo” class 裡是沒有內容的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*gG4n8hO8n5Dhxv3z.png" /></figure><p>發現這些品牌資訊是另外 request 去拿到 json 檔案回來 parse 而成</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*bga2uNrrosd7V6yl.png" /></figure><p>這邊直接找出此 request，直接用 python 去抓回來 parse 完成</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/0*eugsoWx7kNQzVtID.png" /></figure><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2024/02/scrapy-101.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aef9b8fe76c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[投資] 2023 年投資回顧與未來展望]]></title>
            <link>https://bradchou.medium.com/%E6%8A%95%E8%B3%87-2023-%E5%B9%B4%E6%8A%95%E8%B3%87%E5%9B%9E%E9%A1%A7%E8%88%87%E6%9C%AA%E4%BE%86%E5%B1%95%E6%9C%9B-199f7cdd4882?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/199f7cdd4882</guid>
            <category><![CDATA[投資回顧]]></category>
            <category><![CDATA[投資]]></category>
            <category><![CDATA[中文]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 08:42:13 GMT</pubDate>
            <atom:updated>2023-12-30T08:42:13.447Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twaoPHuG9DYrUZHFkJvn4A.jpeg" /><figcaption>攝影師：<a href="https://www.pexels.com/zh-tw/photo/19399437/">Walls.io</a></figcaption></figure><p>2023 年使用了 <a href="https://bradnopitt.blogspot.com/2022/01/2021.html">定期定額+再平衡</a>的操作，今年用市值來看績效比較單純，市值增加 62.5%，若不計算入金也就是純投資的部份，市值增加 51%，表現超越台美股大盤（台股大盤 24%、NASDAQ 43%），記得 <a href="https://bradnopitt.blogspot.com/2022/12/2022.html">去年投資回顧</a> 有提到，大盤投報好的時候，我的投報可能會落後，看來打破了這個預期；既然時間用的少，大盤好與壞時的績效都還可以接受，那就繼續這麼做下去吧。</p><p><strong>重點數字</strong></p><p>市值增加：62.5%<br>市值（不含入金）增加：51%<br>平均現金水位：11.7%<br>台股大盤投報：24%<br>NASDAQ 投報：43%</p><h4>2024 年的策略：定期定額 + 再平衡</h4><p>定期定額：每個月操作一次，輪流投入每個標的，當標的歷史價格低於十年前太多時，當次投入兩倍</p><p>再平衡：每半年將投報超過 20% 或平均的標的，賣出賺錢的部份</p><p><strong>2024 年標的</strong></p><p>006208、00878、5880 合庫金、2412 中華電、QQQ、ARKW、AAPL、TSLA</p><p><strong>2023 年市值變化圖</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*0GRLbhxID3lTCGrZ.png" /></figure><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2023/12/2023.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=199f7cdd4882" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[iOS][Swift][App] 整合 Google AdMob 到 iOS App]]></title>
            <link>https://bradchou.medium.com/ios-swift-app-%E6%95%B4%E5%90%88-google-admob-%E5%88%B0-ios-app-de5d725294d7?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/de5d725294d7</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[admob]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 26 Aug 2023 07:15:43 GMT</pubDate>
            <atom:updated>2023-08-26T07:15:43.165Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mV3AFDEukP4hWmJtS_wseg.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/young-women-working-on-laptops-in-creative-workspace-4126705/">Ketut Subiyanto</a></figcaption></figure><p>我在整合 Google AdMob 時卡了超久，Google 了也沒找到很直接能解決的方法，想說在此做個記錄，讓以後的我能照著做，也讓遇到類似問題的人能夠有個解法，以下是參考 <a href="https://developers.google.com/admob/ios/quick-start">官方說明</a> 做的</p><h3><strong>第一動，Import the Mobile Ads SDK</strong></h3><p>先在 xocde project 的根目錄下（.xcodeproj 檔案的路徑）執行 pod init，這樣就能產生一個 Podfile 檔案，若沒安裝 cocopods 可以 follow <a href="https://guides.cocoapods.org/using/getting-started">這裡</a> 安裝，然後再按照 <a href="https://developers.google.com/admob/ios/quick-start#cocoapods">這裡</a> 的做法，加</p><p>pod ‘Google-Mobile-Ads-SDK’</p><p>在 Podfile 檔案，然後執行下面，記得此時要將 xcode 關閉</p><p>[!] Unable to determine the platform for the `your project name` target.</p><p>解決方法是將 Podfile 檔案裡的第二行 uncomment 就可以了，完成後如下</p><h3><strong>第二動，Update your Info.plist</strong></h3><p>遇到的第一個問題是，我找不到 Info.plist 檔案</p><p>參考 <a href="https://sarunw.com/posts/where-is-info-plist/">這邊</a> ，原來 info.plist 變成了 project 設定裡的 tab</p><p>然後將 GADApplicationIdentifier (1個) 和 SKAdNetworkItems (49個) 輸入（如下圖紅框）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*PCXy_PhSS22qQsKq.png" /></figure><h3><strong>第三動，建立 banner structure 來呼叫顯示廣告</strong></h3><pre>import GoogleMobileAds<br><br>struct BannerVC: UIViewControllerRepresentable {<br>    var bannerID: String<br>    var width: CGFloat<br><br>    func makeUIViewController(context: Context) -&gt; UIViewController {<br>        let view = GADBannerView(adSize: GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width))<br><br>        let viewController = UIViewController()<br>        view.adUnitID = bannerID<br>        <br>        view.rootViewController = viewController<br>        viewController.view.addSubview(view)<br><br>#if false<br>        /* Simulator */<br>        let request = GADRequest()<br>        let extras = GADExtras()<br>        extras.additionalParameters = [&quot;suppress_test_label&quot;: &quot;1&quot;]<br>        request.register(extras)<br>        view.load(request)<br>#else<br>        /* Real device */<br>        view.load(GADRequest())<br>#endif<br>        <br>        return viewController<br>    }<br><br>    func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}<br>}<br><br>struct Banner: View {<br>    var bannerID: String<br>    var width: CGFloat<br><br>    var size: CGSize {<br>        return GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(width).size<br>    }<br><br>    var body: some View {<br>        BannerVC(bannerID: bannerID, width: width)<br>            .frame(width: size.width, height: size.height)<br>    }<br>}<br><br>struct ContentView: View {<br>    var body: some View {<br>        VStack {<br>            Image(systemName: &quot;globe&quot;)<br>                .imageScale(.large)<br>                .foregroundColor(.accentColor)<br>            Text(&quot;Hello, world!&quot;)<br>        }<br>        .padding()<br>        Banner(bannerID: &quot;ca-app-pub-3940256099942544/2934735716&quot;, width: UIScreen.main.bounds.width)<br>    }<br>}</pre><p>實作方式如上，這邊用的 bannerID 是測試使用的，請參考 <a href="https://developers.google.com/admob/ios/test-ads#demo_ad_units">這邊</a> ，順利的話就可以看到下面的畫面</p><p>Simulator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/0*-DkRQSP3aK_GEmBT.png" /></figure><p>若不想在 Simulator 上看到 “Test mode” 的字樣，將上面程式的 /* Simulator */ 上的 if false 改成 if true，就可將之移除如下圖，這功能在你上架 app 提供截圖時會用到</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/184/0*9e0oQMqIxP2m67x2.png" /></figure><p>若是跑在實機上的話，上述的程式記得改成 if false，會看到如下畫面</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/0*D1sM2s3KNc1PtckZ.png" /></figure><h3><strong>Note</strong></h3><p>若想 build 在 Mac 上會遇到 <em>No such module ‘GoogleMobileAds’</em> 的 error，這個問題我也想知道解答，歡迎提供給我，謝謝</p><h3><strong>環境</strong></h3><ul><li>Mac Mini M1</li><li>Xcode Version 14.3 (14E222b)</li><li>iPhone 12 Pro Max (16.6)</li></ul><h3><strong>Reference</strong></h3><ul><li>COCOAPODS getting-start (<a href="https://guides.cocoapods.org/using/getting-started">link</a>)</li><li>Mobile Ads SDK (iOS) Get Started (<a href="https://developers.google.com/admob/ios/quick-start">link</a>)</li></ul><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2023/08/iosswiftapp-google-admob-ios-app.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de5d725294d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[scrapy] 使用 scrapy 爬不到資料]]></title>
            <link>https://bradchou.medium.com/scrapy-%E4%BD%BF%E7%94%A8-scrapy-%E7%88%AC%E4%B8%8D%E5%88%B0%E8%B3%87%E6%96%99-516413755cd7?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/516413755cd7</guid>
            <category><![CDATA[scrapy]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[爬蟲]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 03 Jun 2023 09:03:00 GMT</pubDate>
            <atom:updated>2023-06-03T09:03:00.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*904Fxn2XJtBrit17viAjAg.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/woman-coding-on-computer-3861958/">ThisIsEngineering</a></figcaption></figure><p>記錄一下使用 scrapy 遇到的一些問題</p><p><strong>問題：<br></strong>用 browser 打開這個<a href="https://info.sogo.com.tw/tp1/floors/B2">網頁</a>明明就能看到畫面，但使用下面方法後<br><em>scrapy shell https://info.sogo.com.tw/tp1/floors/B2 <br>view(response)</em><br>卻只能看到下面錯誤</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*0TgmbaF-rdGhOTiu.png" /></figure><p>後來發現，這是因為少設定了 USER_AGENT 的關係，user agent 通常是用來識別 request 這方的軟體、os、device 等資訊，有些 server 會檢查這個 http header 資訊，若沒有的話，就不會回傳正確 response</p><p><strong>處理方式： </strong><br>在 settings.py 裡找到 USER_AGENT 設定，將一個正確的 user agent 填入即可，這邊我是參考 chrome 的 user agent 填入（如下）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEVSjwopFPdNJ09LiNddFA.png" /></figure><p><strong>問題：<br></strong><a href="https://info.sogo.com.tw/tp1/floors/B2">網頁</a> 能打開後，卻找不到品牌列表，用 browser 打開往下 scroll 後，會看到如下的畫面，品牌列表的部份看起來是被放在這樣的結構裡<br><em>&lt;div class=”tab-content”&gt;<br>…<br>&lt;a href=”xxxx” class=”brandBox”&gt;…&lt;/a&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*aKZQEqs5NUcoklVe.png" /></figure><p>但是使用<br><em>scrapy shell https://info.sogo.com.tw/tp1/floors/B2 <br>view(response)<br></em>卻只能看到 &lt;div class=”tab-content”&gt; 裡沒有 brandBox 的資料</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*OmQZ9TPin2iHSc0M.png" /></figure><p><strong>分析： <br></strong>用 chrome 的 inspect 可以找到品牌列表是用這個 request 來的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eW4AivxKC9j2Pjw077b5hQ.png" /></figure><p>而這個 request 是由 jquery-3.2.0.min.js 裡呼叫的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*30KNCduT2bwSugpI6CGa_w.png" /></figure><p>由此就能確定，找不到品牌列表是因為他是 javascript 的 request 而來的，scrapy 預設是爬靜態網頁，所以我邊需要針對這個 javascript 的 request 多做處理才行</p><p>這邊分享兩個 debug 技巧，<br>1. 在 spider 程式內呼叫 scrapy shell 的功能，在 def parse() 裡寫到下面即可<br><em>from scrapy.shell import inspect_response<br>inspect_response(response, self)<br></em>2. 在 spider 程式內印出 response 網頁資料，做法如下<br><em>def write_to_file(self, words):<br>with open(“logging.log”, “a”) as f:<br>f.write(words)</em></p><p><em>def parse():<br>self.write_to_file(“response text: %s” % response.text)<br>inspect_response(response, self)</em></p><p><strong>處理方式：<br></strong>使用 selenium 幫忙處理 javascript 的 request，照下面方法將 selenium 安裝且設定好，使用 selenium 的 function 做同一個 url 的 request，response 的資料裡就有品牌列表了</p><p><strong>安裝 selenium<br></strong><em>pip install scrapy-selenium</em></p><p><strong>安裝 chrome driver<br></strong>到<a href="https://chromedriver.chromium.org/downloads">這裡</a>下載跟自己使用的 chrome driver 相近的版本</p><p><strong>在 settings.py 裡做好設定<br></strong>總共四個設定，SELENIUM_DRIVER_EXECUTABLE_PATH 就是填上面下載的 chrome driver 檔案的路徑</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*XDQK1VHtJg2_ePdF.png" /></figure><p><strong>在 spider 中使用</strong><br>這邊不使用原本的 start_urls，而是使用如下的做法<br><em>from scrapy_selenium import SeleniumRequest<br>def start_request(self):<br> target_url = “xxx”<br> yield SeleniumRequest(url=target_url, callback=self.parse)</em></p><p>原本使用下面兩行去看有多少品牌是 0，設定成功之後，就可以看到 60<br><em>brands_num = len(response.xpath(‘//a[</em><a href="http://twitter.com/class"><em>@class</em></a><em>=”brandBox”]’))<br>print(“brands_num: “ + (str)(brands_num))</em></p><p><strong>Reference</strong><br><a href="https://blog.csdn.net/mouday/article/details/81159416">Python爬虫：scrapy框架请求参数meta、headers、cookies一探究竟<br></a><a href="https://scrapeops.io/python-scrapy-playbook/scrapy-selenium/">Scrapy Selenium Guide: Integrating Selenium Into Your Scrapy Spiders</a></p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2023/06/scrapy-scrapy.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=516413755cd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Web] 開源傳說小工具網頁版]]></title>
            <link>https://bradchou.medium.com/web-%E9%96%8B%E6%BA%90%E5%82%B3%E8%AA%AA%E5%B0%8F%E5%B7%A5%E5%85%B7%E7%B6%B2%E9%A0%81%E7%89%88-bf733b37f853?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf733b37f853</guid>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[開源]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[傳說小工具]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sun, 26 Feb 2023 04:46:35 GMT</pubDate>
            <atom:updated>2023-02-26T04:46:35.766Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gVpg4VTDoTOTYPxy.jpg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/yellow-and-teal-open-neon-signage-109998/">Ben Taylor</a></figcaption></figure><p>在 <a href="https://bradnopitt.blogspot.com/2023/01/app-ios.html">[App] iOS 傳說小工具誕生以及網頁版結束維護</a> 有提到，網頁版傳說小工具會想 open source，好讓有興趣的人可以繼續維護，現在完成開源了。</p><p>開源傳說對決網頁版<br><a href="https://github.com/bradchow/toolsofrov_web">https://github.com/bradchow/toolsofrov_web</a></p><p>開源的程式碼原本是在 Heroku 上運作在 php 後台的，所以只要有 php 環境，放上這些檔案就可以直接使用，我只有把下面程式拿掉，然後加上一些 readme.md 和 LICENSE.md</p><p>1. Firebase<br>2. Google Analytics<br>3. Google Adsense</p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2023/02/web.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf733b37f853" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[App] iOS 傳說小工具誕生以及網頁版結束維護]]></title>
            <link>https://bradchou.medium.com/app-ios-%E5%82%B3%E8%AA%AA%E5%B0%8F%E5%B7%A5%E5%85%B7%E8%AA%95%E7%94%9F%E4%BB%A5%E5%8F%8A%E7%B6%B2%E9%A0%81%E7%89%88%E7%B5%90%E6%9D%9F%E7%B6%AD%E8%AD%B7-112901c46faa?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/112901c46faa</guid>
            <category><![CDATA[傳說小工具]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[heroku]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 07:14:19 GMT</pubDate>
            <atom:updated>2023-01-20T07:14:19.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_MWKjoF8zY_8S4H-.jpg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/blue-and-white-logo-guessing-game-5444435/">Brett Jordan</a></figcaption></figure><p>網頁版傳說小工具使用的主機 <a href="https://www.heroku.com/">Heroku</a>，已經 <a href="https://blog.heroku.com/next-chapter">停止免費提供網頁服務</a> 了，傳說小工具一直以來的變現能力都不好，所以也不打算花錢買 Heroku 的服務，雖然網頁版傳說小工具就這樣畫上句點，但未來有打算將他 open source，讓有興趣的人可以繼續維護。</p><p>網頁版從 2017 年開始服務，當時還提到若要開發 iOS 版必定要 <a href="https://bradnopitt.blogspot.com/2017/04/web.html">花上很長一段時間</a>，我一直沒有忘記這件事，工作緣故讓我必須多接觸 iOS 相關環境，這也正是我著手進行 iOS 版的契機，雖然變現能力不好，Apple Developer 的 保護費費用也相當高（ <strong>每年 100 美金</strong> ），但在 Android Play Store 後台看到還是有不少人在使用，決定還是要完成這件事，2017 年推出了 Android 版，在經過了 5 年多之後，iOS 版傳說小工具終於上架了，同樣的，第一版功能還蠻陽春，讓我們慢慢改進</p><p>傳說小工具 App Store 連結<br><a href="https://apps.apple.com/app/id1664793884">https://apps.apple.com/app/id1664793884</a></p><p>傳說小工具粉絲專頁<br><a href="https://www.facebook.com/toolsofrov/">https://www.facebook.com/toolsofrov/</a></p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2023/01/app-ios.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112901c46faa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[投資] 2022 年投資回顧與未來展望]]></title>
            <link>https://bradchou.medium.com/%E6%8A%95%E8%B3%87-2022-%E5%B9%B4%E6%8A%95%E8%B3%87%E5%9B%9E%E9%A1%A7%E8%88%87%E6%9C%AA%E4%BE%86%E5%B1%95%E6%9C%9B-5126a9ec944b?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5126a9ec944b</guid>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[投資回顧]]></category>
            <category><![CDATA[投資]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 31 Dec 2022 04:45:52 GMT</pubDate>
            <atom:updated>2022-12-31T04:45:52.686Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9wD9gWO5QaxLUObH.jpg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/writing-2023-on-sand-beach-13088176/">Engin Akyurt</a></figcaption></figure><p>2022 年使用了 <a href="https://bradnopitt.blogspot.com/2022/01/2021.html">定期定額+再平衡</a> 的操作，已實現投報 1.87%，未實現投報 -20%，從台股大盤 -22%、NASDAQ -33% 看來，表現雖是有比大盤好，但這可能也代表大盤投報好的時候我的投報可能會落後。一個月操作一次的期望都有做到，花的時間也比以前再更少，過程跟績效都符合預期，就這麼繼續做下去吧。</p><p><strong>2023 年的策略：定期定額 + 再平衡</strong></p><p>定期定額：每個月操作一次，投入月 KD 較低的標的<br>再平衡：每月若有投報超過 20% 的標的以及每半年做整體再平衡</p><p>0050、00878、5880 合庫金、2412 中華電、QQQ、ARKW、AAPL、TSLA</p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2022/12/2022.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5126a9ec944b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Android][App] 傳說小工具進版 targetSDKVersion 31 後遇到的問題]]></title>
            <link>https://bradchou.medium.com/android-app-%E5%82%B3%E8%AA%AA%E5%B0%8F%E5%B7%A5%E5%85%B7%E9%80%B2%E7%89%88-targetsdkversion-31-%E5%BE%8C%E9%81%87%E5%88%B0%E7%9A%84%E5%95%8F%E9%A1%8C-2ad171fe7a5d?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ad171fe7a5d</guid>
            <category><![CDATA[target-sdk-version]]></category>
            <category><![CDATA[傳說小工具]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[中文]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sun, 11 Dec 2022 05:46:08 GMT</pubDate>
            <atom:updated>2022-12-11T05:46:08.748Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SF6y6dNV_jiI9nPC.jpg" /><figcaption>Photo by <a href="https://www.pexels.com/photo/man-fixing-vehicle-engine-2244746/">Malte Luk</a></figcaption></figure><p>這次進版問題特別多，就把這些過程都記錄下來，希望也幫助到遇到類似問題的人</p><p>這邊也帶出個問題，就是平常用的測試手機 HTC UU 是 Android 8 的版本實在太舊了，測不出問題 XD，話說現在還有人在用 Android 8 的手機嗎？</p><p>我的開發環境：Android Studio 3.6.1, Java</p><p><strong>問題：</strong> <br>Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.<br>Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.</p><p>有趣了，我的 source code 裡沒有用到 PendingIntenet，居然要我加 FLAG，後來才發現，原來是使用的 library 裡有用到…</p><p><strong>處理方式：</strong><br>發現 app 已經非常久沒使用，之前用的 library 都太舊了或無法使用，先改用 AndroidX 並將舊的 library 換掉</p><p>使用 AndroidX，參考 <a href="https://developer.android.com/jetpack/androidx?hl=zh-tw">https://developer.android.com/jetpack/androidx?hl=zh-tw</a><br><em>gradle.properties</em><br>+android.useAndroidX=true<br>+android.enableJetifier=true</p><p>若有 library 因此找不到，可參考 <a href="https://developer.android.com/jetpack/androidx/migrate/class-mappings?hl=zh-tw">https://developer.android.com/jetpack/androidx/migrate/class-mappings?hl=zh-tw</a> 來替換</p><p><em>app\build.gradle<br></em>defaultConfig {<br>-minSdkVersion 16<br>+minSdkVersion 21<br>+multiDexEnabled true<br>}<br>dependencies {<br> +implementation ‘androidx.work:work-runtime-ktx:2.7.0’<br>+implementation ‘androidx.work:work-runtime:2.7.1’<br>}</p><p>build.gradle<br>dependencies {<br> -classpath ‘com.android.tools.build:gradle:3.2.1’<br>-classpath ‘com.google.gms:google-services:3.2.0’<br> +classpath ‘com.android.tools.build:gradle:3.6.4’<br> +classpath ‘com.google.gms:google-services:4.3.14’<br>}</p><p>升級 gradle（利用 Android Studio 在 build 的時候的提示做的）</p><p><strong>問題：</strong><br>java.lang.NoSuchMethodError: No static method metafactory</p><p><strong>處理方式：<br></strong>build.gradle<br>android {<br> compileOptions {<br> sourceCompatibility JavaVersion.VERSION_1_8<br> targetCompatibility JavaVersion.VERSION_1_8<br> }<br>}</p><p><strong>問題：</strong> Error inflating class com.google.android.gms.ads.AdView</p><p><strong>處理方式：<br></strong>build.gradle<br>dependencies {<br> -api ‘com.google.android.gms:play-services-ads:11.8.0’<br> +api ‘com.google.android.gms:play-services-ads:21.3.0’<br>}<br>加入以下在 AndroidManifest.xml 裡<br>&lt;meta-data<br> android:name=”com.google.android.gms.ads.APPLICATION_ID”<br> android:value=”ca-app-pub-xxxxxxxxxxxxxxxx~yyyyyyyyyy”/&gt;</p><p><strong>問題：</strong> error: incompatible types: String cannot be converted to OnInitializationCompleteListener MobileAds.initialize(this, “xxxx”);</p><p><strong>處理方式：<br></strong>使用下面方式替換原有寫法<br>AdView mAdView = (AdView) findViewById(R.id.adView); mAdView.setAdUnitId(getString(R.string.banner_ad_unit_id));</p><p><strong>Reference</strong><br><a href="https://github.com/flutter/flutter/issues/23131">Firebase For Flutter Execution failed for task ‘:app:transformClassesWithDexForDebug’</a><br><a href="https://firebase.google.com/docs/analytics/get-started?platform=android">feedbackGet started with Google Analytics</a></p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2022/12/androidapp-targetsdkversion-31.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ad171fe7a5d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[生活] RHINOSHIELD 犀牛盾 固架的優缺]]></title>
            <link>https://bradchou.medium.com/%E7%94%9F%E6%B4%BB-rhinoshield-%E7%8A%80%E7%89%9B%E7%9B%BE-%E5%9B%BA%E6%9E%B6%E7%9A%84%E5%84%AA%E7%BC%BA-7112e5f477f4?source=rss-ad67c0127be7------2</link>
            <guid isPermaLink="false">https://medium.com/p/7112e5f477f4</guid>
            <category><![CDATA[生活]]></category>
            <category><![CDATA[犀牛盾]]></category>
            <category><![CDATA[中文]]></category>
            <category><![CDATA[固架]]></category>
            <category><![CDATA[rhinoshield]]></category>
            <dc:creator><![CDATA[Brad Chou]]></dc:creator>
            <pubDate>Sat, 03 Dec 2022 00:00:43 GMT</pubDate>
            <atom:updated>2022-12-03T00:00:43.075Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XcFWxHJ-hwMmirKtUmvqIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4eSkfmhW0pvVc5mAi_3lA.png" /></figure><p>不斷從網頁和 YouTube 上看到 RHINOSHIELD 犀牛盾 固架的廣告，被它的便利性給吸引，不用黏在手機殼上，只要有 MagSafe，就可以在要用時吸上去就行，而且吸力超強，很適合我常遇到的一個情境，就是在吃飯時，手機只能平放在桌上，很不適合邊吃邊看，所以就買回來試試了</p><p>優點：<br>1. 吸力確實超強不怕掉<br>2. 手機直立使用時確實能讓你在吃飯時看手機有個好角度，手機跟桌面的角度大概在 111 度</p><p>缺點：<br>1. 手機平放使用時，手機跟桌面的角度大概在 98 度左右，這樣的角度使用起來有點太小，還是能使用但若角度再大一點會更好<br>2. 搭配 iPhone 12 Pro Max 直立使用時，站立時不太穩定，手機很容易會晃動</p><p>上面的角度是我使用 Angle Meter 這個 app 量測出來的，可能沒到很精確，但可以參考一下。</p><p><em>Originally published at </em><a href="https://bradnopitt.blogspot.com/2022/12/rhinoshield.html"><em>https://bradnopitt.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7112e5f477f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>