<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ted | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/author/hameba_wp_ted/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Sat, 29 Feb 2020 15:42:47 +0800</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.3</generator>

<image>
	<url>https://sdt.hameba.tw/wp-content/uploads/2020/02/hameba_favicon-150x150.png</url>
	<title>Ted | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>python 取得終端機指令</title>
		<link>https://sdt.hameba.tw/630/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-%25e5%258f%2596%25e5%25be%2597%25e7%25b5%2582%25e7%25ab%25af%25e6%25a9%259f%25e6%258c%2587%25e4%25bb%25a4</link>
				<comments>https://sdt.hameba.tw/630/#respond</comments>
				<pubDate>Sat, 29 Feb 2020 15:42:47 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=630</guid>
				<description><![CDATA[<p>有時後在執行一些功能時，會習慣從終端機直接帶一些參數，好取得特定的資料，那python 程式碼要如何取得終端機 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/630/" class="more-link">閱讀全文<span class="screen-reader-text">〈python 取得終端機指令〉</span></a></p>
The post <a href="https://sdt.hameba.tw/630/">python 取得終端機指令</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>有時後在執行一些功能時，會習慣從終端機直接帶一些參數，好取得特定的資料，那python 程式碼要如何取得終端機的指令？</p>
<p><span id="more-630"></span></p>
<p>很簡單，只要使用 python 標準函式庫 sys 模組裡的 <code>argv</code> 變數就可以了。</p><pre class="crayon-plain-tag"># 範例程式碼
# 只要在終端機輸入：<span class="pre">python</span> <span class="pre">demo.py</span> <span class="pre">one</span> two<span class="pre">
</span>
&gt;&gt;&gt; import sys
&gt;&gt;&gt; print(sys.argv)
['demo.py', 'one', 'two']</pre><p>如果要更為複雜的使用終端機輸入的指令的話，可以使用  sys 模組裡的 <a class="reference internal" title="argparse: Command-line option and argument parsing library." href="https://docs.python.org/zh-tw/3/library/argparse.html#module-argparse"><code class="xref py py-mod docutils literal notranslate"><span class="pre">argparse</span></code></a> 變數。</p>
<p>參考文件</p>
<p><a href="https://docs.python.org/zh-tw/3/tutorial/stdlib.html">https://docs.python.org/zh-tw/3/tutorial/stdlib.html</a></p>The post <a href="https://sdt.hameba.tw/630/">python 取得終端機指令</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/630/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>在執行 Git 操作時，發生卡住的狀況</title>
		<link>https://sdt.hameba.tw/628/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8%25e5%259f%25b7%25e8%25a1%258c-git-%25e6%2593%258d%25e4%25bd%259c%25e6%2599%2582%25ef%25bc%258c%25e7%2599%25bc%25e7%2594%259f%25e5%258d%25a1%25e4%25bd%258f%25e7%259a%2584%25e7%258b%2580%25e6%25b3%2581</link>
				<comments>https://sdt.hameba.tw/628/#respond</comments>
				<pubDate>Sat, 29 Feb 2020 14:23:02 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=628</guid>
				<description><![CDATA[<p>之前有發生過下 Git 指令時，終端機給了我這樣的訊息 [crayon-6413ce97ec3ba523365 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/628/" class="more-link">閱讀全文<span class="screen-reader-text">〈在執行 Git 操作時，發生卡住的狀況〉</span></a></p>
The post <a href="https://sdt.hameba.tw/628/">在執行 Git 操作時，發生卡住的狀況</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>之前有發生過下 Git 指令時，終端機給了我這樣的訊息</p><pre class="crayon-plain-tag">Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.</pre><p><span id="more-628"></span></p>
<p>後來查了一下，會發生這個原因，通常會是以下情況發生的</p>
<ol>
<li>同時執行了兩個 Git 的指令時，有可能一個操作是來自終端機，另一個來自 IDE。</li>
<li>有時強制關閉進行中的 Git 操作，這個檔案沒有被自動刪除，之後你就無法進行其他操作。</li>
</ol>
<p>發生這種狀況的時候，Git 通常會在此專案的 Git 資料夾裡面，產生一個 index.lock 的檔案，通常在進行某些比較費時的git操作時自動生成，操作結束後自動刪除，相當於一個鎖定檔案，目的在於防止對一個目錄同時進行多個操作。</p>
<p>要如何解決這個情形呢？</p>
<p>只要刪除 index.lock 檔案即可。</p><pre class="crayon-plain-tag">rm -f .git/index.lock</pre><p>參考資料：</p>
<p><a href="https://stackoverflow.com/questions/38004148/another-git-process-seems-to-be-running-in-this-repository">https://stackoverflow.com/questions/38004148/another-git-process-seems-to-be-running-in-this-repository</a></p>
<p><a href="https://iter01.com/331280.html">https://iter01.com/331280.html</a></p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/628/">在執行 Git 操作時，發生卡住的狀況</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/628/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>CSS 視窗捲動效果</title>
		<link>https://sdt.hameba.tw/596/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-%25e8%25a6%2596%25e7%25aa%2597%25e6%258d%25b2%25e5%258b%2595%25e6%2595%2588%25e6%259e%259c</link>
				<comments>https://sdt.hameba.tw/596/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 13:35:10 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[scroll-behavior]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=596</guid>
				<description><![CDATA[<p>在做網頁的時，我們為了要讓某些連結點了之後移動到適當的位置，我們會透過 HTML anchor link 定義 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/596/" class="more-link">閱讀全文<span class="screen-reader-text">〈CSS 視窗捲動效果〉</span></a></p>
The post <a href="https://sdt.hameba.tw/596/">CSS 視窗捲動效果</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>在做網頁的時，我們為了要讓某些連結點了之後移動到適當的位置，我們會透過 HTML anchor link 定義此連結，達到上述的功能。</p>
<p><span id="more-596"></span></p>
<p>不過這個功能的體驗，感覺就是閃一下，就跳到要顯示的位置上，感覺並不怎麼好，所以這時候就可以使用 CSS 屬性 <code>scroll-behavior</code> 來達到平滑移動的效果啦。</p><pre class="crayon-plain-tag">// scroll-behavior

html {
    scroll-behavior: smooth
}</pre><p>不過此 scroll-behavior CSS 屬性好像並不支援 safari 瀏覽器，所以如果也想要支援 safari 瀏覽器的朋友們，可能就要換另外一種方法了。</p>
<p>參考連結：<a href="https://developer.mozilla.org/zh-CN/docs/Web/CSS/scroll-behavior">https://developer.mozilla.org/zh-CN/docs/Web/CSS/scroll-behavior</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/596/">CSS 視窗捲動效果</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/596/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>NPM 檢查過期套件模組</title>
		<link>https://sdt.hameba.tw/542/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=npm-%25e6%25aa%25a2%25e6%259f%25a5%25e9%2581%258e%25e6%259c%259f%25e5%25a5%2597%25e4%25bb%25b6%25e6%25a8%25a1%25e7%25b5%2584</link>
				<comments>https://sdt.hameba.tw/542/#respond</comments>
				<pubDate>Sun, 23 Feb 2020 13:32:11 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[npm]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=542</guid>
				<description><![CDATA[<p>對於前端開發者來說，相信 NPM (Node Package Manager) 大家一定都不陌生，它是一個線上 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/542/" class="more-link">閱讀全文<span class="screen-reader-text">〈NPM 檢查過期套件模組〉</span></a></p>
The post <a href="https://sdt.hameba.tw/542/">NPM 檢查過期套件模組</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>對於前端開發者來說，相信 NPM (Node Package Manager) 大家一定都不陌生，它是一個線上 JavaScript 套件庫，使用者可以根據自己的需求，下載套件來使用。</p>
<p><span id="more-542"></span></p>
<p>線上的套件，會因為各種因素，而有新版本的更新，要如何知道自己現在用的套件有沒有過期？是否有更新的版本，這時候就可以用以下指令來確認啦。</p><pre class="crayon-plain-tag">// 檢查專案中，使用的 NPM 套件是否過期
npm outdated</pre><p>他會列出當前你這專案中使用的套件中，有沒有新版本的更新，如果有會列出你當前這個套件的的版本號 (Current)、滿足 package.json 中指定的 semver 範圍的軟件包的最高版本(Wanted)、此套件最新的版本號 ( Latest )，及這個專個套件的所在的專案範圍 (Location)，如果沒有，就不會列出。</p>
<p>參考文章 <a href="https://docs.npmjs.com/cli-commands/outdated.html">https://docs.npmjs.com/cli-commands/outdated.html</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/542/">NPM 檢查過期套件模組</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/542/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>JavaScript includes 用法</title>
		<link>https://sdt.hameba.tw/527/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-includes-%25e7%2594%25a8%25e6%25b3%2595</link>
				<comments>https://sdt.hameba.tw/527/#respond</comments>
				<pubDate>Thu, 20 Feb 2020 15:44:31 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=527</guid>
				<description><![CDATA[<p>相信大家常常在做字串比對的處理，這次我要介紹一個新的字串比對處理方法 includes ， 他會用你指定的字串 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/527/" class="more-link">閱讀全文<span class="screen-reader-text">〈JavaScript includes 用法〉</span></a></p>
The post <a href="https://sdt.hameba.tw/527/">JavaScript includes 用法</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>相信大家常常在做字串比對的處理，這次我要介紹一個新的字串比對處理方法 <code>includes</code> ， 他會用你指定的字串去搜尋要比對的內容中，是否有匹配的字。</p>
<p><span id="more-527"></span></p>
<p>語法:  string.includes(&lt;要搜尋的字&gt;, &lt;要比對的位置&gt;)。</p>
<p>回傳的值：true / false，有找到要搜尋的字會回傳 true，反之則是 false。</p><pre class="crayon-plain-tag">// JavaScript includes method

// example

const string = 'This is a test';

console.log(string.includes('test')); // true
// 注意這邊連大小寫都會區分出來，如果不一樣，會回傳 false
console.log(string.includes('Test')); // false
console.log(string.includes('hello')); // false</pre><p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/527/">JavaScript includes 用法</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/527/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>人都會變！</title>
		<link>https://sdt.hameba.tw/508/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e4%25ba%25ba%25e9%2583%25bd%25e6%259c%2583%25e8%25ae%258a%25ef%25bc%2581</link>
				<comments>https://sdt.hameba.tw/508/#respond</comments>
				<pubDate>Sun, 02 Feb 2020 08:51:38 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[人生]]></category>
		<category><![CDATA[感想]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=508</guid>
				<description><![CDATA[<p>這次過年的期間，有跟一陣子沒見面的朋友聊了一下最近的狀況，這次談話裡面印象最深刻的就是有聊到 人都會變  ，當 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/508/" class="more-link">閱讀全文<span class="screen-reader-text">〈人都會變！〉</span></a></p>
The post <a href="https://sdt.hameba.tw/508/">人都會變！</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>這次過年的期間，有跟一陣子沒見面的朋友聊了一下最近的狀況，這次談話裡面印象最深刻的就是有聊到 <code>人都會變</code>  ，當下聊到句的時候只覺得這句聽起來有點無奈加悲傷的感覺，並沒有特別留意，之後也約好那個禮拜的禮拜五晚上要一起看個電影，順便吃個晚飯。</p>
<p><span id="more-508"></span></p>
<p>結果到了禮拜五那天，我清楚記得大約下午五點的時候，他跟我講他現在已經下班了，因為我這邊沒有辦法這麼快下班的緣故，所以先取消這次的約，我看到這訊息的當下是滿腦子問號啊，不過還是接受了這個事實。</p>
<p>快速結束這話題後，到了下班時間，腦中慢慢開始浮現，過年我們聊到 <code>人都會變</code> 這句話，這不由得讓我仔細思考了這其中所代表的含義  &#8230;.</p>The post <a href="https://sdt.hameba.tw/508/">人都會變！</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/508/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Git 刪除分支</title>
		<link>https://sdt.hameba.tw/476/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-%25e5%2588%25aa%25e9%2599%25a4%25e5%2588%2586%25e6%2594%25af</link>
				<comments>https://sdt.hameba.tw/476/#respond</comments>
				<pubDate>Sun, 12 Jan 2020 17:40:56 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=476</guid>
				<description><![CDATA[<p>每過一段時間，都要定時清理一下專案上分支的數量，不然時間一長，清理起來會很痛苦，所以這邊紀錄一下 Git 刪除 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/476/" class="more-link">閱讀全文<span class="screen-reader-text">〈Git 刪除分支〉</span></a></p>
The post <a href="https://sdt.hameba.tw/476/">Git 刪除分支</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>每過一段時間，都要定時清理一下專案上分支的數量，不然時間一長，清理起來會很痛苦，所以這邊紀錄一下 Git 刪除分支的語法。</p>
<p><span id="more-476"></span></p><pre class="crayon-plain-tag"># 刪除 local 的分支
git branch (-d | -D) &lt;branch name&gt;
e.g. git branch -d branch_test
e.g. git branch -D branch_test

# 刪除 remote 的分支
git push &lt;remote_name&gt; :&lt;branch name&gt;
e.g. git push origin :branch_test

git push &lt;remote_name&gt; --delete &lt;branch_name&gt;
e.g. git push origin --delete branch_test</pre><p>上述就是 Git 如何刪除分支的方法，不用懷疑，刪除 remote 分支就是那麼的簡單，只要在想刪除的 remote 分支前面加上 <code>:</code> 就可以了，注意，這邊 <code>:</code> 跟分支之間是沒有空格的喔。</p>
<p>參考資料:</p>
<p><a href="https://git-scm.com/docs/git-branch">https://git-scm.com/docs/git-branch</a></p>
<p><a href="https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely">https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-locally-and-remotely</a></p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/476/">Git 刪除分支</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/476/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Linux 指令 ls 以時間做排序列出檔案</title>
		<link>https://sdt.hameba.tw/468/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-%25e6%258c%2587%25e4%25bb%25a4-ls-%25e4%25bb%25a5%25e6%2599%2582%25e9%2596%2593%25e5%2581%259a%25e6%258e%2592%25e5%25ba%258f%25e5%2588%2597%25e5%2587%25ba%25e6%25aa%2594%25e6%25a1%2588</link>
				<comments>https://sdt.hameba.tw/468/#respond</comments>
				<pubDate>Tue, 07 Jan 2020 16:51:43 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ls]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=468</guid>
				<description><![CDATA[<p>Linux 指令 ls 以時間排序列出檔案，上網查了一下文章，這邊做個筆記記錄一下。 [crayon-6413 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/468/" class="more-link">閱讀全文<span class="screen-reader-text">〈Linux 指令 ls 以時間做排序列出檔案〉</span></a></p>
The post <a href="https://sdt.hameba.tw/468/">Linux 指令 ls 以時間做排序列出檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Linux 指令 ls 以時間排序列出檔案，上網查了一下文章，這邊做個筆記記錄一下。</p>
<p><span id="more-468"></span></p><pre class="crayon-plain-tag"># 列出檔案，如果要以修改檔案的時間排序，只要加入參數 -t 即可
# 預設都會由最近的時間開始往下排
ls -lt

# 如果順序要由遠到近的話，只要在補上參數 -r 即可
ls -ltr</pre><p>如果不確定是否真的是按造修改的時間來排序，可以使用 <code>touch</code> 指令，來更改指定檔案或目錄的時間戳記 ，然後再馬上以 <code>ls -lt</code> 指令查看修改時間，通常被 touch 指令的檔案都會跑到最上面，因為他的更動時間已經被更改了。</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/468/">Linux 指令 ls 以時間做排序列出檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/468/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>網頁 scroll bar 顯示</title>
		<link>https://sdt.hameba.tw/458/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=css-overflow-%25e5%25b1%25ac%25e6%2580%25a7</link>
				<comments>https://sdt.hameba.tw/458/#respond</comments>
				<pubDate>Sun, 05 Jan 2020 16:09:22 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=458</guid>
				<description><![CDATA[<p>之前 PM 有需求，說想要頁面上 scroll bar 會一直出現，不要等滑動的時候才顯示， 所以做了一些 C &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/458/" class="more-link">閱讀全文<span class="screen-reader-text">〈網頁 scroll bar 顯示〉</span></a></p>
The post <a href="https://sdt.hameba.tw/458/">網頁 scroll bar 顯示</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>之前 PM 有需求，說想要頁面上 scroll bar 會一直出現，不要等滑動的時候才顯示，</p>
<p>所以做了一些 CSS scroll bar 的屬性的測試，這邊做一下記錄。</p>
<p><span id="more-458"></span></p><pre class="crayon-plain-tag">// 滑動時，才會顯示。
.test {
overflow: scroll;
}

// 不滑動時，如果內容長度有超過限制的高度，也會顯示。
.test {
overflow: auto;
}</pre><p>不過這邊值得注意的一點是， windows 系統跟 mac 不太一樣，上面的設定在 window 執行的很順利，在 mac 上，還需要做一些額外的設定，才可以達到不滑動時，也出  scroll bar 的效果。</p><pre class="crayon-plain-tag"># mac 設定

# 系統偏好設定 -&gt; 一般 -&gt; 顯示捲軸 -&gt; 勾選 (總是)

# 完成以上設定就可以了。</pre><p>&nbsp;</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/458/">網頁 scroll bar 顯示</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/458/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>JavaScript every 用法</title>
		<link>https://sdt.hameba.tw/404/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-every-%25e7%2594%25a8%25e6%25b3%2595</link>
				<comments>https://sdt.hameba.tw/404/#respond</comments>
				<pubDate>Sun, 29 Dec 2019 16:03:17 +0000</pubDate>
		<dc:creator><![CDATA[Ted]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=404</guid>
				<description><![CDATA[<p>前篇介紹過 JavaScript some 函式的用法，some 函式的用途是只要其陣列的其中一個數值，有通過 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/404/" class="more-link">閱讀全文<span class="screen-reader-text">〈JavaScript every 用法〉</span></a></p>
The post <a href="https://sdt.hameba.tw/404/">JavaScript every 用法</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>前篇介紹過 JavaScript <code>some</code> 函式的用法，<code>some</code> 函式的用途是只要其陣列的其中一個數值，有通過 callback 函式的測試，就代表其陣列是符合需求的，但 <code>every</code> 恰恰相反，他是要全部得數值都通過，才算數喔。</p>
<p><span id="more-404"></span></p>
<p>JavaScript <code>every</code> ，此方法跟 <code>some</code> 很像，也是透過給予的 callback 函式，去檢視測試的目標陣列中，是否有數值，符合/ 通過 callback 函式的檢測，其回傳的內容，也是布林值 <code>true</code> /  <code>false</code>。</p><pre class="crayon-plain-tag">// 這次一樣使用判斷是否是偶數來舉例
let even = function(element) {
  // 希望數值是偶數
  return element % 2 === 0;
};
let array = [1, 3, 5];
console.log(array.every(even)); // false

let array2 = [1, 2, 5];
console.log(array2.every(even)); // false

let array3 = [2, 4, 6];
console.log(array3.every(even)); // true，因為所有條件成立</pre><p>參考資料：<a href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Array/every">https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Array/every</a></p>
<p>&nbsp;</p>
<div id="gtx-trans">
<div class="gtx-trans-icon"></div>
</div>The post <a href="https://sdt.hameba.tw/404/">JavaScript every 用法</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/404/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
