<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aaron Hsu on Medium]]></title>
        <description><![CDATA[Stories by Aaron Hsu on Medium]]></description>
        <link>https://medium.com/@aaronhsu_98736?source=rss-762cd88ec15b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6jBndoS-XW7iK2rH.</url>
            <title>Stories by Aaron Hsu on Medium</title>
            <link>https://medium.com/@aaronhsu_98736?source=rss-762cd88ec15b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 03:30:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aaronhsu_98736/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[QGIS: Export Image with Transparent Background]]></title>
            <link>https://medium.com/@aaronhsu_98736/qgis-export-image-with-transparent-background-617a7000067a?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/617a7000067a</guid>
            <category><![CDATA[image]]></category>
            <category><![CDATA[qgis]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 13:29:12 GMT</pubDate>
            <atom:updated>2021-10-27T13:29:12.124Z</atom:updated>
            <content:encoded><![CDATA[<p>Step1. In Layout Manager, right click the background of the layout, then click ”Page Property”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDlfDeC3Ff4nHwJC23UCrQ.png" /></figure><p>Step2. Click the “button” next to item Background item.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1f8hW9Fv8CGUt8aZXLLwng.png" /></figure><p>Step3. Tune the Opacity to 0%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6-h9U4aO8evLW95u6hCJaQ.png" /></figure><p>Step4. Export the layout as image in *.png format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z73ku4o6BgxiP0D641xzLQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=617a7000067a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django2.0 Website Basic]]></title>
            <link>https://medium.com/@aaronhsu_98736/django2-0-website-basic-a14f897e1f4a?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a14f897e1f4a</guid>
            <category><![CDATA[settings]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 11:50:27 GMT</pubDate>
            <atom:updated>2018-05-28T11:19:31.378Z</atom:updated>
            <content:encoded><![CDATA[<p>After looking up for some resources that teaches how to build a basic django website, I found a <a href="https://www.udemy.com/intro-to-django-with-python-for-web-development/learn/v4/overview">Udemy course</a> that explains the steps vary clearly and has simple steps to follow along.</p><p>The basic idea are as follows:</p><blockquote><em>1. Create </em><strong><em>[mysite]</em></strong><em> django project</em><br><em>2. Create</em><strong><em> [app]</em></strong><em> folder | </em><strong><em>[mysite]</em></strong><em> level</em><br><em>3. Modify </em><strong><em>settings.py </em></strong><em>| </em><strong><em>[mysite]</em></strong><em> level</em><br><em>4. Modify </em><strong><em>views.py</em></strong><em> | </em><strong><em>[app]</em></strong><em> level </em><br> this step defines what pages we want to create<br><em>5. Add </em><strong><em>[templates]</em></strong><em> folder and files inside | </em><strong><em>[app]</em></strong><em> level</em><br> this step creates actual pages with contents<em><br>6. Add and modify </em><strong><em>urls.py</em></strong><em> | </em><strong><em>[app] level</em><br> </strong>this step tells the server to look for the created page and display in (respond to )</blockquote><blockquote>simply follow the series:<br><strong>[mysite] &gt; [app] &gt; settings.py &gt; views.py &gt; [templates] &gt; urls.py</strong></blockquote><p>Here are some notes for the Udemy course.</p><h3>Step0: Environment Setting</h3><p>See <a href="https://medium.com/@aaronhsu_98736/django-environment-setup-958b9f6489c1">this</a></p><h3>Step1: Build a new site and check</h3><pre># Activate environment<br>activate dj2<br>django-admin startproject [mysite]<br>cd [mysite]</pre><pre># Create an app<br>python manage.py startapp [app]</pre><pre># migrate database<br>python manage.py migrate [app]</pre><pre># Test if django installed successfully<br># python manage.py makemigrations [app] # if there&#39;s new app built<br>python manage.py runserver</pre><pre># Check if server is running<br># check <a href="http://localhost:8000/">http://localhost:8000</a><br># check <a href="http://localhost:8000/admin">http://localhost:8000/admin</a></pre><h3>Step2: Create superuser (under [mysite] dir)</h3><pre>python manage.py createsuperuser</pre><h3>Step3: Create a new app (under [mysite] dir)</h3><pre>python manage.py startapp [pages]</pre><pre># this creates [pages] folder under [mysite] and associated files inside</pre><h3>Step4: Config [mysite]/settings.py</h3><pre># Application definition<br>INSTALLED_APPS = [<br>   …<br>   &#39;pages&#39;,<br>]</pre><pre># Internationalization<br># <a href="https://docs.djangoproject.com/en/2.0/topics/i18n/">https://docs.djangoproject.com/en/2.0/topics/i18n/</a><br>LANGUAGE_CODE = &#39;en-us&#39;  # or &#39;zh-Hant&#39;<br>TIME_ZONE = &#39;Asia/Taipei&#39;</pre><h3>Step5: Edit [view.py] inside [pages] folder</h3><pre>from django.shortcuts import render<br>def home(request):<br>    return render(request, “home.html”, {})</pre><pre>def about(request):<br>    return render(request, “about.html”, {})</pre><pre>def contact(request):<br>    return render(request, “contact.html”, {})</pre><h3>Step6: Add [templates] folder inside [pages] folder</h3><p>Add following files:</p><ul><li>home.html</li><li>about.html</li><li>contact.html</li></ul><h3>Step7: Add urls.py in [pages] folder and edit</h3><p>Create contents in urls.py</p><pre><strong>from django.urls import path</strong><br>from . import views</pre><pre>urlpatterns = [<br>    path(&#39;&#39;, views.home, name=&#39;home&#39;),<br>    path(&#39;about&#39;, views.about, name=&#39;about&#39;),<br>    path(&#39;contact&#39;, views.contact, name=&#39;contact&#39;),<br>]</pre><p>Compare to django 1.11</p><pre><strong>from django.conf.urls import url</strong><br>from . import views</pre><pre>urlpatterns = [<br>    url(https://medium.com/r&#39;^r&#39;^$&#39;, views.home, name=&#39;home&#39;#39;,%20views.home,%20name=&#39;home&#39;),<br>    url(https://medium.com/r&#39;^about/r&#39;^about/$&#39;, views.about, name=&#39;about&#39;#39;,%20views.about,%20name=&#39;about&#39;),<br>    url(https://medium.com/r&#39;^contact/r&#39;^contact/$&#39;, views.contact, name=&#39;contact&#39;#39;,%20views.contact,%20name=&#39;contact&#39;),<br>]</pre><blockquote>Note that the difference: imported module, <strong>path/url,</strong> and use of <strong>regular expression.</strong></blockquote><h3>Step8: Modify urls.py in [mysite] fol</h3><pre>m django.contrib import admin<br>from django.urls import path, <strong>include</strong></pre><pre>urlpatterns = [<br>    path(&#39;admin/&#39;, admin.site.urls),<br>    <strong>path(&#39;&#39;, include(&#39;pages.urls&#39;)),</strong><br>]</pre><p>In django 1.11</p><pre>from django.conf.urls import url, <strong>include</strong><br>from django.contrib import admin</pre><pre>urlpatterns = [<br>    url(https://medium.com/r&#39;^admin/&#39;,%20admin.site.urls),<br><strong>    url(https://medium.com/r&#39;&#39;,%20include(&#39;pages.urls&#39;)),</strong><br>]</pre><h3>Step9: Check results</h3><p>Check following urls in browser</p><ul><li><a href="http://localhost:8000/">http://localhost:8000</a></li><li><a href="http://localhost:8000/about">http://localhost:8000/about</a></li><li><a href="http://localhost:8000/contact">http://localhost:8000/contact</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a14f897e1f4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook Setting 4 — snippets]]></title>
            <link>https://medium.com/@aaronhsu_98736/jupyter-notebook-setting-4-snippets-2531d3ebe446?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2531d3ebe446</guid>
            <category><![CDATA[settings]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 05:34:17 GMT</pubDate>
            <atom:updated>2018-04-25T05:39:08.456Z</atom:updated>
            <content:encoded><![CDATA[<p>Set snippets for Jupyter Notebook</p><h3>1. Run jupyter nbextension enable snippets extension</h3><pre>jupyter nbextension enable snippets/main</pre><h3>2. Run jupyter --path to determine the location(path) of your Jupyter Notebook configuration</h3><p>In my PC, it could be following</p><pre>config:<br>    C:\Users\Aaron\.jupyter<br>    C:\Anaconda35\etc\jupyter<br>    C:\ProgramData\jupyter<br>data:<br>    C:\Users\Aaron\AppData\Roaming\jupyter<br>    C:\Anaconda35\share\jupyter<br>    C:\ProgramData\jupyter<br>runtime:<br>    C:\Users\Aaron\AppData\Roaming\jupyter\runtime</pre><p>then search for nbextensions/snippets/snippets.json after above paths</p><h3>3. Edit snippet.json and save</h3><p><strong>snippet.json example</strong></p><pre>{<br>    &quot;snippets&quot; : [<br>        {<br>            &quot;name&quot; : &quot;example&quot;,<br>            &quot;code&quot; : [<br>                &quot;# This is an example snippet!&quot;,<br>                &quot;# To create your own, add a new snippet block to the&quot;,<br>                &quot;# snippets.json file in your jupyter data directory under nbextensions:&quot;,<br>                &quot;# $(jupyter --data-dir)/nbextensions/snippets/snippets.json&quot;,<br>                &quot;import this&quot;<br>            ]<br>        },<br>        {<br>            &quot;name&quot; : &quot;some imports&quot;,<br>            &quot;code&quot; : [<br>                &quot;import numpy as np&quot;,<br>                &quot;import matplotlib as mpl&quot;,<br>                &quot;print(&#39;spam&#39;)&quot;<br>            ]<br>        }<br>    ]<br>}</pre><h3>Refs:</h3><ul><li><a href="https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/snippets">https://github.com/ipython-contrib/jupyter_contrib_nbextensions/tree/master/src/jupyter_contrib_nbextensions/nbextensions/snippets</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2531d3ebe446" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook Setting 3 — sublime keymap]]></title>
            <link>https://medium.com/@aaronhsu_98736/jupyter-notebook-setting-3-sublime-keymap-a7466cc97fe8?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7466cc97fe8</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[settings]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 05:34:02 GMT</pubDate>
            <atom:updated>2018-04-25T05:34:02.239Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Refs:</strong></h3><p><a href="http://blog.rtwilson.com/how-to-get-sublime-text-style-editing-in-the-ipythonjupyter-notebook/">http://blog.rtwilson.com/how-to-get-sublime-text-style-editing-in-the-ipythonjupyter-notebook/</a></p><h3><strong>參考資料的說明如下：</strong></h3><ol><li>Find your Jupyter configuration folder by running jupyter --config-dir</li><li>Open the custom.js file in the custom sub-folder in your favourite editor</li><li>Add the following lines to the bottom of the file</li></ol><pre>require([&quot;codemirror/keymap/sublime&quot;, &quot;notebook/js/cell&quot;, &quot;base/js/namespace&quot;],</pre><pre><strong>function</strong>(sublime_keymap, cell, IPython) {<br>  // setTimeout(function(){ // uncomment line to fake race-condition<br>  cell.Cell.options_default.cm_config.keyMap = &#39;sublime&#39;;<br>  <strong>var</strong> cells = IPython.notebook.get_cells();<br>  <strong>for</strong>(<strong>var</strong> cl=0; cl&lt; cells.length ; cl++){<br>    cells[cl].code_mirror.setOption(&#39;keyMap&#39;, &#39;sublime&#39;);<br>  } // }, 1000)// uncomment  line to fake race condition<br>  }<br>);</pre><h3><strong>我自己的安裝環境則是在：</strong></h3><pre>C:\[Anaconda Install Folder]\Lib\site-packages\notebook\static\custom</pre><h3><strong>檔案內容如下：</strong></h3><pre>require([&quot;codemirror/keymap/sublime&quot;, &quot;notebook/js/cell&quot;, &quot;base/js/namespace&quot;],<br>    function(sublime_keymap, cell, IPython) {<br>        // setTimeout(function(){ // uncomment line to fake race-condition<br>        cell.Cell.options_default.cm_config.keyMap = &#39;sublime&#39;;<br>        var cells = IPython.notebook.get_cells();<br>        for(var cl=0; cl&lt; cells.length ; cl++){<br>            cells[cl].code_mirror.setOption(&#39;keyMap&#39;, &#39;sublime&#39;);<br>        }<br>         // }, 1000)// uncomment  line to fake race condition <br>    } <br>);</pre><pre>$([IPython.events]).on(&quot;kernel_ready.Kernel&quot;, function() {</pre><pre>IPython.keyboard_manager.command_shortcuts.add_shortcut(&#39;ctrl-k&#39;, function(event) {<br>    IPython.notebook.move_cell_up();<br>    return false;<br>  });<br>});</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7466cc97fe8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook Setting 2 — table of content at top]]></title>
            <link>https://medium.com/@aaronhsu_98736/jupyter-notebook-setting-2-table-of-content-at-top-99d79c35ded2?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/99d79c35ded2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[settings]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[jupyter]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 05:33:43 GMT</pubDate>
            <atom:updated>2018-04-25T05:33:43.904Z</atom:updated>
            <content:encoded><![CDATA[<h3>Refs:</h3><p><a href="http://www.statsblogs.com/2016/08/10/add-table-of-contents-to-your-jupyter-notebook/">Add Table of Contents to your Jupyter Notebook</a></p><h3>Steps</h3><ol><li><strong>Find your Jupyter Notebook data directory by using this command in your DOS console:</strong></li></ol><pre> Jupyter — data-dir</pre><p><strong>2. Copy the following two files into your Jupyter data directory:</strong><br> <a href="https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/toc.js">https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/toc.js</a><br> <a href="https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/toc.css">https://rawgithub.com/minrk/ipython_extensions/master/nbextensions/toc.css</a></p><p><strong>3. Run this command:</strong></p><pre>Jupyter nbextension enable toc — user</pre><p><strong>4. In your Jupyter Notebook, add this command to a MarkDown cell on top of your notebook:</strong></p><pre>&lt; div id=”toc” &gt; &lt; /div &gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99d79c35ded2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jupyter Notebook Setting 1 — nbextensions]]></title>
            <link>https://medium.com/@aaronhsu_98736/jupyter-notebook-setting-1-nbextensions-63bc8f4c2c01?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/63bc8f4c2c01</guid>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[settings]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Wed, 25 Apr 2018 05:33:26 GMT</pubDate>
            <atom:updated>2018-04-25T05:33:26.240Z</atom:updated>
            <content:encoded><![CDATA[<p>Although jupyterlab has come out for a while, and some functions are vary handy. Jupyter Notebook still has some merits in terms of function/interface customization. Following articles are the settings that I’m currently using.</p><h3>Refs:</h3><p><a href="https://github.com/ipython-contrib/jupyter_contrib_nbextensions">https://github.com/ipython-contrib/jupyter_contrib_nbextensions</a></p><h3>Steps:</h3><h4>1. Install</h4><p>pip</p><pre>pip install jupyter_contrib_nbextensions</pre><p>conda</p><pre>conda install -c conda-forge jupyter_contrib_nbextensions</pre><h4>2. Install javascript and css files</h4><pre>jupyter contrib nbextension install --user</pre><p>Other choices</p><p>--user to install into the user&#39;s home jupyter directories<br>--system to perform installation into system-wide jupyter directories<br>--sys-prefix to install into python&#39;s sys.prefix, useful for instance in virtual environments, such as with conda<br>--symlink to symlink the nbextensions rather than copying each file (recommended, on non-Windows platforms).<br>--debug, for more-verbose output</p><h4>3. Enabling/Disabling extensions</h4><pre>jupyter nbextension enable &lt;nbextension require path&gt;</pre><p>for example,</p><pre>jupyter nbextension enable codefolding/main</pre><p>To disable the extension again, use</p><pre>jupyter nbextension disable &lt;nbextension require path&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63bc8f4c2c01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Django Environment Setup]]></title>
            <link>https://medium.com/@aaronhsu_98736/django-environment-setup-958b9f6489c1?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/958b9f6489c1</guid>
            <category><![CDATA[virtualenv]]></category>
            <category><![CDATA[conda]]></category>
            <category><![CDATA[create]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[django]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Tue, 24 Apr 2018 13:10:09 GMT</pubDate>
            <atom:updated>2018-04-24T15:13:14.412Z</atom:updated>
            <content:encoded><![CDATA[<p>整理一下 django 環境設定方法。<br>一般常見的方式有 virtualenv 與 conda create。<br>virtualenv 每次執行都可建立一個獨立的 python 環境與資料夾；相對的conda create 則建立在系統安裝的 anaconda 底下。<br>使用(建立 django 網站)時 virtualenv 創建的環境內需重新安裝 django，conda create 產生的環境只需安裝一次 django 即可。</p><h3>1. Use vertualenv</h3><h3>1.1 Setup Envronment</h3><pre>pip install virtualenv</pre><h3>1.2 Activate Environment and Install django</h3><pre>virtualenv [VENV]</pre><pre>cd [VENV]<br>Scripts\activate.bat</pre><pre>pip isntall django&lt;1.9 # 安裝 1.8 最新版本<br># pip isntall django==1.11 # 安裝 1.11 版<br># deactivate # 跳出 virtual environment</pre><h3>1.3 Build django Project</h3><pre>dajngo-admin startproject [mysite]</pre><pre>cd mysite<br>python manage.py migrate<br>python manage.py runsever</pre><h3>Refs:</h3><p>何敏煌 “Python 程式設計實務” 博碩</p><h3>2. Use conda create</h3><h3>2.1 Setup Environment</h3><pre>conda create --name [myenv]<br>conda create -n [myenv] python=3.4<br>conda create -n [myenv] python=3.4 anaconda</pre><h3>2.2 Activate Environment and Install django</h3><pre>activate [myenv]</pre><pre># 以下若已安裝則 skip<br>pip isntall django&lt;1.9 # 安裝 1.8 最新版本<br>pip isntall django==1.11 # 安裝 1.11 版本<br>deactivate # 跳出 env</pre><h3><strong>2.3 Build django project</strong></h3><pre>activate [myenv]</pre><pre>django-admin startproject [mysite]</pre><pre>cd [mysite]<br>python manage.py migrate<br>python manage.py runsever</pre><p><strong>Refs</strong></p><ul><li><a href="https://conda.io/docs/user-guide/tasks/manage-environments.html">https://conda.io/docs/user-guide/tasks/manage-environments.html</a></li><li><a href="https://conda.io/docs/user-guide/tasks/manage-python.html">https://conda.io/docs/user-guide/tasks/manage-python.html</a></li><li>h<a href="https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/">ttps://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=958b9f6489c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Run arbitrary language code script using VSCode]]></title>
            <link>https://medium.com/@aaronhsu_98736/run-arbitrary-language-code-script-using-vscode-15a2f5be5faf?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/15a2f5be5faf</guid>
            <category><![CDATA[settings]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[fortran]]></category>
            <category><![CDATA[matlab]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 17:21:29 GMT</pubDate>
            <atom:updated>2018-04-25T05:38:19.549Z</atom:updated>
            <content:encoded><![CDATA[<p>Intend to run more code language in VSCode</p><ol><li><strong>打開設定檔</strong></li></ol><p>File &gt; Preferences &gt; Settings</p><p><strong>2. 在 User Setting 裏加上如下內容 (以 fortran 和 matlab 為例)</strong></p><pre>&quot;code-runner.executorMapByFileExtension&quot;: {</pre><pre>&quot;.for&quot;: &quot;cd $dir &amp;&amp; gfortran $fileName -o $fileNameWithoutExt &amp;&amp; $dir$fileNameWithoutExt&quot;,</pre><pre>&quot;.f90&quot;: &quot;cd $dir &amp;&amp; gfortran $fileName -o $fileNameWithoutExt &amp;&amp; $dir$fileNameWithoutExt&quot;,</pre><pre>&quot;.f95&quot;: &quot;cd $dir &amp;&amp; gfortran $fileName -o $fileNameWithoutExt &amp;&amp; $dir$fileNameWithoutExt&quot;,</pre><pre>&quot;.f&quot;: &quot;cd $dir &amp;&amp; gfortran $fileName -o $fileNameWithoutExt &amp;&amp; $dir$fileNameWithoutExt&quot;,</pre><pre>&quot;.m&quot;: &quot;cd $dir &amp;&amp; matlab -nodesktop -nosplash -r $fileNameWithoutExt&quot;</pre><pre>},</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15a2f5be5faf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Use geopandas to edit GIS shapefile]]></title>
            <link>https://medium.com/@aaronhsu_98736/use-geopandas-to-manage-gis-shapefile-4bc6ed462403?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bc6ed462403</guid>
            <category><![CDATA[geopandas]]></category>
            <category><![CDATA[shapefile]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 11:45:54 GMT</pubDate>
            <atom:updated>2018-04-19T11:58:18.015Z</atom:updated>
            <content:encoded><![CDATA[<p>geopandas 是 python 的套件之一，用於 shapefile 的讀寫編輯等，使用方式與 pandas 很相似。下面以 shapefile 的讀取，刪除欄位，產生新的 shapefile 為例做示範。</p><h3>前置作業 — 安裝套件</h3><pre>pip install geopandas</pre><p>或</p><pre>conda install <strong>-</strong>c conda<strong>-</strong>forge geopandas</pre><h3>1. 載入套件</h3><pre>import geopandas as gpd</pre><h3>2. 讀入檔案</h3><pre>gdf = gpd.read_file(&#39;rlt_shp/landuse.shp&#39;)</pre><h3>3. 讀取欄位</h3><pre>coln = gdf.columns<br>coln</pre><p>在 juypter 內處理的結果：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*Q-BKFLpgP1HQI5nZJcNaFw.png" /></figure><h3>4. 展示資料</h3><pre>gdf.plot()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*GA1igrK4CRZNDD9tu0wwnw.png" /></figure><h3>5. 刪除欄位 (使用gdf.drop()方法)</h3><pre>gdf2 = gdf.drop(columns=[&#39;OBJECTID_1&#39;, &#39;ID&#39;, &#39;GRIDCODE&#39;, &#39;Shape_Leng&#39;, &#39;OBJECTID_2&#39;, &#39;OBJECTID&#39;, &#39;Shape_Le_1&#39;, &#39;Shape_Le_2&#39;, &#39;Shape_Le_3&#39;, &#39;Shape_Le_4&#39;])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*eEbHXsCk1FyvVv2ryXty4A.png" /></figure><p><strong><em>注意 ’geometry’ 欄位需保留，修改完才可寫入新的 shapefile</em></strong></p><h3>6. 寫回 shapefile，得到新檔案及所需要的欄位</h3><pre>gdf2.to_file(&#39;rlt_shp/lu_cln.shp&#39;)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bc6ed462403" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase + Python 筆記]]></title>
            <link>https://medium.com/@aaronhsu_98736/firebase-python-%E7%AD%86%E8%A8%98-456583230cf3?source=rss-762cd88ec15b------2</link>
            <guid isPermaLink="false">https://medium.com/p/456583230cf3</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Aaron Hsu]]></dc:creator>
            <pubDate>Thu, 19 Apr 2018 01:50:13 GMT</pubDate>
            <atom:updated>2018-04-19T11:50:51.184Z</atom:updated>
            <content:encoded><![CDATA[<p>整理一下 Resnick Chang 的 firebase 教學</p><h3><strong>Cloud 端</strong></h3><p>前置作業：申請 <strong>Google </strong>帳號<br>步驟1：進入 <strong>firebase </strong>首頁<br>步驟2：進入 <strong>firebase </strong>主控台<br>步驟3：新增 <strong>firebase </strong>專案<br>步驟4：建立資料庫<br>(1) 專案畫面<br>(2) 點選 <strong>Database</strong><br>(3) 選取<strong> Cloud Firestore Beta</strong><br>(4) 選取安全性規則<br>(5) 啟用</p><h3>Client 端</h3><p>前置作業<br>步驟1: 下載專案授權金鑰<br>步驟2: 安裝 <strong>firebase-admin</strong></p><pre><em>pip install firebase-admin google-cloud-firestore</em></pre><p>步驟3: 初始化 <strong>firebase </strong>與 <strong>firestore</strong></p><p>寫入資料<br>步驟1: 決定集合與文件的架構<br>步驟2: 準備文件內容使用 <strong>dictionary</strong><br>步驟3: 根據路徑建立文件參考<br>步驟4: 透過參考，使用 <strong>set </strong>寫入文件</p><h3><strong>References</strong></h3><ol><li><a href="https://medium.com/pyradise/60%E7%A7%92%E6%90%9E%E6%87%82firestore%E8%B3%87%E6%96%99%E7%B5%90%E6%A7%8B-c61ba6206cba">60秒搞懂firestore資料結構</a></li><li><a href="https://medium.com/pyradise/%E5%8D%81%E5%88%86%E9%90%98%E5%BB%BA%E7%AB%8B%E5%B0%88%E5%B1%AC%E8%B3%87%E6%96%99%E5%BA%AB-c9f9de6728b6">10分鐘建立專屬資料庫</a></li><li><a href="https://medium.com/pyradise/10%E5%88%86%E9%90%98%E8%B3%87%E6%96%99%E5%BA%AB%E6%93%8D%E4%BD%9C-%E6%96%B0%E5%A2%9E%E8%B3%87%E6%96%99-b96db385e1e4">10分鐘資料庫操作 — 新增資料</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=456583230cf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>