<?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 Lynn Chiang on Medium]]></title>
        <description><![CDATA[Stories by Lynn Chiang on Medium]]></description>
        <link>https://medium.com/@lynnchiang?source=rss-cd5e6e3e7bde------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Fp9K_J9p3EIqTJZI_vAUbg.png</url>
            <title>Stories by Lynn Chiang on Medium</title>
            <link>https://medium.com/@lynnchiang?source=rss-cd5e6e3e7bde------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 10:41:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lynnchiang/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[Learn Ruby The Hard Way Exercise #005]]></title>
            <link>https://medium.com/@lynnchiang/learn-ruby-the-hard-way-exercise-005-235becad1906?source=rss-cd5e6e3e7bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/235becad1906</guid>
            <dc:creator><![CDATA[Lynn Chiang]]></dc:creator>
            <pubDate>Tue, 12 Dec 2017 16:18:14 GMT</pubDate>
            <atom:updated>2017-12-12T16:25:24.443Z</atom:updated>
            <content:encoded><![CDATA[<p>#非本科系學程式語言</p><p>本篇包含：</p><ol><li>廢文前言</li><li>Exercise #005</li></ol><h3>前言</h3><p>下班前匆匆順過一次明天要在 Google 101 辦公室講研討會的投影片，約莫 18 分鐘；覺得要上講台簡報給很光榮。（ 明日前言再來講內容 &amp; 心得)</p><p>接著再次匆匆趕路，到 AppWorks 參加一個 Fb Messenger Chatbot 軟體主辦的聚會 ( Mr.reply )，印象最深刻的是主講人兼 Co-founder Kenny 聊到『 <strong>Chatbot 不是客服，是一個獲得客戶、給客戶第一印象的管道</strong>。以一個男追女的比喻來說，這<strong>不是教你怎麼追女生，是讓你認識更多女生</strong> 』。聽完秒懂他的比喻，與把妹顧問做不了生意，交友軟體卻多如牛毛同理。 ( 重點錯 )</p><p>比較好奇的是依照這個定位來開發產品，能找到 product market fit 嗎？實際使用後，有可能部分取代付費流量、維持穩定嗎？</p><p>以台灣人一般對通訊、社交軟體的習慣是 『 做客服 』管道， 如果是這個定位，現有 LINE@ 的 bot 其實已經很夠用，作為行銷溝通的管道不知道成效如何？如果作為行銷溝通的管道，LINE@缺點就在沒有 Social 的成分，個人的對訊息的互動沒有其他『 自然觸及 』可言。總之，讓我們繼續看下去。</p><p>進入正題 —</p><h3>變數命名與變數表達方式 (2)</h3><p>跟 Exercise4 的差別就是幾乎沒有差別，同樣都是定義變數、在 string 裡把變數放進去、再運算。</p><p>作者只是希望你多用不一樣的方式練習，來熟悉變數命名的方式。看你會不會因為邊練習，邊回答個人身材尺寸，而對程式有點印象</p><pre>name = &#39;Lynn Chiang&#39;<br>age = 24 #hope to stay young forever<br>height = 172 #cm<br>weight = 55 #kg #hope to stay strong and slim forever<br>eyes = &#39;brown&#39;<br>teeth = &#39;white&#39;<br>hair = &#39;black&#39;</pre><pre>puts &quot;Let&#39;s talk about #{name}.&quot;<br>puts &quot;She is #{height} cm tall.&quot;<br>puts &quot;She is #{weight} kg heavy.&quot;<br>puts &quot;Actually that’s not heavy at all.&quot;<br>puts &quot;She’s got #{eyes} eyes and #{hair} hair.&quot;<br>puts &quot;Her teeth are usually #{teeth} depending on the coffee.&quot;<br>puts &quot;If I add #{age}, #{height} and #{weight}, I get #{age + height + weight}.&quot;</pre><pre>#exercise3: change kg to pounds and cm to inches<br>height = 172 #cm<br>weight = 55 #kg #hope to stay strong and slim forever<br>kg = 2.246 #pounds<br>cm = 0.3937 #inch</pre><pre>puts &quot;She is #{height * cm} inches tall.&quot;<br>puts &quot;She is #{weight * kg} pounds heavy.&quot;</pre><p>寫完檔案存檔，回到 Terminal 跑跑看</p><pre>$ ruby 005.rb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*XzN7r1L2wjCQXZXCRQqr7g.png" /></figure><p>問答中作者有探討適不適合將變數命名為『 1 』，如 1 = ‘Lynn Chiang’ ，答案是不行。個人建議不要強求，寫 Aud1 吧，還買不起，看了也開心囉。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=235becad1906" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Ruby The Hard Way Exercise #004]]></title>
            <link>https://medium.com/@lynnchiang/learn-ruby-the-hard-way-exercise-004-d5e501db8e5a?source=rss-cd5e6e3e7bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5e501db8e5a</guid>
            <dc:creator><![CDATA[Lynn Chiang]]></dc:creator>
            <pubDate>Mon, 11 Dec 2017 17:04:16 GMT</pubDate>
            <atom:updated>2017-12-11T17:09:32.576Z</atom:updated>
            <content:encoded><![CDATA[<p>#非本科系學程式語言</p><h3>本篇包含：</h3><ol><li>廢文前言</li><li>Exercise #004</li></ol><h3>前言</h3><p>AdWords 廣告還沒幫客戶開完 ( 改天來介紹：GSA, DSA, DRA 是什麼)，下班就匆匆趕去試鏡。沒想到只是先聽說明，先付費上課換取『 可能獲得 』品牌代言人的機會，其實沒有很吸引我。</p><p>前言跟本文的內容沒啥關係，沒錯，剛才就說了是廢文，所以必須曬張專業攝影照。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*NHXkkg22ZBdn1fMLod1xKA.png" /></figure><p>進入正題 ——</p><h3>變數與變數命名的表達方式</h3><p>簡單來說，要表達有 100 輛車；每輛車裡面的空位分別的表達方式是：</p><pre>cars = 100   #表達有 100 輛車<br>space_in_a_car = 4.0  #每輛車裡面有多少空位，文字中間用底線 _ 隔開</pre><pre>puts “There are #{cars} cars available”<br>puts “There are only #{drivers} drivers available”</pre><p>作者很逗趣的請大家用英文把上段每一行翻譯出來，再連同練習下段 puts 開始的地方一同倒著看，我的結果是這樣：</p><pre>#there are 100 cars<br>cars = 100</pre><pre>#there are 4 seats in a car<br>space_in_a_car = 4</pre><pre>#there are 30 drivers<br>drivers = 30</pre><pre>#there are 90 passengers<br>passengers = 90</pre><pre>#number of not used car= number of cars deduct drivers<br>cars_not_driven = cars — drivers</pre><pre>#number of driven cars = drivers<br>cars_driven = drivers</pre><pre>#The capacity equals cars being driven multiple space in a car<br>carpool_capacity = cars_driven * space_in_a_car</pre><pre>#The average number in a car equals all passengers divided by cars being driven</pre><pre>average_passengers_per_car = passengers / cars_driven</pre><p>沒有很懂這樣做的用意哈哈 ( 枉費作者的苦心 )，但沒關係<br>我接著輸入練習下段中的 puts 段，儲存後打開 terminal 查看結果</p><pre>puts “There are #{cars} cars available”<br>puts “There are only #{drivers} drivers available”<br>puts “There will be #{cars_not_driven} empty cars today”<br>puts “We can transport #{carpool_capacity} people today”<br>puts “We have #{passengers} to carpool today”<br>puts “We need to put about #{average_passengers_per_car} in each car”</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*qT9bl5VPvIKz3fe5RbfpVg.png" /></figure><p>QA 中值得注意 1. 其中作者有探討到他應該要把 4 寫成 『 4.0 』 如下圖</p><pre>#there are 4 seats in a car<br>space_in_a_car = 4</pre><p>原因是 4.0 是『 floating point number 』，這一點我尚未明白，正在 google 與詢問中。</p><pre>#there are 4.0 seats in a car<br>space_in_a_car = 4.0</pre><p>QA 中值得注意 2. 作者有埋梗問 = 與 == 的差異，<br>並會在後面的 exercise 中解答，拭目以待。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5e501db8e5a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn Ruby The Hard Way Exercise #001–3]]></title>
            <link>https://medium.com/@lynnchiang/learn-ruby-the-hard-way-exercise-001-d12492f950b5?source=rss-cd5e6e3e7bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/d12492f950b5</guid>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Lynn Chiang]]></dc:creator>
            <pubDate>Sun, 10 Dec 2017 09:45:30 GMT</pubDate>
            <atom:updated>2017-12-10T12:11:11.678Z</atom:updated>
            <content:encoded><![CDATA[<p>#非本科系學程式語言</p><p>雖然還不知道這些練習實際對未來的幫助<br>重頭到尾紮實練習總是踏實多了</p><h3>本篇包含：</h3><p><a href="#e8a5">Exercise #001 開始熟悉</a><br><a href="#1391">Exercise #002 加備註的練習</a><br><a href="#41fe">Exercise #003 用 Ruby 算數學</a></p><h3>Exercise #001 開始熟悉</h3><p>開一個 .rb 結尾的檔案，我的是 001.rb<br>在編輯器裡開始輸入 Exercise 1 的內容<br>或像我一樣一開始在 terminal 用 irb <br>一行一行試試看</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*nPFmS7Wm6cq4GwHFi6pAcw.png" /></figure><p>編輯器裡：</p><pre>#Learn ruby the hard way 001<br>puts “Hello World!” #Hello World!<br>puts “Hello Again” #Hello Again<br>puts “I like typing this.” #I like typing this.<br>puts “This is fun.” #This is fun.<br>puts “Yay! Printing.” #Yay! Printing.<br>puts “I’d much rather you ‘not’.” #I’d much rather you ‘not’.<br>puts ‘I “said” do not touch this.’ #I “said” do not touch this.</pre><p>最後，在 terminal 下指令：</p><pre>$ ruby 001.rb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/1*6w2gY6QRD2yDf1G0ZLzQEQ.png" /></figure><p>可能也會跟我一樣遇到：undefined local variable or method 或是 Syntax error 的提示</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*InWwvLOb1HWX5Y1Kto3dsg.png" /></figure><p>可能是因為寫了廢話在內容中，又忘了加備註 #哈哈<br>備註記得加 “#” 像是 -&gt; #Learn ruby the hard way 001</p><h3>Exercise #002 加備註的練習</h3><pre>#Learn ruby the hard way #002<br>#Exercises about how to comment<br>puts “I could hace code like this.” #and the comment after is ignores<br>#You can also use a comment to “disable” or comment our a piece of code.<br>#puts “This wont run”<br>puts “This will run”</pre><p>備註完全不會被 print 出來</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*-yqX4b_GM5DskzvmhbHmrA.png" /></figure><h3>Exercise #003 用 Ruby 算數學</h3><p>編輯器裡把練習手打出來：<br>或是在 irb 裡面跑跑看</p><pre>#Learn ruby the hard way #003<br>#Exercises about operators and how they work</pre><pre>puts “I will not count my chickens:” #I will not count my chickens:<br>puts “Hens #{25 + 30 / 6}” #Hens 30<br>puts “Roosters #[100–25 * 3 % 4]” #Roosters 97<br>puts “Now I will count the eggs” #Now I will count the eggs<br>puts 3 + 2 + 1–5 + 4 % 2–1 / 4 + 6 #7<br>puts “Is it true that 3 + 2 &lt; 5–7?” #Is it true that 3 + 2 &lt; 5–7?<br>puts 3 + 2 &lt; 5–7 #false<br>puts “what is 3 + 2 #{3 + 2}” #what is 3 + 25 btw#{} meaning ruby operator in string<br>puts “what is 5–7 #{5–7}” #what is 5–7 -2<br>puts “oh that’s why it’s false” #oh that’s why it’s false<br>puts “How about some more” #How about some more<br>puts “Is it greater #{5 &gt; -2}” #Is it greater true<br>puts “Is it greater or equal? #{5 &gt;= -2}” #Is it greater or equal? true<br>puts “Is it less or equal? #{5 &lt;= -2}” #Is it less or equal? false</pre><p>練習基本上就是先照做，去想 print 出來的結果為什麼是這樣。<br>內容包含基本得數學的運算，如先『 乘除 』後『 加減 』等基本觀念不提。</p><p>我覺得比較值得留意的是：<br>「 % 」表示取餘數，「 #{ } 」 表示在 text string 裡做運算</p><pre>puts “Roosters #[100–25 * 3 % 4]”   #Roosters 97</pre><p>檔案完成，存檔後回 terminal：</p><pre>$ ruby 003.rb</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*CaM7vQ2lTWxLO2hPa4JwdQ.png" /></figure><p>即可看見結果囉!</p><h3>後記</h3><p>在所有 Exercise 開始之前有許多安裝環境 ( ruby )、安裝編輯器 ( Atom ) <br>與熟悉 terminal 指令的指引等<br>在每個練習中會不斷遇到，建議先裝好、學會再開始練習<br>找個時間再把以前做的筆記丟上來</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d12492f950b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[重拾學習 & 重新產生 Github SSH Key]]></title>
            <link>https://medium.com/@lynnchiang/%E9%87%8D%E6%8B%BE%E5%AD%B8%E7%BF%92-%E9%87%8D%E6%96%B0%E7%94%A2%E7%94%9F-github-ssh-key-e2367a4ad777?source=rss-cd5e6e3e7bde------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2367a4ad777</guid>
            <dc:creator><![CDATA[Lynn Chiang]]></dc:creator>
            <pubDate>Sun, 10 Dec 2017 07:38:55 GMT</pubDate>
            <atom:updated>2017-12-10T12:18:17.229Z</atom:updated>
            <content:encoded><![CDATA[<p>#人真的是不能沒有朋友</p><h4>本篇包含：</h4><ol><li>近期重拾程式學習的心路歷程</li><li>重新 Generate Github SSH Key 與遇到的困難、解法筆記</li></ol><h3>前言</h3><p>今天與鄰居好友分享自己 chrome 分頁內容的演進，覺得自己改變很多。</p><p>工作第一年下班與週末偶爾宅在家， chrome 都是開10 幾 20 個分頁在 看美劇、買淘寶、看電影，每周追美劇真是太過癮了。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*61x18HDEObLJMpSzAvA_Xw.png" /></figure><p>第二年開始 Marketing 職位，常常宅在家。</p><p>會開至少三個 chrome，目測 50 頁，各種 google sheet 或 Google AdWords 或 Bing 關鍵字 的頁面，儘管週末 chrome 還是捨不得關，好像隨時都可以重整看一下情況。</p><p>如果再加開 Ai+Ps 那些未做完的圖、未修完的照片，都覺得電腦要起飛燒壞了…( 悠哉時，美劇電影照舊，啊，後來都在手機淘寶 )</p><p>然後，最近這幾週，都是 stackoverflow 與 github help，算是人生有很大的長進 ( 吧？) 至少我是這樣覺得</p><p>廢文結束，進入正題 —</p><h3>到底要幹嘛？</h3><p>荒廢近三個月程式學習的狀態讓我每天都很囧，工作以外的時間，覺得自己一事無成。每天睡前與睡醒都會很煩惱，覺得需要方向重新開始，卻又不知道往哪裡前進。( 講的像是失戀一樣 )</p><p>一方面又因為目標不夠明確，導致不夠熟悉與害怕問題、另一方面怕讓所有曾幫助過我的工程師大大們失望。</p><p>終於三週前與公司工程師女神 Nana 、鄰居同事兼好友 Ryan 聊過當時自己的選擇後，我決定重新開始。他們推薦了用 Rails 寫一個 blog 試試，我馬上找到了<a href="https://www.youtube.com/watch?v=BI_VnnOLSKY"> Mackenzie Child 的 How to Build a Rails Blog in Rails 4</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*lO56aSItRWKgM0MeKWCDpw.png" /></figure><p>Mackenzie Child 原本是個前端工程師兼 UI/UX，在「 想成為 unicorn 的目標之下 」，他開始學 Rails 跨到後端。他在12 週做了 12 個 Web App，還錄影下來分享給大家，真的很猛！</p><p>( 詳見：<a href="https://www.inside.com.tw/2015/01/27/how-i-finally-learned-to-build-stuff-with-rails">我是這樣學會 Ruby on Rails：12 個星期打造 12 個網頁 APP</a> )</p><p>回到正題，但沒想到影片 10 分鐘的內容我要做三小時，卡在各種 terminal 下指令與權限搞錯的問題，真是好氣又好笑。( 像是，repo 沒有建在平常使用的 user 之下，導致每一行指令都要 sudo 或是用 root 才能執行 ，最後敗在在 sublime 裡 View 之下無法新增檔案，才森氣氣砍掉重來 - - )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*Q38apmXsGGYj7ovn-YN2_g.png" /></figure><p>又沒想到學到第 2 個 10 分鐘，卡在一個 debug 的時候，我問了這個問題</p><blockquote>我：@post, :posts, 大寫 Post 的差異是什麼？Params 是什麼？</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*z1NcBREBx9IpkBNs_WMjXA.png" /></figure><p>才終於被發現我自己 Ruby 觀念根本嚴重不足 ( 嚴格來說，可能連基礎都沒有哈哈哈 )</p><blockquote>Ryan：只會用框架做出東西是沒有用的，基礎觀念沒有，以後會很慘</blockquote><p>好吧，來，Rails 先放著，先從 Ruby 觀念學起，開始了 <a href="https://learnrubythehardway.org/book/">Learn Ruby The Hard Way</a> 練習。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*pbPBhq2fdzWIYf5fzNdy7Q.png" /></figure><p>千呼萬喚始出來，在把 Learn Ruby The Hard Way 練習紀錄 push 到 git 的時候，引發了本文的正題 SSH Key 的問題。</p><p>感恩惜福兩個月前工程師大大 Lucas 詳盡的介紹過 SSH Key，我才對 public key 這段錯誤提示不那麼陌生。果然就是要先培養對這些內容的感覺才不會怕？ 哈哈哈哈</p><p>錯誤提示：</p><blockquote>Permission denied (publickey).<br>fatal: Could not read from remote repository.</blockquote><h3>SSH Key 是什麼？作用是？</h3><p>在開始解問題之前，首先幫我自己複習一下 SSH Key 的作用是什麼？Github 的 SSH Key 是用來驗證 local 身份、綁住你的 Github 帳號，可以想像是當你需要與 remote server 連接的時候的一把鑰匙。</p><h3>為什麼要重新產生一個 SSH Key？</h3><p>我遇到的問題是換過一台電腦，導致 github 帳號無法驗證我的身份。這個問題體現在 git push 的時候出現 permission denied (publickey) 的錯誤提示。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*MZh4PX31BkLDfCnM_47_lg.png" /></figure><p>google 這些錯誤提示之後會看到很多 stackoverflow 的問答，後來直接用 github <a href="https://help.github.com/articles/error-permission-denied-publickey/">官方的回答來 debug</a></p><p>Terminal 輸入指令：</p><pre>$ ssh -vT <a href="/service/mailto:git@github.com">git@github.com</a></pre><p>則會跑出許多 debug 提示，讀了提示才發現 github 只會去特定 folder 找特定名字的 public key，而我在產生 SSH Key 時不小心自己命名 folder 了…</p><p>試過刪除 repo 裡的 .git 檔案，終究沒有成功，才決定試試產生新的 SSH Key ，再一次新增到自己的 Github Setting 來解決。</p><h3>如何重新產生？</h3><p>再次對 Terminal 輸入指令：</p><pre>$ ssh-keygen -t rsa -b 4096 -C “<a href="/service/mailto:your_email@example.com">your_email@example.com</a>”</pre><p>接著會看見提示輸入 SSH Key 的 filename，請不要上當，直接按 Enter</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*I-M3VKHIHvkoaGbrG_TPzA.png" /></figure><p>最後輸入一組密碼兩次，這個密碼在 git push 的時候都會需要輸入，請詳記下來！</p><p>步驟詳見：<a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/">產生一組新的 SSH 與 新增至 SSH Agent (en)</a></p><p>最後，用編輯器打開 id_rsa.pub 找到你的 Public SSH Key ( ssh-rsa 開頭，最後會是一個 email )，再回到 Github 的 Profile Setting 裡新增 SSH Key 並貼上、儲存，就大功告成了！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*JVJZFtZoYuc62F7QUTtx6A.png" /></figure><p>完成 SSH Key 這部分後，鑰匙會變成綠色的 ( 如圖 ) 接著終於可以 git push 到 remote 了，覺得豪感動。</p><p>希望每個解很久才了解的小觀念進步，都是鋪墊未來的一大步。</p><h3>後記</h3><p>很幸運的身邊的工程師們不嫌煩，很正向的幫我 ( 問進度，大部分讓我自己想 )，還有朋友對於文字紀錄的啟發。希望本篇超級菜鳥的筆記也可以幫助到正在找資源、閱讀本文的你／妳。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2367a4ad777" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>