<?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 erinus on Medium]]></title>
        <description><![CDATA[Stories by erinus on Medium]]></description>
        <link>https://medium.com/@erinus?source=rss-dcbd2d018342------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tekfAAY8foLfJo_YJfuslg.jpeg</url>
            <title>Stories by erinus on Medium</title>
            <link>https://medium.com/@erinus?source=rss-dcbd2d018342------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:11:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@erinus/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[Python 程式交易新手入門：Day-05 取得代理清單]]></title>
            <link>https://medium.com/@erinus/python-%E7%A8%8B%E5%BC%8F%E4%BA%A4%E6%98%93%E6%96%B0%E6%89%8B%E5%85%A5%E9%96%80-day-05-%E5%8F%96%E5%BE%97%E4%BB%A3%E7%90%86%E6%B8%85%E5%96%AE-a7afe8274b93?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7afe8274b93</guid>
            <category><![CDATA[trade]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 15:56:29 GMT</pubDate>
            <atom:updated>2019-09-19T15:56:29.677Z</atom:updated>
            <content:encoded><![CDATA[<h3>安裝所需套件</h3><p>使用 pip 安裝</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d760a7ede09b203557da2d8d7c4c5a3/href">https://medium.com/media/3d760a7ede09b203557da2d8d7c4c5a3/href</a></iframe><h3>蒐集代理清單</h3><p>為了避免因頻繁存取被目標網站封鎖，必須透過不斷變換代理進行存取，因此我們先從網路搜尋可免費使用的 IP 代理清單網站，如下所列：</p><ol><li><a href="https://www.proxynova.com/">ProxyNova</a></li><li><a href="http://www.gatherproxy.com/">GatherProxy</a></li><li><a href="https://free-proxy-list.net/">Free Proxy List</a></li></ol><h3>ProxyNova</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/0*hWSUdnxXRJJHtbWt.png" /></figure><p>我們可以觀察到第一筆代理的 IP 是 61.220.204.25，但在原始碼中卻無法搜尋到，改以後面的 3128 進行搜尋，發現該網站以特殊的方式對 IP 進行保護。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Btjh-UuNRURtyAy6.png" /></figure><p>如紅框部分所示，按照 JavaScript 語法推斷，去掉 1234567861.22 字串前 8 個字元後接上 0.204.25 字串即為所需的 IP。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4abc9ecea8ee9ae918dc5a6800f75958/href">https://medium.com/media/4abc9ecea8ee9ae918dc5a6800f75958/href</a></iframe><h3>GatherProxy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*ENCpk94xxPa7xK09.png" /></figure><p>我們可以觀察到第一筆代理的 IP 是 185.190.105.179，在原始碼中搜尋到後，發現該網站以特殊的方式對 IP 進行保護。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bagqvPn7e-w1HELQ.png" /></figure><p>如圖中所示，在 gp.insertPrx 函數中傳入的參數物件，裡面就包含我們所需要的代理資料，但 Port 是以 16 進位表示法表示。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f33450b18138a3150a9b96261321c31/href">https://medium.com/media/7f33450b18138a3150a9b96261321c31/href</a></iframe><h3>Free Proxy List</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*_xTfz2gMPtdVQZeX.png" /></figure><p>我們可以觀察到第一筆代理的 IP 是 109.101.139.106，在原始碼中搜尋到後，發現該網站並無以特殊的方式對 IP 進行保護。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qj_M6HGxw2JsFNbQ.png" /></figure><p>如圖中所示，可直接從表格中取出所需代理資料。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c8cbc64ef98b0c497b2ab52c1026a623/href">https://medium.com/media/c8cbc64ef98b0c497b2ab52c1026a623/href</a></iframe><h3>Would You Like To Know More?</h3><p><a href="http://piter.io/projects/js2py">http://piter.io/projects/js2py</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7afe8274b93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 程式交易新手入門：Day-04 解析 HTML]]></title>
            <link>https://medium.com/@erinus/python-%E7%A8%8B%E5%BC%8F%E4%BA%A4%E6%98%93%E6%96%B0%E6%89%8B%E5%85%A5%E9%96%80-day-04-%E8%A7%A3%E6%9E%90-html-a6df2d936037?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6df2d936037</guid>
            <category><![CDATA[trade]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 14:04:50 GMT</pubDate>
            <atom:updated>2019-09-19T15:26:50.233Z</atom:updated>
            <content:encoded><![CDATA[<h3>安裝所需套件</h3><p>使用 pip 安裝</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf2b99a21c9f608f084423911f5cf3f8/href">https://medium.com/media/cf2b99a21c9f608f084423911f5cf3f8/href</a></iframe><h3>解析 HTML</h3><p>以取得加權指數成分股暨市值比重資料為例。</p><h3>分析資料結構</h3><p><a href="https://www.taifex.com.tw/cht/9/futuresQADetail">https://www.taifex.com.tw/cht/9/futuresQADetail</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t4Ju9oBBapqAIe33.png" /></figure><ol><li>表格有標頭行。</li><li>一行有二筆資料，且非依序排列，故資料取出後，視需求可能需要重新排序。</li><li>百分比僅紀錄到小數第 4 位，有重複資料的狀況，若要依照市值佔比排序，則無法只靠百分比欄位排序，仍需透過排行欄位進行市值佔比排序。</li></ol><h3>定義儲存類別</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ad33c34b4695833b6629c379d803dad/href">https://medium.com/media/6ad33c34b4695833b6629c379d803dad/href</a></iframe><h3>下載資料並解析</h3><p>使用 PyQuery 解析 HTML 內容，因 PyQuery 套件庫用法參考自 jQuery，故函數用法等均類同於 jQuery，對於多數開發者應較 Beautiful Soup 4 更加容易上手。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dea092e2932317ec5d3d901c9e86fb7f/href">https://medium.com/media/dea092e2932317ec5d3d901c9e86fb7f/href</a></iframe><h3>重新定義資料儲存結構</h3><p>因為存入資料都是字串，但實際內容有整數（排序），還有浮點數（市值佔比），所以需要在儲存類別的建構子中進行轉換處理。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/223f59013c6248a0397db6d9fd53bd1e/href">https://medium.com/media/223f59013c6248a0397db6d9fd53bd1e/href</a></iframe><h3>重新調整輸出方式</h3><p>在定義儲存物件的表達式後，我們會看到輸出如下圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*-bLl_HlWfTMUCyWn.png" /></figure><p>雖然已經格式化，但卻有點雜亂難以閱讀，所以必須修正輸出方式。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/71c5b8f17245792342c77ff35ab5b900/href">https://medium.com/media/71c5b8f17245792342c77ff35ab5b900/href</a></iframe><p>重新執行得到適合人類閱讀的輸出結果。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*XLSpSWCvZ_NbPnIC.png" /></figure><h3>Would You Like To Know More?</h3><p><a href="https://pythonhosted.org/pyquery/">https://pythonhosted.org/pyquery/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6df2d936037" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 程式交易新手入門：Day-03 取得加權指數成分股暨市值比重資料]]></title>
            <link>https://medium.com/@erinus/python-%E7%A8%8B%E5%BC%8F%E4%BA%A4%E6%98%93%E6%96%B0%E6%89%8B%E5%85%A5%E9%96%80-day-03-%E5%8F%96%E5%BE%97%E5%8A%A0%E6%AC%8A%E6%8C%87%E6%95%B8%E6%88%90%E5%88%86%E8%82%A1%E6%9A%A8%E5%B8%82%E5%80%BC%E6%AF%94%E9%87%8D%E8%B3%87%E6%96%99-fa4c97c22b18?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa4c97c22b18</guid>
            <category><![CDATA[trade]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 14:03:39 GMT</pubDate>
            <atom:updated>2019-09-19T14:57:41.358Z</atom:updated>
            <content:encoded><![CDATA[<h3>安裝所需套件</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/540e8d3a741a570c734b17532b9525d7/href">https://medium.com/media/540e8d3a741a570c734b17532b9525d7/href</a></iframe><h3>輸出紀錄</h3><p>在 Python 程式開發或後續執行過程中，開發者經常會使用 print 輸出紀錄，但這樣容易在大量紀錄輸出時，受限於 Terminal 的緩衝空間大小，難以保存完整記錄，從而忽略錯誤及問題關聯性。因此筆者推薦使用 <strong>loguru</strong> 套件輸出 log，美觀且方便。</p><h3>設定紀錄輸出規則</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/663c313cb0b51e91954b65492a452a4c/href">https://medium.com/media/663c313cb0b51e91954b65492a452a4c/href</a></iframe><h3>使用紀錄輸出函式</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/384b1397863b813de7fbcda20e2fbbc1/href">https://medium.com/media/384b1397863b813de7fbcda20e2fbbc1/href</a></iframe><p>在 Terminal 和紀錄檔都是以如下格式輸出資料（在 Terminal 中支援標色輸出）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/0*4gWIMfhfOOzlmcs_.png" /></figure><h3>下載資料</h3><p>以取得加權指數成分股暨市值比重資料為例。</p><h3>發出要求並取得回應</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2eb0fd33ec4263d746b117003059daed/href">https://medium.com/media/2eb0fd33ec4263d746b117003059daed/href</a></iframe><h3>進行資料編碼判斷</h3><p>因為政府機關不少系統還停留在早年的字集 BIG5，甚至有延伸字集 BIG5-HKSCS，所以下載來自於政府機關網頁的文字資料時，都建議對內容進行編碼判斷，避免解讀出現亂碼。</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd11450e5499392716a8062ed539c288/href">https://medium.com/media/fd11450e5499392716a8062ed539c288/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*kBiH-k2tlRK0vzq7.png" /></figure><h3>Would You Like To Know More?</h3><p><a href="https://loguru.readthedocs.io/en/stable/api/logger.html">https://loguru.readthedocs.io/en/stable/api/logger.html</a><br><a href="https://2.python-requests.org/">https://2.python-requests.org/</a><br><a href="https://chardet.readthedocs.io/">https://chardet.readthedocs.io/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa4c97c22b18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 程式交易新手入門：Day-02 資料源的重要性]]></title>
            <link>https://medium.com/@erinus/python-%E7%A8%8B%E5%BC%8F%E4%BA%A4%E6%98%93%E6%96%B0%E6%89%8B%E5%85%A5%E9%96%80-day-02-%E8%B3%87%E6%96%99%E6%BA%90%E7%9A%84%E9%87%8D%E8%A6%81%E6%80%A7-bf264079e164?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf264079e164</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[trade]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 14:01:12 GMT</pubDate>
            <atom:updated>2019-09-19T14:01:12.340Z</atom:updated>
            <content:encoded><![CDATA[<h3>蒐集資料源</h3><p>程式交易的基礎就是要足夠的資料源做為參考，無論是用在分析建模，還是交易時的運算，甚至是盤中避險，總是逃不脫歷史資料跟即時資料的互相參佐，因此如何穩定取得需要的資料源，是程式交易者必須掌握的基本功。</p><h3>資料源分類</h3><p>通常分為二大類</p><ol><li>靜態資料源<br>通常來自歷史資料等，以 XML / CSV / XLS / JSON / HTML 等方式提供，常用於擬定策略參考時，作為參考值使用，或者用於歷史回測。</li><li>動態資料源<br>通常來自即時報價等，以 CSV / JSON / HTML 等方式提供，常用於即時交易時計算技術線或指標等用途。</li></ol><h3>資料源協定</h3><p>通常分為二大類</p><ol><li>TCP 協定<br>常封裝為 ActiveX / COM / DDE 等元件</li><li>HTTP / HTTPS 協定<br>以網頁或 API 等方式提供</li></ol><h3>蒐集前準備</h3><ol><li>發送 HTTP / HTTPS 要求及處理 HTTP / HTTPS 回應</li><li>蒐集代理伺服器清單<br><a href="https://www.proxynova.com/">ProxyNova</a><br><a href="http://www.gatherproxy.com/">GatherProxy</a><br><a href="https://free-proxy-list.net/">Free Proxy List</a></li><li>透過代理發送 HTTP / HTTPS 要求<br>避免頻繁查詢而被阻擋存取。</li><li>資料編碼判斷<br>證交所與期交所不少資料仍使用 big5 編碼，尤其是目前九百多檔上市股票名稱中，有超出 big5 編碼的中文字，必須使用 big-hkscs 編碼才能顯示。</li><li>確認合適的資料儲存方式<br>如使用 csv 儲存，或使用 MariaDB / MongoDB 等資料庫儲存。</li><li>資料解析技巧<br>正確解析 HTML / JSON / CSV / PDF 並取出所需資料。</li><li>資料清整技巧<br>去除無用資訊，將資料內容格式化，例如將 1080917 轉為 2019–09–17。</li></ol><h3>執行環境</h3><p>不建議直接使用 Command Prompt 和 PowerShell，建議改用 <a href="https://cmder.net/">Cmder</a> 執行，避免輸出編碼問題，還能提供色彩提示。</p><h3>系列進程</h3><p>明天開始到第 12 天會集中說明資料蒐集相關的套件使用與開發，從第 13 天開始券商 API 串接與常見技術指標的介紹與計算等內容。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf264079e164" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 程式交易新手入門：Day-01 基礎觀念及準備]]></title>
            <link>https://medium.com/@erinus/python-%E7%A8%8B%E5%BC%8F%E4%BA%A4%E6%98%93%E6%96%B0%E6%89%8B%E5%85%A5%E9%96%80-day-01-%E5%9F%BA%E7%A4%8E%E8%A7%80%E5%BF%B5%E5%8F%8A%E6%BA%96%E5%82%99-cd849a670908?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd849a670908</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[trade]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Thu, 19 Sep 2019 14:00:02 GMT</pubDate>
            <atom:updated>2019-09-19T14:00:02.178Z</atom:updated>
            <content:encoded><![CDATA[<h3>程式交易</h3><p>隨著資訊技術的快速發展，各家券商除提供金融交易軟體外，部分券商也開放可供交易者自行開發交易軟體的 API，而金融交易軟體本身功能的限制、反應速度的遲緩，及難以整合外部資料等困難，都促使部分交易者轉向自行開發交易程式，以滿足自身需求，甚至尋找心中的聖杯，然而這中間的困難有二大門檻，一是交易程式的開發撰寫，二是策略的建構，在如今市場及圈子中滿是 ML / AI 策略交易的風潮下，我們姑且放下這些神奇的交易策略建構方式不談，回歸交易的本質，從取得優質可用的交易參考資料開始，到建構穩定的交易系統，讓交易者能在穩定且安心的基礎之上，追尋各種合適的策略，取得心中的聖杯。</p><h3>前言介紹</h3><p>為了搭配其他參賽者追尋聖杯策略的優質文章，筆者將以該領域參賽者較常使用的 Python 作為主要示範環境，而非使用筆者真實交易過程中採取的 .NET 平台為基礎。</p><p>本系列需要以下基本的開發經驗，但不僅限於此：</p><ol><li>Python 語言基礎</li><li>wxPython 視窗元件開發</li><li>Python 爬蟲開發</li><li>SQLAlchemy 資料庫開發</li><li>Docker 容器開發使用</li></ol><p>本系列開發環境以 Windows 為主，肇因於國內各家券商技術迭代幾乎停滯，仍以早期的 ActiveX / COM / DDE 一類的資訊服務提供技術為主，導致難以擺脫 Windows 運行環境，因此若想在 Linux 上進行開發，仍須將報價及下單模組抽離並置於 Windows 上運行，而後透過如 TCP / HTTP 等通訊方式進行對接，確保依賴 Windows 部分的模組機制可正常運作。</p><h3>申請開戶</h3><p>各家券商 API 細節及比較因活動特性，筆者將不予介紹，僅以最常使用的元大期貨 API 做為主要介紹標的。</p><p>請至元大期貨辦理開戶，並申請開放程式交易 API 功能，過程中需簽至少二張政府規範的授權同意書，若營業員未提及該流程，則代表申請的交易戶並未開放程式交易 API 功能。</p><p>開戶作業時間約需一周左右，應可銜接上本系列文章的進度，預計於第 14 天開始介紹串接元大期貨 API 報價及下單元件。</p><h3>環境安裝</h3><ol><li>Python 3.6.8 x86<br>因非各家券商均提供 x64 元件，故建議使用 x86 版本的 Python 以避免 COM 元件等串接相容性問題。<br><a href="https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe">https://www.python.org/ftp/python/3.6.8/python-3.6.8.exe</a></li><li>Docker for Windows<br><a href="https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe">https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd849a670908" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build PHP Extension on Windows]]></title>
            <link>https://medium.com/@erinus/how-to-build-php-extension-on-windows-d1667290f809?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1667290f809</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-extension]]></category>
            <category><![CDATA[windows]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 17:26:32 GMT</pubDate>
            <atom:updated>2019-02-11T05:53:14.225Z</atom:updated>
            <content:encoded><![CDATA[<p>For PHP 7.2+</p><h3><strong>Follow this post andmake sure you can build PHP on Windows</strong></h3><p><a href="https://medium.com/@erinus/how-to-build-php-on-windows-a7ad0a87862a">https://medium.com/@erinus/how-to-build-php-on-windows-a7ad0a87862a</a></p><h3><strong>Take APCu for Example</strong></h3><p>Download from PECL<br><a href="https://pecl.php.net/get/APCu">https://pecl.php.net/get/APCu</a></p><h3><strong>Extract Source to extensions folder</strong></h3><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src\ext\apcu</p><h3><em>Invoke VS 2017 x64 Native Tools Command Prompt with Administrator Privileges</em></h3><p>C:\Windows\System32&gt; <strong>cd C:\php-sdk</strong></p><p>C:\php-sdk&gt; <strong>phpsdk-starter.bat -c vc15 -a x64</strong><br>[vcvarsall.bat] Environment initialized for: ‘x64’</p><p>PHP SDK 2.1.10</p><p>OS architecture: 64-bit<br>Build architecture: 64-bit<br>Visual C++: 15<br>PHP-SDK path: C:\php-sdk</p><p>C:\php-sdk<br>$ <strong>cd C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src</strong></p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>nmake clean</strong></p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>buildconf --force<br></strong>Rebuilding configure.js<br>Now run ‘configure --help’</p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>configure --disable-all --enable-cli --enable-apcu=shared</strong></p><p>PHP Version: 7.2.15</p><p>Saving configure options to config.nice.bat<br> Checking for cl.exe … &lt;in default path&gt;<br> Detected compiler MSVC15 (Visual C++ 2017)<br> Detected 64-bit compiler<br> Checking for link.exe … C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64<br> Checking for nmake.exe … &lt;in default path&gt;<br> Checking for lib.exe … &lt;in default path&gt;<br> Checking for bison.exe … &lt;in default path&gt;<br> Checking for sed.exe … &lt;in default path&gt;<br> Checking for re2c.exe … &lt;in default path&gt;<br> Detected re2c version 1.1.1<br> Checking for zip.exe … &lt;in default path&gt;<br> Checking for lemon.exe … &lt;in default path&gt;<br> Checking for mc.exe … C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64<br> Checking for mt.exe … C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64<br> Enabling multi process build</p><p>Build dir: C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src\x64\Release_TS<br> PHP Core: php7ts.dll and php7ts.lib</p><p>Checking for wspiapi.h … &lt;in default path&gt;<br> Enabling IPv6 support<br> Enabling SAPI sapi\cli<br> Checking for library edit_a.lib;edit.lib … ..\deps\lib\edit_a.lib<br> Checking for editline/readline.h … C:\php-sdk\php-dev\vc15\x64\deps\include<br> Enabling extension ext\apcu [shared]<br> Enabling extension ext\date<br> Enabling extension ext\pcre<br> Enabling extension ext\reflection<br> Enabling extension ext\spl<br> Checking for timelib_config.h … ext/date/lib<br> Enabling extension ext\standard</p><p>Creating build dirs…<br> Generating files…<br> Generating Makefile<br> Generating main/internal_functions.c<br> Generating main/config.w32.h<br> Generating phpize<br> Done.</p><p>…</p><p>Type ‘nmake’ to build PHP</p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>nmake</strong></p><h3><strong>Output</strong></h3><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src\x64\Release_TS\<strong>php_apcu.dll</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d1667290f809" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build PHP on Windows]]></title>
            <link>https://medium.com/@erinus/how-to-build-php-on-windows-a7ad0a87862a?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7ad0a87862a</guid>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 17:07:45 GMT</pubDate>
            <atom:updated>2019-03-12T21:25:53.118Z</atom:updated>
            <content:encoded><![CDATA[<p>for PHP 7.2 or newer</p><h3><strong>Requirements</strong></h3><p>Microsoft Visual Studio 2017</p><h3><strong>Creater workspace folder</strong></h3><p>C:\php-sdk</p><h3><strong>Download PHP SDK from GitHub</strong></h3><p><a href="https://github.com/Microsoft/php-sdk-binary-tools">https://github.com/Microsoft/php-sdk-binary-tools</a></p><h3><strong>Extract PHP SDK to C:\php-sdk</strong></h3><p>C:\php-sdk\bin<br>C:\php-sdk\lib<br>C:\php-sdk\msys2<br>C:\php-sdk\pgo<br>…</p><h3><strong>Download PHP Source</strong></h3><p><a href="https://windows.php.net/download/">https://windows.php.net/download/</a></p><h3><strong>Invoke VS 2017 x64 Native Tools Command Prompt with Administrator Privileges</strong></h3><p>C:\Windows\System32&gt; <strong>cd C:\php-sdk</strong></p><p>C:\php-sdk&gt; <strong>phpsdk-starter.bat -c vc15 -a x64</strong><br>[vcvarsall.bat] Environment initialized for: ‘x64’</p><p>PHP SDK 2.1.10</p><p>OS architecture: 64-bit<br>Build architecture: 64-bit<br>Visual C++: 15<br>PHP-SDK path: C:\php-sdk</p><p>C:\php-sdk<br>$ <strong>phpsdk_buildtree php-dev</strong></p><h3><strong>Extract PHP Source</strong></h3><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src</p><h3><strong>Download Dependencies</strong></h3><p>C:\php-sdk<br>$ <strong>cd C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src</strong></p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>phpsdk_deps -u</strong></p><p>Configuration: 7.2-vc15-x64-stable</p><p>Processing package ICU-63.1-vc15-x64.zip<br>Processing package apache-2.4.28-vc15-x64.zip<br>…<br>Processing package zlib-1.2.11-vc15-x64.zip<br>Processing package libsodium-1.0.16-vc15-x64.zip<br>Updates performed successfully.<br>Old dependencies backed up into ‘C:\php-sdk\php-dev\vc15\x64\deps.201902091501’.</p><h3><strong>Compile</strong></h3><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>C:\php-sdk\phpsdk-vc15-x64.bat</strong><br>[vcvarsall.bat] Environment initialized for: ‘x64’</p><p>PHP SDK 2.1.10</p><p>OS architecture: 64-bit<br>Build architecture: 64-bit<br>Visual C++: 15<br>PHP-SDK path: C:\php-sdk</p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>buildconf</strong><br>Rebuilding configure.js<br>Now run ‘configure --help’</p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src</p><p>$ <strong>configure --disable-all --enable-cli</strong><br>$ <strong>configure --disable-all --enable-cli --disable-zts</strong><br>PHP Version: 7.2.15</p><p>Saving configure options to config.nice.bat<br>Checking for cl.exe … &lt;in default path&gt;<br>Detected compiler MSVC15 (Visual C++ 2017)<br>Detected 64-bit compiler<br>Checking for link.exe … C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64<br>Checking for nmake.exe … &lt;in default path&gt;<br>Checking for lib.exe … &lt;in default path&gt;<br>Checking for bison.exe … &lt;in default path&gt;<br>Checking for sed.exe … &lt;in default path&gt;<br>Checking for re2c.exe … &lt;in default path&gt;<br>Detected re2c version 1.1.1<br>Checking for zip.exe … &lt;in default path&gt;<br>Checking for lemon.exe … &lt;in default path&gt;<br>Checking for mc.exe … C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64<br>Checking for mt.exe … C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64<br>Enabling multi process build</p><p>Build dir: C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src\x64\Release_TS<br>PHP Core: php7ts.dll and php7ts.lib</p><p>Checking for wspiapi.h … &lt;in default path&gt;<br>Enabling IPv6 support<br>Enabling SAPI sapi\cli<br>Checking for library edit_a.lib;edit.lib … ..\deps\lib\edit_a.lib<br>Checking for editline/readline.h … C:\php-sdk\php-dev\vc15\x64\deps\include<br>Enabling extension ext\date<br>Enabling extension ext\pcre<br>Enabling extension ext\reflection<br>Enabling extension ext\spl<br>Checking for timelib_config.h … ext/date/lib<br>Enabling extension ext\standard</p><p>Creating build dirs…<br>Generating files…<br>Generating Makefile<br>Generating main/internal_functions.c<br>Generating main/config.w32.h<br>Generating phpize<br>Done.</p><p>…</p><p>Type ‘nmake’ to build PHP</p><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src<br>$ <strong>nmake</strong></p><h3>Output</h3><p>C:\php-sdk\php-dev\vc15\x64\php-7.2.15-src\x64\Release_TS</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7ad0a87862a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TDD Course Day 1]]></title>
            <link>https://medium.com/@erinus/tdd-course-day-1-1e5eba91263e?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e5eba91263e</guid>
            <category><![CDATA[joey]]></category>
            <category><![CDATA[skilltree]]></category>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[bdd]]></category>
            <category><![CDATA[tdd]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Sun, 11 Jun 2017 11:46:27 GMT</pubDate>
            <atom:updated>2017-06-11T14:33:30.057Z</atom:updated>
            <content:encoded><![CDATA[<p>By Joey Chen (91)</p><p>91 哥的課程真的挺傷腦的，一天課程下來，回家就只想跳上床去好好休息，上課前真的要好好睡滿十小時再去才能撐得住啊！</p><p>好啦！廢話不多說，就讓我這個弱弱工程師來聊聊這次上課的心得。</p><p>首先要提的當然是便當還不錯（八飛），放心 ~ 不是 XD 那系列的，不用太擔心會孤獨的踩雷，喂 ~ 跑題了 &gt;&quot;&lt; 是上課過程 91 哥很在意互動，所以請盡力的舉手回答問題，因為回答問題就算被打臉也沒關係，因為被打臉才會發現自己的問題，不問不回答就會自己腦補，這是 91 哥滿希望學員們改善的重點：【寧可提出討論，不要自行腦補】，所以我回家有冰敷，哈！</p><p>再來課程名稱雖是測試驅動開發，但 91 哥講的其實是一整套開發觀念，並非只有 TDD 一條主軸，實際上還內含 BDD 與部分開發文化的兼容，這點與其他把某些觀念理論奉為圭臬的講師有所不同，對我來說的確是比較貼近業界實務上的改善模式，因為理論歸理論，最終要跟實際環境文化相結合才能發揮，甚至 91 哥還會以自己的業界經驗提供一些如何說服老闆及主管的情境模擬應對，這部分相當有價值。</p><p>第一天的主軸，我自己歸納如下：</p><pre><strong>1. 先明確需求</strong><br>   誰不做的先出來讓我景仰一下</pre><pre>2. <strong>找出最小測試單位</strong><br>   函數或是工作單元</pre><pre><strong>3. 讓測試需求可獨立運作</strong><br>   避免環境相依性產生，因為有相依，就無法在任意環境執行測試程式<br>   避免測試程式間有相依性，因為有相依，就無法讓測試工具藉多執行緒降低測試時間</pre><pre><strong>4. 讓測試一次只處理一個明確的目標</strong><br>   測試沒通過時才能立即明確問題所在</pre><pre><strong>5. 確保測試程式自身的有效性</strong><br>   測試程式還需要測試程式驗證，你確定你不是在增加自己的工作量</pre><pre><strong>6. 測試程式的運行結果必須是可重複實現的</strong><br>   每次跑都不一樣，你覺得你是在廟裡擲筊對吧</pre><pre><strong>7. 單元測試覆蓋率每次都有提升就是進步</strong><br>   刻意追求一定百分比的覆蓋率，反而會造成偷雞摸狗，甚至是製造進入門檻</pre><pre><strong>8. 單元測試不是萬靈丹</strong><br>   單元測試是避免工程師犯低級錯誤，還有確立程式中每個最小單元的正確性<br>   若已知每個最小單元均可正確運作，那錯誤就應該是發生在單元之間的連動</pre><p>再來關鍵的 3A 原則，我自己的看法是</p><pre><strong>Arrange</strong><br>定義測試執行時期的輸出輸入與相關初始化行為</pre><pre><strong>Act</strong><br>執行測試行為</pre><pre><strong>Assert</strong><br>判斷執行結果是否符合預期並輸出明確錯誤原因之訊息</pre><p>接下來就是工程師的表演時間啦！不過這時候就會看出差距了，光是開發工具流程加速與優化，看的出我絕對是白痴，從 Visual Studio 的內建快捷鍵、Resharper、OzCode，到作業系統的快速工具 Wox 和 Alfred，我完全狀況外，臉又不小心腫了起來 ~（沒關係！左臉腫了，右臉也腫起來比較平衡）</p><p>在 C# 領域，91 哥推薦了幾套測試相關框架</p><pre><strong>Testing</strong></pre><pre><strong>1. MSTest</strong><br>   Visual Studio 內建的官方框架</pre><pre><strong>2. NUnit</strong><br>   功能豐富完整的主流框架</pre><pre><strong>3. xUnit</strong><br>   NUnit 部分開發者另外發展的新型框架，支援更多新功能<br>   這我自己補充的，因為 Visual Studio for Mac 以及 .NET Core 預設是用這套</pre><pre><strong>Mocking</strong></pre><pre><strong>1. NSubstitute</strong><br>   輕量化框架</pre><pre><strong>2. Moq</strong><br>   功能豐富完整的主流框架</pre><p>單元測試目前對我來說，是在開始寫程式碼之前，將需求分析文件和規格書先轉化成程式化的描述過程，現在開始有點明瞭為何要先寫單元測試再寫真正運作的程式碼。</p><p>第一，先讓自己藉由單元測試將需求和規格梳理一次，避免未考慮周全就開始撰寫程式造成的架構問題。</p><p>第二，避免寫完真正運作的程式碼後，因為開發過程中形成的既定想法，影響測試程式撰寫時的邏輯性和可靠性。</p><p><strong>小記．2017 夏</strong></p><p><strong>回家作業（持續撰寫修正中）</strong><br><a href="https://github.com/erinus/91TDD">https://github.com/erinus/91TDD</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e5eba91263e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cmder - Build SSH connection quickly]]></title>
            <link>https://medium.com/@erinus/cmder-setup-tasks-e5109bbb742b?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5109bbb742b</guid>
            <category><![CDATA[cmder]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Sun, 04 Jun 2017 09:54:35 GMT</pubDate>
            <atom:updated>2017-06-06T14:36:03.610Z</atom:updated>
            <content:encoded><![CDATA[<p>Use Cmder to connect your servers easily</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*GDKAeuRfFcUYkGXAR6cEAg.png" /><figcaption>Click [Create new console]</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*zSBDIN0Vk_Bpp5-D416_gw.png" /><figcaption>Click [Setup tasks…]</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*XAnnWOMQfA4NnUoPOWIRxw.png" /><figcaption>Select [Startup -&gt; Tasks] and click [+] to add new task</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*4OYakrCKP1snUiNROZ3pgg.png" /></figure><p>1 the “::” means menu seperator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*Hn4r3X_T3c-ji-vdThe_PQ.png" /></figure><p>2 display cmder icon instead of conemu icon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*6Pk6fO_6K60oaPBlcfeZNw.png" /></figure><p>3 Command for building SSH connection</p><pre><strong>Format:</strong><br>cmd /c &quot;%ConEmuDir%\..\git-for-windows\usr\bin\ssh <strong>[username]</strong>@<strong>[hostname]</strong> -i <strong>[certifaicate]</strong>&quot; -new_console:d:%USERPROFILE% &quot;-new_console:t:<strong>[display]</strong>&quot;</pre><pre><strong>Sample:</strong><br>cmd /c &quot;%ConEmuDir%\..\git-for-windows\usr\bin\ssh ubuntu@dev.lifeplus.tw -i E:\LifePlusSystem.pem&quot; -new_console:d:%USERPROFILE% &quot;-new_console:t:dev.lifeplus.tw&quot;</pre><p><strong>[certificate]</strong><br>certificate file path</p><p><strong>[dispaly]</strong><br>means the text of the console tab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*WVPBNMBK0jj6O4ze7sigwg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5109bbb742b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Go my way - Day 3]]></title>
            <link>https://medium.com/@erinus/go-my-way-day-3-9c9b420ed43e?source=rss-dcbd2d018342------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c9b420ed43e</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[gin]]></category>
            <category><![CDATA[template]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[erinus]]></dc:creator>
            <pubDate>Fri, 26 May 2017 14:57:24 GMT</pubDate>
            <atom:updated>2019-02-11T18:18:22.845Z</atom:updated>
            <content:encoded><![CDATA[<p>Add Binary FileSystem and Multiple Template Renderer</p><p><strong>Add Binary FileSystem</strong></p><p>&gt; go get -u github.com/jteeuwen/go-bindata/…<br>&gt; go get github.com/elazarl/go-bindata-assetfs<br>&gt; go get github.com/gin-contrib/static</p><p>bfs.go</p><pre>import(<br>    &quot;net/http&quot;<br>)<br><br>import (<br>    &quot;github.com/elazarl/go-bindata-assetfs&quot;<br>)<br><br>type BFS struct {<br>    FileSystem http.FileSystem<br>}<br><br>func (bfs *BFS) Open(name string) (http.File, error) {<br>    return bfs.FileSystem.Open(name)<br>}<br><br>func (bfs *BFS) Exists(prefix string, filepath string) bool {<br>    var err error<br>    var url string<br>    url = strings.TrimPrefix(filepath, prefix)<br>    if len(url) &lt; len(filepath) {<br>        _, err = bfs.FileSystem.Open(url)<br>        if err != nil {<br>            return false<br>        }<br>        return true<br>    }<br>    return false<br>}<br><br>func GetBFS(root string) *BFS {<br>    var fs *assetfs.AssetFS<br>    fs = &amp;assetfs.AssetFS{Asset, AssetDir, AssetInfo, root}<br>    return &amp;BFS{ fs }<br>}</pre><p>server.go</p><pre>import (<br>    &quot;crypto/tls&quot;<br>    &quot;net/http&quot;<br>)<br><br>import (<br>    &quot;github.com/gin-gonic/gin&quot;<br>)<br><br>import (<br>    <strong>&quot;github.com/gin-contrib/static&quot;</strong><br>)<br><br>import (<br>    &quot;github.com/facebookgo/grace/gracehttp&quot;<br>)<br><br>var (<br>    SSLCRT string = &quot;/etc/letsencrypt/live/[domain]/fullchain.pem&quot;<br>    SSLKEY string = &quot;/etc/letsencrypt/live/[domain]/privkey.pem&quot;<br>)<br><br>func main() {<br>    r := gin.Default()<br>    <strong>r.Use(static.Serve(&quot;/files&quot;, GetBFS(&quot;assets/files&quot;)))</strong><br>    r.GET(&quot;/ping&quot;, func(c *gin.Context) {<br>        c.JSON(200, gin.H{<br>            &quot;message&quot;: &quot;pong&quot;,<br>        })<br>    })<br>    var x509 tls.Certificate<br>    x509, err = tls.LoadX509KeyPair(SSLCRT, SSLKEY)<br>    if err != nil {<br>        return<br>    }<br>    var server *http.Server<br>    server = &amp;http.Server{<br>        Addr: &quot;:8080&quot;,<br>        Handler: router,<br>        TLSConfig: &amp;tls.Config{<br>            Certificates: []tls.Certificate{ x509 },<br>        },<br>    }<br>    gracehttp.Serve(server)<br>}</pre><p><strong>Add Multiple Template Renderer</strong></p><p>&gt; go get github.com/gin-contrib/multitemplate</p><p>tpl.go</p><pre>import (<br>    &quot;fmt&quot;<br>    &quot;html/template&quot;<br>)<br><br>func LoadTemplates(paths ...string) *template.Template {<br>    var err error<br>    var tpl *template.Template<br>    var path string<br>    var data []byte<br>    for _, path = range paths {<br>        data, err = Asset(&quot;assets/pages/&quot; + path)<br>        if err != nil {<br>            fmt.Println(err)<br>        }<br>        var tmp *template.Template<br>        if tpl == nil {<br>            tpl = template.New(path)<br>        }<br>        if path == tpl.Name() {<br>            tmp = tpl<br>        } else {<br>            tmp = tpl.New(path)<br>        }<br>        _, err = tmp.Parse(string(data))<br>        if err != nil {<br>            fmt.Println(err)<br>        }<br>    }<br>    return tpl<br>}</pre><p>server.go</p><pre>import (<br>    &quot;crypto/tls&quot;<br>    &quot;net/http&quot;<br>)<br><br>import (<br>    &quot;github.com/gin-gonic/gin&quot;<br>)<br><br>import (<br>    &quot;github.com/gin-contrib/static&quot;<br>)<br><br>import (<br>    <strong>&quot;github.com/gin-contrib/multitemplate&quot;</strong><br>)<br><br>import (<br>    &quot;github.com/facebookgo/grace/gracehttp&quot;<br>)<br><br>var (<br>    SSLCRT string = &quot;/etc/letsencrypt/live/[domain]/fullchain.pem&quot;<br>    SSLKEY string = &quot;/etc/letsencrypt/live/[domain]/privkey.pem&quot;<br>)<br><br>func main() {<br>    <strong>var render multitemplate.Render<br>    render = multitemplate.New()<br>    render.Add(&quot;index&quot;, LoadTemplates(&quot;base.tpl&quot;, &quot;index.tpl&quot;))<br>    render.Add(&quot;login&quot;, LoadTemplates(&quot;base.tpl&quot;, &quot;login.tpl&quot;))</strong><br>    r := gin.Default()<br>    <strong>r.HTMLRender = render</strong><br>    r.Use(static.Serve(&quot;/files&quot;, GetBFS(&quot;assets/files&quot;)))<br>    r.GET(&quot;/&quot;, func(c *gin.Context) {<br>        c.HTML(200, <strong>&quot;index&quot;</strong>, gin.H{<br>            &quot;Title&quot;: &quot;Go-Server&quot;,<br>        })<br>    })<br>    r.GET(&quot;/login&quot;, func(c *gin.Context) {<br>        c.HTML(200, <strong>&quot;login&quot;</strong>, gin.H{<br>            &quot;Title&quot;: &quot;Go-Server&quot;,<br>        })<br>    })<br>    var x509 tls.Certificate<br>    x509, err = tls.LoadX509KeyPair(SSLCRT, SSLKEY)<br>    if err != nil {<br>        return<br>    }<br>    var server *http.Server<br>    server = &amp;http.Server{<br>        Addr: &quot;:8080&quot;,<br>        Handler: router,<br>        TLSConfig: &amp;tls.Config{<br>            Certificates: []tls.Certificate{ x509 },<br>        },<br>    }<br>    gracehttp.Serve(server)<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c9b420ed43e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>