<?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 Allan Sun on Medium]]></title>
        <description><![CDATA[Stories by Allan Sun on Medium]]></description>
        <link>https://medium.com/@allan914?source=rss-1aa3d039832f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*G4ieYwKQebc62pOodIqV1g.jpeg</url>
            <title>Stories by Allan Sun on Medium</title>
            <link>https://medium.com/@allan914?source=rss-1aa3d039832f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:07:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@allan914/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://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%A1%83%E5%9C%92%E4%B8%AD%E5%A3%A2-%E6%97%A5%E5%BC%8F-%E5%88%9D%E8%A8%AA-%E5%9D%90%E8%91%97%E5%81%9A-%E5%A3%BD%E5%8F%B8%E6%9C%AC%E5%BA%97-34261b848abe?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/34261b848abe</guid>
            <category><![CDATA[food]]></category>
            <category><![CDATA[japanese]]></category>
            <category><![CDATA[restaurant]]></category>
            <category><![CDATA[sushi]]></category>
            <category><![CDATA[taiwan]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Mon, 24 Aug 2020 10:39:32 GMT</pubDate>
            <atom:updated>2020-08-24T10:39:32.148Z</atom:updated>
            <content:encoded><![CDATA[<p>日期：2020/Aug/23 晚餐<br>價位：1080 / 1680 / 2280 NTD/person</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGjzq6ROGVepI5ZNaJLdtg.jpeg" /><figcaption>店在奇妙的小巷子裡，附近有收費停車場所以倒是不用擔心找位子的部分（大概）</figcaption></figure><p>前陣子美登利在台北剛開幕的時候跑去吃，立馬被我敬愛的甫爺報了這家在桃園中壢的無菜單壽司來做個比較。由於我在美登利吃大概是 1000 左右，為了比較我就點了一樣 1080 的套餐作為參考。店家表示 1080 跟 1680 的差別在於會多幾道菜，2280 的話則是跟 1680 一樣，但食材更升級；訂位的時候就要決定好要點什麼價位的套餐，不過如果你真的到現場想升級的話，可以偷偷問問看師傅材料夠不夠，有機會吃更飽喔（欸）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khZxCcR32kizY_3FcY7ZEg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_sZ5nsBlxybLi0VGqtwMw.jpeg" /></figure><p>座位的部分外面是榻榻米，但下面有放腳跟行李的地方所以不用擔心需要跪坐一整晚；裡面有個小包廂，需要私密的可訂（？）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YOxX-_uBCZkGIQmZWCs7Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*82ICGLR6F5fj4g2X5QrDuA.jpeg" /></figure><p>一坐下除了熱茶之外也會看到毛豆小菜，這時候就覺得台灣的お通し不用錢真好（欸）；師傅也在盤子上準備好了薑片、醃蘿蔔跟山葵，等等會頻繁的用到 XD 不夠的話吃完可以跟師傅講一下喔！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KPK5cI_KlhtYJtgDkt8o5A.jpeg" /><figcaption>大家都有的山藥冷麵</figcaption></figure><p>首先第一道開胃菜是大家都有的山藥冷麵；也就是山藥，不是麵（怎麼覺得很饒口）。我覺得算是中規中矩，開個胃這樣。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edC0eOMPbQnguFhi5Gazdg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeE6mTUBt6paSjJiOdRsWQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ELkCDEIBIwmi1UxuYW2EQ.jpeg" /><figcaption>1680 的生魚片（左）、不吃生魚片的紫蘇明蝦揚（中）、跟 1080 的握壽司</figcaption></figure><p>接下來就是讓你體驗價格差距的時候了！在接下來的套餐中蠻常見的是 1680 的會是兩片生魚片，而 1080 的則會是以握壽司的方式提供；漁獲幾乎都是台灣當地的。不吃生的話在預定的時候可以先說，你的菜會全部特製，像中間的這個紫蘇明蝦揚（簡稱炸蝦）。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HNm_yPmQ8nEsaJmYLnR_zg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vw04vLfzBoVTTbJK4KnYHQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4fpbh2V8oQinrcLpXaVUuQ.jpeg" /><figcaption>熟食的人才有的鮑魚軍艦（左）、生食才有的炙燒干貝握壽司（中）跟大家都有的松葉蟹蒸蛋（右）</figcaption></figure><p>炙燒干貝的部分我覺得也是中規中矩，不過松葉蟹蒸蛋我吃到兩次蟹殼，算是我覺得比較不行的地方。然後我跟外場主任反應有蟹殼她說她要問問看內場師傅，難道是我不懂師傅的苦心！？莫非這個蟹殼其實佔了重要的畫龍點睛之效！？</p><p>然後過陣子外場主任就來說不好意思了，師傅撥太多螃蟹累了 XD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f93vTfnSGQ6Nk-bDGeYjCQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATp9ZB84OQnkKN18OC4PeA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0GvcgOjQtDpJlRLsjNE-g.jpeg" /><figcaption>1680 才有的生魚片（左）第二發跟鮑魚（中），1080 只有握壽司 again (右）</figcaption></figure><p>說到這個生魚片上面放了來自日本的柚子胡椒，我旁邊的乾爹立馬表示他還有一罐上次從九州帶回來的，需要的話可以自己加料（？）讓我不禁感覺到有錢人跟你想的果然不一樣（欸）。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DLoRY9MUpBuE70bxw2ASzg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v3Ruu9AbKRiJigrJAMyiLQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrM_aaGbQZVsPKRL6JoIJw.jpeg" /><figcaption>熟食的人有大大的干貝燒（左）、1680 有灑了紫蘇花的握壽司（中）、1080 則是海膽軍艦（右）</figcaption></figure><p>我有時候看到上菜的時候會小納悶，例如為什麼炙燒干貝握壽司算是生食的部分，可是用海苔包起來以後他就算是熟食了呢？或者是握壽司上了撒了紫蘇花是因為紫蘇葉剛剛拿去炸明蝦了嗎（並不是），但反正都很好吃，大家不要計較 XD</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4gBcwr0d-ua891jwCsBS2w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R60cmt8aeT6BnTM8Biahww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JqW-i24DhCW3s4Q00-868g.jpeg" /><figcaption>大家都有的竹筍田樂燒（左），熟食才有的西京燒（中），以及 1680 的超屌黑鮪魚捲海膽壽司（右）</figcaption></figure><p>不知道大家知不知道，其實田樂燒是味增，西京燒也是味增 XD 也就是說熟食的朋友，你這餐的鈉攝取量可能會有點高（欸）。一開始竹筍上來的時候我差點以為是馬鈴薯，想說難道我今天要敗在這一道上了嗎，還好沒有。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJG8HV9dlBYXb7grlZWVMA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rVT9gwJmQHTuQR1t1aFFbw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMim8v66btgh6j_h6T2AYQ.jpeg" /><figcaption>本日大菜活龍蝦，師傅特別趁他活著的時候帶他出來跟大家亮相，不然你只能看到遺照了（欸）</figcaption></figure><p>我不得不說我看到這道菜上來的時候突然有種坐在喜宴辦桌的 deja vu，但是下面放的不是板條或者豆腐，而是來自日本的粗葛粉條，稍稍把你從婚宴會館推往了旁邊的桃園機場。師傅帶龍蝦出來的時候特別交代大家拍龍蝦就好不要拍到他，立馬上傳龍蝦生前的照片以茲證明我很聽話的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PW-8mL9tprPXQZb9MMXJMA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUL3GBLAhNQxt3XPg7FkPQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nD5gYK3AMGppoeSk1JsVlQ.jpeg" /><figcaption>招待的牛蒡手捲（左）、1680 的炸圓鱈（中）、以及熟食才有的星鰻壽司（右）</figcaption></figure><p>師傅上星鰻壽司的時候特別強調是來自東京灣的進口星鰻，讓我腦袋裡一直不禁腦補出核能外洩或者瀝青重金屬的畫面。但基本上我個人在日本吃星鰻只有一個原則：吃爆。說起這個，美登利一整條的星鰻一直是我無法忘懷的一個點，雖然我很難說是因為價格還是味道就是了。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TqJvAcFFz6NXmO48EbIwhw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWXsiv27dN_cjbl91_nMzQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6yxo6aI0kwFYZrDdIGqKPw.jpeg" /><figcaption>有認出來嗎？中間那個是 1080 的握壽司，是 1680 的生魚片做的；右邊的甜蝦倒是大家都有。</figcaption></figure><p>甜蝦的部分我十分讚揚，因為有把尾巴去掉。我對魚刺啊殼啊尾巴啊這些東西一向苦手，貼心小幫手我一律五星吹捧。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n83sAyg82ZdsUvXoALWi2A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*71A5OfrPvCubCgaNF9C_cg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wuE5ZurVfYRQ5X7k65Vc7A.jpeg" /><figcaption>誰能抵抗炙燒比目魚的海苔握（左）呢？玉子燒很築地場外市場（中），味增湯看得到隱隱的蝦油（右）</figcaption></figure><p>師傅在上玉子燒的時候大概是因為聽到我們在聊日本的話題，非常熱心地告訴我築地場外市場也有玉子燒。但想到那個大小跟那個價位，再看看這塊精緻的玉子燒，我覺得我們還是先不要提那個地方的好（欸）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3r05G4KKowfruw0VrvxxPw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DXl6J2pM1H0s6eLXv7xAag.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_h3BrwL0mdxeQckkgEWruQ.jpeg" /><figcaption>熟食專屬的稻禾烏龍（左）、生食專用的散壽司（中）、以及大家都可以和平相處的飯後甜點（右）</figcaption></figure><p>我們在門口等的時候聽來過的朋友介紹說吃不飽的話最後師傅會加做散壽司讓大家吃飽；剛好門口很多可愛的貓貓，我們就在說會不會散壽司上面的料其實是貓貓的晚餐，所以他才這樣眼巴巴地看著我們，覺得我們要進去搶他糧食（？）</p><p>雖然前面開了一些玩笑，不過總體來說我覺得是一間很棒的店，昨天吃完我今天已經在研究要哪一天二訪了（無誤）；感謝各位大大帶我見世面。基本上我個人推薦一定要點 1680 以上的套餐，應該蠻容易看得出來有些基本面上的差距難以彌平；2280 的套餐就留待好心乾爹贊助了（？）。</p><p>至於最一開始的目的跟美登利的比較？</p><p>屌打啊！哪次不屌打！（欸）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edNPqvlho73iVsfKa8h3Ww.jpeg" /><figcaption>貓貓抱歉，你的加菜被我們吃掉了（逃）</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34261b848abe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%A1%83%E5%9C%92%E4%B8%AD%E5%A3%A2-%E6%97%A5%E5%BC%8F-%E5%88%9D%E8%A8%AA-%E5%9D%90%E8%91%97%E5%81%9A-%E5%A3%BD%E5%8F%B8%E6%9C%AC%E5%BA%97-34261b848abe">[桃園中壢][日式][初訪] 坐著做。壽司本店</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Virtual Destructor]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/virtual-destructor-5b20ea8d4eb3?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b20ea8d4eb3</guid>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[virtual]]></category>
            <category><![CDATA[secure-coding]]></category>
            <category><![CDATA[polymorphism]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 13:15:31 GMT</pubDate>
            <atom:updated>2020-03-01T13:15:31.962Z</atom:updated>
            <content:encoded><![CDATA[<p>這篇剛好在草稿裡面，就把它整理一下發出來了；是我之前面試的時候遇到的問題。</p><p>情境如下：</p><ul><li>有一個沒有 virtual destructor 的 base class</li><li>有一個繼承他的 derived class</li><li>有一個 base class type 的 pointer 指向 derived class</li></ul><p>這個時候去 delete object 的時候實際上會變成一個 undefined behavior。有可能發生的事情包括異常終止、memory leak、只 call 了 base class 的 destructor 而沒有 call derived class 的 destructor。</p><p>下面是從 <a href="https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor">Secure coding</a> 借來的範例：</p><pre><strong>struct</strong> Base {<br><strong>  virtual</strong> <strong>void</strong> f();<br>};</pre><pre><strong>struct</strong> Derived : Base {};</pre><pre><strong>void</strong> f() {<br>  Base *b = <strong>new</strong> Derived();<br>  // ...<br><strong>  delete</strong> b;<br>}</pre><p>在這個範例中，`Base` 沒有 virtual destructor ，而 `b` 又是一個指向 derived class 的 base class type pointer；就造成了上面說的情形。幫它加一個 virtual destructor 就可以了：</p><pre><strong>struct</strong> Base {<br><strong>  virtual</strong> ~Base() = <strong>default</strong>;<br><strong>  virtual</strong> <strong>void</strong> f();<br>};</pre><pre><strong>struct</strong> Derived : Base {};</pre><pre><strong>void</strong> f() {<br>  Base *b = <strong>new</strong> Derived();<br>  // ...<br>  <strong>delete</strong> b;<br>}</pre><p>結論上來說應該是：</p><ul><li>不要去繼承沒有 virtual destructor 的 class</li><li>在 class 裡寫到 virtual function 的時候就幫他加個 virtual destructor 以絕後患</li></ul><p>整理完之後我內心一陣莫名，我之前到底是面到什麼遇到這個問題（？）</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b20ea8d4eb3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/virtual-destructor-5b20ea8d4eb3">Virtual Destructor</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[日本] 宇都宮半日遊 + 宇都宮 みんみん]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%97%A5%E6%9C%AC-%E5%AE%87%E9%83%BD%E5%AE%AE%E5%8D%8A%E6%97%A5%E9%81%8A-%E5%AE%87%E9%83%BD%E5%AE%AE-%E3%81%BF%E3%82%93%E3%81%BF%E3%82%93-b632d1e50b8a?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b632d1e50b8a</guid>
            <category><![CDATA[utsunomiya]]></category>
            <category><![CDATA[japan]]></category>
            <category><![CDATA[travel]]></category>
            <category><![CDATA[food]]></category>
            <category><![CDATA[tokyo]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Sat, 29 Feb 2020 03:47:51 GMT</pubDate>
            <atom:updated>2020-02-29T03:47:51.439Z</atom:updated>
            <content:encoded><![CDATA[<p>前陣子買了個 JR 東京廣域周遊券，本來想去河口湖看個富士山再回東京，結果武漢肺炎疫情一直升溫就取消了。但券都買了不用好像也有點可惜，就決定去宇都宮初體驗一下囉（？）</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NhDTSfHtelgdlD9Fb7VQTQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KaHAtF1K1OVwH3sAW5tQpA.jpeg" /><figcaption>新幹線咻一下，宇都宮站就到囉～</figcaption></figure><p>宇都宮從東京出發搭新幹線大概 40 分鐘，距離上還蠻近的；這次的目標主要是來探訪一下傳說中的餃子之都到底餃子是有多好吃 :D 畢竟大家也知道的，日本的餃子作為拉麵跟白飯的配菜，以台灣口味來說實在很難說的上厲害。</p><p>不過因為是上午出發的（想把餃子當午餐），所以到宇都宮其實還有點早。於是就到了附近有名的二荒山神社逛了一下。神社本身清幽清幽的，不知道是不是因為武漢肺炎大家不出門（？），不過還蠻有趣的，拿到了蠻漂亮的御朱印。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*34vf703udonVyNw2ERdsEA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MlnS3ES2hkiz4-DGCNjB_w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l6PCKxNNYQrdxlvYL8N6Pg.jpeg" /><figcaption>餃子造型的籤很有趣，是用夾的不是用抽的</figcaption></figure><p>值得一提的我覺得這個神社的抽籤很有趣，他是一盤餃子形狀的籤，有筷子讓你夾😆 <br>裡面除了有籤以外還有餃子餡料造型的緣起物（護身符）；旁邊有加工區，你可以把籤拿出來，把餃子餡料包進去，然後把餃子包起來（旁邊有膠水讓你黏起來），打個洞穿個線把它掛在包包上或者跟御朱印帳放一起。</p><p>參拜完畢之後雖然還是很早（大概十一點多），但還是先往餃子店移動了。二荒山神社的旁邊有一整條的餃子通（餃子街的概念），這次選擇的是在 tabelog 上面也有 3.6 高分的宇都宮 みんみん(MINMIN)本店。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i9Zs7IZqdMROv_D5raHSWw.jpeg" /><figcaption>宇都宮みんみん本店，排隊不是在這邊 XD</figcaption></figure><p>到的時候看這樣還想說運氣不錯時間還早沒什麼人，沒想到轉頭一看是排在旁邊停車場裡面還轉彎 😂 <br>乖乖跟著進去排順便問了一下警衛阿桑要排多久，她很熱心地跟我說我排的位子大概一個半小時就有囉～（就嗎，真的是就嗎😂）；她還說昨天排出停車場就要超過兩小時了，我今天運氣不錯（？）反正來就是為了吃的，就排下去吧！</p><p>排完進店裡之後看了一下，菜單蠻簡單的，就煎餃子、炸餃子、水餃子、白飯跟飲料這樣，沒有其他東西了。餃子一份六顆 230 yen，套餐基本上就是單點的東西價格加起來一毛沒省，所以就點自己想吃的就好囉！既然是為了餃子來的，當然餃子類的東西都是要點一份的。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jHgpjbkA58BXtYSdyPomhg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rm-xaa66aLEQCnQFRcRy4Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSAjjc97ugqum2ZiI5Vdtw.jpeg" /><figcaption>依序為燒餃子（煎餃），揚餃子（炸餃子），水餃子（就水餃）</figcaption></figure><p>餃子內餡的部分都是菜肉餡，不算油膩。煎餃子香脆，炸餃子不油膩，至於水餃子嘛我雖然不懂為什麼日本水餃子都真的要泡在水裡不過也不錯沒有到皮軟爛掉。不得不說以餃子來說我覺得在日本真的算是蠻好吃的，不愧是高評分排隊名店；大概唯一缺點是不點白飯其實還是不會吃太飽，畢竟對日本人來說餃子就是配菜，吃起來空虛感還是重了點。</p><p>吃完之後打算飯後散散步，看到旅遊地圖上說宇都宮城址公園是賞櫻勝地，還可以看看宇都宮城，就往那邊前進了。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQTf-AcjJ_LjCdFnIIjavA.jpeg" /></figure><p>對，跟我想的賞櫻勝地完全不一樣 XDDD 而且不愧是被稱為城址公園，真的是只有遺址，沒有城😂 外面看起來好像圍起來很厲害的樣子，走進去真的就是公園，一片青草地；建議大家是可以直接跳過這邊了。</p><p>但就這樣什麼都沒看到好像也不太甘心，於是換了個方向，繼續往八幡山公園前進；結果在不小心走過頭的地方反而看到了花。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GDGa3NE0UPVLH6HiQOblCQ.jpeg" /><figcaption>我如果不說你是不是會覺得這很像東京鐵塔（？）</figcaption></figure><p>八幡山公園蠻有趣的，裡面有神社，宇都宮塔，兒童遊樂區和 Go Kart ，動物園（？）等等的東西，我覺得是蠻微妙的複合型公園；裡面還有一個一等三角點，但我想沒有在收集的人大概就不會有什麼興趣吧😂</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YX5x8db24L5YhxB1-ZU4CQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*siapEW5YU5lqNx7iSo0q6g.jpeg" /><figcaption>沒有景的奇妙觀景台跟上去要錢的迷你版東京鐵塔（？） aka 宇都宮塔</figcaption></figure><p>本來還想說要留在宇都宮吃晚餐但也沒什麼特別想吃的，就去改了提早回東京的票了；幸好大概 20 分鐘就有一班新幹線，隨時想來想走都很方便。感想就是下次還是去日光或者鬼怒川泡溫泉好了哈哈哈（欸</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXuXjIty05rtPctcsdUrPw.jpeg" /><figcaption>離開前在 JR 站買的日光布丁亭深得我心 ❤</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b632d1e50b8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%97%A5%E6%9C%AC-%E5%AE%87%E9%83%BD%E5%AE%AE%E5%8D%8A%E6%97%A5%E9%81%8A-%E5%AE%87%E9%83%BD%E5%AE%AE-%E3%81%BF%E3%82%93%E3%81%BF%E3%82%93-b632d1e50b8a">[日本] 宇都宮半日遊 + 宇都宮 みんみん</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FreeBSD 2019 in Review 摘要]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/freebsd-2019-in-review-%E6%91%98%E8%A6%81-e478c667be36?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e478c667be36</guid>
            <category><![CDATA[2019]]></category>
            <category><![CDATA[freebsd]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[review]]></category>
            <category><![CDATA[briefing]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Fri, 28 Feb 2020 13:55:31 GMT</pubDate>
            <atom:updated>2020-02-28T13:55:31.360Z</atom:updated>
            <content:encoded><![CDATA[<p>這幾篇 2019 in review 的摘要本來是過年的時候要拿來發電子報用的，結果放著放著就到現在了；雖然有點過期了，但還沒有看過的人不妨就花個兩三分鐘看一下吧 :)</p><p>2019 in Review: Advocacy</p><p><a href="https://www.freebsdfoundation.org/blog/2019-in-review-advocacy/">2019 in Review: Advocacy</a></p><p>在過去一年 (2019) ，FreeBSD 基金會團隊在 38 個活動中為了宣傳 FreeBSD 而出現，跟前年相比多了 10 個！其中有些是第一次，像是 Open Source Summit North American &amp; Open Source Summit Europe ，為這些比較多 Linux 的活動注入了一些 FreeBSD 元素；也有些是像 All Things Open 或 OSCON 這樣再次登場。</p><p>此外， 官方雙月刊 FreeBSD Journal 於今年開始也完全免費開放線上觀看。也別忘了上新的線上商店購買 FreeBSD 周邊商品 (有送台灣，需運費)，訂閱電子報，或者直接捐款喔！</p><p>2019 in Review: Software Development Projects</p><p><a href="https://www.freebsdfoundation.org/blog/2019-in-review-software-development-projects/">2019 in Review: Software Development Projects</a></p><p>截至 2019 年 12 月中，被標記為基金會資助的 commit 有 1276 個，佔了整年所有 commit 的 17%；文章中也列出了一些今年完成的以及正在進行的專案。</p><p>今年的專案中也有不少與安全性相關的內容，包含整合 Syzkaller 這個 fuzzer，Intel x86 相關元件的改良，以及例行的 security update 都是。<br>（裡面還有一段是在講 lwhsu 在 CI 上的工作成果 :) ）</p><p>2019 in Review: CI and Testing Advancements</p><p><a href="https://www.freebsdfoundation.org/blog/2019-in-review-ci-and-testing-advancements/">2019 in Review: CI and Testing Advancements</a></p><p>這篇主要在講 FreeBSD 在 2019 年對 CI 投入的心血。你可以在 <a href="http://tinderbox.freebsd.org/">http://tinderbox.freebsd.org</a> 看到每個 branch 跟 arch 的建構資訊，也可以在 <a href="https://ci.freebsd.org/hwlab">https://ci.freebsd.org/hwlab</a> 看到不同硬體的 CI 。</p><p>除了在 freebsd-testing mailing list 看到每週 CI 報告之外，也可以在 <a href="https://hackmd.io/@FreeBSD-CI">https://hackmd.io/@FreeBSD-CI</a> 看到過去的紀錄；此外你也可以在 <a href="https://wiki.freebsd.org/HostedCI">https://wiki.freebsd.org/HostedCI</a> 找到 FreeBSD 在不同的 Hosted CI 服務上的支援。</p><p>詳細的內容就請大家自己點進去各篇看囉！其實每篇都不長很快就可以看完了（吧？）</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e478c667be36" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/freebsd-2019-in-review-%E6%91%98%E8%A6%81-e478c667be36">FreeBSD 2019 in Review 摘要</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用 SAN Certificate 做 Multi-Domain Certificate]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E7%94%A8-san-certificate-%E5%81%9A-multi-domain-certificate-c7403e05c697?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7403e05c697</guid>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[san]]></category>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Mon, 04 Feb 2019 10:39:12 GMT</pubDate>
            <atom:updated>2019-02-04T10:39:12.290Z</atom:updated>
            <content:encoded><![CDATA[<p>在發完<a href="https://blog.cssuen.tw/create-a-self-signed-certificate-using-openssl-240c7b0579d3">上一篇 “Create a self-signed certificate using OpenSSL”</a> 之後有人在回應中提到怎麼沒有講到 SAN ，突然覺得好像是該補充一下這個部分，因為那天好像也有學弟問到如果有多個網址的時候該怎麼辦可是我懶的詳細講所以我就跳過了（茶）</p><p>SAN 的全名是 “Subject Alternative Name”，維基百科上翻譯的中文叫做「主題備用名稱」（但我覺得這感覺像是丟翻譯軟體翻出來的，所以後面都直接用簡寫 SAN），是前一篇提到的 X.509 的擴充（extension）之一。</p><p>下面我們來解釋一下多個 domain 簽 certificate 這件事。</p><h3>Wildcard certificate &amp; SAN</h3><p>一般在做多個 domain 的 certificate 的時候，除了幫每個 domain 各自簽自己的 certificate 之外，我們也會用一張 certificate 給多個 domain 用的方式，來節省管理上和金錢上的各種成本。其中常見的兩種方式一個是 Wildcard certificate（萬用字元憑證），另一個就是加上 SAN。</p><p>Wildcard certificate 的概念是在簽 certificate 的時候使用萬用字元（wildcard），例如我們簽發 *.hs.ntnu.edu.tw 這個 certificate，那不管是 www.hs.ntnu.edu.tw 或者是 mail.hs.ntnu.edu.tw 都可以使用這張 certificate。對 Wildcard certificate 來說，只要一張就可以讓所有的子網域使用；而且之後任何新增的子網域也不需要重新簽發憑證，因為也都符合 Wildcard 的規則。</p><p>而 SAN 則是我們在簽發的時候加上 SAN 的欄位，讓這張 certificate 可以符合多個獨立的網域。例如我可以簽一張 certificate 給 cnmc.tw 跟 cnmc.club 一起用，不需要是同一個網域下面的子網域。相對的，變更 SAN 需要進行重新簽發；另外 SAN 也有一個上限值，不能無限增加網域。</p><p>所以一般來說，如果今天我們要使用的都是同一個網域下的子網域，那 Wildcard certificate 會是比較簡便的方法；如果我們今天有多個不同的網域要使用，那通常就會使用 SAN 。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*Q1Nf8xC9E_tX3vF9NnbzNA.png" /><figcaption>用 blog.cssuen.tw 來當範例，快幫我拍拍手（咦）</figcaption></figure><h3>用 CNF 建立有 SAN 的 CSR</h3><p>接下來我們來用 cnf（config file）建立一個有 SAN 的 CSR，以下是一個範例 config 檔，我將它取名叫 host.cnf：</p><pre>[ req ]<br>distinguished_name = req_dn<br>req_extensions     = req_ext<br>prompt             = no</pre><pre>[ req_dn ]<br>C = TW<br>ST = Taiwan<br>L = Taipei City<br>O = HSNU<br>OU = CNMC<br>CN = hs.ntnu.edu.tw<br>emailAddress = root@hs.ntnu.edu.tw</pre><pre>[ req_ext ]<br>basicConstraints = CA:FALSE<br>keyUsage = digitalSignature, keyEncipherment<br>subjectAltName = @alt_names</pre><pre>[ alt_names ]<br>DNS.1 = hs.ntnu.edu.tw<br>DNS.2 = mail.hs.ntnu.edu.tw<br>DNS.3 = www.hs.ntnu.edu.tw</pre><p>接下來我們來看一下這個設定檔：</p><ul><li>[ req ] 表示接下來這段設定檔是給 openssl req 用的</li><li>distinguished_name 這邊指定了我們產生 CSR 需要的資訊放在 req_dn 這一塊區域</li><li>req_extensions 這邊指定了 CSR 要用的擴充（extension）放在 req_ext 這一塊區域</li><li>prompt 這邊設成 no ，表示不用互動式輸入，直接拿 distinguished_name 的資料來用就可以</li><li>[ req_dn ] 這邊指定的其實就是我們在互動式輸入裡輸入的國家、地區、domain name 等等資訊，可以參考<a href="https://blog.cssuen.tw/create-a-self-signed-certificate-using-openssl-240c7b0579d3">上一篇</a>帶過的參數</li><li>[ req_ext ] 這邊指定的是要用的擴充相關的資訊</li><li>在 basicConstraints 中我們指定 CA:FALSE 表示這不是一個 CA 的 cert （非必要）</li><li>在 keyUsage 中我們指定了密鑰用途為數位簽名（digitalSignature）、密鑰加密（keyEncipherment）；根據不同的用途這邊可以指定不同的值，可以參考 <a href="https://www.openssl.org/docs/manmaster/man5/x509v3_config.html">OpenSSL 文件</a>或者直接看 <a href="https://www.ietf.org/rfc/rfc3280.txt">RFC 3280</a> Section 4.2.1.3</li><li>在 subjectAltName 中我們指定了 SAN 設定在 alt_names 這一區；當然也可以全部用成一行寫在這邊，不過這樣看起來很累 XD</li><li>在 [ alt_names ] 中，我們使用 DNS.# 來指定每個 domain；當然這塊能放的其實不只有 domain ，可以參考相關文件</li></ul><p>在建立完這個設定檔之後，在<a href="https://blog.cssuen.tw/create-a-self-signed-certificate-using-openssl-240c7b0579d3">上一篇</a>執行指令的時候只要帶入 -config host.cnf ，就會自動把這些設定帶入囉！</p><p>如果要檢查有沒有成功，可以這樣：</p><pre>openssl req -text -noout -in host.csr</pre><p>看一下產生的 CSR 是不是有出現相關資訊：</p><pre>...(上略)<br>        Attributes:<br>        Requested Extensions:<br>            X509v3 Basic Constraints:<br>                CA:FALSE<br>            X509v3 Key Usage:<br>                Digital Signature, Key Encipherment<br>            X509v3 Subject Alternative Name:<br>                DNS:hs.ntnu.edu.tw, DNS:mail.hs.ntnu.edu.tw, DNS:<a href="http://www.hs.ntnu.edu.tw/">www.hs.ntnu.edu.tw</a><br>...(下略)</pre><p>剩下的步驟都跟先前的差不多，直接參考<a href="https://blog.cssuen.tw/create-a-self-signed-certificate-using-openssl-240c7b0579d3">上一篇</a>就可以囉！有空也可以試試看簽一個 Wildcard Certificate ，感受一下差別 :)</p><p>沒想到寫著寫著太陽就下山了，我要去吃年夜飯了，大家新年快樂！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7403e05c697" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E7%94%A8-san-certificate-%E5%81%9A-multi-domain-certificate-c7403e05c697">用 SAN Certificate 做 Multi-Domain Certificate</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a self-signed certificate using OpenSSL]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/create-a-self-signed-certificate-using-openssl-240c7b0579d3?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/240c7b0579d3</guid>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[openssl]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[freebsd]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Sat, 02 Feb 2019 17:55:35 GMT</pubDate>
            <atom:updated>2019-02-02T17:55:35.665Z</atom:updated>
            <content:encoded><![CDATA[<p>TL;DR: 請去用 <a href="https://letsencrypt.org/">Let’s Encrypt</a> :P</p><p>上禮拜回去帶高中社團寒訓的時候讓大家試著架了一下各種伺服器，像是 Web Server (FAMP) 、Mail Server (Postfix + Dovecot) 之類的。當然其中一個部分就是要追隨潮流（咦）幫每個東西加個 S ：讓 HTTP 變成 HTTPS，IMAP 變成 IMAPS 之類的。</p><p>當然現在遇到這種情況我個人都覺得就用 <a href="https://certbot.eff.org/">Certbot</a> 直接弄個 <a href="https://letsencrypt.org/">Let’s Encrypt</a> 的 certificate 就好了，不過確實偶爾也是會有想要用自簽憑證 (Self-signed Certificate) 測試一下就好的情況，所以就來把這個步驟記一下，因為我那天看了才發現這個步驟好像對大家來說意外的是個難關（？）</p><p>以下名詞預設大家已經理解：</p><ul><li>certificate：指 SSL 證書</li><li>key：指證書的私鑰</li><li>CA：Certificate Authority，憑證頒發機構，負責簽憑證的</li><li>CSR：Certificate Signing Request</li></ul><h3>Method #1: 直接生出一組 key &amp; certificate</h3><pre>openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout key.pem -out cert.pem -days 30</pre><p>對，就是這麼簡單，一行 :D</p><p>其中的參數說明一下：</p><ul><li>req：Certificate Request(PKCS #10)</li><li>x509：輸出 x509 的 certificate ，而不要輸出 certificate request</li><li>newkey rsa:4096：建立一個新的 4096 bits 的 RSA key</li><li>sha256：用 SHA256 做檢查碼（Digest）</li><li>nodes：不要幫 key 加密</li><li>keyout：輸出 key 的檔案</li><li>out：輸出 certificate 的檔案</li><li>days 365：憑證的有效日期</li></ul><p>這樣你就會有一個叫做 key.pem 的私鑰檔跟 cert.pem 的證書檔可以直接用在各種服務上了。順帶提一下之所以不幫 key 加密的原因是因為服務基本上都需要讀到 key 跟 certificate 兩個檔，你如果加密了不是把密碼寫在檔案裡就是每次重啟服務的時候都要輸入一次，這邊為了方便就算了。</p><h3>Method #2: 用自己的 CA 簽自己的 Certificate</h3><p>用這個方法的話步驟會稍微多一點點，大致上是這樣：</p><ol><li>先幫自己的 CA 生一組 key &amp; certificate</li><li>幫自己的主機生一組 key &amp; CSR</li><li>用自己的主機簽 CSR 讓他變成 certificate</li></ol><p>首先我們先幫 CA 生一組 key</p><pre>openssl genrsa -des3 -out ca.key 4096</pre><p>由於 CA 的 key 只有在簽 certificate 的時候會用到，不像 certificate 的 key 服務本身會用到，所以這邊可以加上 des3 ，會要你輸入一個密碼加密。</p><pre>openssl req -x509 -new -nodes -key ca.key -sha256 -days 365 -out ca.crt</pre><p>接下來我們幫 CA 生一組 certificate，通常這個天數會久不少。</p><pre>openssl genrsa -out host.key 4096</pre><p>這組是主機上的服務要用的 key ，就不加密了。</p><pre>openssl req -new -key host.key -sha256 -out host.csr</pre><p>產生一個 CSR ，會要求你輸入一些資訊，你也可以把他們弄成參數直接帶入，像下面這樣：</p><pre>openssl req -new -key host.key -subj &quot;/C=TW/ST=Taiwan/L=Taipei City/O=MyOrg/OU=MyUnit/CN=my.domain&quot; -sha256 -out host.csr</pre><p>最後來簽這個 CSR 產生 certificate</p><pre>openssl x509 -req -in host.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out host.crt -days 30 -sha256</pre><p>其中幾個先前沒出現的參數說明一下：</p><ul><li>in：輸入檔案，這邊是 CSR 檔</li><li>out：輸出檔案，這邊是產生的 certificate</li><li>CA：CA 自己的 certificate</li><li>CAkey：CA 自己的 key</li><li>CAcreateserial：建立一個 CA 的序號檔（.srl），這是用來記錄 CA 簽了多少 certificate 的，只有第一次需要，之後是直接用 CAserial 指定 srl 檔就可以了</li></ul><p>第二種方法的好處是你可以簽很多 certificate 出來，把自己的 CA 加入信任的 CA 之後就不會有錯誤訊息了。不過說真的，<a href="https://certbot.eff.org/">Certbot</a> 跟 <a href="https://letsencrypt.org/">Let’s Encrypt</a> 真的很方便，不試試嗎？ :P</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=240c7b0579d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/create-a-self-signed-certificate-using-openssl-240c7b0579d3">Create a self-signed certificate using OpenSSL</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[法律名詞中英對照]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%B3%95%E5%BE%8B%E5%90%8D%E8%A9%9E%E4%B8%AD%E8%8B%B1%E5%B0%8D%E7%85%A7-8e507a4d7df8?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e507a4d7df8</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[translation]]></category>
            <category><![CDATA[terms]]></category>
            <category><![CDATA[interpretation]]></category>
            <category><![CDATA[law]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Sat, 28 Jul 2018 16:39:42 GMT</pubDate>
            <atom:updated>2018-07-28T16:39:42.922Z</atom:updated>
            <content:encoded><![CDATA[<p>這次剛好遇到一個法律相關的 session 做中翻英，研究了一下做了點小功課；覺得直接刪除很可惜乾脆貼上來（結果完全沒用到😂）</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25965c73d4042fb1d28cc16ca27d2271/href">https://medium.com/media/25965c73d4042fb1d28cc16ca27d2271/href</a></iframe><p>其實我覺得這些名詞還挺有趣的；沒有補上的很多在司法院的雙語詞典其實也找得到，估計算是很夠用了吧 :P</p><p>Patches welcomed!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e507a4d7df8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E6%B3%95%E5%BE%8B%E5%90%8D%E8%A9%9E%E4%B8%AD%E8%8B%B1%E5%B0%8D%E7%85%A7-8e507a4d7df8">法律名詞中英對照</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google JavaScript Style Guide Walkthrough]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/google-javascript-style-guide-walkthrough-6ce773187b4e?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ce773187b4e</guid>
            <category><![CDATA[style-guides]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Fri, 06 Apr 2018 18:25:33 GMT</pubDate>
            <atom:updated>2018-04-06T18:25:33.014Z</atom:updated>
            <content:encoded><![CDATA[<p>趁食記寫到一半來寫寫前陣子看的這個，覺得也蠻有趣的。</p><p>雖然寫 JS 的人煩惱大概趨近於無限多（對，我私心不愛 JS ），不過再怎麼說也是寫程式， coding style 還是大家會在意的事情。我自己以前比較常聽到大家用的是 <a href="https://github.com/airbnb/javascript">Airbnb 的 style guide</a> ，不過 <a href="https://google.github.io/styleguide/jsguide.html">Google 也有 style guide</a>。可以的話蠻建議兩個都看一看比對一下的；雖然你可能還是會寫得很絕望不過至少他長得比較漂亮（咦）</p><p>以下條列一些有趣的內容：</p><blockquote>用 2 格空白做縮行</blockquote><p>不用吵要用 tab 還是 space 啦！ 就是空白了！而且還是 2 格喔 :P<br><strong>不要省略大括號</strong>；也不用煩惱大括號怎麼放了，不換行就對了<br>另外，<strong>分號必須加</strong>；又一個引戰點被消除了，喔耶<br><strong>一行 80 字</strong>這個倒是還好，縮排是 2 格空白的話也不會拉太長</p><p>建議用 `clang-format` 來幫忙我倒是沒有想過就是了</p><p>來一小段範例：</p><pre>class InnerClass {<br>  constructor() {}<br><br>  /** @param {number} foo */<br>  method(foo) {<br>    if (condition(foo)) {<br>      try {<br>        // Note: this might fail.<br>        something();<br>      } catch (err) {<br>        recover();<br>      }<br>    }<br>  }<br>}</pre><blockquote>不建議水平對準</blockquote><p>看到這個終於不是只有我覺得煩真是太好了😂</p><pre>{<br>  tiny: 42, // this is great<br>  longer: 435, // this too<br>};<br><br>{<br>  tiny:   42,  // permitted, but future edits<br>  longer: 435, // may leave it unaligned<br>};</pre><blockquote>var 掰掰，用 const 或 let</blockquote><p>很多你在網路上找到的範例或教學會用 var 來定義變數，可以叫他們去剁手手了（誤）；開始習慣不要再用 var 了。預設用 const ，會 re-assigned 的才用 let 。</p><p>一次定義一個變數，不要好幾個串在一起。</p><p>定 array 的時候最後一個元素也加逗號；不要用 new Array()。</p><pre>// bad<br>let a = 1, b = 2;</pre><pre>// good<br>const values = [<br>  &#39;first value&#39;,<br>  &#39;second value&#39;,<br>];</pre><pre>// don&#39;t use Array constructor<br>// bad<br>const a1 = new Array(x1, x2, x3);</pre><pre>// good<br>const a1 = [x1, x2, x3];</pre><blockquote>建議用 Arrow function</blockquote><p>老實說我以前看到 Arrow function 只覺得阿不就少打幾個字 XD 沒想到還可以讓人生快樂一點：</p><pre>原文：&quot;Arrow functions provide a concise syntax and fix a number of difficulties with this. Prefer arrow functions over the function keyword, particularly for nested functions&quot;</pre><p>然後不要再寫 `const self = this;` 了！</p><blockquote>先不要用 ES6 modules</blockquote><p>本來以為 Google 會愛用比較新的東西的，不過反而不建議使用 ES6 modules ；雖然主要原因是因為語意標準還沒定案就是了。算是小意外吧 lol</p><p>一些我個人覺得比較有趣的部分大概是這樣，還有一整個 Section 在講 JSDoc 的寫法不過我就不提了；有興趣的大家自己去看吧！</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ce773187b4e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/google-javascript-style-guide-walkthrough-6ce773187b4e">Google JavaScript Style Guide Walkthrough</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[那些可怕的 JavaScript 型別]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E9%82%A3%E4%BA%9B%E5%8F%AF%E6%80%95%E7%9A%84-javascript-%E5%9E%8B%E5%88%A5-4900e848adcf?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4900e848adcf</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[language]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[myths]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Sun, 01 Oct 2017 16:13:07 GMT</pubDate>
            <atom:updated>2017-10-01T16:13:07.213Z</atom:updated>
            <content:encoded><![CDATA[<p>好我知道大家都在問我為什麼這麼久沒寫食記（你們根本不想看技術文章對吧我知道！！！），今天讓我來跟大家解惑一下：</p><p>我在等著買 iPhone 8+ 拍食記的照片啊啊啊啊啊啊（歡迎樂捐 XDDD）</p><p>總之最近有好幾個點播的專題系列我都還沒空寫歡迎大家投票決定我買好 iPhone 之後應該先寫哪一個 😂</p><p>回到正題，為了讓大家知道我還是有在朝向部落客之路 (?) 邁進的我決定先來跟大家分享一下可怕的 JavaScript 型別們。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*qULC7rJkeKyC2RumD4kVzw.png" /></figure><p>會想到寫這個主要是看到了 <a href="https://blog.campvanilla.com/javascript-the-curious-case-of-null-0-7b131644e274">Javascript : The Curious Case of Null &gt;= 0</a> 這篇文章，有種「那一天，人們想起了被 JavaScript 統治的恐懼」的感覺（誤）</p><p>讓我簡單翻譯一下這篇可怕的地方：</p><pre>&gt;&gt; null &gt; 0<br>false<br>&gt;&gt; null == 0<br>false<br>&gt;&gt; null &gt;= 0<br>true</pre><p>是的你沒看錯，不大於 0 也不等於 0 的 null 就這樣大於等於 0 了，根本宇宙等級刑案好嗎 😱</p><p>大意來說是這樣的：</p><ul><li>在 null &gt; 0 的判斷中，因為 null 被轉換成了 +0 ，跟 0 相等，所以回傳 false</li><li>在 null == 0 的判斷中，因為 null 跟 0 不符合任何會被判斷成相等的條件，所以回傳 false (在這個判斷中沒有把 null 轉換成 +0)</li><li>在 null ≥ 0 的判斷中，由於數學的三一律，我們只要判斷 null &lt; 0 就可以了；而由於第一點，所以 null &lt; 0 為 false ，也就是說 null ≥ 0 為 true</li></ul><p>我的看法大概是這樣：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*y7d-CG8kV-BgdJUsvN_KjA.jpeg" /></figure><p>不過大家要不要來猜猜看下面幾個東西會是什麼呢：</p><pre>&gt;&gt; [] + []<br><br>&gt;&gt; [] + {}<br><br>&gt;&gt; {} + []<br><br>&gt;&gt; {} + {}<br></pre><p>我知道你看到答案一定會問我怎麼還在寫 Node.js ，我只能說</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*keBwd_YpQ96c7kVZQ9tIVA.jpeg" /></figure><p>好啦今天的厭世 JavaScript 講座就到這邊，歡迎大家告訴我下一篇到底應該寫拉麵特輯還是咖啡廳特輯！（是怎樣）</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4900e848adcf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/%E9%82%A3%E4%BA%9B%E5%8F%AF%E6%80%95%E7%9A%84-javascript-%E5%9E%8B%E5%88%A5-4900e848adcf">那些可怕的 JavaScript 型別</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS App Store redesigned, so what to do?]]></title>
            <link>https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/ios-app-store-redesigned-so-what-to-do-23a76b174c8d?source=rss-1aa3d039832f------2</link>
            <guid isPermaLink="false">https://medium.com/p/23a76b174c8d</guid>
            <category><![CDATA[app-store]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[promotion]]></category>
            <dc:creator><![CDATA[Allan Sun]]></dc:creator>
            <pubDate>Thu, 08 Jun 2017 17:40:00 GMT</pubDate>
            <atom:updated>2017-06-08T17:40:00.741Z</atom:updated>
            <content:encoded><![CDATA[<p>Since the app store redesign has <a href="https://developer.apple.com/videos/play/wwdc2017/301/">a unique session in WWDC 2017</a>, this should be quite important(at least I think so lol)</p><ul><li>Tabs have changed!</li></ul><p>The “Today” tab is now full of editorial picks and stories. Want to be featured? <a href="https://developer.apple.com/contact/app-store/promote/">Tell Apple your story</a> 6~8 weeks before.</p><p>“Games” and “Apps” are now totally separated tabs so you don’t have to worry about being mixed in a lot of games anymore. “Search” looks like an old feature, but search results now include developers, in-app purchases, categories, editorial stories, tips and tricks, and collections. One change might be related to that might be app’s description can only be changed when submitting a new version of the app.</p><ul><li>App name and Subtitle</li></ul><p>App name and the new coming subtitle are now both limited to 30 characters. That means you should put YOUR APP’S NAME on it, not some adjectives like “The most funny app in the world” or others might not even find your app.</p><p>Worth thinking a good slogan and make it your subtitle as a call to action.</p><ul><li>Icon and Rating</li></ul><p>Icon are now nearly 1.5 times bigger than before, make it a good one! The rating section are also larger and comes with score. You can now choose if you want to reset your rating when submitting your app for review. No need to worry when you are only fixing bugs now.</p><ul><li>Videos for app preview</li></ul><p>You can now have 3 app preview videos, each up to 30 seconds, which will autoplay muted when people comes to your product page. You can also localize them for different App Store languages. Screenshots comes after them.</p><p>You might want to take a look at your preview video and see if they reveal enough of your app, and also understandable while played muted. Make videos localized if possible.</p><p>And since old app store only has one preview video, the first one will be presented. So, order matters.</p><ul><li>Promotional Text</li></ul><p>Since description can only be updated when you submit, promotional text comes in now. This 170 character limited text area can be updated any time without having to submit and appears at the top of your description.</p><p>But remember to keep the things short, you still only get to show the first three lines without clicking :P</p><ul><li>Keywords</li></ul><p>How can you search without keywords? Keywords are limited to 100 characters, with words separated by commas and no spaces, so put something people will type when searching your app, exclude the word “app” itself. :)</p><p>Your apps may be rejected by improper use of keywords, Apple says.</p><ul><li>In-app purchases (IAP)</li></ul><p>IAP now can be viewed and bought from product page, and can also be searched or featured. User will be prompted when they buy IAP from app store but does not have your app.</p><p>I personally think this is more useful for games; think when you see you can buy a great gift pack for games, how appealing :P</p><ul><li>What’s New</li></ul><p>The What’s New section is not at the bottom anymore, that means funny release notes are more likely to be seen. :P</p><p>But you still don’t get to see it all if it’s too long, so you can consider make the most eye-catching ones as the first one.</p><p>Suggestions: Get someone good at marketing to help you refactor your app metadata, developers. This is going to be a lot of work :hecry:</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23a76b174c8d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98/ios-app-store-redesigned-so-what-to-do-23a76b174c8d">iOS App Store redesigned, so what to do?</a> was originally published in <a href="https://medium.com/%E9%9A%A8%E7%AD%86%E9%9B%9C%E8%A8%98">隨筆雜記</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>