<?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>Li Der | SDT 攻城獅區</title>
	<atom:link href="https://sdt.hameba.tw/author/hameba_wp_der/feed/" rel="self" type="application/rss+xml" />
	<link>https://sdt.hameba.tw</link>
	<description>由Steven, Der, Ted 三位高級打字員所組成，是三位工程師(攻城獅)所維護的技術分享平台，或許偶爾會分享一些日常，有任何問題或是錯誤的部分，歡迎留言告訴我們！</description>
	<lastBuildDate>Fri, 05 Aug 2022 16:45:13 +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>Li Der | SDT 攻城獅區</title>
	<link>https://sdt.hameba.tw</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>安裝Python以及安裝編輯器VSCode</title>
		<link>https://sdt.hameba.tw/663/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25ae%2589%25e8%25a3%259dpython%25e4%25bb%25a5%25e5%258f%258a%25e5%25ae%2589%25e8%25a3%259d%25e7%25b7%25a8%25e8%25bc%25af%25e5%2599%25a8vscode</link>
				<comments>https://sdt.hameba.tw/663/#respond</comments>
				<pubDate>Thu, 04 Aug 2022 16:57:12 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[VSCode]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=663</guid>
				<description><![CDATA[<p>Python是一種直譯語言，需要執行平台(runtime)。 Python官網可以直接下載Python3然後安 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/663/" class="more-link">閱讀全文<span class="screen-reader-text">〈安裝Python以及安裝編輯器VSCode〉</span></a></p>
The post <a href="https://sdt.hameba.tw/663/">安裝Python以及安裝編輯器VSCode</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>Python是一種直譯語言，需要執行平台(runtime)。</p>
<p><a href="https://www.python.org/downloads/" target="_blank" rel="noopener noreferrer">Python官網</a>可以直接下載Python3然後安裝。<em>(範例為Python 3.10.6)</em></p>
<p><span id="more-663"></span></p>
<p><span style="color: #ff0000"><strong>＊Python2已經不會再出新版本，已在2020/01/01停止官方支援</strong></span></p>
<p><img class="size-medium wp-image-666" src="https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-300x199.png" alt="DownloadPython" width="300" height="199" srcset="https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-300x199.png?v=1659630158 300w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-1024x680.png?v=1659630158 1024w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-768x510.png?v=1659630158 768w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-1536x1020.png?v=1659630158 1536w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadPython-2048x1360.png?v=1659630158 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>俗話說得好「工欲善其事，必先利其器」，接下來～</p>
<p>我們需要一個拿來寫程式的文字編輯器，讓我們來<a href="https://code.visualstudio.com/Download" target="_blank" rel="noopener noreferrer">下載VSCode</a>安裝。</p>
<p><img class="alignnone size-medium wp-image-667" src="https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-300x177.png" alt="DownloadVSCode" width="300" height="177" srcset="https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-300x177.png?v=1659630571 300w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-1024x603.png?v=1659630571 1024w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-768x452.png?v=1659630571 768w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-1536x904.png?v=1659630571 1536w, https://sdt.hameba.tw/wp-content/uploads/2022/08/DownloadVSCode-2048x1205.png?v=1659630571 2048w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>安裝好VSCode後，讓我們把它打開來並且安裝延伸模組。</p>
<p>點選『延伸模組』並輸入python，會看到「Python」讓我們安裝它。</p>
<p><img class="alignnone size-medium wp-image-668" src="https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension-300x271.png" alt="VSCodePythonExtension" width="300" height="271" srcset="https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension-300x271.png?v=1659631911 300w, https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension-1024x924.png?v=1659631911 1024w, https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension-768x693.png?v=1659631911 768w, https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension-1536x1385.png?v=1659631911 1536w, https://sdt.hameba.tw/wp-content/uploads/2022/08/VSCodePythonExtension.png?v=1659631911 1662w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>這樣子我們都準備好，可以開始寫Python程式了！</p>
<blockquote><p>Python檔案的副檔名 .py</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>參考資料：</p>
<p><a href="https://www.youtube.com/watch?v=CXZYvNRIAKM&amp;list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6&amp;index=3" target="_blank" rel="noopener noreferrer">Getting Started | Python for Beginners [3 of 44]</a></p>
<p><a href="https://www.youtube.com/watch?v=EU8eayHWoZg&amp;list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6&amp;index=4" target="_blank" rel="noopener noreferrer">Configuring Visual Studio Code | Python for Beginners [4 of 44]</a></p>
<p><a href="https://www.python.org/downloads/" target="_blank" rel="noopener noreferrer">Download Python</a></p>
<p><a href="https://code.visualstudio.com/Download" target="_blank" rel="noopener noreferrer">Download Visual Studio Code</a></p>The post <a href="https://sdt.hameba.tw/663/">安裝Python以及安裝編輯器VSCode</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/663/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Windows 7 忘記系統管理員密碼與把使用者加入Administrators群組</title>
		<link>https://sdt.hameba.tw/648/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=windows-7-%25e5%25bf%2598%25e8%25a8%2598%25e7%25b3%25bb%25e7%25b5%25b1%25e7%25ae%25a1%25e7%2590%2586%25e5%2593%25a1%25e5%25af%2586%25e7%25a2%25bc%25e8%2588%2587%25e6%258a%258a%25e4%25bd%25bf%25e7%2594%25a8%25e8%2580%2585%25e5%258a%25a0%25e5%2585%25a5administrators%25e7%25be%25a4%25e7%25b5%2584</link>
				<comments>https://sdt.hameba.tw/648/#respond</comments>
				<pubDate>Thu, 21 Jan 2021 16:02:10 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=648</guid>
				<description><![CDATA[<p>需要administrator權限執行系統的使用者， 不知道為什麼被從administrators群組移除了， &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/648/" class="more-link">閱讀全文<span class="screen-reader-text">〈Windows 7 忘記系統管理員密碼與把使用者加入Administrators群組〉</span></a></p>
The post <a href="https://sdt.hameba.tw/648/">Windows 7 忘記系統管理員密碼與把使用者加入Administrators群組</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>需要administrator權限執行系統的使用者，</p>
<p>不知道為什麼被從administrators群組移除了，</p>
<p><span id="more-648"></span></p>
<p>無奈沒有系統管理員的密碼，只好想想其他辦法。</p>
<p>參考不少網路上的方法，不外乎是要將螢幕小鍵盤改成命令提示字元。</p>
<p>因為沒有administrator的密碼，</p>
<p>只好出動安裝光碟(修復您的電腦)或是開機光碟。</p><pre class="crayon-plain-tag">cd windows\system32
copy cmd.exe cmd.exe_bak
copy osk.exe osk.exe_bak
del osk.exe
ren cmd.exe osk.exe
shutdown –r –t 00</pre><p>重開機後，Windows登入畫面左下角&#8221;輕鬆存取&#8221;，</p>
<p>開啟被我們修改過後的&#8221;螢幕小鍵盤&#8221;，就可以把命令提示字元打開了。</p>
<p>接下來將使用者加入到Administrators群組裡。</p><pre class="crayon-plain-tag">net localgroup administrators 使用者名稱 /add</pre><p>大功告成！</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/648/">Windows 7 忘記系統管理員密碼與把使用者加入Administrators群組</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/648/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>JAVA讀取及寫入TXT檔案</title>
		<link>https://sdt.hameba.tw/641/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java%25e8%25ae%2580%25e5%258f%2596%25e5%258f%258a%25e5%25af%25ab%25e5%2585%25a5txt%25e6%25aa%2594%25e6%25a1%2588</link>
				<comments>https://sdt.hameba.tw/641/#respond</comments>
				<pubDate>Thu, 16 Jul 2020 16:24:22 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=641</guid>
				<description><![CDATA[<p>練習用JAVA讀取及寫入TXT檔案，一併順手記錄下來。 會使用到BufferedReader跟FileRead &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/641/" class="more-link">閱讀全文<span class="screen-reader-text">〈JAVA讀取及寫入TXT檔案〉</span></a></p>
The post <a href="https://sdt.hameba.tw/641/">JAVA讀取及寫入TXT檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>練習用JAVA讀取及寫入TXT檔案，一併順手記錄下來。</p>
<p>會使用到<span style="font-size: 1rem">BufferedReader跟</span><span style="font-size: 1rem">FileReader還有</span><span style="font-size: 1rem">FileWriter</span></p>
<p><span id="more-641"></span></p>
<p>先用一支程式來建立TXT檔，再來把這TXT檔案的內容寫到另一個新的文字檔</p><pre class="crayon-plain-tag">import java.io.FileWriter;

public class Write {
    public static void main(String[] args) {
        try {
            // Constructs a FileWriter object given a file name.
            FileWriter fw = new FileWriter("one.txt");
            fw.write("This is one!");
            fw.flush();
            fw.close();
        } catch (Exception e) {
            System.out.println("Something Error");
        }

    }
}</pre><p>編譯跟執行一下</p><pre class="crayon-plain-tag">javac Write.java
java -cp . Write</pre><p>就可以在目錄底下看到「one.txt」這個檔案</p>
<p>接下來就到我們的主題了，我們要把這檔案讀出來然後寫入到另一個檔案</p><pre class="crayon-plain-tag">import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;

public class ReadAndWrite {
    public static void main(String[] args) {
        try {
            // Creates a new FileReader, given the name of the file to read from.
            FileReader fr = new FileReader("one.txt");
            // Creates a buffering character-input stream that uses a default-sized input buffer.
            BufferedReader br = new BufferedReader(fr);
            String content = "";
            while (br.ready()) {
                content = br.readLine();
                System.out.println("Ready... read txt");
                System.out.println("-------------");
                System.out.println(content);
                System.out.println("-------------");
            }

            // Constructs a FileWriter object given a file name.
            FileWriter fw = new FileWriter("target.txt");
            fw.write(content);

            fw.flush();
            System.out.println("Write Complete!");
            // After used close.
            fr.close();
            fw.close();
        } catch (Exception e) {
            System.out.println("Something Error");
        }

    }
}</pre><p>編譯執行了之後，就會出現「target.txt」的檔案</p><pre class="crayon-plain-tag">javac ReadAndWrite.java 
java -cp . ReadAndWrite</pre><p>完成！</p>
<p>&nbsp;</p>
<p>之後有機會再分享讀取及寫入多行的方式。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/641/">JAVA讀取及寫入TXT檔案</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/641/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Python初學者教學影片</title>
		<link>https://sdt.hameba.tw/606/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python%25e5%2588%259d%25e5%25ad%25b8%25e8%2580%2585%25e6%2595%2599%25e5%25ad%25b8%25e5%25bd%25b1%25e7%2589%2587</link>
				<comments>https://sdt.hameba.tw/606/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 16:29:46 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=606</guid>
				<description><![CDATA[<p>＃＃ 2022/08/05 更新  (持續更新中)＃＃ 學習任何一種新的語言時， 最大的障礙可能就是不知道從哪 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/606/" class="more-link">閱讀全文<span class="screen-reader-text">〈Python初學者教學影片〉</span></a></p>
The post <a href="https://sdt.hameba.tw/606/">Python初學者教學影片</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>＃＃ <strong>2022/08/05 更新  (持續更新中)</strong>＃＃</p>
<p>學習任何一種新的語言時，</p>
<p>最大的障礙可能就是不知道從哪裡開始。</p>
<p><span id="more-606"></span></p>
<p>微軟有推出Python程式語言的教學影片。</p>
<p>總共有44支影片，長度最長的也只有12分鐘。</p>
<p><iframe title="Python for Beginners" width="525" height="295" src="https://www.youtube.com/embed/videoseries?list=PLlrxD0HtieHhS8VzuMCfQD4uJ9yne1mE6" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>
<p><del>有機會再分享影片中各個章節！</del></p>
<p>分享各個章節的重點部分：</p>
<p><strong>第1章節 &#8211; 講師介紹 (Susan Ibach &amp; Christopher Harrison)</strong></p>
<p><strong>第2章節 &#8211; 什麼是Python? 為什麼選Python? Python可以做什麼?</strong></p><pre class="crayon-plain-tag">彈性高、靈活、可讀性高的程式語言，不需要記太多語法、字元、符號。

機器學習模型、AI專案、網頁應用程式、自動化腳本和工具。(幾乎都能做)

更棒的是，有很多套件可以下載，再加入自己的邏輯即可完成想要的程式</pre><p><strong>第3, 4章節 &#8211; 開始安裝Python以及安裝編輯器VSCode</strong></p>
<p><a href="https://sdt.hameba.tw/663/#more-663" target="_blank" rel="noopener noreferrer">安裝Python以及安裝編輯器VSCode | SDT 攻城獅區</a></p>
<p><strong>第5至16章節 &#8211; 簡單實做，如何輸出、寫註解、字串、數字、日期</strong></p>
<p>(趕工中，敬請期待..)</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/606/">Python初學者教學影片</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/606/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>武漢肺炎搞亂北海道之旅之退訂分享</title>
		<link>https://sdt.hameba.tw/601/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%25ad%25a6%25e6%25bc%25a2%25e8%2582%25ba%25e7%2582%258e%25e6%2590%259e%25e4%25ba%2582%25e5%258c%2597%25e6%25b5%25b7%25e9%2581%2593%25e4%25b9%258b%25e6%2597%2585%25e4%25b9%258b%25e9%2580%2580%25e8%25a8%2582%25e5%2588%2586%25e4%25ba%25ab</link>
				<comments>https://sdt.hameba.tw/601/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 15:07:42 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[旅遊]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=601</guid>
				<description><![CDATA[<p>原本去年年底跟朋友約好，今年趁著228連假去北海道滑雪， 想不到一月底爆發武漢肺炎後，慢慢的連北海道也出現確認 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/601/" class="more-link">閱讀全文<span class="screen-reader-text">〈武漢肺炎搞亂北海道之旅之退訂分享〉</span></a></p>
The post <a href="https://sdt.hameba.tw/601/">武漢肺炎搞亂北海道之旅之退訂分享</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>原本去年年底跟朋友約好，今年趁著228連假去北海道滑雪，</p>
<p>想不到一月底爆發武漢肺炎後，慢慢的連北海道也出現確認案例。</p>
<p><span id="more-601"></span></p>
<p>為了保護自己的生命以及周遭朋友們的生命安全，</p>
<p><del>(其實是怕去了但機上有其他人身體不適反而入境不了)</del></p>
<p>只好開始著手退票的相關事宜，</p>
<p>這次訂的是樂桃航空以及用agoda訂希爾頓飯店</p>
<p>隨著疫情慢慢的嚴重，從一級到二級..</p>
<p>我們原本的航班在官網上遲遲沒有因應武漢肺炎停航的訊息，</p>
<p>所以在25號的時候就把機票給退掉 (手續費就這樣給他扣了)</p>
<p>然後不是退錢是退點數，然後點數還有使用期限是今年8月!</p>
<p>想不到居然在27號，原本我們預計要出發的這天公告消息了!!!</p>
<p>想要打客服詢問對於這情形是否可以退手續費，</p>
<p>但白天客服電話都打不進去，都是忙線中..</p>
<p>至於飯店部分，</p>
<p>寫信詢問飯店是否因為武漢肺炎可以取消，</p>
<p>但因為我們當時所訂的房型，是不可取消的，</p>
<p>所以完全<strong> 沒 得 退 ！</strong></p>
<p>==================================</p>
<p>這故事告訴我們以後</p>
<p><strong>不要訂廉航！</strong></p>
<p><strong>不要訂不可取消的飯店！</strong></p>The post <a href="https://sdt.hameba.tw/601/">武漢肺炎搞亂北海道之旅之退訂分享</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/601/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Java syntax error on token enum 解決</title>
		<link>https://sdt.hameba.tw/598/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-syntax-error-on-token-enum-%25e8%25a7%25a3%25e6%25b1%25ba</link>
				<comments>https://sdt.hameba.tw/598/#respond</comments>
				<pubDate>Fri, 28 Feb 2020 14:25:49 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[enum]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=598</guid>
				<description><![CDATA[<p>在維護舊的專案，沒想到一編譯後就出現錯誤訊息了。 把訊息看清楚了之後，原來是該專案有個變數叫做 enum， 而 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/598/" class="more-link">閱讀全文<span class="screen-reader-text">〈Java syntax error on token enum 解決〉</span></a></p>
The post <a href="https://sdt.hameba.tw/598/">Java syntax error on token enum 解決</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>在維護舊的專案，沒想到一編譯後就出現錯誤訊息了。</p>
<p>把訊息看清楚了之後，原來是該專案有個變數叫做 <span style="color: #ff0000">enum<span style="color: #000000">，</span></span></p>
<p><span id="more-598"></span></p>
<p>而這個變數在 Java 1.5 之後已經是保留字了，</p>
<p>所以會看到大概的錯誤訊息如下：</p>
<blockquote><p><strong>syntax error on token enum identifier expected &#8230;</strong></p></blockquote>
<p>解決的方式有兩個，一個是修改變數名稱，另一個是調整Compiler的版本。</p>
<p>preference -&gt; Java -&gt; Compiler -&gt; Compiler compliance level 改為 <span style="color: #ff0000"><strong>1.4</strong></span></p>
<p><img class="alignnone wp-image-599 size-large" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4-1024x533.png" alt="" width="840" height="437" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4-1024x533.png?v=1582899387 1024w, https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4-300x156.png?v=1582899387 300w, https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4-768x400.png?v=1582899387 768w, https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4-1200x624.png?v=1582899387 1200w, https://sdt.hameba.tw/wp-content/uploads/2020/02/compilerTo1.4.png?v=1582899387 1311w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>如果是維護舊專案，還是建議用第二種方式。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>The post <a href="https://sdt.hameba.tw/598/">Java syntax error on token enum 解決</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/598/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Mac 安裝 NVM</title>
		<link>https://sdt.hameba.tw/530/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-%25e5%25ae%2589%25e8%25a3%259d-nvm</link>
				<comments>https://sdt.hameba.tw/530/#respond</comments>
				<pubDate>Sat, 22 Feb 2020 11:56:11 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[nvm]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=530</guid>
				<description><![CDATA[<p>為了方便切換Node版本，我們可以安裝NVM(Node Version Manager)。 介紹一下如何在Ma &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/530/" class="more-link">閱讀全文<span class="screen-reader-text">〈Mac 安裝 NVM〉</span></a></p>
The post <a href="https://sdt.hameba.tw/530/">Mac 安裝 NVM</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>為了方便切換Node版本，我們可以安裝NVM(Node Version Manager)。</p>
<p>介紹一下如何在Mac上安裝這個工具。</p>
<p><span id="more-530"></span></p>
<p>官方有提到不支持 homebrew 的 nvm 安裝</p>
<blockquote><p>Homebrew installation is not supported. If you have issues with homebrew-installed <code>nvm</code>, please <code>brew uninstall</code> it, and install it using the instructions below, before filing an issue.</p></blockquote>
<p>我們這邊依照官方步驟來安裝(可以用 curl 或是 wget 下載)</p>
<ul>
<li>curl</li>
</ul>
<p></p><pre class="crayon-plain-tag">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash</pre><p></p>
<ul>
<li> wget</li>
</ul>
<p></p><pre class="crayon-plain-tag">wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash</pre><p>安裝好記得先把terminal關閉重開，或是手動重新生效bas_profile</p><pre class="crayon-plain-tag">source ~/.bash_profile</pre><p>確認一下是否成功</p><pre class="crayon-plain-tag">nvm --version</pre><p><img class="alignnone wp-image-532 size-full" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/nvmVersion.png" alt="" width="607" height="68" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/nvmVersion.png?v=1582372164 607w, https://sdt.hameba.tw/wp-content/uploads/2020/02/nvmVersion-300x34.png?v=1582372164 300w" sizes="(max-width: 607px) 100vw, 607px" /></p>
<p>接下來就可以安裝指令版本的Node了</p>
<p>&nbsp;</p>
<p>參考資料：</p>
<p><a href="https://github.com/nvm-sh/nvm">https://github.com/nvm-sh/nvm</a></p>The post <a href="https://sdt.hameba.tw/530/">Mac 安裝 NVM</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/530/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Ubuntu 安裝 Nodejs</title>
		<link>https://sdt.hameba.tw/515/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-%25e5%25ae%2589%25e8%25a3%259d-nodejs</link>
				<comments>https://sdt.hameba.tw/515/#respond</comments>
				<pubDate>Wed, 12 Feb 2020 16:30:14 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[nodejs]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=515</guid>
				<description><![CDATA[<p>介紹 Ubuntu 18.04 環境下安裝Node.js， 會使用到的指令有 apt-get 以及 curl。 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/515/" class="more-link">閱讀全文<span class="screen-reader-text">〈Ubuntu 安裝 Nodejs〉</span></a></p>
The post <a href="https://sdt.hameba.tw/515/">Ubuntu 安裝 Nodejs</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>介紹 Ubuntu 18.04 環境下安裝Node.js，</p>
<p>會使用到的指令有 apt-get 以及 curl。</p>
<p><span id="more-515"></span></p>
<p>如果是macOS或Windows的話，官方有提供安裝包 <a href="https://nodejs.org/en/download/">(官網)</a></p>
<p>先更新套件清單跟安裝curl</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get install curl</pre><p>接下來就可以來安裝Node.js (版本v13.x)</p><pre class="crayon-plain-tag">curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs</pre><p>安裝完成後，確認安裝版本。</p><pre class="crayon-plain-tag">node -v</pre><p>&nbsp;</p>
<p>參考資料</p>
<p><a href="https://github.com/nodesource/distributions">https://github.com/nodesource/distributions</a></p>The post <a href="https://sdt.hameba.tw/515/">Ubuntu 安裝 Nodejs</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/515/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>Python 使用 pytube 下載 Youtube 影片</title>
		<link>https://sdt.hameba.tw/511/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-%25e4%25bd%25bf%25e7%2594%25a8-pytube-%25e4%25b8%258b%25e8%25bc%2589-youtube-%25e5%25bd%25b1%25e7%2589%2587</link>
				<comments>https://sdt.hameba.tw/511/#respond</comments>
				<pubDate>Mon, 03 Feb 2020 17:04:14 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[pytube]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=511</guid>
				<description><![CDATA[<p>現在 Youtube 越來越方便，有時候我們會想要把影片下載下來， 這時候就可以使用 pytube 模組。 首 &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/511/" class="more-link">閱讀全文<span class="screen-reader-text">〈Python 使用 pytube 下載 Youtube 影片〉</span></a></p>
The post <a href="https://sdt.hameba.tw/511/">Python 使用 pytube 下載 Youtube 影片</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>現在 Youtube 越來越方便，有時候我們會想要把影片下載下來，</p>
<p>這時候就可以使用 pytube 模組。</p>
<p><span id="more-511"></span></p>
<p>首先要先安裝 pytube 的模組，詳細資訊的話，可以去開發者的 <a href="https://github.com/nficano/pytube">Github</a> 瞧瞧。</p><pre class="crayon-plain-tag">pip3 install pytube</pre><p><img class="alignnone wp-image-512 size-full" src="https://sdt.hameba.tw/wp-content/uploads/2020/02/install_pytube.png" alt="install_pytube" width="802" height="142" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/02/install_pytube.png?v=1580749153 802w, https://sdt.hameba.tw/wp-content/uploads/2020/02/install_pytube-300x53.png?v=1580749153 300w, https://sdt.hameba.tw/wp-content/uploads/2020/02/install_pytube-768x136.png?v=1580749153 768w" sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px" /></p>
<p>安裝的版本為 <span style="color: #0000ff">pytube-9.5.3</span></p>
<p>接下來，快速簡單的示範如何下載影片。</p>
<p>拿這個網址做示範：<a href="https://www.youtube.com/watch?v=dq-1hVpnquk">https://www.youtube.com/watch?v=dq-1hVpnquk</a></p><pre class="crayon-plain-tag">from pytube import YouTube
yt = YouTube('https://www.youtube.com/watch?v=dq-1hVpnquk')
yt.streams.first().download()</pre><p>執行後過一會就會出現啦。(影片會跟程式在同一層目錄)</p>
<p>如果出現錯誤訊息 <span style="color: #ff0000">KeyError: &#8216;url_encoded_fmt_stream_map&#8217;</span></p>
<p>可以參考 <a href="https://github.com/nficano/pytube/issues/467">Issue</a> 來排除 (把mixins.py裡apply_descrambler中的內容替換)</p>
<p>最後，提醒大家下載的影片僅供個人使用或學術交流，避免做商業用途。</p>
<p>&nbsp;</p>
<p>參考資料·：</p>
<p><a href="https://python-pytube.readthedocs.io/en/latest/">https://python-pytube.readthedocs.io/en/latest/</a></p>The post <a href="https://sdt.hameba.tw/511/">Python 使用 pytube 下載 Youtube 影片</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/511/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
		<item>
		<title>git diff 每行結尾出現^M如何解決</title>
		<link>https://sdt.hameba.tw/471/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=git-diff-%25e6%25af%258f%25e8%25a1%258c%25e7%25b5%2590%25e5%25b0%25be%25e5%2587%25ba%25e7%258f%25bem%25e5%25a6%2582%25e4%25bd%2595%25e8%25a7%25a3%25e6%25b1%25ba</link>
				<comments>https://sdt.hameba.tw/471/#respond</comments>
				<pubDate>Sun, 12 Jan 2020 06:05:53 +0000</pubDate>
		<dc:creator><![CDATA[Li Der]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">https://sdt.hameba.tw/?p=471</guid>
				<description><![CDATA[<p>在 git diff 的時候，發現在每行結尾的地方居然出現了 ^M的符號， 原來是因為不同作業系統中，按下 e &#8230; </p>
<p class="link-more"><a href="https://sdt.hameba.tw/471/" class="more-link">閱讀全文<span class="screen-reader-text">〈git diff 每行結尾出現^M如何解決〉</span></a></p>
The post <a href="https://sdt.hameba.tw/471/">git diff 每行結尾出現^M如何解決</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></description>
								<content:encoded><![CDATA[<p>在 <kbd>git diff</kbd> 的時候，發現在每行結尾的地方居然出現了 ^M的符號，</p>
<p>原來是因為不同作業系統中，按下 enter(return) 結尾符號上的不同(LF、CRLF)，</p>
<p><span id="more-471"></span></p>
<p><img class="alignnone wp-image-472 size-full" src="https://sdt.hameba.tw/wp-content/uploads/2020/01/gitDiffM.png" alt="" width="598" height="220" srcset="https://sdt.hameba.tw/wp-content/uploads/2020/01/gitDiffM.png?v=1578806340 598w, https://sdt.hameba.tw/wp-content/uploads/2020/01/gitDiffM-300x110.png?v=1578806340 300w" sizes="(max-width: 598px) 100vw, 598px" /></p>
<p>當看到上方圖中出現^M的符號，表示檔案在每行結尾是有差異的。</p>
<p>這時候設定一下參數(core.autocrlf)，讓git更改每行結尾的方式。</p><pre class="crayon-plain-tag">$ git config --global core.autocrlf true</pre><p>以上設定是針對自己做處理，</p>
<p>如果專案是多人在進行的話，</p>
<p>建議在專案中加入 .gitattributes 來定義每行結尾的定義，</p>
<p>這樣就不會因為每台環境的不同而需要個別處理了。</p>
<p>參考資料：</p>
<p><a href="https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings#global-settings-for-line-endings">https://help.github.com/en/github/using-git/configuring-git-to-handle-line-endings#global-settings-for-line-endings</a></p>The post <a href="https://sdt.hameba.tw/471/">git diff 每行結尾出現^M如何解決</a> first appeared on <a href="https://sdt.hameba.tw">SDT 攻城獅區</a>.]]></content:encoded>
							<wfw:commentRss>https://sdt.hameba.tw/471/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
							</item>
	</channel>
</rss>
