<?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 Takuma 不上班 on Medium]]></title>
        <description><![CDATA[Stories by Takuma 不上班 on Medium]]></description>
        <link>https://medium.com/@TakumaLee?source=rss-9e26d32cee34------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*HDXO-wa5sl85Ph3-.jpg</url>
            <title>Stories by Takuma 不上班 on Medium</title>
            <link>https://medium.com/@TakumaLee?source=rss-9e26d32cee34------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 23:19:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@TakumaLee/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[ChatGPT for Everything]]></title>
            <link>https://medium.com/@TakumaLee/chatgpt-for-everything-1632821da61f?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/1632821da61f</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Wed, 05 Apr 2023 08:39:28 GMT</pubDate>
            <atom:updated>2023-04-05T08:39:28.677Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4PkVsHhSfJqPmtcRjZVd_Q.png" /></figure><h3>前言</h3><blockquote>ChatGPT 是一個由 OpenAI 開發的大型語言模型，可以進行自然語言處理相關的任務。由於其具有高度的通用性和靈活性，因此可以應用於各種工作和項目中。</blockquote><blockquote>在工作上，ChatGPT 可以用於各種文本相關的任務，例如自然語言理解、自然語言生成、問答系統、機器翻譯、文本分類、情感分析等等。對於需要處理大量自然語言文本的公司和組織來說，ChatGPT 的使用可以極大地提高效率和準確性。</blockquote><blockquote>另外，在其他項目上，ChatGPT 也可以發揮巨大的作用。例如，可以使用 ChatGPT 進行自動化寫作、自動化翻譯、智能客服、情感分析、自動化回答常見問題等等。這些應用將大大減少手動工作的負擔，同時也可以提高產品和服務的品質和用戶體驗。</blockquote><blockquote>總之，ChatGPT 的應用非常廣泛，可以滿足各種不同的需求。無論您是需要對大量文本進行分析，還是需要實現自動化寫作和智能客服，都可以考慮使用 ChatGPT。希望本文可以為您提供一些有用的訊息，讓您更好地了解 ChatGPT 的應用和價值。</blockquote><p>上述內容經由 ChatGPT 產生，只有這段文字算是我自己寫的？整篇文章接下來都會靠 ChatGPT 產生，我自己來校稿 (´･ω･`)</p><p>而以後應該也會因為 ChatGPT 而讓我重新跑來寫一些技術文章。</p><p>畢竟 ChatGPT 還是沒辦法把完全正確的技術情報提供出來，即使使用了 GPT 4，對於一些過於深入且新東西目前他還無法給予正確的資訊。</p><h4>使用由來</h4><p>寫技術文章需要付出大量的時間和精力，往往需要進行廣泛的研究和實踐。然而，對於很多人來說，這樣的投入可能超出他們的能力範圍，或者他們可能沒有足夠的時間來完成這些工作。這種情況下，ChatGPT 作為一個大型語言模型，可以為這些人提供有效的幫助。</p><p>使用 ChatGPT 可以讓文章的撰寫變得更加輕鬆和方便。通過提供基本的文章草稿，ChatGPT 可以根據相關主題和內容，自動補充更多的訊息和細節。這樣，作者可以省去大量的時間和精力，而且還能夠得到更加詳盡和完整的文章。</p><p>此外，ChatGPT 還可以為其他項目提供幫助。例如，在開發應用程式時，ChatGPT 可以提供有用的建議和提示，幫助開發人員快速解決問題。同時，ChatGPT 還可以提供自動化文本翻譯、自然語言理解等方面的支持，幫助人們更有效地處理語言相關的問題。<strong><em>除了要注意它可能還是會一本正經地說幹話以及說謊</em></strong></p><p>總之，ChatGPT 是一個非常有用的工具，可以為人們提供便利和支持，幫助他們更輕鬆地完成各種工作，尤其是與語言相關的工作應該是最完善的。</p><h4>如何應用於技術上</h4><p>在技術上使用 ChatGPT可以大幅度增加產值，因為它能夠提供快速且精確的解決方案，減少人工處理的時間和錯誤率。開發人員可以像一個資深的 PM 或需求確立者，而 ChatGPT 就像一個技術很好但還沒法做到完整架構規劃的 Jr. Developer，給予必要的規則就可以讓它擁有足夠品質的產出，例如：</p><ol><li>快速產生單元測試程式碼：開發人員可以透過提供測試樣本，讓 ChatGPT 自動產生單元測試程式碼，減少手動撰寫測試程式碼的時間和錯誤率。</li><li>提供邏輯實作與驗證的規則：ChatGPT 可以透過提供程式碼樣本和規則，幫助開發人員驗證邏輯是否正確，提高程式的品質和效率。</li><li>分析和 code review：ChatGPT 可以幫助開發人員分析程式碼和提供 code review 建議，讓開發人員更快速地找到和解決程式碼中的問題，同時提高程式的可讀性和可維護性。</li></ol><p>總體而言，ChatGPT能夠提高開發人員的工作效率和程式品質，減少開發成本和時間，同時提高軟體產品的品質和競爭力。</p><h3>Not by ChatGPT</h3><p>往後我會使用 ChatGPT 把更多技術細節的東西產生出來，當然會先驗證過，畢竟自己也踩了不少一臉正經給予錯誤資訊的雷</p><p>但畢竟還是有很多東西不是單純 ChatGPT 可以提供且正確的，所以之後我會把一些 ChatGPT 基本不會給出正確答案的東西或處理方法補上。</p><p>省了大量寫文章的時間就是爽٩(˃̶͈̀௰˂̶͈́)و</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1632821da61f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 的高效率高品質開發 — 使用 Koin, Kotlin, ViewModel, LiveData, Navigation]]></title>
            <link>https://medium.com/@TakumaLee/android-%E7%9A%84%E9%AB%98%E6%95%88%E7%8E%87%E9%AB%98%E5%93%81%E8%B3%AA%E9%96%8B%E7%99%BC-%E4%BD%BF%E7%94%A8-koin-kotlin-viewmodel-livedata-navigation-fc6715f28c24?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc6715f28c24</guid>
            <category><![CDATA[viewmodel]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[koin]]></category>
            <category><![CDATA[livedata]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Sun, 02 Feb 2020 10:57:42 GMT</pubDate>
            <atom:updated>2020-02-02T14:42:38.171Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android 的高效率高品質開發 — 使用 Koin, Kotlin, ViewModel, LiveData, Navigation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwRRyOzTaZ-L_-_b-iGDrg.jpeg" /><figcaption>紀念我家剛離開的菲爾</figcaption></figure><p>目前開發 Android 可以說是難度已經大幅度降低，包含各種官方元件工具也已越來越完整，比較少出現大地雷讓大家無以適從（當然還是有，像是 <a href="https://blog.danlew.net/2020/01/28/coroutines-and-java-synchronization-dont-mix">Coroutine 的 Thread lock 問題</a>）</p><p>由於近期還未連 Room 與 Coroutine 都實作在產品上，等實作完再看看是否適合一同放入本篇中</p><p>而目前開發起來非常順手的就是標題所說的五項元件工具 framework，下面稍微說明一下這五項的內容</p><h4>Koin</h4><p>給 Kotlin 使用的 DI framework，還不懂 DI 的朋友可以查查看 Dependency Injection，另一個是 Dagger，兩個的選用看個人，但兩個適合的情境不同，主要還是要看專案產品</p><h4>Kotlin</h4><p>Android 上取代 Java 的 JVM 語言，但實際上效能還是沒有比 Java 好，不過若是沒有追求極限效能，就轉 Kotlin 吧，外加本身內建多個語法糖，也有更多的防禦措施。e.g. Null Safety</p><h4>ViewModel</h4><p>在 MVVM 架構為基礎上，一個拆分邏輯運算與 UI 介面的…橋樑？<br>通常會把運算、事件處理後的「狀態」在此處進行更新後，使用 LiveData 進行資料更新通知，再讓 <strong><em>UI 進行更新</em></strong>，但是更新 UI 的職責並不會寫在 ViewModel 中，以此降低耦合度</p><h4>LiveData</h4><p><a href="https://developer.android.com/topic/libraries/architecture/livedata">官方文件</a><br>這是 Google 推出的一個可以註冊監聽器的 data holder class，當 LiveData 內的資料被變更時，他會通知註冊的 Lifecycle Owner<br>什麼是 <a href="https://developer.android.com/reference/android/arch/lifecycle/LifecycleOwner">Lifecycle Owner</a>？就像是 Activity, Fragment 這些有著 Lifecycle 的元件<br>為什麼要有這個呢？因為幫你直接控制在哪一個生命週期時應該被取消監聽，在哪一個生命週期時應該重新被註冊，好我在說廢話。</p><h4>Navigation</h4><p>目前觀察並使用起來已經算是很完整的一個 library，開發上需要用到的 fragment 流程可以節省大量的時間。當然如果你的產品專案的畫面切換流程是自定義的，而且自定義的複雜度非常高，那就不建議使用這個 library。</p><h3>如何搭配？</h3><p>如何使用就不說了，文件有詳細說明，這邊說如何搭配。<br>首先，唯一可以拆開的就是 Navigation，這個 library 就算不搭配其他東西也非常好用，可以節省開發上大量的頁面切換控制時間</p><p>需要搭配的就是以 Kotlin 為基礎的 Koin framework，在這之上的 ViewModel 控制以及在 ViewModel 上的 LiveData</p><p>當然再把 Kotlin 與 Koin 拿掉，只用 Java 來撰寫 ViewModel 與 LiveData 也是可以，不過 Kotlin 跟 Koin 真的太香了（欸</p><p>其實如何使用是不太想特別寫，畢竟一堆文件跟一堆文章都有說明了</p><pre><em>startKoin </em><strong>{<br>    </strong><em>androidContext</em>(this)<br>    modules(<em>appModule</em>)<br><strong>}</strong></pre><pre>val <em>appModule </em>= <em>module </em><strong>{<br>    </strong>single <strong>{<br>        </strong>MyAccount()<br>    <strong>}<br>    </strong>single <strong>{<br>        </strong>OkHttpClient.Builder()<br>                .connectTimeout(40, TimeUnit.SECONDS)<br>                .callTimeout(40, TimeUnit.SECONDS)<br>                .readTimeout(40, TimeUnit.SECONDS)<br>               <strong> </strong>.build()<br>    <strong>}<br>    <br>    </strong>single&lt;ApiDataProvider&gt; <strong>{<br>        </strong>ApiRepository(get())<br>    <strong>}<br>    </strong><em>viewModel </em><strong>{ <br>        </strong>MediaItemViewModel(get())<br>    <strong>}<br>}</strong></pre><p>以上為例，可以讓 koin 使用 <em>single</em> 管理在 application 層的 data，包括 OKHttp 的設定，以及 MyAccount 的 data class，就像是一個 singleton 一樣，整個 application 可以共用的資料都可以這樣擺</p><p>ApiDataProvider 是一個 interface，ApiRepository 實作 ApiDataProvider<br>舉例：</p><pre>interface ApiDataProvider {<br>    fun fetchData(callback: (List&lt;ApiData&gt;) -&gt; Unit)<br>    fun fetchDataDetailsInfo(id: String, onSuccess: (ApiData) -&gt; Unit, onFailed: (Int, String) -&gt; Unit)<br>}</pre><p>以下是實作：</p><pre>class ApiRepository(okHttpClient: OkHttpClient) : ApiDataProvider {<br><br>    var apiServiceImpl: ApiServiceImpl = ApiServiceImpl(okHttpClient)<br><br>    override fun fetchData(callback: (List&lt;ApiData&gt;) -&gt; Unit) {<br>        apiServiceImpl.fetchData(object : ApiServiceImpl.ServiceCallback {<br>            override fun onGetDataList(dataList: List&lt;Data&gt;) {<br>                callback(dataList)<br>            }<br><br>        })<br>    }<br><br>    override fun fetchDataDetailsInfo(id: String, onSuccess: (ApiData) -&gt; Unit, onFailed: (Int, String) -&gt; Unit) {<br>        <br>    }<br><br>}</pre><p>這裡應該會有個疑問<br><em>single&lt;ApiDataProvider&gt;<br>這裡為什麼要給他一個型別？</em></p><p>因為如果不給他這個 interface 的型別的話，他拿到的就會是 <em>ApiRepository </em>這個已經實作的 class</p><p>當然拿到 class 的話也是沒什麼問題的，只差在若是想要做測試，你有可能因為你的架構或是 class 內用到的元件而處處受限，所以會特別隔離出一個介面，在需要使用假資料測試時，建立一個 FakeClass 實作 <em>ApiDataProvider</em>，這樣就可以直接藉由實作了 <em>ApiDataProvider</em> 的 FakeClass 回傳假資料，然後把 <em>ApiDataProvider </em>這個介面注入到 ViewModel 裡，讓 Unit Test 可以利用 FakeClass 注入到 ViewModel，測試預期的資料或流程是否正確</p><h4>那 LiveData 呢？</h4><pre>val mediaButtonRes = MutableLiveData&lt;Int&gt;().<em>apply </em><strong>{<br>    </strong>postValue(playBtnRes)<br><strong>}<br><br></strong>var playBtnRes: Int = R.drawable.<em>ic_play_arrow_black_24dp<br></em>var pauseBtnRes: Int = R.drawable.<em>ic_pause_black_24dp</em></pre><p>他可以像是這樣給予一個資源檔的 id，然後將 <em>mediaButtonRes</em> 放在 ViewModel 內，經過邏輯運算當他被變更時，通知外層（Activity or Fragment）去根據 <em>mediaButtonRes </em>的 value 變更 UI</p><pre>viewModel.mediaButtonRes.observe(this, <em>Observer </em><strong>{ it <br>    </strong>imageView.setImageRes(<strong>it</strong>)<br><strong>}</strong>)</pre><p>如此一來，在需要變更圖片或是各種狀態的 UI 時，會先在 ViewModel 內更新完狀態（以上面的例子就是變更 <em>mediaButtonRes</em> 內的 <strong>value</strong>，再透過 Activity 或 Fragment 內的註冊監聽器，得到資料已變動的 callback，直接進行 UI 的更新</p><p>上述例子也可用在 TextView 或是各種其他的元件上<br>這樣子寫在 Activity 與 Fragment 內的邏輯就可以被轉往 ViewModel，藉此切分 UI 與邏輯，可維護性與可閱讀性大幅度提高</p><p>開發速度也會因為 ViewModel 的可通用性（當然要真的是同種用途，不同種還是要寫不同的 ViewModel，case by case）提高不少</p><h3>結語</h3><p>就以上的說明，不知道是否能讓大家體會開發包含測試，整體變得更加輕鬆與愜意，如果還未使用的朋友也可以立即嘗試使用試試看</p><p>我相信應該會與以往的開發習慣與速度，有相當大的區別和體悟</p><p>光是同時使用這五項元件（喔 Kotlin 是語言，Koin 是 Framework，不是元件，不等你們吐槽我自己吐）就可以讓你的程式開發速度提高、品質提高、可閱讀性可維護性也大量提高</p><p>當然，還是有可能會有濫用的情況，不過那就等濫用的時候再來說吧～</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5eK-YqSVejt23rP1Mq3ZKA.jpeg" /><figcaption>以此紀念我的愛貓・菲爾</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc6715f28c24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 的入門與初學・實戰篇（一）]]></title>
            <link>https://medium.com/@TakumaLee/android-%E7%9A%84%E5%85%A5%E9%96%80%E8%88%87%E5%88%9D%E5%AD%B8-%E5%AF%A6%E6%88%B0%E7%AF%87-%E4%B8%80-2afa3ac475d0?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/2afa3ac475d0</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[study]]></category>
            <category><![CDATA[junior]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[rookie]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Tue, 27 Aug 2019 00:31:01 GMT</pubDate>
            <atom:updated>2019-08-27T06:43:54.856Z</atom:updated>
            <content:encoded><![CDATA[<p>理論是給那些天才用的，像我這種庸才的凡夫俗子、凡骨，只能靠實戰訓練自己。當然在實戰中永久陣亡也是有可能的</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*-PKzBZR8rCZdDxK7jhiSHQ.gif" /><figcaption>實戰，就是要瘋狂！_(꒪ཀ꒪」∠)_</figcaption></figure><h3>前導</h3><p>上一篇說了<a href="https://medium.com/@TakumaLee/android-%E7%9A%84%E5%85%A5%E9%96%80%E8%88%87%E5%88%9D%E5%AD%B8-%E6%A6%82%E8%BF%B0%E5%BB%A2%E8%A9%B1-898d87bde988"><strong><em>初學的概述概論</em></strong></a>，所以這篇開始來直接講實戰<br>其實也是因為目前在公司開始每週稍微講解 Android 如何開發，開始誤人子弟，帶壞大家，所以就順便把使用的材料與內容釋出</p><p>那些讀書讀理論就能寫出一手好程式、漂亮的架構、完美不會有問題的 performance，這篇可能不適合你，因為這篇就是 try &amp; error 到自己理解為止的文章(╯‵□′)╯︵┻━┻</p><p>所以其實這種做法相對來說可能更加耗費你的時間與精力，這邊請自我掌控好自己比較屬於哪種學習方式，請用最適合自己的學習方式進行，可以的話要以最高效率的方式學習。</p><h3>Keyword、關鍵字</h3><p>承接上篇文章，若是你已掌握了關鍵字的學習方法，我想也應該已經不需要看這篇文章了，當然如果這篇文章對你還是有所幫助的話，就請繼續看下去吧。</p><h3>語言</h3><p>使用語言就都請轉用 <strong><em>Kotlin</em></strong> 進行，我絕對不會推 Java 的，打死不推，請用 <strong><em>Kotlin</em></strong> 進行開發。</p><h3>基本知識</h3><p>希望您至少要能夠擁有一些程式開發的基本知識，包括宣告（declare）、給值（assign）、因為不是手把手地帶著練習所以沒法把這些基本知識在實戰中一同帶給您。</p><h4>邏輯與畫面</h4><p>通常程式邏輯，需要運算撰寫各種行為模式的 code 只會寫在</p><pre>app/src/main/java/com.example.testbalabala</pre><p>這種路徑下，然後不包含邏輯，單純畫面的資源檔案則會放置於</p><pre>app/src/main/res</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*9WDGQ1kvbCN7guIMxepwZQ.png" /><figcaption>個人比較偏好這種原始排列</figcaption></figure><p>另外最上方的 Project 表示此表的排列方式，預設會是 Android，如下圖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*nAX77VRAcm41eHLVKsv2hQ.png" /><figcaption>以先輩整理過的資料夾顯示，本身資料夾的路徑並未改變，只是顯示上整理過</figcaption></figure><p>每個人偏好哪一種並沒有正確的答案，只有最符合自己的方式，所以哪種模式你比較喜歡，就去選用那個就好。</p><h3>實戰</h3><p>這篇文章只會講述實戰相關的一些流程與技巧，如果有些需要補充或疑問的再請留言。</p><h4>Product、Sample、Prototype</h4><p>所謂的實戰，就是直接將產品、idea 的原型、原案、自己想到的應用直接實作出來，實作過程中就會經歷以下幾個要素</p><ul><li>你的 APP 需求與功能分別是什麼</li><li>UI、畫面的呈現方式</li><li>UI Flow，實作 app 的流程，以及與使用者的互動行為</li><li>資料的呈現、擷取</li><li>資料的儲存方式</li><li>是否需要使用到網路行為</li><li>是否需要 Local 與 Server 個別的 Database</li><li>是否用到各種第三方服務</li><li>完成以上所有部分後的測試，是否會發生資料消失、UI 未正常呈現等等的問題</li><li>開發中是否時常遇到閃退問題</li></ul><p>粗略區分的話大概就是以上幾點，通常以上全部組合起來並解決後，就是一個完整的產品、Sample 或是 Prototype。</p><p>至於 Google Play 的使用者評價就暫時不在這邊的考慮範圍內，雖然我想大家希望做出來的 APP 可以被許多人使用，但無可避免的你懂，人多嘴雜就是嘴賤，然後動不動就送你一顆星，也不能對使用者說不爽不要用啊之類的，不過我還滿想看看有誰那麼有勇氣去說這句話的，我沒有就是。</p><p>所以記得做完 APP 上架後，你的心態要記得調整一下，這就是最後最重要的步驟（先搬到前面來說）</p><h4>範例、Sample</h4><p>我知道不是所有人都會有 idea 跟那個機會擁有實作產品或 prototype 的機會，所以在這邊我提供一個練習用的 idea 讓大家自己嘗試看看</p><blockquote>Pokemon、寶可夢、神奇寶貝 實作（以下使用 Pokemon 或寶可夢）</blockquote><p>這邊提到 Pokemon 的原因是，比較大眾化、很多人都玩過或聽過看過，大致上知道有些什麼要素，比較不需要特別說明相關需求，啊所以如果不懂寶可夢的先去把過去小智ㄓㄤ…的 20 年打不到冠軍的遊歷看完，然後就萌大奶（沒問題）了！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*lRLaAf-QTgqYLFrV.jpg" /><figcaption>小智 20 年練就的臂力，工程師 20 年你就可以練就……</figcaption></figure><p>我們先遵照上面所說的實作過程的幾個步驟</p><blockquote>你的 APP 需求與功能分別是什麼</blockquote><p>不用太難，簡單的就好</p><p>需求：皮卡丘跟水箭龜兩隻在同一個畫面裡互打扣血</p><blockquote>UI、畫面的呈現方式</blockquote><h4>皮卡丘</h4><ul><li>一隻皮卡丘的圖片</li><li>一個皮卡丘名字的文字顯示</li><li>皮卡丘的血量文字顯示</li><li>皮卡丘的血條顯示</li><li>皮卡丘的攻擊按鈕</li></ul><h4>水箭龜</h4><ul><li>一隻水箭龜的圖片</li><li>一個水箭龜名字的文字顯示</li><li>水箭龜的血量文字顯示</li><li>水箭龜的血條顯示</li><li>水箭龜的攻擊按鈕</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*Unnbkr1CylwtsEns7zRugg.png" /></figure><blockquote>UI Flow，實作 app 的流程，以及與使用者的互動行為</blockquote><ul><li>點擊皮卡丘的攻擊按鈕，水箭龜會扣血，血量文字與血條都會有所變動</li><li>點擊水箭龜的攻擊按鈕，皮卡丘會扣血，血量文字與血條都會有所變動</li></ul><blockquote>資料的呈現、擷取</blockquote><ul><li>承上，顯示皮卡丘與水箭龜的血量文字與血條</li><li>取得目前皮卡丘與水箭龜的血量（其中一方攻擊時對面血量不應該回復）</li></ul><h4>Lesson 1</h4><p>到此針對於簡單的範例與描述，我想目前先以以上的目標執行即可，若是希望更加進一步，我想您可以試著做出一個實際的 Pokemon 多個技能與回合制的戰鬥方式。</p><p>目前第一個範例先做到這裡即可（絕對不是因為我每週只有一天會在公司內實作這個）</p><h4>元件</h4><p>我想在製作時會遇到的另一個問題就是關於 UI 的元件，雖然這部份說去看文件就好，但這應該太折磨新手。</p><p>所以這邊列出您在實作中會使用到的元件，然後再去調查他的相關用法即可</p><p>而元件這種東西，就是用越多你就懂越多，所以不用急於一時、也不用特別焦慮還有多少元件不會，Android Studio 開啟 layout/***.xml 之後，你就會看到 Design &amp; Text 的 tab 了。</p><p>你可以使用 Design 的方式拖曳，也可以用 Text 的方式直接撰寫 UI code，當然 Design 的拖曳會遇上各種特別的問題，這邊暫時不多詳述，因為…問題太多了。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*txhT6N1dJIeoyJryt3eOlw.png" /></figure><p>所以很多工程師為了節省時間，其實都是直接自行撰寫 xml，不然光是拉個元件設幾個參數而已，大概就會以小時為計浪費掉這些時間。</p><h4>小技巧</h4><p>實作中會發生完全不知道如何下手的情況，這時候如果您宣告的一些元件，像是 TextView，您給的 id 或是 field 命名假定為 textPickachu，您希望設置文字在這個 UI 的 View 上面，您可以試著打出 tex…，如此 Android Studio 這個開發環境就會將包含「tex」相關的元件都列出來，供您選擇您需要的</p><p>待您選好後，為了呼叫該元件內部的功能或方法，您可以直接一個點：</p><pre>textPickachu.text = “皮卡丘”</pre><p>通常您只要打一個字，Android Studio 的 AutoComplete 機制就會幫助您列出可以用的相關內容，然後您可以直接觀察那些內容的描述，通常就能找出您真正需要的東西。</p><p>太棒了，連看文件都不用呢！追 Code 就可以學到東西了！</p><h4>keyword</h4><p>這邊還是要再補充 keyword，您會用到相當多的方法，而方法的命名都有其邏輯，像是你要設置一些內容到 UI 上，只要對 UI 的元件打出 .set***，通常就會列出你希望的東西</p><h4>example</h4><pre>image.setImageResource(R.drawable.ic_launcher)<br>text.setText(&quot;我要成為貓奴王&quot;)</pre><h4>如果您希望的是取得某些東西的話</h4><pre>text.getText()<br>json.getString(&quot;pokemon_name&quot;)</pre><h3>命名命的好，寫 Code 沒煩惱</h3><h3>Github</h3><p>關於 sample 程式碼的部分，我都還沒有整理的放在 Github 上了，自己去拿吧</p><p><a href="https://github.com/TakumaMochizuki/AndroidLesson-Pokemon">AndroidLesson-Pokemon</a></p><p>然後關於有哪些元件哪些初學的內容可以學習？</p><p>我推薦大家可以去看看 Rick Wu 寫的 <a href="https://givemepass.blogspot.com/">GiveMePass</a></p><p>之後再找一些時間整理一下一些中文相關學習資源給大家，中國的話就不一定，中國裡面的 Copy Paste 太過氾濫，對的資訊裡面都參雜錯的內容，所以會稍微篩選一下。</p><h3>Lesson2</h3><p>下一個階段…或許大家都自學學會了吧？應該不需要講解了吧？</p><p>下一個階段大概等週五講完實作完後會再釋出吧？有空的話？</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2afa3ac475d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 的入門與初學・概述廢話]]></title>
            <link>https://medium.com/@TakumaLee/android-%E7%9A%84%E5%85%A5%E9%96%80%E8%88%87%E5%88%9D%E5%AD%B8-%E6%A6%82%E8%BF%B0%E5%BB%A2%E8%A9%B1-898d87bde988?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/898d87bde988</guid>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Mon, 05 Aug 2019 15:39:41 GMT</pubDate>
            <atom:updated>2019-08-06T04:34:38.105Z</atom:updated>
            <content:encoded><![CDATA[<h4>就是一篇稍微描述一下 Android 的幹話文章</h4><h4>最近無論是在網路上還是實體聚會，似乎越來越多新手出現，並且都提出了相似的問題</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2tRCeFk-WoGL_Q2cHJCRvQ.jpeg" /></figure><h4>要怎樣才能像貓一樣不上班不工作睡爽爽</h4><p>喔抱歉，這是所有人的疑問，然後回答就是：</p><h3>「乖乖當貓奴工作奉養他們吧。」</h3><h4><strong>各種疑問像是以下：</strong></h4><p>我是新手該怎麼學習？<br>什麼是套件？<br>有哪些資源？<br>為什麼我寫的 app 會閃退？<br>我要怎麼刻出一個甘特圖？<br>我原本不是寫 app 的，但是有點興趣，可是不知道概念</p><p>…………</p><p>………</p><p>……</p><p>…</p><p>所以我們該怎麼做？身為一個新到不能再新的新手該怎麼學習？原本是其他領域的工程師要怎麼學習一個跟自己原本領域差距不算小的技術？</p><p>由於新手跟已是工程師的朋友的學習方式還是有點差距，所以還是先從初心者開始敘述</p><h3>Get Started</h3><p>開始之前先提供兩個資源連結，Google 就不放上來了，如果連 Google 都不會你可能要先考慮一下別的出路。</p><p><a href="https://stackoverflow.com/">Stackoverflow</a><br><a href="https://github.com/">Github</a></p><h4>開始正題</h4><p>新手跟有點經驗的工程師之間的差距在於<strong><em>關鍵字</em></strong>，<strong><em>keyword</em></strong> 的多寡<br>那有點經驗的工程師跟更加資深能力更強的，大約在接近 Senior 程度的工程師，差距在哪呢？</p><blockquote>更多的關鍵字<br>資源資訊的正確性<br>查看並理解原文文件</blockquote><p>這裡就不探討更資深的強力工程師甚至大神了。</p><p>所以就以上來看，初學新手最需要的是 <strong><em>關鍵字</em></strong> 、<strong><em>keyword</em></strong>，為什麼我要在後面再補上一個英文呢？因為你是工程師對吧？你寫程式是用英文對吧？你的資料來源不該僅僅只是中文圈才對，自學能力、資訊搜尋能力、資料來源正確性，每個都是你應該具備並且訓練起來的能力，嘛這只是後話。</p><p>如果你只熱衷於查看中文的教學，甚至只看那廣大中國的各種抄來抄去的教學文，那你終究會發現：</p><h3>為什麼照著上面做卻閃退了？</h3><p>因為有非常非常多的文章講的理由是錯的，所以解決方法也是錯的，也有理由是對的，但解法是錯的，只是當下似乎他解決了，卻不代表「其他 Device」、「其他操作流程」、「使用者習慣」正常 work。</p><p>然後當你發生這個問題時，你又只看中文的文章，也不去看 source code，你就會像是撞上長城，不知道如何爬過去，VPN 開下去也被ㄓㄨ…</p><p>以上你可以得知：<br>英文關鍵字是非常重要的。<br>英文閱讀能力也是非常重要的。<br>不要因為害怕就不去讀不去唸。</p><h4>不然其實我覺得你去賣雞排比較有錢途。</h4><h4>關鍵字（Keyword）</h4><p>你要如何得到更多更大量的關鍵字呢？除了大量閱讀、大量撰寫外還有什麼方法嗎？</p><p>這邊其實沒有一定答案，找一個 mentor 或前輩，不停地追問或許是一個辦法，只要你有點慧根或是不會太死纏爛打應該有空的人會很願意解答。當然也會有老手說：「為什麼連這個都不會？」、「為什麼不 Google？」、「Google 第一頁就有了啊！」</p><p>我想我應該還是比較能理解新手完全不知道如何著手時的感受<br>看看那俗稱背就好的作業系統，我被當了三年，最後還是老師看不下去給我 60 分及格過。<br>所以當各個老手給出這些回覆時，或是給出的回覆你完全看不懂時，真心建議找個教練或是顧問，好好的一對一帶你。當然如果你的自學能力足夠強、對自己的自學能力也很有自信，這些就都不是問題，隨便上個資策會的課程應該都可以飛黃騰達，因為你本身就是這種人，所以這種人會來看這個文章嗎？可能會有吧？大概稍微受挫了一點所以找不到方向的這種我也大概略知一二。如果你屬於這種就直接往下繼續看吧！</p><p>以上這些其實橫跨其他語言其他技術，不侷限於 Android。</p><h4>How to use?</h4><p>那麼在 Android 方面你該怎麼下關鍵字呢？</p><ol><li>Android</li><li>Android</li><li>Android</li></ol><p>首先你要找的東西，必須先鎖定為 Android 的範圍才行<br>接下來就是一個空白後，接你想找的「東西」</p><ol><li>View</li><li>Layout</li><li>Lifecycle</li><li>Activity, Service, Content Provider, BroadcastReceiver</li><li>Fragment</li><li>SQLite</li></ol><p>以上是 Android 的一些基本元素，那麼要進階一點的話呢？</p><ol><li>Custom</li><li>SDK</li><li>Library</li><li>Material</li><li>Ripple</li></ol><p>當然以上都只是舉例，實際上會遇到的還是很多很多，如何增加使用的量跟使用時機的知識與技巧，與其說明不如提供明確資源應該更有幫助，所以接下來會開始列出實際上會用到的關鍵字以及資源</p><h3>所以上面的其實全部都是廢話，下面才是正題</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQFq1b36kVHA0rw7AEqUqg.jpeg" /><figcaption>貓都會了，你呢？（我只想當貓）</figcaption></figure><h4>做中學</h4><p>如果你適合這個學習法，你需要的是直接找一個專案，或是自己想一個 app 來做，你可以參考市面上所有的 app，他們有的所有的畫面你可以想想如何刻出來，然後就是把各種你看到的元件，用中文也行，拿去 Google 搜尋，一定可以找到類似的關鍵字。</p><h4>找師傅</h4><p>找師傅是最快的方式，不要跟師傅拚拳，要嘗試斷他電路，這樣他就會受不了來教你了（誤）</p><p>當然要找一個真的會教的人…有些人是會做不會教，要注意。</p><h4>官方學習連結</h4><p><a href="https://developer.android.com/docs">Android Developers Doc</a><br>我再強調一次，如果你比較屬於做中學習的方式，然後連學習方向都不確定又無法靜下來好好按部就班看的就別來看官方學習的東西了，那只會減緩你的速度。</p><p>官方學習內容非常齊全，非常適合跨過新手，成為 Junior 往 Senior 路上的朋友。</p><h4>Github</h4><p><a href="https://github.com/wasabeef/awesome-android-ui">Awesome-Android-UI</a><br>由日本 GDE (Google Developer Expert) 做的 repo 整理，裡面還是有相當多的 UI 設計整理，對於製作 app 該怎麼用 UI 有疑問的可以先看這裡。</p><p>而所謂的套件、Library、SDK 就像是這種，幫你整理好、做好，你只要拿去用就行，通常裡面都會有如何使用在自己的 project 裡的導覽，照著做即可。</p><h4>Lifecycle</h4><p>我其實不是很推薦新手要在什麼都不清楚的狀況下弄懂這個東西，通常也只是一知半解而已，除非你是一個看文件看說明看原理就知道他在幹嘛的天才，不然還是建議在實作專案中去嘗試去理解就好。</p><p>不過越基本越是原理的東西，通常就是你可以解決所有你產生出的問題的萬能藥，所以不管如何，不管要現在還是以後，你都還是必須理解，時間早晚的問題而已。</p><h4>不推薦初學階段就想弄懂的東西</h4><ul><li>Lifecycle</li><li>BroadcastReceiver</li><li>Service</li><li>Content Provider</li><li>RxJava</li><li>MVP, MVVM</li></ul><h4>推薦初學階段先弄懂的東西</h4><ul><li>Custom View（客製化 UI）</li><li>Adapter</li><li>SQLite</li></ul><h4>上面弄懂後再來就比較適合的東西</h4><ul><li>Lifecycle</li><li>Content Provider</li></ul><p>至於其他可能工作上還是會用到的東西不算在會推薦先去理解的範圍內，像是 RxJava，有些東西連稍微有點經驗的都不一定可以說得很準確，所以那是下一個階段，當你跨過關鍵字過少的階段時要學習的重點項目。</p><h3>Android 概念</h3><p>Android 是一個很特別的東西，他就像是一個前端網頁加上後端 server 的一個輕量化全端平台，然後根據專案，他還是有可能需要透過網路溝通來取得 server 後端的資料庫資料。</p><p>但他本身還是有被稱作 SQLite 的輕量化資料庫，所以針對資料流的處理產生了 repository 的概念，甚至進一步衍生出 use case。</p><p>然後資料處理如果過於大量，又會導致 UI block，進而發生 ANR，你的畫面就會死在那裡，專有名詞是 freeze，就像世界結凍一樣動不了，然後系統就會跳一個 dialog 告訴你 app 沒有回應，是否要等待或是終止。</p><p>為了因應這個問題而有 thread 做控管，中國文章應該都是叫線程，台灣稱為執行緒，而與網路的溝通，在很早以前的版本放在 UI thread（render 畫面的執行緒）是沒有問題的，但在某個版本後這樣會在 runtime （app 執行的時候）時噴錯，至於某個版本是哪個…</p><blockquote>我忘惹，然後一時也找不太到就先放棄了，待有人補充</blockquote><p>由於網路溝通可能會因各種狀況 timeout、終止、等待太久才回傳值，這時候如果還是在繪製 UI 的 thread 進行等待的話，顯然易見你的 app 就會像時間暫停一樣被凍結，完全無法動作。</p><p>所以 Android 本身有著資料處理所需 thread，以及繪製、渲染（render） UI 所需的 main thread，然後在這種狀態下為了程式碼不要太難看要有些規律而因此有了 MVP、MVVM 等等的架構。</p><p>所以你開發 Android 的話其實多多少少都能夠累積一些前後端的知識，嘛多多少少…就真的是多多少少……</p><h3>結論</h3><p>目前 Google 官方文件真的是非常詳盡，當你跨過一些初學門檻之後，Google 官方文件帶來的效益會是等比級數的提高，有些東西需要時間跟經驗累積，慢慢來比較快，不要急著覺得看懂了就以為懂了，通常過幾天幾個月後你再看一次又有可能有新的體悟。</p><p>若是有其他人也想給找不到方向的新手一些建議的，歡迎留言補充說明～</p><p>(´▽｀)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=898d87bde988" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DI & Testing]]></title>
            <link>https://medium.com/series/di-testing-51aa98721398?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/51aa98721398</guid>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Sat, 29 Dec 2018 19:37:14 GMT</pubDate>
            <atom:updated>2018-12-29T19:40:39.202Z</atom:updated>
            <content:encoded><![CDATA[<p>DI &amp; Testing Step 1</p><p><a href="https://www.youtube.com/watch?v=kgENC3JYqrk">Video</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51aa98721398" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android]]></title>
            <link>https://medium.com/series/android-be550ee65455?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/be550ee65455</guid>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Fri, 01 Jun 2018 15:39:09 GMT</pubDate>
            <atom:updated>2018-06-01T15:39:09.244Z</atom:updated>
            <content:encoded><![CDATA[<p>Kotlin, Java(deprecated), MVP, Unit Test… study everything</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9HvlQz6WhiUNZWkhbV9P4Q.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be550ee65455" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【Android】Dump SQLite « 夢の回廊]]></title>
            <link>https://medium.com/@TakumaLee/android-dump-sqlite-%E5%A4%A2%E3%81%AE%E5%9B%9E%E5%BB%8A-63f73af82280?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/63f73af82280</guid>
            <category><![CDATA[dump-database]]></category>
            <category><![CDATA[sqlite]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[db-browser-for-sqlite]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Tue, 27 Dec 2016 00:00:00 GMT</pubDate>
            <atom:updated>2016-12-27T13:38:39.776Z</atom:updated>
            <content:encoded><![CDATA[<p>【Android】Dump SQLite « 夢の回廊</p><p>又欠這篇很久了…… 主要還是來記錄一下要如何查看 Android SQLite 的欄位資料</p><p>下一篇是 Google Project exceed limit</p><p>不過還是先來寫這篇 寫一寫發現 Logdown 的編輯器真的有夠爛……</p><p>也該是時候換去 medium 了</p><p>剛好也是時候自己試著架網站了</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*dKoyXbCdMB0LVNmc.jpg" /></figure><h3>正文</h3><p>首先目前有兩種方法</p><ol><li>最近看到的 <a href="https://github.com/amitshekhariitbhu/Android-Debug-Database">Android Debug Database</a> logdown一直刪我文字他喵的</li><li>Dump (Export) SQLite Database</li></ol><p>在這邊採用第二種方法，第一種還沒試過改天再來試試看</p><p>然後 Mac 使用者準備好一個工具 <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a></p><p>首先我先拿我目前的 Project 來做範例</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*3GfXmOUuUtp7bcDQ.png" /></figure><p>再來就是在自己程式碼裡加入以下這段 Code ，將 DB 儲存至 External Storage<br> 記得要將 DATABASE_PATH + DATABASE_NAME 轉成自己原先 SQL 存放的位置</p><pre><strong>private static void </strong>backupDatabase() <strong>throws IOException </strong>{<br>    <em>//Open your local db as the input stream<br>    </em><strong>String </strong>inFileName =  <strong><em>DATABASE_PATH </em></strong>+ <strong><em>DATABASE_NAME</em></strong>;;<br>    <strong>File </strong>dbFile = <strong>new </strong>File(inFileName);<br>    <strong>FileInputStream </strong>fis = <strong>new </strong>FileInputStream(dbFile);<br><br>    <strong>String </strong>outFileName = <strong>Environment</strong>.<em>getExternalStoragePublicDirectory</em>(<strong>&quot;/DMCollector/DMCollectorDB&quot;</strong>).getPath();<br>    <em>//Open the empty db as the output stream<br>    </em><strong>OutputStream </strong>output = <strong>new </strong>FileOutputStream(outFileName);<br>    <em>//transfer bytes from the inputfile to the outputfile<br>    </em><strong>byte</strong>[] buffer = <strong>new byte</strong>[1024];<br>    <strong>int </strong>length;<br>    <strong>while </strong>((length = fis.read(buffer))&gt;0){<br>        output.write(buffer, 0, length);<br>    }<br>    <em>//Close the streams<br>    </em>output.flush();<br>    output.close();<br>    fis.close();<br>}</pre><p>然後你就能在 External Storage 裡看到儲存的 DB 檔案</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*2cMHdp8DWIiOohPY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*l8GbTQVxWbt3CSuR.png" /></figure><p>檔案出來了後其實也有很多方法可以將檔案拿出來<br> 不過這邊還是用 Terminal 的方式快一點</p><p>adb pull mnt/sdcard/DMCollector/DMCollectorDB ~/Documents/work/Takuma/DM</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*CgetP3D67OraE-LX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EeHw92JPSf6R2Iy3.png" /></figure><p>然後就可以用上面說到的工具 <a href="http://sqlitebrowser.org/">DB Browser for SQLite</a> 來開啟了 以下是欄位資料：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*u93PNRXvbIDq6fUG.png" /></figure><p><em>Originally published at </em><a href="http://takuma-nekomayoi-blog.logdown.com/posts/2016/12/27/1249284"><em>takuma-nekomayoi-blog.logdown.com</em></a><em> on December 27, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63f73af82280" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Line Developer Day 2016 — Open « 夢の回廊]]></title>
            <link>https://medium.com/@TakumaLee/line-developer-day-2016-open-%E5%A4%A2%E3%81%AE%E5%9B%9E%E5%BB%8A-674d6bc17de1?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/674d6bc17de1</guid>
            <category><![CDATA[line]]></category>
            <category><![CDATA[line-developer-day-2016]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Wed, 19 Oct 2016 00:00:00 GMT</pubDate>
            <atom:updated>2016-10-25T19:39:23.914Z</atom:updated>
            <content:encoded><![CDATA[<p>Line Developer Day 2016 — Open « 夢の回廊</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*iTtZi46S27UuOKvA." /></figure><p>今年的 <a href="http://linedevday.linecorp.com/jp/2016/">Line Developer Day</a> 2016 在 9/29 東京澀谷舉辦<br> 由於 <a href="https://www.facebook.com/nobody.yu?fref=ts">Aki</a> 的推薦才讓我有這個機會受邀去參加這場開發者聚會</p><p>在此要先感謝 <a href="https://www.facebook.com/valeriiive?fref=ts">Valeri</a> 和 <a href="https://www.facebook.com/heliumlife?fref=ts">Huiyi</a><br> 以及感謝 Line 提供機票與住宿</p><p>其實原本當天結束與回台灣後就該撰寫避免忘記<br> 但其實隔週有 Google DevFest Tokyo 與 再隔一週的 JCConf<br> 時程排太緊變成現在才來寫，不過應該已經有很多篇文章了，台灣去的開發者其實也不少</p><p>不過就還是讓我來報告並整理一下這次開發者日的資源吧！</p><h3>各 Session 錄影</h3><h4><a href="https://live.line.me/r/channels/31960">HALL-A</a></h4><h4><a href="https://live.line.me/r/channels/31959">HALL-B</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-1-opening-introduction">【A-1】Opening &amp; Introduction</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-2-new-world-by-the-line-bot">【A-2】New World by the LINE Bot</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-3-difficult-challenges-that-line-has-overcome">【A-3】Difficult Challenges That LINE has Overcome</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-4-line-login-line-platform">【A-4】LINE Login — LINE Platform</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-5-security-x-line-platform">【A-5】Security x LINE Platform</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-6-group-app-platform">【A-6】Group App Platform</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-7-architecture-sustaining-line-live">【A-7】Architecture Sustaining LINE LIVE</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-8-line-group-call">【A-8】LINE Group Call</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-9-line-shop-powered-by-armeria">【A-9】LINE Shop Powered by Armeria</a></h4><h4><a href="http://www.slideshare.net/linecorp/a-10-working-environment-and-culture-for-line-engineers">【A-10】Working Environment and Culture for LINE Engineers</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-1-rinna-and-rinna">【B-1】Rinna and rinna</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-2-line-game-cloud-our-personal-ec2">【B-2】LINE Game Cloud — Our Personal EC2</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-3-line-bot-live-coding">【B-3】LINE Bot Live Coding</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-4-gravty">【B-4】Gravty: A Graph Database for LINE Timeline</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-5-stellitequotapply-chromium-opensource-to-line-gamequot">【B-5】Stellite: Apply Chromium Open-Source to LINE Game</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-6-new-stream-processing-platformwith-apache-flink">【B-6】New Stream Processing Platform with Apache Flink</a></h4><h4><a href="http://www.slideshare.net/linecorp/b-7-a-true-agile-team-global-line-news-66467006">【B-7】A True Agile Team — Global LINE News</a></h4><h4>入場報到處</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*DLcBkWkgNM4KpVd6.JPG" /></figure><h4>參加者專用的 Line Bot</h4><p>整場會議的資訊都會在上面通知，包含每個 session 的 slide，稍後會將其整理出來</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*qGjzuVwB_vrWpep0.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*Bhl3xqSyCW0_gPxF.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*570zs-dV7RjlXV_k.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yNzgQ1wk6Bx-jlhP.jpg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*AgQayugV9q6RUtds." /></figure><h3>CTO <a href="http://linedevday.linecorp.com/jp/2016/#A-1">Park Euivin</a> 開場</h3><h4>坐太前面結果沒法拍完整個螢幕……</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*KLIixC4CM1fc6LtP." /></figure><h4>Agenda</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8d74hKLhcgA0MALO.jpg" /></figure><ul><li>Line Today</li><li>Smart Portal</li><li>Tech Focus</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*8oXsTtlgfr-ie4Ff." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*mrYiAop5UF3y8lnw." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*FGIlstRN_8iax1HE." /></figure><p>這次的開發者聚會講題以 content platform、infra platform、message app，透過 smart portal，進而縮短人與人之間的距離為主。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*6lGaPU8bOJqYmGeT." /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*ZfrtJzPN9z2j4JRG." /></figure><p>後以 Open 為方向分享 Message API、Chat Extension、Large-Scale Platform、Big Data等技術上的架構與應用，並在 Github 開源、提供技術領域的人共同參與（我忘了有沒有 Github 連結了可能要找一下）。</p><p><a href="http://www.slideshare.net/linecorp/a-1-opening-introduction">Slide 傳送門</a></p><h3>LINE BOT</h3><p><a href="http://linedevday.linecorp.com/jp/2016/#A-2">松野徳大</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*SZRB5hUUpfdH1E9_." /></figure><h4>Agenda</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*vIRELxjE3BD7frny." /></figure><ul><li>LINE Notify</li><li>LINE Message API</li></ul><p>其實我有點想直接貼一堆照片交差了事（拖走）</p><h4>LINE Notify</h4><p>此服務為免費，並未提到付費限制相關的資訊</p><p>推播通知的服務，可以直接透過 OAuth2、Https Api 來與 IFTTT(if this then that) 溝通 <a href="https://ifttt.com/">#IFTTT網站</a></p><p>類似 GCM、FCM 的用法</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*s5DK6PWbWRbm-6vW." /></figure><h4>LINE Message API</h4><p>此 api 已開放於 <a href="https://github.com/line/line-bot-sdk-java">Github</a> 上，為了能在 Bot 應用上透過此 api 來獲得更多的應用創新，進而強化平台與內容的深化。</p><p>PS: <a href="https://www.facebook.com/photo.php?fbid=10210928928688588&amp;set=a.10200170015002470.191478.1514263143&amp;type=3&amp;theater">目前有人測試過有些相關 BUG</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*MH4fwWaJB-ChOA9I." /></figure><p>BOT SDK 支援 Java, golang, Ruby, PHP, Perl5</p><p>另外 松野さん 其實還提到了許多關於這兩個開放 api 的相關技術與架構，不過果然時間過太久有點忘了，我會再一一翻閱 slide 後有想起什麼就馬上補衝上來</p><p><a href="http://www.slideshare.net/linecorp/a-2-new-world-by-the-line-bot">Slide 傳送門</a></p><p>不過當場有直接 demo bot 的應用，其實就像是直接把目前現有的「找餐廳」之類的服務打趴的功能<br> 同時還能直接由 BOT 發 Push 給使用者，但這些細節會需要再去看一下文件<br> 在 Slide 內有關於 Bot push 的一些架構流程，請先稍微參閱一下</p><p>這幾天會慢慢補上一些細節，補完 Line Developer Day 2016 之後就是補 Google DevFest 2016 Tokyo 了～</p><p><em>Originally published at </em><a href="http://takuma-nekomayoi-blog.logdown.com/posts/2016/10/19/line-developer-day-2016"><em>takuma-nekomayoi-blog.logdown.com</em></a><em> on October 19, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=674d6bc17de1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【Android】Google Analytics 踩地雷 « 夢の回廊]]></title>
            <link>https://medium.com/@TakumaLee/android-google-analytics-%E8%B8%A9%E5%9C%B0%E9%9B%B7-%E5%A4%A2%E3%81%AE%E5%9B%9E%E5%BB%8A-5b6afbbb1769?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b6afbbb1769</guid>
            <category><![CDATA[google-analytics]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Sun, 24 Apr 2016 00:00:00 GMT</pubDate>
            <atom:updated>2016-04-24T09:20:43.380Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*jiGSxowuvUEiPKQ6.gif" /></figure><p>因為在升級一堆 library 版本<br> 然後踩了一堆雷<br> 然後最令人厭煩的事 google service lib 的版本一直說跟 8.3.0 有衝突<br> 然後完全編譯不過</p><p>Please fix the version conflict either by updating the version of the google-services plugin.</p><p><a href="http://stackoverflow.com/questions/34398191/found-com-google-android-gmsplay-services8-4-0-but-version-8-3-0-is-needed-fo">解決方案在此</a></p><p>最後竟然是要把</p><p>apply plugin: ‘com.google.gms.google-services’</p><p>放到 app 的 build.gradle 的「最後」，放在最下面<br> 結果就 Build Successful ……</p><p>搞了我一天啊！！！</p><p>還有順序性的啊？！<br> 這到底是為什麼啊囧！！！</p><p>(╯°Д°）╯︵ /(.□ . )</p><p><em>Originally published at </em><a href="http://takuma-nekomayoi-blog.logdown.com/posts/2016/04/24/android-google-analytics-minesweeper"><em>takuma-nekomayoi-blog.logdown.com</em></a><em> on April 24, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b6afbbb1769" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[【Python】入門・ 從安裝衝到爬蟲・實作階段 − crawler 筆記 « 夢の回廊]]></title>
            <link>https://medium.com/@TakumaLee/python-%E5%85%A5%E9%96%80-%E5%BE%9E%E5%AE%89%E8%A3%9D%E8%A1%9D%E5%88%B0%E7%88%AC%E8%9F%B2-%E5%AF%A6%E4%BD%9C%E9%9A%8E%E6%AE%B5-crawler-%E7%AD%86%E8%A8%98-%E5%A4%A2%E3%81%AE%E5%9B%9E%E5%BB%8A-c8fb2cf16530?source=rss-9e26d32cee34------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8fb2cf16530</guid>
            <category><![CDATA[web-crawler]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Takuma 不上班]]></dc:creator>
            <pubDate>Thu, 11 Feb 2016 00:00:00 GMT</pubDate>
            <atom:updated>2016-04-08T20:18:29.222Z</atom:updated>
            <content:encoded><![CDATA[<h3>★ 前序</h3><p><a href="http://takuma-nekomayoi-blog.logdown.com/posts/2016/02/09/python-introduction-to-python-crawler-notes">【Python】入門・ 從安裝衝到爬蟲・準備階段 − crawler 筆記</a></p><h3>★ 正文</h3><h3>サービスです</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/0*8_Rwj8EAew0iT-Zy.jpg" /></figure><p>首先要先記錄一點<br> 就是<a href="http://codex.wiki/question/1859511-9818">TypeError</a>的錯誤<br> 簡單來說就是型態宣告不同導致，而 python 無需事先定義宣告變數型態，所以在撰寫時要注意這個問題<br> 當初我卡這邊卡了一兩個小時才發現……</p><p>所以 Error Log 很重要，請不要忽視～</p><p>上一篇有說到 lib import 是不同的，所以這部分要稍微注意一下，這篇就繼續開始寫下去（其實已經快寫完了）<br> 這篇開始主要是要分析要爬的資料到底長成什麼鬼樣子，然後從中取出來<br> 除了 HTML Parser 外，活用 Regex 以及內部 string 的 method 會是捷徑</p><p>……<br> 雖然想找範例可是好像會有點問題所以……<br> 直接就我有用到的每個地方做簡單解說跟筆記呈現好了</p><ol><li>讀檔（json）</li><li>寫檔（json）</li><li>印出</li><li>迴圈</li><li>if else</li><li>json array object</li><li>boolean</li><li>讀取需要爬蟲的網站 html</li><li>regex</li></ol><h3>1. 讀檔（json）</h3><p>讀 json 檔</p><p>with open(‘xxx.json’) as data_file: data = json.load(data_file)</p><h3>2. 寫檔（json）</h3><p>將 json 寫入檔案中</p><p>with open(‘NewFile.json’, ‘w’) as f: json.dump(arrayList, f)</p><p>修正：＠Ching Yi Chan（qrtt大神） 該寫 dict 與 list，不是寫 json object 跟 json array</p><p>參考資料：<a href="http://kaira.sgo.fi/2014/05/saving-and-loading-data-in-python-with.html">寫入與讀檔</a><br> 參考資料：<a href="https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch06s02.html">寫入與讀檔</a></p><h3>3. 印出</h3><p>為什麼要特別多出印出呢？不就 print 嗎？<br> 其實不是，單純的 print 會把 json 資料當成字串印出，我們要分析資料其實很難看<br> 所以我有用另外一個 lib： pprint</p><p>pprint import</p><p>from pprint import pprint</p><p>這樣就可印出乾淨的 json 資料了<br> （題外話：我本來想有個連結可以導去上一篇 import lib 的位置，結果似乎 logdown 不支援……真的要換 blog 了）</p><h3>4. 迴圈</h3><p>for迴圈大家應該都很熟悉<br> 不過有兩種寫法大家應該也很熟悉<br> 一個是用第幾個位置（i）來做計算，一個是直接跑裡面有多少個物件的 for each</p><p>for loop</p><p>// 範圍在 1 ~ 50 for i in range(1, 50): .. print(data[i]) ..</p><p>for each</p><p>for item in arrayList: .. print(item) ..</p><p>參考資料：<a href="http://www.python-course.eu/python3_for_loop.php">for loop</a><br> 參考資料：<a href="https://wiki.python.org/moin/ForLoop">for loop</a></p><p>錯誤訊息參考資料：<a href="https://www.codecademy.com/forum_questions/50ebc64f856dafd0870011af">TypeError: string indices must be integers</a><br> 出現原因：用迴圈跑一個持續增加的 array list<br> 實際原因還沒有確認，不過目前用迴圈跑一個 array，並持續對其新增 item，就會發生此問題<br> 歡迎 python 高手指錯！ Orz</p><h3>5. if else</h3><p>判斷式就是寫在 java 或 c 括弧裡的判斷，python 不需要括弧，但要記得加冒號</p><p>if 判斷式 : .. break else : .. continue</p><p>否定句：</p><p>java、c 都是驚嘆號 !， python 是用 not</p><p><a href="http://stackoverflow.com/questions/9573244/most-elegant-way-to-check-if-the-string-is-empty-in-python">參考資料</a></p><h3>6. json array object</h3><p>// 建立 json object arrayList = {} // 塞入一個 key 為 results 的 json array arrayList[“results”] = []</p><p>添加 object 進 array</p><p>arrayList[“results”].append(jsonObj)</p><p>參考資料：<a href="http://www.tutorialspoint.com/python/dictionary_len.htm">JSON 長度</a><br> 參考資料：<a href="http://stackoverflow.com/questions/23110383/how-to-dynamically-build-a-json-object-with-python">給值</a><br> 參考資料：<a href="http://www.tutorialspoint.com/python/list_append.htm">append</a><br> 參考資料：<a href="http://stackoverflow.com/questions/10895028/python-append-to-array-in-json-object">python append to array in json object</a><br> 參考資料：<a href="http://stackoverflow.com/questions/10252010/serializing-python-object-instance-to-json">Serializing python object instance to json</a><br> 參考資料：<a href="http://stackoverflow.com/questions/2835559/parsing-values-from-a-json-file-in-python">Parsing values from a JSON file in Python</a></p><h3>7. boolean</h3><p>python 的布林值也有些不同<br> 寫法是：</p><p>boolean</p><p>hasData = True hasData = None</p><p>參考資料：<a href="http://stackoverflow.com/questions/1748641/boolean-in-python">布林值</a></p><h3>8. 讀取需要爬蟲的網站 html</h3><p>html = urlopen(url) soup = BeautifulSoup(html.read(), “html.parser”)</p><p>此時，soup 可用來搜尋所有需要的 tag 或 attribute 、 value</p><p>參考資料：<a href="http://www.crummy.com/software/BeautifulSoup/bs4/doc/">BeautifulSoup文件</a><br> 參考資料：<a href="http://stackoverflow.com/questions/11205386/python-beautifulsoup-get-an-attribute-value-based-on-the-name-attribute">soup.find</a><br> 參考資料：<a href="http://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-parents-and-find-parent">find parent</a><br> 警告、錯誤參考資料：<a href="https://github.com/ckreibich/scholar.py/issues/49">No parser was explicitly specified</a></p><p>建議：@余澄弈 除了 bs4 外推薦 pyquery 唷！</p><h3>9. regex</h3><p>regex，Regular Expression （正規表示式） 縮寫<br> 主要可以幫助搜尋 BeautifulSoup 無法 cover 的一些規則<br> 下面列幾個參考資料，不過主要還是有特別需要用到的時候再去找就行了<br> 大家可以用線上測試的網站來做 regex 是否正確的練習～</p><p>參考資料：<a href="http://stackoverflow.com/questions/19587328/extracting-key-value-pairs-with-regex-dot-group-not-cooperating-wit">find key value</a><br> 參考資料：<a href="http://stackoverflow.com/questions/180986/what-is-the-difference-between-pythons-re-search-and-re-match">match 例子</a><br> 參考資料：<a href="http://stackoverflow.com/questions/4931825/regular-expression-any-number">搜尋任何數字</a><br> 重要參考資料：<a href="http://pythex.org/">線上測試 regex</a></p><p>綜合參考資料：<a href="http://stackoverflow.com/questions/11977818/python-not-parsing-json-correctly-all-the-time">boolean and json</a><br> 綜合參考資料：<a href="http://openhome.cc/Gossip/Encoding/Python.html">unicode-全形之類文字</a></p><p><em>Originally published at </em><a href="http://takuma-nekomayoi-blog.logdown.com/posts/2016/02/11/python-entry-from-the-installed-into-reptiles-implementation-phase-crawler-notes"><em>takuma-nekomayoi-blog.logdown.com</em></a><em> on February 11, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8fb2cf16530" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>