<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1816058796586787870</id><updated>2024-10-05T13:49:27.071-07:00</updated><category term="碎碎唸"/><category term="Python"/><category term="Django"/><category term="Linux"/><category term="其他"/><category term="MacOSX"/><category term="C/C++"/><category term="MCU"/><category term="ARM"/><category term="GCC"/><category term="STM32"/><category term="git"/><category term="google code"/><category term="指令"/><category term="筆記"/><category term="7697"/><category term="Raspberry Pi2"/><category term="autocomplete"/><category term="clang"/><category term="linkit7697hdk"/><category term="matplotlib"/><category term="micro SD card"/><category term="micropython"/><category term="mt7697"/><category term="network"/><category term="onionys"/><category term="plugin"/><category term="raspberry pi"/><category term="vim"/><category term="wifi"/><title type='text'>自學程設</title><subtitle type='html'>爬文啃Manual、Google撈資料、買組機器、安裝OS、架網路，然後筆記寫心得的網誌。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>93</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-1850504895774038219</id><published>2020-05-14T06:17:00.003-07:00</published><updated>2020-05-14T06:31:08.934-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="matplotlib"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="其他"/><category scheme="http://www.blogger.com/atom/ns#" term="筆記"/><title type='text'>用python 畫圖 -- matplotlib 簡單畫等高線圖 -- (二)</title><content type='html'>&lt;div&gt;除了一些的 line plot 之外，在數據繪圖的時候也常常遇到要 plot 一些三維數據。而我最常遇到的需求是將一組三維的數據用等高線圖 ( contour )的形式畫出來。 matplotlib 提供了非常好用的 function 來滿足這項需求。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;而目前我知道用來畫 contour 的 function 有下面這幾個:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;contour()&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;contourf()&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;tricontour()&lt;/pre&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;tricontourf()&lt;/pre&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;contour() 和 contourf() 因為要求輸入的數據形式必須為格狀 (Grid)，所以使用上較不直覺。而tricontour() 和 tricontourf() 則只需要將手上的數據分為 x  list、y list、z list 餵進去就行。  &lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;準備數據&lt;/h3&gt;&lt;div&gt;因為手邊沒有現成的數據，所以只好假設一個情境來讓練習有點代入感。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;先假設一個房間寬 5 公尺、長 12 公尺。準備一台掃地功能壞掉而且會亂跑的掃地機器人，這台機器人雖然無法掃地但是可以量測地板的骯髒程度，並用 0 ~ 10 的數值表示(0 為最乾淨，10為最髒)。放著讓這台機器人在房間裡跑一個晚上，並在隔天從機器人裡取出數據。而我們預計機器人會給出這個房間的骯髒程度分佈圖。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;根據這個情境做假數據，假如機器人一個晚上進行了 100 次的隨機位置量測，所以產生假數據的程式碼可以簡單地這樣寫:&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;import numpy as np&lt;br /&gt;x_list = []&lt;br /&gt;y_list = []&lt;br /&gt;z_list = []&lt;br /&gt;for i in range(100):&lt;br /&gt;&amp;nbsp; &amp;nbsp; x_list.append(np.random.random() * 5)&lt;br /&gt;&amp;nbsp; &amp;nbsp; y_list.append(np.random.random() * 12)&lt;br /&gt;&amp;nbsp; &amp;nbsp; z_list.append(np.random.random() * 10)&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;從機器人裡面取得了 x_list，y_list，z_list 分別代表依照時間順序量到的 x 和 y 位置與對應的地板骯髒程度 z。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Plot&lt;/h3&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;而使用 matplotlib 畫出等高線的程式碼:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;import matplotlib.pyplot as plt&lt;br /&gt;plt.tricontour(x_list, y_list, z_list)&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;所以整個程式碼其實很簡單:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMFTLq6x4iMgTXUuTI_7VYK4XwzWK_Arcu6UypO2iqQ0YCeb1PdBpumx7bOAdhXBDr8LZmt0dQc7CEmzhBEQBZplnO3dYpAtO-E1rjGqJhYHCi4QnMcRcK8xxzLINIs0XuKJnOEIIdlnu_/&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1008&quot; data-original-width=&quot;1102&quot; height=&quot;586&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMFTLq6x4iMgTXUuTI_7VYK4XwzWK_Arcu6UypO2iqQ0YCeb1PdBpumx7bOAdhXBDr8LZmt0dQc7CEmzhBEQBZplnO3dYpAtO-E1rjGqJhYHCi4QnMcRcK8xxzLINIs0XuKJnOEIIdlnu_/w640-h586/pic+2020-05-14+%25E4%25B8%258B%25E5%258D%25888.46.42.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;而 tricontourf() 這個 function 則是用來畫著色圖...還是直接給圖比較清楚:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihQbii47jQeey2ciXcqnTq2eDEjR2-P4VgAzGeYbmTW9CLiuVVGAYSt0UbILKjKVJi_ZP-PrKSlYx86Xd0N6Lssr_391oJp9OkVJu-Wyj6p5c2IHKHue7Hnbt1sprh3i0fE21v5lomnqCp/&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1040&quot; data-original-width=&quot;1140&quot; height=&quot;584&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihQbii47jQeey2ciXcqnTq2eDEjR2-P4VgAzGeYbmTW9CLiuVVGAYSt0UbILKjKVJi_ZP-PrKSlYx86Xd0N6Lssr_391oJp9OkVJu-Wyj6p5c2IHKHue7Hnbt1sprh3i0fE21v5lomnqCp/w640-h584/pic+2020-05-14+%25E4%25B8%258B%25E5%258D%25888.49.04.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;br /&gt;在畫等高線時，其實是可以指定要畫哪幾個 z 值就好。譬如說我們現在只想看骯髒程度 3 到 9 之間的地方，然後每隔程度 2 畫一層就好。那麼指令就可以這樣下&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre style=&quot;text-align: left;&quot;&gt;plt.contour(x_list,y_list,z_list, levels = [3,5,7,9] )&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;看下圖比較清楚：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqsiJgAk3wYA8PCFUNIaBfs5jLxh0ZcCwFo8978yS9YF6dVe25WA6A4U8CNj_kGeHzZ5tjRiJ2CO7L7ib1CZG47O47_mm-R2jPgrd48GBbzxKBLyvUGPRf9H7D8Qsv9i_aEFux4LKp2Zf7/&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1016&quot; data-original-width=&quot;1138&quot; height=&quot;572&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqsiJgAk3wYA8PCFUNIaBfs5jLxh0ZcCwFo8978yS9YF6dVe25WA6A4U8CNj_kGeHzZ5tjRiJ2CO7L7ib1CZG47O47_mm-R2jPgrd48GBbzxKBLyvUGPRf9H7D8Qsv9i_aEFux4LKp2Zf7/w640-h572/pic+2020-05-14+%25E4%25B8%258B%25E5%258D%25889.00.34.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;結語&lt;/h3&gt;&lt;div&gt;其實看到這邊，大概也不會產生進一步的動機去學 contour() 和 contourf() 怎麼用了。因為 tricontour() 和 tricontourf() 已經滿足大部份的需求了，而且用法又簡單。不過就三維的數據繪圖，其實還有一個是畫三維立體圖。那個看起來很炫，但是要求的數據形式就比較複雜，通常要寫些小程式來進行整理。這個就改天再寫了。&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/1850504895774038219/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2020/04/matplotlib-plot.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/1850504895774038219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/1850504895774038219'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2020/04/matplotlib-plot.html' title='用python 畫圖 -- matplotlib 簡單畫等高線圖 -- (二)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMFTLq6x4iMgTXUuTI_7VYK4XwzWK_Arcu6UypO2iqQ0YCeb1PdBpumx7bOAdhXBDr8LZmt0dQc7CEmzhBEQBZplnO3dYpAtO-E1rjGqJhYHCi4QnMcRcK8xxzLINIs0XuKJnOEIIdlnu_/s72-w640-h586-c/pic+2020-05-14+%25E4%25B8%258B%25E5%258D%25888.46.42.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8934523165700248594</id><published>2019-11-18T00:42:00.000-08:00</published><updated>2019-11-19T21:06:00.484-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="MacOSX"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="STM32"/><title type='text'>STM32F7 GCC 開發筆記 -- example 專案</title><content type='html'>在 Linux 或是 Mac OSX 上面用 GCC 開發 STM32F7，在開始之前要先去 ARM 官網 download gcc、安裝相關工具(make、st-flash...)、買開發板。之後就是要找到一個可以build 出 firmware 檔的專案了。&lt;br /&gt;
&lt;br /&gt;
最初我也是到 SDK 裡面的 example 找看看有沒有直接可以 build 成功的專案，後來發現都沒有 makefile。無奈之下只好自已寫了，我把這個樣板專案放到 github 上。&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;https://github.com/onionys/STM32_GCC_PROJ_TEMPLATE&quot;&gt;https://github.com/onionys/STM32_GCC_PROJ_TEMPLATE&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
內附的 README.md 有簡單地說明在 ubutnu 64 bits 的作業系統之下如何安裝才能成功地build 出 firmware.bin。在 mac 系統下安裝的方式可能不太一樣，但是因為我手上沒有&quot;乾淨&quot; 的 mac 環境，所以就沒寫在 mac 環境下如何準備...(只記得都是靠 brew 指令)，等哪一天買新的 mac 之後再來補好了。&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
在 ubuntu 下的安裝簡介&lt;/h3&gt;
測議的環境是 ubuntu 14.04 (64 bit) 版本&amp;nbsp; 在 docker 下測試。一般不大會有問題才是。&lt;br /&gt;
&lt;br /&gt;
首先安裝常用的工具:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
sudo dpkg --add-architecture i386
sudo update 
sudo apt-get install git build-essential cmake libc6:i386 libncurses5:i386 libstdc++6:i386 wget unzip
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
再來就是把專案抓回來，順便進入資料夾 stm32dev 。&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
git clone https://github.com/onionys/STM32_GCC_PROJ_TEMPLATE.git stm32dev 

cd stm32dev 

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
會看到資料夾 &quot;stm32dev/stm32f7&quot; 這個才是 STM 的專案資料夾，裡面的 Makefile 設置會需要把 SDK 和 gcc 放置在 stm32dev 這個資料夾。&lt;br /&gt;
&lt;br /&gt;
所以接下來就是去 &lt;a href=&quot;https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm&quot;&gt;ARM&lt;/a&gt; 官網抓特定版本的 gcc 回來。這邊用的版本是&amp;nbsp;&lt;a href=&quot;https://launchpad.net/gcc-arm-embedded/+milestone/4.8-2014-q3-update&quot;&gt;&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , monospace; font-size: 13.6px;&quot;&gt;arm-none-eabi-gcc&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #24292e; font-family: , &amp;quot;consolas&amp;quot; , &amp;quot;liberation mono&amp;quot; , &amp;quot;menlo&amp;quot; , monospace; font-size: 13.6px;&quot;&gt;4.8..4 for linux&lt;/span&gt;&lt;/a&gt;&amp;nbsp;，可以使用 wget 指令抓下來，順便解壓縮:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2

tar jxvf gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
再來就是去 ST 官網抓 &lt;a href=&quot;https://www.st.com/en/embedded-software/stm32cubef7.html&quot;&gt;STM32CubeF7 SDK 1.15&lt;/a&gt;&amp;nbsp; &amp;nbsp;，不用錢但是要在官網註冊帳號。抓到資料夾 stm32dev 後，就解壓縮:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
unzip en.STM32Cube_FW_F7_V1.15.0.zip

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
這個時候應該就可以進去 stm32f7 資料夾 build 看看了&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
cd stm32f7

make all

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
成功的話會在 build 資料夾下看到 firmware.bin 這個檔案。&lt;br /&gt;
&lt;br /&gt;
STM32CubeF7 SDK 和 arm gcc 的位置要更換的就，就自行修改 Makefile 裡下這兩個變數&lt;br /&gt;
&lt;pre&gt;&lt;code class=&quot;plaintext&quot;&gt;
...
STM32SDK = ../STM32Cube_FW_F7_V1.15.0
...
ARM_GCC_PATH= ../gcc-arm-none-eabi-4_8-2014q3/bin
...
&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
目前只能用常見的 HAL 部份，像是 lwip、 freeRTOS、 fatfs 之類這種第三方的還沒有完全整合進去，之後會再慢慢加進去 Makefile。&lt;br /&gt;
&lt;br /&gt;
說明一下，之所以想開這個系列，是因為官方沒有提供寫好的 Makefile。官方提供的 example project 都沒有看到 Makefile。後來新提供的什麼CubeMX 的工具可以產生專案，但是對我來說過於複雜，所以在還沒摸索到能否產生 Makefile 之前就累了。於是索性就自已花點時間建個樣板專案並寫個 Makefile。發現花的時間還比較少...&lt;br /&gt;
&lt;br /&gt;
所以我的整個開發環境就是，使用 vim + ctag + make，然後 compile 就使用 arm 官方的 gcc。然後全部都在 command line 環境底下開發。總之就是完全脫離 windows 了~~，GUI 什麼的也用不太習慣。話說以前第一次玩 STM32 的 MCU 時竟然是先從買IC、layout、洗板子、焊接完之後才開始coding，是種由先硬後軟的方式在摸索。會這樣子完全是因為閉門造車，所以花了很久的時間。說實在的，早知就就先買一塊官方出的開發板這樣還比較省事。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8934523165700248594/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2019/11/stm32f7-gcc-example.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8934523165700248594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8934523165700248594'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2019/11/stm32f7-gcc-example.html' title='STM32F7 GCC 開發筆記 -- example 專案'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8042902384847156418</id><published>2019-10-28T23:43:00.001-07:00</published><updated>2020-04-26T03:52:31.893-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ARM"/><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="GCC"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="STM32"/><title type='text'>STM32F7 MCU GCC 開發自學筆記 -- 前言</title><content type='html'>最近一直在玩 STM32F7 MCU，當真覺得真的是很有趣的開發平台。玩到現在也差不多有些心得了，而最近一直想寫點什麼但又不知道要寫點什麼，只好開個學習心得系列文了。&lt;br /&gt;
&lt;br /&gt;
之前也玩過他廠 MCU，但在建立 linux (或是 mac os) + gcc + make 這樣的開發環境都顯得很麻煩，直到用到 STM32 系列的 MCU。該廠有提供 GUI 圖形介面開發工具，不過我都用不太順手，而且基於學習和探索的理由我還是喜歡自行整理出 vim + ctag + gcc 這樣的開發環境。&lt;br /&gt;
&lt;br /&gt;
重申一次，這系列的文章開發環境都是建立在 command line + arm gcc + make 這樣的工具鍊上的。適合熟悉 linux 開發環境的讀者，mac os x 也行，因為筆者就是用 mac os x 開發的。&lt;br /&gt;
&lt;br /&gt;
開發硬體上，實在是不適合一開始自行買 IC 和洗電路板這樣的硬派作風。還是建議先買一塊官方出的開發板來加速入門會比較好，至少挫折感沒那麼重，可以拉長從入門到放棄的時間。我目前是使用這塊:&lt;br /&gt;
&lt;br /&gt;
NUCLEO-F746ZG&lt;br /&gt;
&lt;br /&gt;
網路上價格應在一千新台幣以下。上面已經附有一塊 st-link 燒錄器所以就省下買 st-link 燒錄器的錢了，買回來只要接上 USB 就可以開始 coding-building-uploading 了。而且開發板上的 st-link 燒錄器還可以自行將其 &quot;分離&quot; 變成獨立的 st-link，所以算是蠻划算的部份，但是在還沒搞清楚 SWD 電路接法之前不建議進行 &quot;分離&quot; 的動作。&lt;br /&gt;
&lt;br /&gt;
玩 MCU 的話，個人覺得是無法避開電路上的問題。所以不管是使用哪塊官方出的開發板，記得去下載對應 manual。開發板的針腳對應都會寫在 manual 裡面，很重要的。不然一開始玩 GPIO 和 UART 就會產生強烈放棄的唸頭。下面是 NUCLEO-F746ZG manual 的官方連結。該連結不知道什麼時候會過期，過期的話就 google 一下，很容易找的。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/26/49/90/2e/33/0d/4a/da/DM00244518/files/DM00244518.pdf/jcr:content/translations/en.DM00244518.pdf&quot;&gt;https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/26/49/90/2e/33/0d/4a/da/DM00244518/files/DM00244518.pdf/jcr:content/translations/en.DM00244518.pdf&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
而 example code 的部份，筆者會放在 github 上。連結如下:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/onionys/STM32_GCC_PROJ_TEMPLATE&quot;&gt;https://github.com/onionys/STM32_GCC_PROJ_TEMPLATE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
歡迎有興趣的朋友一起來討論。&lt;br /&gt;
&lt;br /&gt;
-------------下面是系列文章分隔線---------------&lt;br /&gt;
STM32F7 GCC 開發筆記 -- example 專案:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://onionys.blogspot.com/2019/11/stm32f7-gcc-example.html&quot;&gt;https://onionys.blogspot.com/2019/11/stm32f7-gcc-example.html&lt;/a&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8042902384847156418/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2019/10/stm32f7-mcu-gcc.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8042902384847156418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8042902384847156418'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2019/10/stm32f7-mcu-gcc.html' title='STM32F7 MCU GCC 開發自學筆記 -- 前言'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8166973642942078528</id><published>2019-05-10T19:06:00.001-07:00</published><updated>2019-05-10T19:06:17.571-07:00</updated><title type='text'>micropython 移植與學習的心路歷程</title><content type='html'>知道 micropython 這東西大約是 2016 年的時候了。那個時候印象針對 ESP8266 的官方移植才剛開始，國內能玩到 micropython 的模組直接從國外買大概是最快的方式了吧。不過那個時候腦子一熱，就從官網給的電路圖開始出發。&lt;br /&gt;
&lt;br /&gt;
先是跑去下載 KiCAD 摸一摸，然後照著官網給的 pyboard v1 的線路圖開始 layout、出 gerber 檔、下單洗板、買料、手焊。過程中充滿了手動與自學的樂趣，找資料、思考、收尋電子論壇...。&lt;br /&gt;
&lt;br /&gt;
然後灌 Linux 安裝開發環境，還好 micropython 官方使用 arm gcc ，不然還要花錢買 keil C。學 Makefile、重溫 C 語言。Build 成功那一瞬間是有得到感動的。&lt;br /&gt;
&lt;br /&gt;
最後使用 dfu 模式把 build 出來的 micropython 燒到自一手包辦的板子上，看到提示符號並 print 出 &quot;Hello World&quot; 時真是無言的感動。&lt;br /&gt;
&lt;br /&gt;
但是之後工作開始忙了之後就停了一陣子，然後看著市場上的 ESP 系列的活躍，忽然也想說再來摸一摸，但是可以更精進一些到達可以了解原始碼的地步。原本想說就從 STM32F 系列繼續玩下去了，官方完整的支援下非常適合順便學習 STM32 的架構。但也是這時，友人介紹了一塊MTK 產的 ARM cortex M4 MCU，想說也有提供 gcc 的開發環境和 STM32F4 是很相似的，而且當下 micropython 還沒有移植到上面，如果可以成功移植上去的話對於 MCU 的學習的幫助應該會蠻大的。&lt;br /&gt;
&lt;br /&gt;
於是又開始了一輪收尋資料與學習的過程，而這次則是對整個 MCU 的開發有著較為深入的了解-- FAT file system、C 的 OO 手法、FreeRTOS、BLE、LwIP...。真的是感覺到，有著一個完整的目標框架對於學習而言是很重要的。&lt;br /&gt;
&lt;br /&gt;
當然最後也順利的把 micropython 移植到 MT7697 上了，下面是 Build 出來的 bin 檔。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/onionys/micropython-mt7697-experiment-bin&quot;&gt;https://github.com/onionys/micropython-mt7697-experiment-bin&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
開發過程之中，也稍稍進行了一些思考-- 為何 MT7697 在國外的論壇很少看到討論? 為何 STM32 的學習討論這麼多? 為何 ESP 系列在不是 ARM Core 的情況下可以引領一波流行? 可以執行直譯器語言的 MCU 和 SoC with Linux 系統的差別又在哪? 有誰會需要這樣的東西? 可以用在生產力環境之上嗎? 這些問題都是沒有標準解答的問題。思考者這類問題並進行自問自答的流程也是很有趣: 提出假設 --&amp;gt; 蒐集資料進行答辯 --&amp;gt; 修正假設 --&amp;gt; 蒐集資料進行答辯...。&lt;br /&gt;
&lt;br /&gt;
這次 MT7697 的移植已經到了一個初步的階段，正在修正 bug 和撰寫 API 文件之間來回。告一段落之後，應該就會回到 STM32F 系列繼續在官方的版本上疊床架屋，而這次的目標想要開始試著設計一些產品投入在實驗性質的環境之上了。&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8166973642942078528/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2019/05/micropython.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8166973642942078528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8166973642942078528'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2019/05/micropython.html' title='micropython 移植與學習的心路歷程'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-6364257532180849400</id><published>2019-02-02T05:22:00.004-08:00</published><updated>2019-02-02T05:31:35.072-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="7697"/><category scheme="http://www.blogger.com/atom/ns#" term="linkit7697hdk"/><category scheme="http://www.blogger.com/atom/ns#" term="MCU"/><category scheme="http://www.blogger.com/atom/ns#" term="micropython"/><category scheme="http://www.blogger.com/atom/ns#" term="mt7697"/><category scheme="http://www.blogger.com/atom/ns#" term="onionys"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>MicroPython 移植到 linkit7697</title><content type='html'>大約兩年多前，在網路上注意到 micropython 這個東西。想說這真是個好東西，可以在 MCU 上面執行 python 語法的直譯器。這樣一來，只要移植&amp;nbsp;micropython 的 MCU 就會變得非常得好開發上手。&lt;br /&gt;
&lt;br /&gt;
現下最流行 MCU 開發流派是 Arduino 。就我看來，它是一個 Framework 使用了 C++ 為開發語言，然後把一些麻煩的底層工作巧妙地蓋住了，並提供給開發者一個更為簡易的 API。這樣的 Framework 讓一些只有簡單需求的開發者，從各家 MCU 廠提供的複雜 SDK 開發環境給解放了出來。像是以往開發者只是要亮個 LED 燈卻要花費龐大的時間在 download SDK... 設定執行環境... 阿! Keil C 好像要錢?! 有沒有#@%^版本...原來亮個LED燈不用錢?? 暫存器是什麼?...等等的掙扎。變成只要有Arduino，接上線馬上就可以用 C++ 把LED燈亮起來了，潮爽的~~&lt;br /&gt;
&lt;br /&gt;
但是，MicroPython 的出現又是個完全不一樣的玩法了。只要有 MicroPython 的 MCU，不用 SDK，不用Compile，不用 IDE。簡單的 serial port 連線後，馬上就可以開始用 Python 語法開發了。&lt;br /&gt;
&lt;br /&gt;
更不用說，程式碼一打馬上就執行得到結果。省去了 編譯 --&amp;gt; 燒錄 這樣一個麻煩的動作。完完全全的即時動態開發。用過之後，就很難回去了~~~~(Compiler bye~~bye~~)。再加上 MicroPython 通常會支援檔案系統，所以程式碼可以用 .py 的文字檔形式直接存在 MCU 的 Flash 記憶體裡面。整個使用體驗上非~常~的方便。&lt;br /&gt;
&lt;br /&gt;
這樣的完全脫離了編譯式開發環境，並且完全動態的特性, 甚至讓 MicroPython 被考慮使用在太空人造衛星上。可以參考下面的連結，MicroPython 作者的一場演講表示 &quot;Yes!&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/Zm08hXeuv-I?start=2506&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
不過 MicroPython 的問世其實不算久，而目前有支援的 MCU 以 STM32 和 ESP32 系列為主，然後有 nordic 51 與 52 系列...等等。主要以 ARM Cortex M4 為基礎延伸出去(ESP32不是ARM的)。&lt;br /&gt;
&lt;br /&gt;
就國內來說，也是有幾家大廠有在生產 ARM Cortex M4 系統的 MCU，就個人有聽過的是 MTK、新唐。前一陣子因為某些關係接觸到 MTK 的 7697 系列，個人對 MicroPython 非常的喜愛，更看都沒人在國內進行 porting 的動作，所以花了一些時間和朋友合作把 MicroPython Porting 到 linkit7697 HDK 這個開發板上了。目前有一個還可以動的版本了~~~。&lt;br /&gt;
&lt;br /&gt;
我把porting出來的 bin 檔給 release 到我的 github 帳號上:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://github.com/onionys/micropython-mt7697-experiment-bin&quot;&gt;https://github.com/onionys/micropython-mt7697-experiment-bin&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
有興趣的可以download 下來燒到市面上常常看到的 linkit7697 HDK 開發板上玩玩看。&lt;br /&gt;
&lt;br /&gt;
而原始碼，整理過後就會release出來。&lt;br /&gt;
&lt;br /&gt;
但是我知道有時候燒 firmware 其實也不是一件簡單的事，所以目前我也正在努力的修改下面這個 open source 的 專為 micropython 設計的編輯器，讓開發者可以更簡單地燒錄firmware與寫code 上傳code。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://codewith.mu/&quot;&gt;https://codewith.mu&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
已經快完成了~~~，應該最近就會 Release出來讓大家玩看看了。&lt;br /&gt;
&lt;br /&gt;
這個 blog 之後應該會開始集中討論 MicroPython 上了。&lt;br /&gt;
&lt;br /&gt;
不過在 porting micropython 的過程中也算是摸了 MCU 的開發(至少mtk 的 7697)，所以之後也考慮寫一些 MCU 的開發筆記(當然以 MTK 的系統為主...目前我最熟的就是這個)。&lt;br /&gt;
&lt;br /&gt;
不過先說一下，這些開發MCU的筆記會以 gcc + linux (或 mac os x) 的作業系統為主。&lt;br /&gt;
&lt;br /&gt;
會說明這點是，感覺使用 gcc 和 linux 、mac os x 開發 MCU 似乎不是個主流的玩法...</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/6364257532180849400/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2019/02/micropython-linkit7697.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6364257532180849400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6364257532180849400'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2019/02/micropython-linkit7697.html' title='MicroPython 移植到 linkit7697'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Zm08hXeuv-I/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-217206912591882148</id><published>2017-06-30T00:11:00.003-07:00</published><updated>2018-04-06T01:06:52.394-07:00</updated><title type='text'>Python筆記系列 -- 操作瀏覽器去抓網頁資料</title><content type='html'>Python配合jupyter介面之後，因為其極高的互動性所以被拿來當作爬蟲的第一選擇&lt;br /&gt;
&lt;br /&gt;
但是要做到這事之前，要去下載一個Google Chrome的Driver，然後再安裝selenium套件。&lt;br /&gt;
&lt;br /&gt;
Google Chrome Driver 來這裡Download :&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/a/chromium.org/chromedriver/downloads&quot;&gt;https://sites.google.com/a/chromium.org/chromedriver/downloads&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6Fb1USD66OeJjlXbMNMds2-od0ZFr5P6l7sEM92vvQnmSHcf2oJA3z8BgHSnhBiT1rqdsCnJte2pOcWsJiJ_-lWAWV_StKCHYtVzPHzKp72Nb_SiX4n9Sm1u1XFv8LlQhwfFQZLmihC9/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.45.50.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;925&quot; data-original-width=&quot;1600&quot; height=&quot;368&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6Fb1USD66OeJjlXbMNMds2-od0ZFr5P6l7sEM92vvQnmSHcf2oJA3z8BgHSnhBiT1rqdsCnJte2pOcWsJiJ_-lWAWV_StKCHYtVzPHzKp72Nb_SiX4n9Sm1u1XFv8LlQhwfFQZLmihC9/s640/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.45.50.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0gm5gjRcu_V6Tudh6qYiG7WK7RNtKX8bsLgUVLMyRACzV62K_otkMHSIoKm5_E_OBxix4_Av8s6A04V4xMamOx-2M5JAStOh6zhKddtPXluH1T2gIYRKMgpoZWhsiGx8BffBfGMj1tBd/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.46.03.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;678&quot; data-original-width=&quot;892&quot; height=&quot;243&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib0gm5gjRcu_V6Tudh6qYiG7WK7RNtKX8bsLgUVLMyRACzV62K_otkMHSIoKm5_E_OBxix4_Av8s6A04V4xMamOx-2M5JAStOh6zhKddtPXluH1T2gIYRKMgpoZWhsiGx8BffBfGMj1tBd/s320/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.46.03.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
根據自已的系統 Download 。解壓縮後會得到一個 &quot;chromedriver&quot;，放在打開jupyter notebook的資料夾中。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3lSKYIryK93xXCCqKCDRRR6mTQUua-3um-ZZmG0AE2vE8iZnJBrSEuvOKSWUkaelZhzsWPJsutsKokoBu6wepxDwujxazg82NJjkihmaiyAmSqqKNiXkydqp6plVg-i_XKCRW10l83SiF/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.48.51.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;121&quot; data-original-width=&quot;1018&quot; height=&quot;73&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3lSKYIryK93xXCCqKCDRRR6mTQUua-3um-ZZmG0AE2vE8iZnJBrSEuvOKSWUkaelZhzsWPJsutsKokoBu6wepxDwujxazg82NJjkihmaiyAmSqqKNiXkydqp6plVg-i_XKCRW10l83SiF/s640/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.48.51.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Selenium&lt;br /&gt;
&lt;br /&gt;
可以使用pip3直接安裝 selenium 套件&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
$&amp;gt; sudo pip3 install selenium&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
裝完之後就可以開始了，參考下面的指令&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggTSJl-7_386nl2KtThnUkFESaxD72ORDxRCyuQIgMCt2K-yDdoVWY-AxQJr8lB5MrRcYQOdjjO5wEzqyf9K3aykZ1MZgbH-gC7TWIz0QmCmQAJXANnx-FczCTHLCs0W9dXZuJ0LiZSH0m/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.57.49.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;268&quot; data-original-width=&quot;984&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggTSJl-7_386nl2KtThnUkFESaxD72ORDxRCyuQIgMCt2K-yDdoVWY-AxQJr8lB5MrRcYQOdjjO5wEzqyf9K3aykZ1MZgbH-gC7TWIz0QmCmQAJXANnx-FczCTHLCs0W9dXZuJ0LiZSH0m/s640/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.57.49.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
執行之後就會發現會多跑出來一個Chrome視窗像是下面這個:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCr9wdABhfBNXpluS9tIE-SJorJTmfUCxt2X7P5KXeLREHzQAM8CRAMBUf0KdD5R2oT2MP8dSC2GQE21oCmJlVblbHGNoZbsfyON1WwiyDfNr0bHpp35pX1R7TWNEhuW7VNgIxj_xexnbP/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.57.59.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1102&quot; data-original-width=&quot;1560&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCr9wdABhfBNXpluS9tIE-SJorJTmfUCxt2X7P5KXeLREHzQAM8CRAMBUf0KdD5R2oT2MP8dSC2GQE21oCmJlVblbHGNoZbsfyON1WwiyDfNr0bHpp35pX1R7TWNEhuW7VNgIxj_xexnbP/s320/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.57.59.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
這個Chrome可以使用程式碼中的那個 &quot;browser&quot; 物件來操控它&lt;br /&gt;
&lt;br /&gt;
下面是操控的範例&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9sxcbAAA_w_AH6x77XyX5_qbeTt0tm_HfzLJcxD-c6eo9naZP-4vMq7FJRwh3LHl6g_JAJUbYY8q_QjV0m6cTMEYqhata9Kt3YMLlgbHJ80c27p5hqX7xAv63S48r5Lcbz9H8sSGkcA2/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25883.10.47.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;602&quot; data-original-width=&quot;1600&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-9sxcbAAA_w_AH6x77XyX5_qbeTt0tm_HfzLJcxD-c6eo9naZP-4vMq7FJRwh3LHl6g_JAJUbYY8q_QjV0m6cTMEYqhata9Kt3YMLlgbHJ80c27p5hqX7xAv63S48r5Lcbz9H8sSGkcA2/s640/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25883.10.47.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
如果要用Firefox 來抓蟲的話&lt;br /&gt;
請到下面這個網站下載&amp;nbsp;geckodriver 這個檔案&lt;br /&gt;
&lt;br /&gt;
https://github.com/mozilla/geckodriver/releases&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWl7vb3p1jwXf31c-walZlckWr5HX998X9H1RTtFY3Sunf-hHFY7wDwWDmBey28uMJHEVVQfDyp-j2CJMcweZZtcwHkR1M0lEZkaBo_-9dQP76AZM54aP9sWLrvPXSZjqNMVUcKhiXQmo_/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.29.07.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1246&quot; data-original-width=&quot;1556&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWl7vb3p1jwXf31c-walZlckWr5HX998X9H1RTtFY3Sunf-hHFY7wDwWDmBey28uMJHEVVQfDyp-j2CJMcweZZtcwHkR1M0lEZkaBo_-9dQP76AZM54aP9sWLrvPXSZjqNMVUcKhiXQmo_/s320/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.29.07.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw1TjlPH9eCE37ArIDlb9Wbnlu_FY6d-otdY6d3fketyS7plxInvMMRkxe5IkV14rC0pRlfxPq-HmV-yTSfqdwhjuuyRZoMgQSQUI4zjg9N0iSgJySnKPmQFR2w7dVEElEwMokyMmMOZ8i/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.29.13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;748&quot; data-original-width=&quot;784&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw1TjlPH9eCE37ArIDlb9Wbnlu_FY6d-otdY6d3fketyS7plxInvMMRkxe5IkV14rC0pRlfxPq-HmV-yTSfqdwhjuuyRZoMgQSQUI4zjg9N0iSgJySnKPmQFR2w7dVEElEwMokyMmMOZ8i/s320/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.29.13.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
要抓那個應該很明顯，抓下來解壓縮後，把geckodriver這個檔案放在其中一個系統找執行檔的路徑裡。&lt;br /&gt;
&lt;br /&gt;
像是 mac os x 我就放到這個資料夾裡&lt;br /&gt;
&lt;br /&gt;
/usr/local/bin/&lt;br /&gt;
&lt;br /&gt;
然後就可以試看看了:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-qtrDSe7OWLXQaktMNFptyOkXDv49uzonndLNjz9e_Ye4kwGd7y99DbmZysZN95HVS94Bs1drKCerwn-MS-fQSO-pxnFEu17D7V882TzfgqE1tI-7GmAar0st1SVObuLw_RtzlLC2ef_/s1600/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.31.54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;258&quot; data-original-width=&quot;930&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy-qtrDSe7OWLXQaktMNFptyOkXDv49uzonndLNjz9e_Ye4kwGd7y99DbmZysZN95HVS94Bs1drKCerwn-MS-fQSO-pxnFEu17D7V882TzfgqE1tI-7GmAar0st1SVObuLw_RtzlLC2ef_/s640/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25884.31.54.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/217206912591882148/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2017/06/python_30.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/217206912591882148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/217206912591882148'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2017/06/python_30.html' title='Python筆記系列 -- 操作瀏覽器去抓網頁資料'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib6Fb1USD66OeJjlXbMNMds2-od0ZFr5P6l7sEM92vvQnmSHcf2oJA3z8BgHSnhBiT1rqdsCnJte2pOcWsJiJ_-lWAWV_StKCHYtVzPHzKp72Nb_SiX4n9Sm1u1XFv8LlQhwfFQZLmihC9/s72-c/pic+2017-06-30+%25E4%25B8%258B%25E5%258D%25882.45.50.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-93173443729205465</id><published>2017-06-29T07:05:00.004-07:00</published><updated>2018-04-06T01:07:15.657-07:00</updated><title type='text'>Python 筆記系列 -- 開啟 Jupyter notebook 簡單動一動</title><content type='html'>如果有用 pip3 裝好 Jupyter 這個python 套件的話。打開終端機輸入下面這行指令:&lt;br /&gt;
&lt;br /&gt;
$&amp;gt; jupyter notebook&lt;br /&gt;
&lt;br /&gt;
會看到終端機跳出下面這些訊息&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2EsT9VvXKpLTWa-V5mg-PxlDcXOUwyq83-81a1NRWC4sM4pNTbv09woimSdODnQTuvJqTAl3ttaGDtzNRGsXdILCTVuVU981vZrh8QEqFG55Op3O9I4M7wWT3NmpLin9sewFeCvgNIKGb/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.15.26.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;379&quot; data-original-width=&quot;1600&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2EsT9VvXKpLTWa-V5mg-PxlDcXOUwyq83-81a1NRWC4sM4pNTbv09woimSdODnQTuvJqTAl3ttaGDtzNRGsXdILCTVuVU981vZrh8QEqFG55Op3O9I4M7wWT3NmpLin9sewFeCvgNIKGb/s640/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.15.26.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
接著會試著去開啟系統裡的預設瀏覽器，然後就會看到瀏覽器出現下面這個畫面:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYaoplBtckMYhZ46pCVr9tZsmcy6kP3izi4GV-lc61Yz9KKyR4C9rC8s_QFye5gxmCduAmc_bHYp4mHPIY5-6i8Whcky1vHVRSQYVlJGFL_JNaYshyHZTBM6fgSMCGG3lh9dyVSvKN1VGF/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.22.48.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;531&quot; data-original-width=&quot;1600&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYaoplBtckMYhZ46pCVr9tZsmcy6kP3izi4GV-lc61Yz9KKyR4C9rC8s_QFye5gxmCduAmc_bHYp4mHPIY5-6i8Whcky1vHVRSQYVlJGFL_JNaYshyHZTBM6fgSMCGG3lh9dyVSvKN1VGF/s640/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.22.48.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
這個畫面類似檔案總管，用來觀察檔案和進行中的 ipython 專案。看不懂沒關係，不管細節，先建立一個Python3 專案來玩玩。&lt;br /&gt;
&lt;br /&gt;
按右上角的 &quot;New&quot; 按鍵然後選 &quot;Python3&quot; 如下圖:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlfF9BcAV6x8BUuAnP5G8R8zwqRQ03UoZo3ott071MFK4deF5NB02OpHowyFNm0oUHRbcOR7SHfnqxD2LXkBLtvVy9yUw6MRd0FeW2tY_3op4_GXm-PVbmtqGy5hwWrVlb_w8NU2Z0NF5K/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.25.27.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;980&quot; data-original-width=&quot;1072&quot; height=&quot;292&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlfF9BcAV6x8BUuAnP5G8R8zwqRQ03UoZo3ott071MFK4deF5NB02OpHowyFNm0oUHRbcOR7SHfnqxD2LXkBLtvVy9yUw6MRd0FeW2tY_3op4_GXm-PVbmtqGy5hwWrVlb_w8NU2Z0NF5K/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.25.27.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
會看到瀏覽器會多開一個分頁，出現下圖的內容:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUT4ZxJMYNIkcJrkF9dGHPUqxWfVbgDNfphpUVvpMD5fzs11BswxzzDBYSB-ep_tVBSdV68n_PAmuxv26d5t-1XplR0PxTQCWoucEadq0PO2L_TP2TDkF2Q8wptFYBg7_lWr265QMkCB5/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.25.54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;440&quot; data-original-width=&quot;1600&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpUT4ZxJMYNIkcJrkF9dGHPUqxWfVbgDNfphpUVvpMD5fzs11BswxzzDBYSB-ep_tVBSdV68n_PAmuxv26d5t-1XplR0PxTQCWoucEadq0PO2L_TP2TDkF2Q8wptFYBg7_lWr265QMkCB5/s640/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.25.54.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
這個畫面就是新建立的 ipython 專案，可以看到中間有一個框框，點一下那個框框後就會在裡面出現游標。這個時候可以開始輸入python3程式碼。我們先如下圖鍵入&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
print(&quot;hello world&quot;)&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP3_yWuZ6l4prqP1N_gJvv-v5tBH0nbN2F9hwQjAZcYRstyKLSYdEKv59oFKygT_xiozZvgetSDtTC3ajhNj11d5xLLsp_7Qwf8l3xGIHCTj-8wYaiqI0OIxdUMtWjvoZ1sHGZVbz4OufA/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.26.22.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;204&quot; data-original-width=&quot;1084&quot; height=&quot;60&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiP3_yWuZ6l4prqP1N_gJvv-v5tBH0nbN2F9hwQjAZcYRstyKLSYdEKv59oFKygT_xiozZvgetSDtTC3ajhNj11d5xLLsp_7Qwf8l3xGIHCTj-8wYaiqI0OIxdUMtWjvoZ1sHGZVbz4OufA/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.26.22.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
這個時候按 &quot;Enter&quot; 會在同一個框框裡換行。按 &quot;shift + Enter&quot; 會執行游標所在框框裡的程式碼:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLHkxHtdswIOrKFo_YsX8-J1jJXkXYs378WU6RLVsc06WqHCYhp4PliVhtVUi-gXQTVX4uXRKv6JOR3MZIwUpM0akicQQP-HF2YSC27JpgAC_d_oV17KTHRne8sMoXjE9NCDMER2hrv3ss/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.26.31.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;400&quot; data-original-width=&quot;942&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLHkxHtdswIOrKFo_YsX8-J1jJXkXYs378WU6RLVsc06WqHCYhp4PliVhtVUi-gXQTVX4uXRKv6JOR3MZIwUpM0akicQQP-HF2YSC27JpgAC_d_oV17KTHRne8sMoXjE9NCDMER2hrv3ss/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.26.31.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
由圖可以馬上看到程式碼執行後的結果。並且新產生一個新的框框。&lt;br /&gt;
&lt;br /&gt;
其實框框在這裡被稱為 &quot;cell&quot; ，每個 cell 裡面由多行的程式碼所組成。cell 點進去之後，會出現游標(進入編輯程式碼模式)，按 &quot;ESC&quot; 之後游標會不見(脫離程式碼編輯模式，進入 cell 編輯模式)。&lt;br /&gt;
&lt;br /&gt;
不管在何模式，按下 &quot;shift + Enter&quot; 會執行目前游標所在的 cell 裡的程式碼(其他cell的程式碼不會執行)。&lt;br /&gt;
&lt;br /&gt;
在 cell 編輯模式可以 新增、剪下、複製、貼上、上下移動 cell -- 利用下面這些按鍵:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSBTIw2BbCaqcU1d2FCn7okoo_8v2KS7HZVq7SI7aauIFO-G3tozCKJecP1nVkdqpg-RcUk2zpK61pQAKWq3eLjaWSXXHe8c7BrBWKhgHQiHvDjooMtpnBg4djmR9JH2aL6rWYn3CcCVFK/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.48.47.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;98&quot; data-original-width=&quot;598&quot; height=&quot;52&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSBTIw2BbCaqcU1d2FCn7okoo_8v2KS7HZVq7SI7aauIFO-G3tozCKJecP1nVkdqpg-RcUk2zpK61pQAKWq3eLjaWSXXHe8c7BrBWKhgHQiHvDjooMtpnBg4djmR9JH2aL6rWYn3CcCVFK/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.48.47.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
要把目前的執行結果存檔下來的話，可以按左上角那個 &quot;磁碟片&quot; 的按鍵 ( 隨著時代的前進，會有越來越多人不知道這個圖案的由來...)。存檔之後可以回到開頭的分頁，可以看到多了一個 &quot;Untitled.ipynb&quot; (預設檔名)的檔案。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6D_cXlFfgBC4ZZM-0tKBHZnk9Kgb324BGHtGHm0Flsz43WLxKb84NwW332nVvMokVMAxZUPd7LqbUFKZBQ_qlQ734Dn_WCegejH-0egCjJHiDMeGdei6lfKSOJwnX2eu-57hNojlgSCWF/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.53.37.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;484&quot; data-original-width=&quot;1104&quot; height=&quot;140&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6D_cXlFfgBC4ZZM-0tKBHZnk9Kgb324BGHtGHm0Flsz43WLxKb84NwW332nVvMokVMAxZUPd7LqbUFKZBQ_qlQ734Dn_WCegejH-0egCjJHiDMeGdei6lfKSOJwnX2eu-57hNojlgSCWF/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.53.37.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
不喜歡這個檔名，可以去點下面這個地方:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_bAXiXnte5Djom6qAtzgXbJl5Rs5jvZgaqu8Iq4vByOA52-scOEWS5_ImuVdf017fKge6SwI1UYfd7BO_ZbSNhFyr3TsQ62L6IyPWf7WkTGfysNf9KroA3pBiY5IV0Nngigv3lHcXysiW/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.55.52.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;620&quot; data-original-width=&quot;1052&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_bAXiXnte5Djom6qAtzgXbJl5Rs5jvZgaqu8Iq4vByOA52-scOEWS5_ImuVdf017fKge6SwI1UYfd7BO_ZbSNhFyr3TsQ62L6IyPWf7WkTGfysNf9KroA3pBiY5IV0Nngigv3lHcXysiW/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.55.52.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
就可以修改檔名&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinMraZ4YmNDXmOWaPyryCjwonsMOKUnmK_aQyCxfxf0-uUSUMBI61lcuN0Kdzeu7XRNIkZ7rEljiG6p7Fk7HDMb7oJIImHUKu-S7T14tVltHrFfR_ighmhpwADyabm0J-_FDCAm7VUeOYi/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.56.05.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1000&quot; data-original-width=&quot;1600&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinMraZ4YmNDXmOWaPyryCjwonsMOKUnmK_aQyCxfxf0-uUSUMBI61lcuN0Kdzeu7XRNIkZ7rEljiG6p7Fk7HDMb7oJIImHUKu-S7T14tVltHrFfR_ighmhpwADyabm0J-_FDCAm7VUeOYi/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.56.05.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
最後回去看一下:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhClFikkOYjCBy6Owkfj0488pke9G5Vvh6HseTLXrgzFfIo4zESweMyVVMe7cgtBDjCRO-Gy2dnFLmLRtIPLIwfQPqJBtNhf5LCT-8a6x4gWjQ1luVbaSlF_ZG8Q7YYAIQRpepBh_a2V7Oj/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.56.16.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;646&quot; data-original-width=&quot;1050&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhClFikkOYjCBy6Owkfj0488pke9G5Vvh6HseTLXrgzFfIo4zESweMyVVMe7cgtBDjCRO-Gy2dnFLmLRtIPLIwfQPqJBtNhf5LCT-8a6x4gWjQ1luVbaSlF_ZG8Q7YYAIQRpepBh_a2V7Oj/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.56.16.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
可以看到如果該ipython的專案檔名前面是綠色的標示，表示這個專案還在&quot;執行當中&quot;，請把它當做一個正在運行的程序。&lt;br /&gt;
&lt;br /&gt;
如果要停止運行的話，在專案分頁裡按 &quot;File&quot; --&amp;gt; &quot;Close and Halt&quot;，該專案就會停止運行並關閉:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSIf9OvAPhpn1r4ZEmShztTDqjMTkGtn1RdyqEoGFa763Dc4dPoisPt75JKmqfha6SsXfF7jihQmN4732VhboYjTo7SWGysFZ1jmLLP0ur-W5suj9ltpJ31pVWLaxpKddn1gxFLSdoqvxB/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.53.54.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;1312&quot; data-original-width=&quot;622&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSIf9OvAPhpn1r4ZEmShztTDqjMTkGtn1RdyqEoGFa763Dc4dPoisPt75JKmqfha6SsXfF7jihQmN4732VhboYjTo7SWGysFZ1jmLLP0ur-W5suj9ltpJ31pVWLaxpKddn1gxFLSdoqvxB/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.53.54.png&quot; width=&quot;151&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
停止運行的專案會像下面這個樣子灰灰的...&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalJL9M6aaasY5ss6mNUWx4yFv_bqr2tcFHJ7s7Vn_nAdnZEwGD4l8wrAkEP1GliTj9otXJv5a6Sz4FbcsGiI5S56D9gs7khqU_zbtqkL8fYzcrWzSmQIvbfTN53LJ_HN0DS52S8L44wiP/s1600/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%258810.03.05.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;116&quot; data-original-width=&quot;470&quot; height=&quot;78&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjalJL9M6aaasY5ss6mNUWx4yFv_bqr2tcFHJ7s7Vn_nAdnZEwGD4l8wrAkEP1GliTj9otXJv5a6Sz4FbcsGiI5S56D9gs7khqU_zbtqkL8fYzcrWzSmQIvbfTN53LJ_HN0DS52S8L44wiP/s320/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%258810.03.05.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
會一些基本的操作之後，下面再正式進入寫一程式碼來用。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/93173443729205465/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2017/06/python-jupyter-notebook.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/93173443729205465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/93173443729205465'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2017/06/python-jupyter-notebook.html' title='Python 筆記系列 -- 開啟 Jupyter notebook 簡單動一動'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2EsT9VvXKpLTWa-V5mg-PxlDcXOUwyq83-81a1NRWC4sM4pNTbv09woimSdODnQTuvJqTAl3ttaGDtzNRGsXdILCTVuVU981vZrh8QEqFG55Op3O9I4M7wWT3NmpLin9sewFeCvgNIKGb/s72-c/pic+2017-06-29+%25E4%25B8%258B%25E5%258D%25889.15.26.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-6272839922187511572</id><published>2017-06-29T05:55:00.001-07:00</published><updated>2018-04-06T01:06:23.575-07:00</updated><title type='text'>Python 筆記系列 -- 安裝 Python3</title><content type='html'>Python 好好用系列之-- 聽說Python好好用，但是要怎麼開始，可以拿來做什麼？&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
首先，要在電腦上安裝 Python3 的直譯器、套件管理程式 pip 、還有超級好用的開發環境 ipython + notebook。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;如果你是用 ubuntu Linux的&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
安裝直譯器很簡單。打開 終端機&amp;nbsp;輸入&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;code&gt;
$&amp;gt; sudo apt-get install python3.5&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
然後你就案裝好 python3 的直譯器了，版本號碼大約是3.5。然後安裝Python的套件管理程式 -- pip:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
$&amp;gt; sudo apt-get python3-pip python3-dev&lt;br /&gt;
&lt;/code&gt;

&lt;br /&gt;
&lt;br /&gt;
接著要裝 ipython notebook 現在好像改名叫 jupyter &amp;nbsp;了。沒裝這個之前，會覺得Python也沒多好用。&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
$&amp;gt; sudo pip3 install jupyter&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
這樣就安裝完成了～&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;如果你是用 Mac OS X 的&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
&amp;nbsp;參考網頁:&amp;nbsp;https://stringpiggy.hpd.io/mac-osx-python3-dual-install/#step1&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;先裝 Xcode &lt;/span&gt;，這個東西要去 &lt;span style=&quot;font-size: large;&quot;&gt;App Store&amp;nbsp;&lt;/span&gt;上面裝。&lt;br /&gt;
&lt;br /&gt;
裝完 Xcode 之後打開終端機輸入下列指令&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$&amp;gt; xcode-select --install&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
然後就可以開始安裝上的套件管理程式 &quot;brew&quot; 。 終端機輸入下面這行(可以複製貼上...)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$&amp;gt; ruby -e &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)&quot;&lt;/code&gt;
&lt;/div&gt;
&lt;br /&gt;
然後利用 brew 來安裝 python3&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
$&amp;gt; brew install python3&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
如果沒意外的話，brew 應該會連 pip3 一起裝好。&lt;br /&gt;
&lt;br /&gt;
所以接著就用 pip3 來安裝 jupyter&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;$&amp;gt; sudo pip3 install jupyter&lt;/code&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;進入&lt;a href=&quot;http://onionys.blogspot.tw/2017/06/python-jupyter-notebook.html&quot;&gt; Python 好好用系統之二&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-size: x-large;&quot;&gt;如果你是用 Windows 的&lt;/span&gt;&lt;/h2&gt;
&lt;br /&gt;
關鍵字 Anaconda 自已去 Google。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/6272839922187511572/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2017/06/python-python3.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6272839922187511572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6272839922187511572'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2017/06/python-python3.html' title='Python 筆記系列 -- 安裝 Python3'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8329787294185777420</id><published>2017-06-04T01:23:00.002-07:00</published><updated>2018-02-07T08:05:37.252-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="碎碎唸"/><title type='text'>因為一篇漫畫而起的碎碎唸</title><content type='html'>端午連假時，女朋友跟我說回鄉的長途車程想看一些輕鬆的小品書籍 。&lt;br /&gt;
&lt;br /&gt;
望向我的書櫃時才發現，儘是無聊的工具書與教科書...，這個時候我知道，再無腦也不能說出這樣的話 : &quot;這本Python的入門書寫得超讚得~~~非常適合在車上看...&quot;&lt;br /&gt;
&lt;br /&gt;
為了不發生上面的情形，於是我穿著拖鞋短褲加汗衫跑到家裡附近的書店去晃了一個小時挑了下面這幾本書:&lt;br /&gt;
&lt;br /&gt;
&quot;我是一個媽媽，我需要柏金包&quot; -- 這是看了囧星人書評後一直想買的書&lt;br /&gt;
&lt;br /&gt;
&quot;哲學能做什麼?&quot; -- 這是本我自已想買的書...&lt;br /&gt;
&lt;br /&gt;
&quot;健康才有鹿用&quot; -- 我是被封面可愛的畫風吸引，內容都是滿滿的四格漫畫。&lt;br /&gt;
&lt;br /&gt;
後來 &quot;健康才有鹿用&quot; 這本漫畫成功的消磨了長途車程的時光。後來還得到了正面的回應。&lt;br /&gt;
&lt;br /&gt;
這本書畫風很可愛，一則則的小故事和個性鮮明的人物會讓人想要一口氣把它看完。&lt;br /&gt;
&lt;br /&gt;
讓人在生動的故事之中了解到癌症療程中人物的心理變化、不自覺地感染到其中作者想表達 &quot;正向面對人生的態度&quot; 。&lt;br /&gt;
&lt;br /&gt;
看完之後的感覺...健康很重要很重要很重要。內在情緒和想法的調節也超重要。&lt;br /&gt;
&lt;br /&gt;
還有...好羨慕作家都可以畫出如此生動的圖案。&lt;br /&gt;
&lt;br /&gt;
------ 進入碎碎唸的分隔線 ------&lt;br /&gt;
&lt;br /&gt;
作為一個自學程式設計並且希望能用程式設計在軟體業裡面討生活的人。在coding的時候是充滿樂趣的。如同漫畫家拿著畫筆畫畫一樣。&lt;br /&gt;
&lt;br /&gt;
除了基本的技巧表現之外，還希望能在其中創作些什麼有意思的東西。當然，可以靠程式設計混口飯吃就太好了。&lt;br /&gt;
&lt;br /&gt;
這個就是我開始自學程式設計的第一個小小目標。現在也如願地，在一家公司裡靠著寫軟體維生。一切看起來都是如此的美好。只是在工作之間，因為職場文化的關係，似乎精力都被其他事情給消磨掉了。&lt;br /&gt;
&lt;br /&gt;
到是沒想到看完這本漫畫，讓我又一次的體會到常初的樂趣。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8329787294185777420/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2017/06/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8329787294185777420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8329787294185777420'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2017/06/blog-post.html' title='因為一篇漫畫而起的碎碎唸'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-795773220090286430</id><published>2017-05-19T00:05:00.000-07:00</published><updated>2017-05-19T00:05:22.567-07:00</updated><title type='text'>ssh 使用筆記--無密碼登入設定</title><content type='html'>
&lt;br /&gt;
&lt;h1 id=&quot;toc_0&quot;&gt;
使用ssh的筆記&lt;/h1&gt;
&lt;h1 id=&quot;toc_1&quot;&gt;
一般使用&lt;/h1&gt;
登入&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; ssh {id}@{IP:port} 
&amp;gt; ssh userone@192.168.0.100:22&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
使用scp複製檔案到遠端&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; scp {filename} {id}@{IP}:{path} -p {port}
&amp;gt; scp video.mp4 userone@192.168.0.100:~/video/
&amp;gt; scp video.mp4 userone@192.168.0.100:~/video/ -p 999&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
使用scp複製遠端的檔案&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; scp {id}@{IP}:{filepath} -p {port} {dest path}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h1 id=&quot;toc_2&quot;&gt;
使用公私鑰登入，免用密碼&lt;/h1&gt;
使用公私鑰登入的方式比較方便，但是要先在自已的主機上準備好一對公私鑰的檔案。&lt;br /&gt;
第一步，先在自已的主機上產生公私鑰&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; ssh-keygen -t rsa
中問會問產生公私鑰對存放的資料夾、是否要設定密碼保護?
一路enter下去也行。預設會放在 ~/.ssh/ 資料夾裡
id_rsa.pub --&amp;gt; 這個是公鑰，是用來公開的。
id_rsa     --&amp;gt; 這個是私鑰，保護好，等同密碼的東西。&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
第二步，把自已的公鑰設定到遠端要登入的站&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; ssh-copy-id {id}@{IP} -i {~/.ssh/id_rsa.pub} -p {port}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
之後登入該站就不需要輸入密碼了。&lt;br /&gt;
&lt;h1 id=&quot;toc_3&quot;&gt;
ssh 事先設定好登入資料&lt;/h1&gt;
修改檔案 &lt;code&gt;~/.ssh/config&lt;/code&gt;，如果沒有的話就產生一個，只是個文字檔。&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;Host {自定名稱}
    User {user ID}
    Port {ssh server port}
    Hostname {IP}
    IdentityFile {~/.ssh/id_rsa : private key file}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
下面是example&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;Host mqtt
    User ubuntu
    Port 22
    Hostname 192.168.101.116
    IdentityFile ~/.ssh/id_rsa

Host gitlab
    User gitsvn
    Port 22
    Hostname 192.168.101.118
    IdentityFile ~/.ssh/id_rsa

Host docker
    User docker
    Port 22
    Hostname 192.168.101.126
    IdentityFile ~/.ssh/id_rsa

Host debian8
    User debian8
    Port 22
    Hostname 192.168.101.160&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
之後就可以直接用自定名稱來登入&lt;br /&gt;
&lt;div&gt;
&lt;pre&gt;&lt;code class=&quot;language-none&quot;&gt;&amp;gt; ssh mqtt&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/795773220090286430/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2017/05/ssh.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/795773220090286430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/795773220090286430'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2017/05/ssh.html' title='ssh 使用筆記--無密碼登入設定'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-7524432091698015931</id><published>2016-10-31T00:09:00.004-07:00</published><updated>2016-10-31T00:09:44.058-07:00</updated><title type='text'>好久沒更新網誌了...</title><content type='html'>前一陣子買的筆電一直感覺很不好用，想說怎麼都已經是intel i7的cpu 了還是這麼慢？&lt;br /&gt;
&lt;br /&gt;
在公司的同事慫恿之下跑去把它給升級成24G RAM 加上一個256G的SSD當作系統碟，馬上就變得跟飛的一樣快。&lt;br /&gt;
&lt;br /&gt;
灌完 ubuntu 系統之後，正在整理舊的資料，發現這個好玩的網頁:&lt;br /&gt;
&lt;br /&gt;
http://inishie-dungeon.com/&lt;br /&gt;
&lt;br /&gt;
才想起來在學生的時候有一陣子很喜觀這個8bit風格的網頁遊戲。&lt;br /&gt;
&lt;br /&gt;
進現在的公司也快半年了，主要是在寫JAVA Android。雖然不是Python，但寫久了也是有寫心得，尤其是在Design Pattern 方面，又有一些小小的進步了......不知為何，總感覺可以去學一下C/C++ 重新溫習一下。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/7524432091698015931/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2016/10/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/7524432091698015931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/7524432091698015931'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2016/10/blog-post.html' title='好久沒更新網誌了...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-66387790900795485</id><published>2016-03-04T03:30:00.002-08:00</published><updated>2016-03-04T03:30:38.942-08:00</updated><title type='text'>最近小事雜雜唸...</title><content type='html'>開始工作之後寫Blog的熱情很快的就被消磨掉，特別是為了工作而寫文章之後，有好一陣子都不想打開blog 了。直到最近心血來潮，打開看一下，竟然有人看了我不知幾年前寫的文章之後還來信問問題，才又想說再重拾鍵盤上線 key 文。(話說我還是個機械鍵盤愛好者...Orz...) 工作期間(現已離職--無業中~~~拉拉拉拉~~~)被交待要寫blog 文章之後，內心寫文章的動機消磨得非常快。果然我只適合偶爾心血來潮才寫個一篇文章的業餘blog主。&lt;br /&gt;
&lt;br /&gt;
而最近休息個一陣子之後，似乎有些回神了，才又打開 blog 寫個雜唸。這個blog 主要還是以自學程式設計的文章為主。而有&quot;自學&quot;兩個字，表示 blog 主小人物我，是個非本科系程式設計愛好者。用武俠仙俠小說的說法，就是個非玄門正宗出身的散修(&quot;偶爾&quot;會看仙俠小說...)。就是個業餘的程式設計者，平時愛逛天龍國天瓏書局，還常常想要頭套絲襪手拿BB槍去洗劫裡面的原文書。&lt;br /&gt;
&lt;br /&gt;
去年很有趣的是，我忽然心血來潮跑去參加 2015PyCon Taiwan，期間被現場的氣氛給感染到之後，就覺得 Python 這個言語果然是個好物，而決定專心在 Python 的學習之上了。所以這個Blog 之後的方向應該會比較確定了，就是以分享 Python 程式言語的一些大小事為主軸。&lt;br /&gt;
&lt;br /&gt;
其實這個想法很久了，這 blog 很久之前就發過一篇 matplotlib 的教學文。那個時候還在新竹工作，原本想要藉著和同事們分享學習 Python + Matplotlib 來做數值分析與出圖的做法，搞個類似讀書會一起學習所以才寫了那篇文章為開頭。但是...身邊所有人對於程式設計都沒什麼興趣，加上在那邊付費套裝軟體做數值繪圖一直是主流做法，為了配合進行數據交換，在那個時候這樣的想法就只能以放在心裡面了。那一段期間，找不到程式設計的同好實在是令我感到生命的寒冷...(在PyCon裡面當個聽眾對我來說是種奢侈的享受了...但是最後沒能待到最後一天就被強迫中止...怒...)&lt;br /&gt;
&lt;br /&gt;
不過目前動力是有了，但是...我的靈感似乎還沒歸位...讓我想想來寫些個什麼...</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/66387790900795485/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2016/03/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/66387790900795485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/66387790900795485'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2016/03/blog-post.html' title='最近小事雜雜唸...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-3318322134260678707</id><published>2015-11-13T03:40:00.002-08:00</published><updated>2015-12-18T18:21:06.532-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="micro SD card"/><category scheme="http://www.blogger.com/atom/ns#" term="Raspberry Pi2"/><title type='text'>Raspberry Pi2 之 micro SD 卡的選擇</title><content type='html'>自從 Raspberry Pi 從 mode A 升級到 mode B+ 之後，使用的儲存媒介也從 SD 卡轉變為 micro SD 卡了。而我大概是在Raspberry Pi 升級成 Pi 2 的時候，才開始玩Raspberry Pi 的。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Raspberry Pi 2 的作業系統是安裝在 micro SD 卡裡面的，所以作業系統跑得快或慢和所使用的 micro SD 卡會有很大的關係。而其實也沒有人有那麼多閒時間去買不同牌的 micro SD 卡來試說那一個牌子的跑得比較快。只是玩了這麼一陣子，不知為何在我手中的 micro SD 卡常常不見，我去買新卡的時候也沒太多注意到底買了哪些牌子，所以不知不覺就發現了，用了不同牌子的 micro SD 卡來跑 Raspberry Pi 2 ，會感覺到速度上有一些差別。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
目前買過我覺得還不錯用的 micro SD 卡(用在Raspberry Pi 2 上面的)是 創見的 MicroSDHC Class 10 系列的 8G 。不過我第一個Raspberry Pi 系統碟掛點的也是 創見的...所以...一切小心，還是不要太相信micro SD 卡的安全性...定時做資料備份比較好....。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
聽說 Raspberry Pi2 好像不是每款micro SD 卡的規格都能吃的樣子。聽說買太好(太大? 太快?)的規格，反而會無法使用。這個我就不是非常清楚了。希望有網友能分享一下各種牌子的使用心得。&lt;br /&gt;
&lt;br /&gt;
-- 後記 --&lt;br /&gt;
&lt;br /&gt;
最近看到這個...相信...這樣就會比較少機會買到地雷了。&lt;br /&gt;
&lt;br /&gt;
https://github.com/geerlingguy/raspberry-pi-dramble/wiki/microSD-Card-Benchmarks&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/3318322134260678707/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/11/raspberry-pi2-micro-sd.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3318322134260678707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3318322134260678707'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/11/raspberry-pi2-micro-sd.html' title='Raspberry Pi2 之 micro SD 卡的選擇'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-5937491563752914368</id><published>2015-03-30T17:28:00.000-07:00</published><updated>2015-11-13T03:53:47.632-08:00</updated><title type='text'>python 筆記 -- multiprocess 和 Threading 使用</title><content type='html'>&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
from multiprocessing import Process, Queue&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
def do_something_func(the_queue):&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; while(1):&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg = the_queue.get() &amp;nbsp;# 從主程序那邊接收一個訊息&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print msg&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# 宣告一個Queue，作為主副程序之間的資料交換管道&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
the_queue = Queue()&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# 宣告一個 Process , target 為子程序要跑的function, args為要傳入該function的參數&lt;/div&gt;
&lt;div&gt;
the_proc = Process(target = do_something_func, args = ((the_queue), ))&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# 子程序開始執行&lt;/div&gt;
&lt;div&gt;
the_proc.start()&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# 主程序的while loop&lt;/div&gt;
&lt;div&gt;
while(1):&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; msg = &quot;hello world&quot;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; the_queue.put(msg) &amp;nbsp;## 傳送一個訊息到子程序之中&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
使用 Threading&lt;br /&gt;
&lt;br /&gt;
from threading import Thread&lt;br /&gt;
&lt;br /&gt;
def do_something():&lt;br /&gt;
&amp;nbsp; &amp;nbsp; while(True):&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &quot;Hello World&quot;&lt;br /&gt;
&lt;br /&gt;
the_thread = Thread(target=do_something, args = ())&lt;br /&gt;
&lt;br /&gt;
the_thread.start()&lt;br /&gt;
&lt;br /&gt;
## 然後會發現用ctrl+c也無法讓這個program停下來...&lt;br /&gt;
## 因為ctrl+c的訊號不會傳遞給其他 threading...&lt;br /&gt;
## 不過這個是 python2 的問題了， python3 把這個問題給修正了。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/5937491563752914368/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/python-multiprocess.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/5937491563752914368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/5937491563752914368'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/python-multiprocess.html' title='python 筆記 -- multiprocess 和 Threading 使用'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-6730492200316512171</id><published>2015-03-18T23:03:00.000-07:00</published><updated>2015-03-18T23:03:01.254-07:00</updated><title type='text'>C語言--找到 OpenCV 的 Compiler 時用的 flag</title><content type='html'>最近在 Linux 下寫 C ，使用到 OpneCV的時候忽然發現不知道在 compile 時到底要用哪些 cflag。&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
上網查了之後才發現可以用 pkg-config 這個指令來找:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
pkg-config --libs --cflags opencv&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
然後系統就會幫你找到 compile 時應該用的 cflag 。&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/6730492200316512171/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/c-opencv-compiler-flag.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6730492200316512171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6730492200316512171'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/c-opencv-compiler-flag.html' title='C語言--找到 OpenCV 的 Compiler 時用的 flag'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8959839916013141333</id><published>2015-03-17T19:49:00.004-07:00</published><updated>2015-03-17T19:49:44.275-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="筆記"/><title type='text'>C 語言筆記: pthread 簡單用法</title><content type='html'>&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;

#include&amp;lt;stdio.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;
#include&amp;lt;unistd.h&amp;gt;
#include&amp;lt;pthread.h&amp;gt;

void * pthread_func(void * data_ptr);

int main(int argc,char *argv[]){

    pthread_t pth;
    pthread_create(&amp;amp;pth, NULL, pthread_func, NULL);

    pthread_join(pth,NULL);
    return 0;
}




void * pthread_func(void * data_ptr)
{
    int i = 10;
    while(i-- ){
        printf(&quot;pthread: %d\n&quot;, i);
        usleep(1000000);
    }

    return NULL;
}

&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Compile 需要加入FLAG:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -pthread&lt;br /&gt;
&lt;br /&gt;
需要include的library :&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; pthread.h&lt;br /&gt;
&lt;br /&gt;
宣告一個 pthread_t 變數做為該 pthread 的控制器。&lt;br /&gt;
&lt;br /&gt;
宣告一個 function 為該pthread要做的事情。&lt;br /&gt;
&lt;br /&gt;
主程式車，pthread_create() 之後，該pthread 開始run。&lt;br /&gt;
&lt;br /&gt;
主程式中，pthread_join() 會等待該pthread的結束和回傳值。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8959839916013141333/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/c-pthread.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8959839916013141333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8959839916013141333'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/c-pthread.html' title='C 語言筆記: pthread 簡單用法'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-3877910835442557334</id><published>2015-03-08T21:03:00.001-07:00</published><updated>2015-03-16T20:54:33.782-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="network"/><category scheme="http://www.blogger.com/atom/ns#" term="raspberry pi"/><category scheme="http://www.blogger.com/atom/ns#" term="wifi"/><title type='text'>Raspberry Pi 上面簡單設定 wifi 筆記</title><content type='html'>在Raspberry Pi上面跑wifi，要先買相容的無線網路卡，這裡用的是EDIMAX的無線網路卡。Raspbian內建好驅動程式，裝上去之後馬上就可以用。&lt;br /&gt;
&lt;br /&gt;
開機之後，用ifconfig指令看一下，馬上就會發現多了一個wlan0的網路介面。通常這個時候還不會連接上無線網路。&lt;br /&gt;
&lt;br /&gt;
先用iwlist指令看一下能接受到的無線訊號吧。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;sudo iwlist scan | grep &quot;ESSID&quot;
&lt;/pre&gt;
然後去修改你的 /etc/netowrk/interfaces&lt;br /&gt;
&lt;br /&gt;
下面為DHCP的連線方式設定值為:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;auto wlan0
allow-hotplug wlan0

iface wlan0 inet dhcp
 wpa-ssid &quot;你的無線AP的SSID&quot;
 wpa-psk &quot;你的無線AP的password&quot;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
下面為固定IP的設定方式:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
auto wlan0
allow-hotplug wlan0

iface wlan0 inet static
  address 192.168.x.x
  netmask 255.255.255.0
  gateway 192.168.x.x
  wpa-ssid &quot;你的無線AP的SSID&quot;
  wpa-psk  &quot;你的無線AP的password&quot;
&lt;/pre&gt;
&lt;br /&gt;
接下來&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
sudo ifdown wlan0
sudo ifup wlan0
&lt;/pre&gt;

或是重新開機....</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/3877910835442557334/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/raspberry-pi-wifi.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3877910835442557334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3877910835442557334'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/raspberry-pi-wifi.html' title='Raspberry Pi 上面簡單設定 wifi 筆記'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-6857722614337949718</id><published>2015-03-05T22:56:00.003-08:00</published><updated>2015-03-16T20:50:08.565-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="google code"/><title type='text'>GoogleCode -- git 使用筆記 (2) -- 簡易指令介紹</title><content type='html'>在前一篇文章介紹怎麼在Google Code上面建立一個專案，並且 Clone 一份到本地 Linux 主機上面之後，這篇文章記錄一下怎麼簡單的和遠端Google Code 主機做同步備份。&lt;br /&gt;
&lt;br /&gt;
假設已經 clone 一份 repo 到 自已的 Linux 主機上，並進去該專案目錄了。&lt;br /&gt;
&lt;br /&gt;
開始寫程式了，寫一個檔案叫做 hello.c 。但此時這個 hello.c 還沒有加入 Git 系統的管理檔案名單之中，所以怎麼 Git 系統這個時候不會看見這個檔案。&lt;br /&gt;
&lt;br /&gt;
所以要讓 Git 系統開始對 hello.c 這個檔案做版本管理要把該檔案加入Git 管理檔案名單之中:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
git add hello.c
&lt;/pre&gt;
&lt;br /&gt;
此時，因為專案內容被修改過了(增加了一個檔案: hello.c )，想要把這個狀態 (版本) 給備份起來，要用 git commit 指令，並且要加一小段文字說明做了什麼修改:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
git commit -a -m &quot;該版本簡短說明&quot;
&lt;/pre&gt;
&lt;br /&gt;
接著在未來經過多次的 git commit 之後，你想要把這個專案備份到GoogleCode上時，就要用下面這個指令:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
git push origin master&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;
說明一下，git push 是把專案備份到 Google Code 主機上用的指令。&lt;br /&gt;
&lt;br /&gt;
origin指的是主機代號，這裡就是指 Google Code 主機，之後如果想要備份多個repo到很多台主機上的時候，可以用 git remote add 這個指令增加新的主機和主機代號。可以到該專案目錄底下的.git目錄裡的config檔看，會看到所有主機的設定。&lt;br /&gt;
&lt;br /&gt;
而master 這個是指分支 (branch) 代號，主幹代號預設為 master ，而要增加其他分支的話，要使用 git checkout 這個指令。&lt;br /&gt;
&lt;br /&gt;
之後，每次修改完 code 到一個要做備份的時候，最好 git commit 一下。&lt;br /&gt;
&lt;br /&gt;
而要備份到Google Code 主機上之時，再用git push這個指令。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/6857722614337949718/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/googlecode-git-2.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6857722614337949718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/6857722614337949718'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/googlecode-git-2.html' title='GoogleCode -- git 使用筆記 (2) -- 簡易指令介紹'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-9043764044066125040</id><published>2015-03-05T22:29:00.001-08:00</published><updated>2015-03-16T20:50:21.526-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="google code"/><title type='text'>GoogleCode -- git 使用筆記 (1) -- 建立專案</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
最近因為工作的關係，Code開始越寫越多了。而且發現相同的一份 code 常常會今天用自已的macbook 寫程式，一下子又跑到 Raspberry Pi 板子上面接著寫。顯然，在這種情況之下馬上就體會到 github 和 google code 的好處。&lt;br /&gt;
&lt;br /&gt;
不過之前沒用過這一類的版本控制系統之前，會很難體會這個系統的概念。所以就這篇文章記錄一下，使用 google code 的流程。&lt;br /&gt;
&lt;br /&gt;
不過先說一下，我都是在用 console 介面下使用 vim 寫程式碼，所以只會記錄在 unix console介面下的使用過程。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h2&gt;
第一步: 安裝Git和註冊Google 帳號:&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
因為是在Debian底下開發居多，所以安裝很簡單:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
sudo apt-get install git-core
&lt;/pre&gt;
&lt;br /&gt;
好Debian不用嗎?&lt;br /&gt;
&lt;br /&gt;
Gmail 帳號通吃，沒有的話去註冊一個，Google 萬歲(呼口號~~)。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
第二步: 在 Google Code 網頁上建立一個 Project。&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
進去Google Code 的首頁: &lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
https://code.google.com/
&lt;/pre&gt;
&lt;br /&gt;
有一個 &quot;Create a new Project&quot; 的選項按下去...然後會要你輸入 Gmail 的帳號和密碼(如果還沒有登入 Gmail 的話)。然後會進入一個Project的設定畫面。&lt;br /&gt;
&lt;br /&gt;
按照網頁的指示輸入 &quot;Projcet name&quot; , &quot;Project Summary&quot; , &quot;Description&quot;。&lt;br /&gt;
&lt;br /&gt;
版本控制系統 &quot;Version control system&quot; 選用Git。&lt;br /&gt;
&lt;br /&gt;
&quot;Source code licence&quot; 選用...看個人喜好。(老實說我不清楚差別在哪)&lt;br /&gt;
&lt;br /&gt;
然後輸入 &quot;Project labels(s)&quot; ，這個應該就是類似關鍵字的東西。&lt;br /&gt;
&lt;br /&gt;
之後就會進入你的Project的首頁了。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
第三步: 找到你的 GoogleCode.com Password 和設定使用 Git&lt;/h2&gt;
&lt;br /&gt;
&lt;br /&gt;
不是已經有Gmail帳號的密碼了嗎? 這個GoogldCode.com Password又是啥東西? 其實這個是給Git控制系統用的密碼，把這個輸入到 linux 系統底家目錄下的 .netrc 這個 Git 的設定檔裡面之後，就不用每次備份程式碼到 GoogleCode 主機上都要輸入帳號密碼。&lt;br /&gt;
&lt;br /&gt;
Project 頁面的右上方會看到一個 &quot;Profile&quot; 的選項，進去之後會看到 &quot;My Profile&quot; 和 &quot;Settings&quot; 兩個分頁。&lt;br /&gt;
&lt;br /&gt;
選 &quot;Settings&quot; 這個分頁進去。接著會看到有一行字如下面顯示:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
machine code.google.com login &lt;你的Gmail帳號位置&gt; password &lt;GoogleCode 給的password&gt;

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
把這一行寫入Linux系統家目錄底下的 ~/.netrc 檔案裡面，之後就不用每次都要輸入帳號密碼才能和 GoogleCode 主機交換資料了。&lt;br /&gt;
&lt;br /&gt;
接著同一個頁面下面還有一個 &quot;User Preference&quot; ，把 Security 下面那個選項打勾。&lt;br /&gt;
&lt;br /&gt;
最後 &quot;Save perference&quot; 讓設定值生效。&lt;br /&gt;
&lt;br /&gt;
上面這些步驟算是Google Code的帳號設定，只需要進行一次。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
第四步: Clone 一份專案到你的 Linux 系統下&lt;/h2&gt;
&lt;br /&gt;
從網頁右上的 &quot;Profile&quot; 的 &quot;My Profile&quot; 分頁裡面可以看到所有這個 Gmail 帳號所創建的所有Project。&lt;br /&gt;
&lt;br /&gt;
這個時候應該只會有一個，名稱就是 &quot;第二步&quot; 時輸入的 &quot;Project Name&quot;。&lt;br /&gt;
&lt;br /&gt;
點進去該 Project 之後會看到一共有五個分頁分別為:&lt;br /&gt;
&lt;br /&gt;
&quot;Project Home&quot;、&quot;Wiki&quot;、&quot;Issues&quot;、&quot;Source&quot;、&quot;Administer&quot;。&lt;br /&gt;
&lt;br /&gt;
點進去 &quot;Source&quot; 這個分頁。然後網頁上會顯示說你有兩個方法 (option) 來 clone 這個專案。因為我們上面有把 GoogldCode Password 寫進去 ~/.netrc 這個檔，所以這裡是使用第二個方法(Option 2)。&lt;br /&gt;
&lt;br /&gt;
第二個方法的說明底下最後一行的指令，長得像下面這個樣子。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;
git clone https://code.google.com/p/&lt;你的專案名稱&gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
這個其實就只是 Git 的 Clone 專案的指令，在 Linux 的 Console 介面底下直接執行這行指令，就會把該專案clone 一份到你當下的目錄裡面。&lt;br /&gt;
&lt;br /&gt;
之後就可以在你的 Linux 底下開始進行你的專案了，現在在該目錄底下應該可以使用 git push 和 git pull 的方式來和 GoogleCode 主機做備份的動作了。&lt;br /&gt;
&lt;br /&gt;
下一篇會講一下簡單的指令介紹。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/9043764044066125040/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/03/googlecode-git-1.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/9043764044066125040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/9043764044066125040'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/03/googlecode-git-1.html' title='GoogleCode -- git 使用筆記 (1) -- 建立專案'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-4489148250567294655</id><published>2015-02-16T05:21:00.002-08:00</published><updated>2015-02-16T05:21:38.487-08:00</updated><title type='text'>自學程式的一個段落</title><content type='html'>去年年底終於找到工作了，是個靠著寫程式賺生活費的一份工作。&lt;br /&gt;
&lt;br /&gt;
不過畢竟和之前所學和寫程式並無多大相關，所以在工資上也就沒太大的議價空間。也就過得去就好。畢竟目前還是先以累積技術實力為主。&lt;br /&gt;
&lt;br /&gt;
不過也因為切入Code Monkey時，是用偏硬體的角度切入了，所以目前當下也就和硬體、電路、MCU、Linux 作業系統的夾縫之間求生存，以及想辦法融入一個組織的工作管理制裡。&lt;br /&gt;
&lt;br /&gt;
所以最近一陣子工作下來，也寫了一些文章，但都是在Raspberry Pi這塊小板子上完成的Code。下面就把這些文章的連結列出來分享一下:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.ittraining.com.tw/2015/02/raspberry-pi2-kernel.html&quot;&gt;Raspberry Pi2 (ARM Cortex-A7) 上編譯Raspbain Kernel&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.ittraining.com.tw/2014/12/raspberry-pi-b-python-lcd-16x2-hd44780.html&quot;&gt;Raspberry Pi b+ 用 Python 控制 LCD 16x2 (HD44780) 教學 Part 1 硬體設定篇&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.ittraining.com.tw/2015/01/raspberry-pi-b-python-lcd-16x2-hd44780_22.html&quot;&gt;Raspberry Pi b+ 用 Python 控制 LCD 16x2 (HD44780) 簡介 Part 2 基本指令介紹&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.ittraining.com.tw/2015/01/raspberry-pi-b-python-lcd-16x2-hd44780_30.html&quot;&gt;Raspberry Pi b+ 用 Python 控制 LCD 16x2 (HD44780) 簡介 Part 3 LCD 初始化動作 &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.ittraining.com.tw/2015/02/raspberry-pi-b-python-lcd-16x2-hd44780.html&quot;&gt;Raspberry Pi b+ 用Python 控制LCD 16x2 (HD44780) 簡介 Part 4 自訂文字或圖示&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/4489148250567294655/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2015/02/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/4489148250567294655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/4489148250567294655'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2015/02/blog-post.html' title='自學程式的一個段落'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-997559209844334402</id><published>2014-12-13T00:24:00.002-08:00</published><updated>2014-12-13T00:38:34.489-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="autocomplete"/><category scheme="http://www.blogger.com/atom/ns#" term="C/C++"/><category scheme="http://www.blogger.com/atom/ns#" term="clang"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="vim"/><title type='text'>Vim 使用 Clang 來達成 C/C++的 autocomplete效果</title><content type='html'>目前主攻的語言是C/C++ 和 Python.&lt;br /&gt;
&lt;br /&gt;
在coding的時候所慣用的環境則是以vim為主加上一些plugin來達成autocomplete的效果.&lt;br /&gt;
&lt;br /&gt;
Vim在編譯C/C++ code的時候所慣用的plugin是clang_complete.&lt;br /&gt;
&lt;br /&gt;
但是常常發現用apt-get 所安裝的vim沒有python的功能支援以至於無法使用clang_complete.&lt;br /&gt;
&lt;br /&gt;
搞得我要重新編譯vim...這樣子很不方便....&lt;br /&gt;
&lt;br /&gt;
最近在vim的plugin發佈網站上看到一個新的complete plugin&lt;br /&gt;
&lt;br /&gt;
vim-clang ( http://www.vim.org/scripts/script.php?script_id=4926 )&lt;br /&gt;
&lt;br /&gt;
也是用clang來達成C/C++ autocomplete的效果,而且不需要vim有python/dyn的支援.&lt;br /&gt;
&lt;br /&gt;
整個安裝起來簡單很多, 目前正在試用當中.&lt;br /&gt;
&lt;br /&gt;
至於python的autocomplete則是推荐下面這一套.&lt;br /&gt;
&lt;br /&gt;
http://www.vim.org/scripts/script.php?script_id=850&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/997559209844334402/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2014/12/vim-clang-cc-autocomplete.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/997559209844334402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/997559209844334402'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2014/12/vim-clang-cc-autocomplete.html' title='Vim 使用 Clang 來達成 C/C++的 autocomplete效果'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-7291678945240039540</id><published>2014-10-25T01:19:00.000-07:00</published><updated>2014-10-25T01:19:18.457-07:00</updated><title type='text'>桌機安裝Linux Mint Debian</title><content type='html'>很久以前桌機安裝的是Ubuntu，但是後來Ubuntu改版之後原先的版本不再維護。想要跟上時代的腳步，沒辦法就只好重新安裝了。&lt;br /&gt;
&lt;br /&gt;
在安裝的時候剛好Suse也進到12版的樣子，所以想說就換個版本玩看看，沒想到一裝下去，不得了~~~~&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
完全不習慣。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
結果就是自步之後我桌機就很少開，反而還買了一台無敵笨重的Acer 17吋FHD筆電來裝Linux Mint Debian，然後用得很開心。看來習慣真的很重要。&lt;br /&gt;
&lt;br /&gt;
直到最近在整理桌面，看到桌機在那邊積灰塵才想說花個時間也改成Linux Mint Debian。&lt;br /&gt;
&lt;br /&gt;
之所以換到這個版本是因為不想再因為版本升級的關係又要花時間去重灌。因為Linux Mint Debian是隨時在更新的，所以就.....&lt;br /&gt;
&lt;br /&gt;
不過每次裝完一個新的系統之後，又要安裝微調一下環境，所以寫一下筆記，下次再重灌的時候可以灌得快一點。&lt;br /&gt;
&lt;br /&gt;
安裝完基本系統之後，就是一堆更新....等阿等，等阿等....ZZZZzzzz.....&lt;br /&gt;
&lt;br /&gt;
阿...什麼時候更新完成的?....接下來先安裝中文輸入法Gcin好了。&lt;br /&gt;
&lt;br /&gt;
NVIDIA Driver:&lt;br /&gt;
&lt;br /&gt;
按照下面這個網址的方式，一下子就裝好。&lt;br /&gt;
http://community.linuxmint.com/tutorial/view/331&lt;br /&gt;
&lt;br /&gt;
Gcin安裝:&lt;br /&gt;
&lt;br /&gt;
先用apt-get install 安裝gcin 、 im-config 和 zenity&lt;br /&gt;
&lt;br /&gt;
之後再用終端機執行im-config，就會進入中文輸入法的設定畫面。之後就跟著設定就好，設定好之後再重新開機後，gcin就可以用Ctrl + 空白鍵打開。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.....&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/7291678945240039540/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2014/10/linux-mint-debian.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/7291678945240039540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/7291678945240039540'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2014/10/linux-mint-debian.html' title='桌機安裝Linux Mint Debian'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-5091865045076010289</id><published>2014-08-06T06:44:00.002-07:00</published><updated>2014-08-06T06:44:27.576-07:00</updated><title type='text'>最近的碎碎唸...</title><content type='html'>離職變成魯蛇之後，先是花了一筆錢去上MCU入門+介紹USB韌體的課。只是在這之後又跑去報了兩個月長的學程，教是以Linux為主的嵌入式系統。&lt;br /&gt;
&lt;br /&gt;
感覺還不錯，因為自已之前已經事先有在玩MCU了。只是課程裡面用的是microchip的PIC系列MCU，但是我自學的卻是AVR 的atmega系列。&lt;br /&gt;
&lt;br /&gt;
大部份上的觀念是一樣的，只是在很多細節上的操作讓我很不適應。不過接觸一下不同廠商的MCU感覺有很多幫助，至少之後因其他需求而換晶片的時候比較容易適應。&lt;br /&gt;
&lt;br /&gt;
前一陣子也從atmega8開始慢慢往atmega328p的MCU跑了，因為寫出來的code已經超過8K了...Orz...，沒辦法，這是為了實現modbus rtu通訊的手段。&lt;br /&gt;
&lt;br /&gt;
最近學程開始上課了，感覺有個老師在上面講比之自己在書桌面前痛K到失神要來得愉快多了。&lt;br /&gt;
&lt;br /&gt;
自學總是寂寞的，特別是身邊沒人可討論的時候...。真想再去唸個資工系...但是不想再接受一些莫名奇妙的考試了...我應該是得了進考場就會死的病...&lt;br /&gt;
&lt;br /&gt;
又在網路上買了功能更強的atmega32u4準備來玩USB通訊...但是這個是TQFP的封裝...每根pin都非常的接近，這真是考驗我曝光和洗電路板的功力...= =;.....阿!還有銲接的功力....&lt;br /&gt;
&lt;br /&gt;
話說最近天氣有夠熱，工作室又沒裝冷氣，只能一邊汗流夾背一邊畫layout一邊玩焊槍。&lt;br /&gt;
&lt;br /&gt;
也不知道是因為汗留太多還是焊煙吸太多，最近好像常常覺得身體虛弱，三不五時的就在小感冒。&lt;br /&gt;
&lt;br /&gt;
老媽看不下去就拿了一瓶陳年紫蘇梅濃縮液叫我稀釋著喝，看看可不可以改善體質。&lt;br /&gt;
&lt;br /&gt;
先不管有沒有效，但是加了冰塊之後在夏天喝感覺真是舒爽。總比去便利商店買化工飲料好多了。&lt;br /&gt;
&lt;br /&gt;
自從之前塑化劑事件之後，只要喝到台廠製的飲料都有一種在喝化學藥劑的感覺，害得我常常在便利商店的冰箱前面找不到可以喝得下去的飲料。&lt;br /&gt;
&lt;br /&gt;
... 離題了...&lt;br /&gt;
&lt;br /&gt;
總之...又離我想要靠著寫程式過活的目標又更進一步了。這是身為一個魯魯蛇的堅持。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/5091865045076010289/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2014/08/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/5091865045076010289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/5091865045076010289'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2014/08/blog-post.html' title='最近的碎碎唸...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-8214981830213776185</id><published>2014-07-27T16:48:00.003-07:00</published><updated>2014-07-27T16:48:34.478-07:00</updated><title type='text'>閒不下來....</title><content type='html'>話說，閒在家裡沒事做的時候就把家裡的一個小空間整理整理，放了一張大賣場買來的大桌子，野外用的那種很好收的那種....&lt;br /&gt;
&lt;br /&gt;
當作工作桌，然後又忍痛買了Hako的焊槍之類等等的電子工具....&lt;br /&gt;
&lt;br /&gt;
還買了一個怎麼樣都沒值那麼多錢的電路板蝕刻機....&lt;br /&gt;
&lt;br /&gt;
然後就找到事情做了...在家裡洗電路板、焊電路板、寫程式、玩MCU&lt;br /&gt;
&lt;br /&gt;
接著就是...程式debug、IC一顆顆的燒、Layout錯的電路板一張張的丟...Orz....&lt;br /&gt;
&lt;br /&gt;
我到底在幹嘛阿 = =;</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/8214981830213776185/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2014/07/blog-post_27.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8214981830213776185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/8214981830213776185'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2014/07/blog-post_27.html' title='閒不下來....'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1816058796586787870.post-3593250964762852922</id><published>2014-07-10T09:01:00.000-07:00</published><updated>2014-07-10T09:01:01.784-07:00</updated><title type='text'>好習慣很重要...orz...</title><content type='html'>果然阿，寫程式的時候最好是把各個重要的模組拆分成很多個小模組。&lt;br /&gt;
&lt;br /&gt;
這樣子可以省去很多個debug的時間，而且要程式碼再利用的時候會比較好。&lt;br /&gt;
&lt;br /&gt;
不過要做到這種地步，與其說是某種技能還不如說是某種習慣。&lt;br /&gt;
&lt;br /&gt;
這是最近實作 modbus rtu 的心得感想，雖然很後面才看到一些官方網站上有詳細的Application note....&lt;br /&gt;
&lt;br /&gt;
不過還是勉強可以用了...。&lt;br /&gt;
&lt;br /&gt;
之前有測式過一次，後來想想，會不穩定很有可能是小電源供應器在吃大電流的時候軟腳了。</content><link rel='replies' type='application/atom+xml' href='http://onionys.blogspot.com/feeds/3593250964762852922/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://onionys.blogspot.com/2014/07/orz.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3593250964762852922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1816058796586787870/posts/default/3593250964762852922'/><link rel='alternate' type='text/html' href='http://onionys.blogspot.com/2014/07/orz.html' title='好習慣很重要...orz...'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>