<?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 Elliot on Medium]]></title>
        <description><![CDATA[Stories by Elliot on Medium]]></description>
        <link>https://medium.com/@elliotcs30?source=rss-19cf6567f906------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*SnMETqo1w322D-E9LwBBUQ.jpeg</url>
            <title>Stories by Elliot on Medium</title>
            <link>https://medium.com/@elliotcs30?source=rss-19cf6567f906------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:20:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@elliotcs30/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[[Lab]解決Ubuntu系統下MySQL資料庫無法連線問題]]></title>
            <link>https://medium.com/@elliotcs30/lab-%E8%A7%A3%E6%B1%BAubuntu%E7%B3%BB%E7%B5%B1%E4%B8%8Bmysql%E8%B3%87%E6%96%99%E5%BA%AB%E7%84%A1%E6%B3%95%E9%80%A3%E7%B7%9A%E5%95%8F%E9%A1%8C-49582b16a1f4?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/49582b16a1f4</guid>
            <category><![CDATA[mysql-workbench]]></category>
            <category><![CDATA[ubuntu-20-04]]></category>
            <category><![CDATA[mysql-server]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 15:00:14 GMT</pubDate>
            <atom:updated>2024-03-31T15:03:23.963Z</atom:updated>
            <content:encoded><![CDATA[<p>Ubuntu connect MySQL</p><p>本篇介紹在Ubuntu系統下MySQL資料庫無法連線解決方式。在VMware vSphere 建立Ubuntu系統，在該系統中安裝MySQL資料庫後，使用MySQL Workbench卻無法連線，畫面如下：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OupC8APWKTbievo-7c5Dw.png" /><figcaption>圖1 MySQL 資料庫無法連線錯誤訊息</figcaption></figure><p>心想應該是在安裝設定的時候應該有設定錯誤，所以才會造成身份驗證問題造成無法連線。</p><p>以下為安裝 MySQL 資料庫步驟：</p><p>安裝 MySQL 資料庫：</p><pre>$ sudo apt install mysql-server -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*yLEwu1gSjSClZuI92eSHsg.png" /><figcaption>圖2 安裝MySQL server</figcaption></figure><p>執行 MySQL 配置：</p><pre>$ sudo mysql_secure_installation # y, n, y, y<br><br># 這邊稍做解釋一下：<br># 不使用 valid_password 插件。<br># 為 root 用戶設置密碼。<br># 刪除匿名帳號。<br># 開啟 root 用戶遠端登入。<br># 刪除 test 資料庫和對 test 資料庫的訪問權限。<br># 刷新授權表使修改生效。</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oXy23O8geSXj7Bg0J0p0JQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65j9xzyY_2t-p9ywrAA4Ww.png" /><figcaption>圖3 MySQL 配置</figcaption></figure><p>登入 MySQL 伺服器：</p><pre>$ sudo mysql -u root -p<br>mysql&gt; SELECT user,authentication_string,plugin,host FROM mysql.user WHERE user=&quot;root&quot;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VFyaVG4ap831r6gLzlwD_g.png" /><figcaption>圖4 MySQL 伺服器使用 auth_socket</figcaption></figure><p>接著輸入：</p><pre>-- 改使用密碼對 root 使用者進行身份驗證<br>mysql&gt; ALTER USER &#39;root&#39;@&#39;localhost&#39; IDENTIFIED WITH mysql_native_password BY &#39;your-password&#39;;<br><br>-- 更新授權權限<br>mysql&gt; FLUSH PRIVILEGES;<br><br>-- 查看 MySQL 帳號權限是否有更改完成<br>mysql&gt; SELECT user,authentication_string,plugin,host FROM mysql.user WHERE user=&quot;root&quot;;<br><br>-- 離開 MySQL<br>mysql&gt; exit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TrWmjNZQ6_UbXk4bMHuY8g.png" /><figcaption>圖5 MySQL指令</figcaption></figure><p>開啟 MySQL Workbench：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgKEcoN5mRtvjRw0qEBhhA.png" /><figcaption>圖6 新增連線設定</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ttp1WqQyVGB_CPj0ag3rg.png" /><figcaption>圖7 輸入帳號密碼測試連線</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/894/1*L10hE1ooMNBhnHK1to6ODQ.png" /><figcaption>圖8 連線成功畫面</figcaption></figure><p>Done!!</p><p><strong>[Reference]</strong> <a href="https://www.bookwalker.com.tw/product/122110?utm_source=tagtoo&amp;utm_medium=cpc&amp;utm_campaign=bookwalkerpmaxtw&amp;gad_source=1">Ubuntu 20 管理入門與實作</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49582b16a1f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note]Ubuntu 防火牆 ufw 指令]]></title>
            <link>https://medium.com/@elliotcs30/note-ubuntu-%E9%98%B2%E7%81%AB%E7%89%86-ufw-%E6%8C%87%E4%BB%A4-9850de98e1aa?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/9850de98e1aa</guid>
            <category><![CDATA[ubuntu-ufw]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 31 Mar 2024 07:27:20 GMT</pubDate>
            <atom:updated>2024-03-31T14:59:33.349Z</atom:updated>
            <content:encoded><![CDATA[<p>ubuntu 防火牆</p><p>本篇為Ubuntu OS 的防火牆指令筆記。Uncomplicated Firewall(UFW) 是 Ubuntu 系統預設的防火牆，還不習慣指令的話，可以下載GUFW的圖形化介面來使用，慢慢練習搞懂每個指令。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*nGAeFwXlJTMQzTNvasLHJA.png" /><figcaption>圖1 防火牆(<a href="https://kknews.cc/zh-hk/news/xqng5zq.html#google_vignette">原圖連結</a>)</figcaption></figure><p>以下是 UFW的指令：</p><ol><li>安裝 UFW</li></ol><pre>$ sudo apt install ufw  # 通常安裝完 ubuntu 後都會有</pre><p>2. 指令說明</p><pre>$ ufw enable         # 啟動防火牆，執行後開機也會自動啟動<br>$ ufw disable        # 關閉防火牆<br>$ ufw status         # 查看防火牆狀態<br>$ ufw status verbose # 查看防火牆詳細狀態</pre><p>3. 規則設定</p><pre>$ ufw default allow           # 預設全部允許<br>$ ufw default deny            # 預設全部阻擋<br>$ ufw allow ssh               # 允許 SSH 服務連線<br>$ ufw allow 80                # 允許通過 80 Port 使用 tcp 與 udp 連線<br>$ ufw allow 80/tcp            # 允許通過 80 Port 使用 tcp 連線<br>$ ufw allow from 192.168.11.1 # 允許來自 192.168.11.1 通過所有連線<br>$ ufw allow from 192.168.11.1 to any port 3306 # 允許來自 192.168.11.1 通過 3306 port</pre><p>允許：allow、阻擋：deny、拒絕：reject。</p><p>deny 與 reject 的差異在於對方會不會收到禁止連線的通知。</p><p>4. 刪除規則</p><pre>$ ufw status numbered  # 查看每一條規則的編號<br>$ ufw delete 規則編號   # 刪除規則</pre><p><strong>[Reference]</strong> <a href="https://blog.tarswork.com/post/ubuntu-firewall-setting-using-ufw/#google_vignette">Ubuntu 防火牆設定 — 使用 ufw 指令</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9850de98e1aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note]解決node.js使用MSSQL出現TLS警告問題]]></title>
            <link>https://medium.com/@elliotcs30/note-%E8%A7%A3%E6%B1%BAnode-js%E4%BD%BF%E7%94%A8mssql%E5%87%BA%E7%8F%BE%E8%AD%A6%E5%91%8A%E5%95%8F%E9%A1%8C-0dcc6feabc4c?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/0dcc6feabc4c</guid>
            <category><![CDATA[ms-sql-server]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 17 Mar 2024 03:48:58 GMT</pubDate>
            <atom:updated>2024-03-17T04:05:48.206Z</atom:updated>
            <content:encoded><![CDATA[<p>node.js use mssql</p><p>本次主要解決的問題是，將專案中連結不同的資料庫，並修正TLS警告的問題。以往開發時都是某一專案連線同一資料庫，這次因為有新的需求，所以要到另一台Server去撈資料回來做數據的呈現，藉此不但可以降低人員的工作業務且只需要按一下按鈕就可以看到數據。</p><p>警告問題如下圖：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PUOr2tlsAc4sgjFgGR7b3Q.png" /><figcaption>圖1 TLS警告訊息</figcaption></figure><p>本次是連線的DB是使用MSSQL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sXrpOammvC_LZpPcUsO3Sg.png" /><figcaption>圖2 Microsoft SQL Server Management Studio 18</figcaption></figure><p>查找一些MSSQL資料後，以下是使用node.js對於MSSQL連線的方式：</p><pre>// 安裝 mssql 套件<br>$ npm i mssql<br><br>// app.js (node.js)<br>const sql = require(&#39;mssql&#39;)<br><br>// 設定資料庫連線<br>const config = {<br>  user: &#39;your_username&#39;,<br>  password: &#39;your_password&#39;,<br>  server: &#39;your_host&#39;, // 若使用IP位址，encrypt改為false就不會出現警告<br>  database: &#39;your_database&#39;,<br>  options: {<br>    encrypt: false, // 使用加密連線(在TLS中，ServerName設為IP是不符合RFC 6066規範)<br>    trustServerCertificate: true, // 忽略驗證<br>    enableArithAbort: true // 防止因運算錯誤而中斷連接<br>  }<br>}<br><br>// 連接資料庫並執行查詢<br>async function connectAndQuery() {<br>  try {<br>    // 資料庫連線<br>    await sql.connect(config);<br><br>    // 執行查詢<br>    const result = await sql.query(&quot;SELECT * FROM your_table&quot;)<br><br>    // 輸出查詢結果<br>    console.log(result.recordset)<br>  } catch(error) {<br>    console.error(`Error connecting to SQL Server:`, error.message)<br>  } finally {<br>    // 關閉資料庫連線<br>    await sql.close()<br>  }<br>}<br><br>// 調用連線並查詢函式<br>connectAndQuery()<br></pre><p>[ref] <a href="https://learn.microsoft.com/zh-tw/sql/connect/node-js/step-3-proof-of-concept-connecting-to-sql-using-node-js?view=sql-server-ver16">使用 Node.js 連線到 SQL 的概念證明</a></p><p>[ref] <a href="https://stackoverflow.com/questions/68528360/node10212dep0123deprecationwarningsetting-the-tls-servername-to-an-ipaddress">DeprecationWarning:Setting the TLS ServerName to an IPaddress is not permitted by RFC 6066.This will be ignored in a future version</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0dcc6feabc4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note]解決node.js 使用multer上傳檔案後下載檔案中文出現亂碼問題]]></title>
            <link>https://medium.com/@elliotcs30/note-%E8%A7%A3%E6%B1%BAnode-js-%E4%BD%BF%E7%94%A8multer%E4%B8%8A%E5%82%B3%E6%AA%94%E6%A1%88%E5%BE%8C%E4%B8%8B%E8%BC%89%E6%AA%94%E6%A1%88%E4%B8%AD%E6%96%87%E5%87%BA%E7%8F%BE%E4%BA%82%E7%A2%BC%E5%95%8F%E9%A1%8C-860c86a20657?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/860c86a20657</guid>
            <category><![CDATA[multer]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 10 Mar 2024 11:49:39 GMT</pubDate>
            <atom:updated>2024-03-10T11:53:44.577Z</atom:updated>
            <content:encoded><![CDATA[<p>下載檔案出現亂碼</p><p>本次要解決的問題是，將PDF檔案上傳至伺服器端，運用程式將PDF檔案轉成Excel後再下載至本機端，藉此可降低人員依照PDF資料輸入為Excel的作業疏失。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*13kXZhdEbZ46qapW2L1Diw.png" /><figcaption>圖1 下載檔案出現中文亂碼問題</figcaption></figure><p>找了些資料可參考本篇 <a href="https://juejin.cn/post/7213677398721724477">node @koa/multer 上傳檔案中文明見名亂碼</a></p><p>文章中講到一個重點，將文件名稱透過 buffer 二進制編碼儲存後再解碼！🤔</p><pre>// Multer 設定用於文件上傳<br>const storage = multer.diskStorage({<br>    destination: (req, file, cb) =&gt; {<br>        cb(null, &#39;uploads/&#39;)<br>    },<br>    filename: (req, file, cb) =&gt; {<br>        // 使用Buffer儲存二進制編碼後再解碼, 避免中文檔名出現亂碼<br>        cb(null, `${Buffer.from(file.originalname,&#39;binary&#39;).toString()}`)<br>    }<br>});</pre><p>於是將souce code 稍微改寫後，成功解決！</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*9JDewvcEs_2Dn8h7SdLJHg.png" /><figcaption>圖2 將亂碼解碼後解決亂碼問題</figcaption></figure><p>[ref] <a href="https://juejin.cn/post/7213677398721724477">node @koa/multer 上傳檔案中文明見名亂碼</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=860c86a20657" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Lab]Django 網站開發]]></title>
            <link>https://medium.com/@elliotcs30/e%E7%A0%94%E7%A9%B6%E5%AE%A4-django-%E7%B6%B2%E7%AB%99%E9%96%8B%E7%99%BC-3490d3c7b195?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/3490d3c7b195</guid>
            <category><![CDATA[python-web-developer]]></category>
            <category><![CDATA[weird-side-projects]]></category>
            <category><![CDATA[python-django-development]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sat, 10 Feb 2024 15:29:28 GMT</pubDate>
            <atom:updated>2024-02-12T01:50:06.687Z</atom:updated>
            <content:encoded><![CDATA[<p>python、Django、Web site、Side Project、Python Django App、0 ➡️ 1</p><p>本篇是紀錄從 0 ➡️ 1 打造全端開發的過程，文章內會介紹Django的優勢、建立專案步驟等。😎</p><p>好！ 那就讓我們開始吧！🤩</p><h3>Django</h3><p>開始建立專案前先來介紹一下基本知識，<a href="https://www.python.org/">Python</a>是一個程式語言，而 <a href="https://www.djangoproject.com/">Django</a> 是 Python 在 Web 使用的框架(Framework)。</p><p>如果沒有資金方面的考量的話，可以再把建立好的專案部署到 Heroku、AWS 等平台。</p><p>簡單來說，Django主要是讓開發複雜、資料庫驅動的網站變得簡單。</p><h4>優勢</h4><p>免費、文件資源、MTV(model-template-view)架構、資料庫元件、錯誤訊息顯示</p><h4>安裝Django模組</h4><pre># 先確認環境是否有安裝<br>python3 --version<br>brew install python<br><br>python3 --version<br>pip3 --version<br>pip3 install --upgrade pip<br><br># 安裝 Django 模組的指令<br>pip3 install django==3.1.7<br><br># 查看 Django 模組是否已在列表中<br>pip3 list</pre><h4>建立 Django 專案</h4><pre># 建立 Django 專案語法<br>django-admin startproject firstproject</pre><pre>\firstproject<br>  |-- manage.py<br>  |-- \firstproject<br>      |-- __init__.py<br>      |-- asgi.py<br>      |-- settings.py<br>      |-- urls.py<br>      |-- wsgi.py<br><br># firstproject: 主目錄。<br># manage.py: Python 命令檔。為專案管理功能，包含建立 app 、啟動 Server 和 Shell 等。<br># 下層 firstproject: 包含專案設定、url配置、網頁伺服器介面設定檔。<br># __init__.py: 該資料夾為 Python package。<br># asgi.py: asgi 網頁伺服器和 Django 的介面設定檔。<br># settings.py: 設定檔。<br># urls.py: url 配置檔。<br># wsgi.py: wsgi 網頁伺服器和 Django 的介面設定檔。</pre><h4>建立 Application 應用程式</h4><pre># 建立 Application 應用程式的語法<br>python3 manage.oy startapp myapp</pre><p>建立 templates 資料夾</p><pre># 在專案目錄下建立 templates<br>md templates</pre><p>建立 static 資料夾</p><pre># 將圖形檔、CSS、JavaScript 存放在此資料夾<br># 在專案目錄下建立 static<br>md static </pre><h4>視圖 (view) 與 URL</h4><p>環境設定</p><pre># 除錯模式設定<br>DEBUG = True<br><br># 加入 Application 應用程式<br>INSTALLED_APPS = [<br>  &#39;django.contrib.admin&#39;,<br>  &#39;django.contrib.auth&#39;,<br>  &#39;django.contrib.contenttypes&#39;,<br>  &#39;django.contrib.sessions&#39;,<br>  &#39;django.contrib.messages&#39;,<br>  &#39;django.contrib.staticfiles&#39;,<br>  &#39;myapp&#39;, # 新增的 app<br>]<br><br># 設定 Template 路徑<br>TEMPLATES = [<br>    {<br>        &#39;BACKEND&#39;: &#39;django.template.backends.django.DjangoTemplates&#39;,<br>        &#39;DIRS&#39;: [BASE_DIR / &#39;templates&#39;], # 加上 templates 路徑<br>        &#39;APP_DIRS&#39;: True,<br>        &#39;OPTIONS&#39;: {<br>            &#39;context_processors&#39;: [<br>                &#39;django.template.context_processors.debug&#39;,<br>                &#39;django.template.context_processors.request&#39;,<br>                &#39;django.contrib.auth.context_processors.auth&#39;,<br>                &#39;django.contrib.messages.context_processors.messages&#39;,<br>            ],<br>        },<br>    },<br>]<br><br># 設定語系和時區<br>LANGUAGE_CODE = &#39;zh-hant&#39; # 改為繁體中文<br>TIME_ZONE = &#39;Asia/Taipei&#39; # 改為台北時區<br><br># 設定 static 靜態檔的路徑<br>STATIC_URL = &#39;/static/&#39;<br>STATICFILES_DIRS = [ # 加入 static 路徑<br>    BASE_DIR / &#39;static&#39;,<br>]<br><br># 啟動伺服器<br>python3 manage.py runserver</pre><p>設定 urls.py</p><p>Django 的程式架構採用 urlpattern 網址和函式對照方式(跟Express類似)</p><pre># 設定 urls.py 檔 urlpatterns 串列中 url 網址和函示的對照<br>from django.contrib import admin<br>from django.urls import path<br>from myapp.views import sayhello<br><br>urlpatterns = [<br>  path(&#39;admin/&#39;, admin.site.urls), # path(網址, 函式)<br>  path(&#39;&#39;, sayhello),<br>]<br><br># 定義函式<br># myapp\views.py<br><br>from django.http import HttpResponse<br><br>def sayhello(request):<br>  return HttpResponse(&quot;Hello Django!&quot;)<br><br># 開啟瀏覽器<br>127.0.0.1:8000</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ittW0GWaShPKo4S6gj0rag.png" /><figcaption>圖1 預覽畫面</figcaption></figure><p>使用參數</p><pre># firstproject\urls.py<br>from django.contrib import admin<br>from django.urls import path<br>from myapp.views import sayhello, hello2 # 加入<br><br>urlpatterns = [<br>  path(&#39;admin/&#39;, admin.site.urls), <br>  path(&#39;&#39;, sayhello),<br>  path(&#39;hello2/&lt;str:username&gt;&#39;, hello2), # 加入 path(網址, 函式)<br>]<br><br># myapp\views.py<br>from django.http import HttpResponse<br><br>def sayhello(request):<br>  return HttpResponse(&quot;Hello Django!&quot;)<br><br>def hello2(request, username):             # 加入<br>  return HttpResponse(&quot;Hello &quot; + username) # 加入<br><br># 開啟瀏覽器<br>http://127.0.0.1:8000/hello2/elliot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2qbJhf0eq8app4MndHQfA.png" /><figcaption>圖2 預覽畫面(參數)</figcaption></figure><p>使用模板</p><pre>&lt;!-- templates\hello3.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&#39;utf-8&#39;&gt;<br>  &lt;title&gt;第一個模板&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h1&gt; 歡迎光臨: {{ username }}&lt;/h1&gt;<br>  &lt;h2&gt; 現在時間: {{ now }}<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><pre># firstproject\urls.py<br>from django.contrib import admin<br>from django.urls import path<br>from myapp.views import sayhello, hello2, hello3 # 加入<br><br>urlpatterns = [<br>  path(&#39;admin/&#39;, admin.site.urls), <br>  path(&#39;&#39;, sayhello),<br>  path(&#39;hello2/&lt;str:username&gt;&#39;, hello2),<br>  path(&#39;hello3/&lt;str:username&gt;&#39;, hello3), # 加入 path(網址, 函式)<br>]<br><br># myapp\views.py<br>from django.http import HttpResponse<br><br>def sayhello(request):<br>  return HttpResponse(&quot;Hello Django!&quot;)<br><br>def hello2(request, username):             # 加入<br>  return HttpResponse(&quot;Hello &quot; + username) # 加入<br><br>def hello3(request, username):<br>    now = datetime.now()<br>    # render(傳遞 GET、POST, 模板名稱, 傳遞所有區域變數)<br>    return render(request, &#39;myapp/hello3.html&#39;, locals())<br><br># 開啟瀏覽器<br>http://127.0.0.1:8000/hello3/elliot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ru4RR8FAzhBf4kpf3hGgzA.png" /><figcaption>圖3 預覽畫面(模板)</figcaption></figure><p>加入 static 靜態檔案</p><pre>STATIC_URL = &#39;/static/&#39;<br>STATICFILES_DIRS = [ # 加入 static 路徑<br>    BASE_DIR / &#39;static&#39;,<br>]</pre><pre># firstproject\urls.py<br>from django.contrib import admin<br>from django.urls import path<br>from myapp.views import sayhello, hello2, hello3 # 加入<br><br>urlpatterns = [<br>  path(&#39;admin/&#39;, admin.site.urls), <br>  path(&#39;&#39;, sayhello),<br>  path(&#39;hello2/&lt;str:username&gt;&#39;, hello2),<br>  path(&#39;hello3/&lt;str:username&gt;&#39;, hello3), # 加入 path(網址, 函式)<br>]<br><br># myapp\views.py<br>from django.http import HttpResponse<br><br>def sayhello(request):<br>  return HttpResponse(&quot;Hello Django!&quot;)<br><br>def hello2(request, username):             # 加入<br>  return HttpResponse(&quot;Hello &quot; + username) # 加入<br><br>def hello3(request, username):<br>    now = datetime.now()<br>    # render(HttpRequest物件: GET、POST, 模板名稱, 傳遞所有區域變數)<br>    return render(request, &#39;myapp/hello3.html&#39;, locals())<br><br>def hello4(request, username):<br>    now = datetime.now()<br>    return render(request, &quot;myapp/hello4.html&quot;, locals()) </pre><pre># templates\hello4.html<br>{% load static %}<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;title&gt;顯示圖片的模板&lt;/title&gt;<br>    &lt;link href=&quot;{% static &quot;css/style.css&quot; %}&quot; rel=&quot;stylesheet&quot; /&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div id=&quot;home&quot;&gt;<br>        &lt;img src=&quot;{% static &quot;images/monkey.png&quot; %}&quot; alt=&quot;歡迎光臨&quot; width=&quot;30&quot; height=&quot;30&quot; /&gt;<br>        &lt;span class=&quot;info&quot;&gt;歡迎光臨: {{username}}&lt;/span&gt;<br>        &lt;h2&gt;現在時刻: {{now}}&lt;/h2&gt;<br>    &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><pre># 開啟瀏覽器<br>http://127.0.0.1:8000/hello4/elliot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zie522HoGJBKwAsfJAaGg.png" /><figcaption>圖4 預覽畫面(靜態檔案)</figcaption></figure><h4>視圖、模板與Template</h4><p>locals() 傳遞變數到 Template 模板</p><pre># 範例1: 以亂數 1-6 分別顯示 3 個骰子點數<br># myapp\views.py<br>import random<br><br>def dice(request):<br>  no1 = random.randint(1, 6)<br>  no2 = random.randint(1, 6)<br>  no3 = random.randint(1, 6)<br>  # 使用 locals() 傳遞所有的區域變數<br>  return render(request, &quot;dice.html&quot;, locals())<br><br># firstproject\urls.py<br>from myapp.views import dice<br><br>urlpatterns = [<br>  path(&#39;dice/&#39;, dice)<br>]</pre><pre>&lt;!-- templates\dice.html --&gt;<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&#39;utf-8&#39;&gt;<br>  &lt;title&gt;擲骰子&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h3&gt; 點數1：{{ no1 }}&lt;/h3&gt;<br>  &lt;h3&gt; 點數2：{{ no2 }}&lt;/h3&gt;<br>  &lt;h3&gt; 點數3：{{ no3 }}&lt;/h3&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Template 標籤</p><pre>{# if 條件指令 #}<br>{% if condition %}<br>  程式區塊<br>{% endif %}<br><br>{% comment %} # 多行註解<br>{% if condition1 %}<br>  程式區塊1<br>{% elif condition2 %}<br>  程式區塊2<br>{% else %}<br>  程式區塊2<br>{% endif %}<br>{% endcomment %} # 多行註解<br><br>{# for 迴圈 #}<br>{% for 變數 in 串列 %}<br>  程式區塊<br>{% empty %}<br>  程式區塊empty # 若串列中沒有任何資料，執行 empty 中的區塊<br>{% endfor %}<br><br># Ex: 定義 list1 串列為 list1 = range(1, 6)<br>def show(request):<br>  list1 = range(1, 6)<br>  return render(request, &quot;show.html&quot;, local())<br><br>{% for i in list1 %}<br>  {{i}},<br>{% empty %}<br>  沒有任何資料<br>{% endfor %}</pre><p>Example: 顯示員工資料</p><pre># myapp\views.py<br>def show(request):<br>  person1 = {&quot;name&quot;: &quot;Elliot1&quot;, &quot;phone&quot;: &quot;0912-123456&quot;, &quot;age&quot;: 30}<br>  person2 = {&quot;name&quot;: &quot;Elliot2&quot;, &quot;phone&quot;: &quot;0912-123455&quot;, &quot;age&quot;: 31}<br>  person3 = {&quot;name&quot;: &quot;Elliot3&quot;, &quot;phone&quot;: &quot;0912-123466&quot;, &quot;age&quot;: 32}<br>  persons = [person1, person2, person3]<br>  return render(request, &quot;show.html&quot;, locals())<br><br># firstproject\urls.py<br>from myapp.views import show<br><br>urlpatterns = [<br>  path(&#39;show/&#39;, show)<br>]</pre><pre>{% for person in persons %}<br>  &lt;h2&gt;第 {{ forloop.counter }} &lt;/h2&gt;<br>  &lt;ul&gt;<br>    &lt;li&gt;姓名: {{ person.name }}&lt;/li&gt;<br>    &lt;li&gt;手機: {{ person.phone }}&lt;/li&gt;<br>    &lt;li&gt;年齡: {{ person.age }}&lt;/li&gt;<br>  &lt;/ul&gt;<br>{% endfor %}</pre><h4>使用 GET、POST 傳送資料</h4><p>以 GET 傳送資料</p><pre># myapp\views.py<br>def djget(request):<br>  name = request.GET[&#39;name&#39;]<br>  city = request.GET[&#39;city&#39;]<br>  return render(request, &quot;djget.html&quot;, locals())<br><br># firstproject\urls.py<br>from myapp.views import djget<br>urlpatterns = [<br>  path(&#39;djget&#39;, djget)<br>]</pre><pre># templates\djget.html<br>&lt;body&gt;<br>  &lt;h1&gt;Django 網站&lt;/h1&gt;<br>  &lt;h2&gt;歡迎來自 {{city}} 的 {{name}} 光臨!&lt;/h2&gt;<br>&lt;/body&gt;</pre><p>以 POST 傳送資料</p><pre># myapp\views.py<br>def djpost(request):<br>  if request.method == &#39;POST&#39;:<br>    username = request.POST[&#39;username&#39;]<br>    password = request.POST[&#39;password&#39;]<br>    if username == &#39;admin&#39; and passowrd == &#39;Q_Q123&#39;:<br>      return HttpResponse(&#39;歡迎光臨本網站!&#39;)<br>    else:<br>      return HttpResponse(&#39;帳號或密碼錯誤!&#39;)<br>  else:<br>    return render(request, &quot;djpost.html&quot;, locals())<br><br># firstproject\urls.py<br>from myapp.views import djpost<br>urlpatterns = [<br>  path(&#39;djpost&#39;, djpost)<br>]</pre><pre>&lt;body&gt;<br>  &lt;h1&gt;Django 網站&lt;/h1&gt;<br>  &lt;form method=&#39;post&#39; action=&quot;djpost&quot;&gt;<br>    {% csrf_token %}<br>    &lt;p&gt;帳號: &lt;input type=&#39;text&#39; name=&#39;username&#39; /&gt;&lt;/p&gt;<br>    &lt;p&gt;密碼: &lt;input type=&#39;password&#39; name=&#39;password&#39; /&gt;&lt;/p&gt;<br>    &lt;p&gt;&lt;button type=&#39;submit&#39;&gt;確定&lt;/button&gt;&lt;/p&gt;<br>  &lt;/form&gt;<br>&lt;/body&gt;</pre><p>持續更新…</p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3490d3c7b195" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note]Installing pip3 in Ubuntu]]></title>
            <link>https://medium.com/@elliotcs30/installing-pip3-in-ubuntu-b363539ba3eb?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/b363539ba3eb</guid>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Thu, 08 Feb 2024 11:20:46 GMT</pubDate>
            <atom:updated>2024-03-10T10:06:46.870Z</atom:updated>
            <content:encoded><![CDATA[<p>pip3 in Ubuntu</p><p>pip3 is the official package installer for Python3. It can be used to install packages from the Pyhton Package Index.</p><h3>Installation</h3><p>Step 1 : Update system</p><p>It is always a good idea to update before trying to install a new package. Run the command below:</p><pre>sudo apt-get update</pre><p>Step 2 : Install pip3</p><p>If Python3 has already been installed on the system, execute the command below to install pip3:</p><pre>sudo apt-get -y install python3-pip</pre><p>Step 3 : Verification</p><p>To verify the installation, run the following command to cross check the version number:</p><pre>pip3 --version</pre><p>[ref] <a href="https://www.educative.io/answers/installing-pip3-in-ubuntu">Installing pip3 in Ubuntu</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b363539ba3eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[Lab] Python Datetime]]></title>
            <link>https://medium.com/@elliotcs30/e%E7%A0%94%E7%A9%B6%E5%AE%A4-python-datetime-acb8152bda7?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/acb8152bda7</guid>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Tue, 11 Apr 2023 02:12:30 GMT</pubDate>
            <atom:updated>2024-03-10T10:00:28.441Z</atom:updated>
            <content:encoded><![CDATA[<p>python 日期時間</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*lk9AzHFbQd6QvyEO1U2F1Q.jpeg" /></figure><p>安裝套件用來計算年、月、日</p><pre>pip install python-dateutil</pre><p>當前日期時間</p><pre>import datetime<br>print (datetime.datetime.now()) # 2023-03-10 03:10:48.908041</pre><p>格式化時間</p><pre>import datetime<br>print(datetime.datetime.now().strftime(&quot;%Y-%m-%d %H:%M&quot;))<br># 2023-03-10 03:10</pre><p>日期加 1 天</p><pre>import datetime<br>now = datetime.datetime.now()<br>print((now+datetime.timedelta(days=1)).strftime(&quot;%Y-%m-%d %H:%M:%S&quot;))<br># 2023-03-11 03:10:24</pre><p>日期減 1 天</p><pre>import datetime<br>now = datetime.datetime.now()<br>print((now+datetime.timedelta(days=-1)).strftime(&quot;%Y-%m-%d %H:%M:%S&quot;))<br>print((now-datetime.timedelta(days=1)).strftime(&quot;%Y-%m-%d %H:%M:%S&quot;))<br># 2023-03-09 03:10:24</pre><p>提前 1 小時 / 提前 1 分鐘</p><pre># datetime.timedelta(days=1), 把 days 改成 hours、minutes 可提前 1hr / 1 min<br># timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])<br><br>import datetime<br># 提前 1 小時<br>print((datetime.datetime.now()+datetime.timedelta(hours=1)).strftime(&quot;%Y-%m-%d %H:%M:%S&quot;))<br># 2023-03-10 04:39:52</pre><p>日期減 1 年</p><pre># 提前 1 年<br>now = datetime.datetime.now()<br>print((now+relativedelta(years=1)).strftime(&quot;%Y-%m-%d %H:%M:%S&quot;))<br># 2024-03-10 03:30:35</pre><p>[參考] <a href="http://www.rorocool.com/article/20230322/174031.html">Python 日期时间datetime</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acb8152bda7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note] 快速了解什麼是 UI 設計]]></title>
            <link>https://medium.com/@elliotcs30/e%E7%A0%94%E7%A9%B6%E5%AE%A4-ui-%E8%A8%AD%E8%A8%88-798c2bf35b45?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/798c2bf35b45</guid>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[ui-design]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 18 Dec 2022 04:50:20 GMT</pubDate>
            <atom:updated>2024-03-10T10:03:38.486Z</atom:updated>
            <content:encoded><![CDATA[<p>UI 設計、UI Design、 UI 設計 0 -&gt; 1</p><h3>前言</h3><p>開始閱讀之前讓我們先來想想什麼是UI？</p><p>為什麼UI對於一個產品的成敗來說也是重要的呢？</p><p>目標導向又是怎麼一回事？</p><h3>相關概念</h3><p>UI (User Interface)指的就是『 使用者介面 』。</p><p>而在使用者介面可分為下面兩種：</p><p>硬體介面：比如相機的操作使用的按鈕，即可稱為硬體介面。</p><p>軟體介面：比如相機螢幕所呈現出來的畫面，就可稱為軟體介面。</p><p>UI 人才培育目標分析：</p><p>視覺設計、互動設計、使用者經驗設計</p><p>UI 人才通常熟練的相關軟體：</p><p>Photoshop、Flash、Dreamweaver、Illustrator、After Effects、3dsMax</p><p>專業技能培養：</p><p>文檔撰寫能力、技術能力、草圖繪製和原型開發，平面、立體、動態圖形設計能力，人體工學理論和認知心理學</p><p>綜合培養：</p><p>造型能力、審美修養、想像力和創造力、溝通與表達能力、觀察感悟能力、自主學習能力。</p><h3>目標導向</h3><p>一個產品的成與敗關鍵在於使用者接受度的成度是否較高，若製造出來的產品類型在市場中沒有任何的需求，那或許就不是一個好的產品。</p><p>因此目標導向、使用者體驗、可用性都是在設計產品中需要考慮到的三個部分，以下就讓我們來繼續了解這三個部分分別是什麼吧～</p><ol><li>UCD (使用者導向)<br> 需求分析:需求討論、競爭產品分析<br> 概念設計：用戶特徵分析(使用場景、應用案例 &gt; 設計初稿)<br> 設計初稿：互動原型、介面設計<br> 詳細設計：迭代優化初稿的不足<br> 測試：產品驗證(專案總結)</li><li>使用者經驗<br> (1)感官體驗 — 視覺、聽覺、觸覺、味覺、嗅覺。<br> (2)行為體驗 — 可用、高效、易用、趣味、準確等。<br> (3)情感體驗 — 滿足心理需求、理想的成就、或是自我價值的實現。</li><li>使用者經驗的要素：<br> (1)策略層 — 使用者需求分析和市場分析。<br> (2)範圍層 — 透過需求分析和功能需求得出的結論。<br> (3)結構層 — 互動設計、資訊架構、業務流程數據流向分析。<br> (4)架構層 — 資訊設計、介面設計將抽象的架構轉化為詳細的框線圖。<br> (5)表現層 — UI 的視覺設計。</li></ol><h3>設計流程</h3><p>從抽象到具體的過程，也就是說我們對於使用者需求的理解為抽象的概念，再把抽象的概念一步一步的具體呈現出來。</p><ol><li>產品定位</li><li>設計需求功能確認</li><li>架構設計<br>(1) 介面流程圖(UI Flow) 繪製：通常會先以手繪方式確認操作流程<br>(2) 線框稿(wireframe)繪製：通常包含資訊、呈現畫面</li><li>原型設計(Prototypes)</li><li>視覺設計的實施</li><li>測試與迭代設計</li><li>回饋與溝通</li></ol><h3>設計風格</h3><p>因應不同的使用者需求來設計相符合的風格，比如說今天主題是車子，那你不可能硬要把不相關的素材涵蓋在其中，並遵從少即是多的極簡設計原則，避免太多太複雜的元素讓人無法快速聚焦。</p><ol><li>設計美學原理：產品語義學、符號學原理、色彩學原理、認知心理學原理</li><li>UI的可用性與視覺設計</li><li>UI視覺設計與情感</li><li>UI視覺設計風格</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhzygmCsd6MmyY4e592WCg.png" /><figcaption><a href="https://www.lamborghini.com/en-en/news/the-new-lamborghini-huracan-sterrato">圖片來源： Lamborghini官網</a></figcaption></figure><h3>藝術規律</h3><p>平面的構成需要一些造型元素的結合，讓整體的設計在視覺上更佳的加分。</p><ol><li>基本造型元素：原型、方形、三角形、六角形、直線</li><li>色彩的構成</li><li>視覺的要素：文字、圖片、動畫、影片</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xejXBEHsA9slEvRzQCsWcw.png" /><figcaption><a href="https://www.lamborghini.com/en-en/custom-solutions">圖片來源： Lamborghini官網</a></figcaption></figure><h3>圖像設計</h3><p>圖標應用得當為專案加分，添加太多不符合的設計感會流失許多使用者的回流，因此設計圖標的造型可依照當前的產品來做設計。</p><ol><li>圖標：<br>(1) 種類：標示(符號、告示牌)、標誌(品牌識別)、圖標(有含義的圖像)<br>(2) 圖標設計的創意：以使用者為導向、功能性出發、識別性、原創性<br>(3) 圖標設計的原則：尺寸、色彩、空間分配<br>(4) 設計的方法和流程：收集相關圖標(過往、類似、創意)<br>(5) 圖像聯想與訓練<br>(6) 細節設計和表現<br>(7) 系統化設計：(主題性、分類)</li><li>像素圖像設計</li><li>向量圖像設計</li><li>資訊圖像設計(圖表分析、線路圖、時間軸)</li><li>動態圖像設計</li></ol><h3>網站UI設計</h3><p>想要掌握網站介面設計通常需要文字、圖像、圖文排版的設計原則、流程，最後則是使用者的回饋。</p><p>讓我們先補一下演進的過程：</p><p>以往只有HTML與CSS和JavaScript來作呈現，後來透過Flash與網頁設計結合讓提升了視覺效果。動態的HTML稱之為DHTML，讓網頁能夠與使用者互動並包含動態的內容頁面。行動裝置的興起讓響應式網站設計也漸漸的成為網頁設計的趨勢。</p><ol><li>網站設計<br>(1) 構成的要素：文字、圖像、聲音、影片、動畫等多媒體元素<br>(2) 文字的設計：Logo 文字、標題、正文、名稱、描述、標籤<br>(3) 圖像設計：功能性、內容、輔助<br>(4) 圖文版型設計：柵格佈局、滿版構圖、上下左右分割、對稱構圖、重心構和四角構圖、三角構圖、並置、自由佈局<br>(5) 設計流程和規範：統一識別、提高效率、復用性高、延續性<br>(6) 設計範例：設計目標 &gt; 網站規劃 &gt; 設計回顧(簡要流程、迭代、上線)</li><li>應用軟體設計<br>(1) 網站介面與軟體介面的區別和聯繫<br>(2) 教育軟體UI設計<br>(3) 家電產品UI設計</li></ol><h3>手機UI設計</h3><p>現今社會已成為人手一機的趨勢，要如何設計出使用者喜愛的應用程式與希望看到的主題、資訊來增加使用者的黏著度就相當重要。</p><ol><li>手機設計<br>(1) 手機主題設計：螢幕鎖定UI、圖標、桌面工具、系統介面<br>(2) 設計原則：主題創意、風格、互動功能、簡潔、通用、情感共鳴<br>(3) 設計流程：分析方向 &gt; 主題、風格確定 &gt; 草圖 &gt; 畫面呈現 &gt; 測試</li><li>手機遊戲<br>(1) 特點：便攜性、參與性、開放性、多樣性、創新性、零碎時間再利用<br>(2) 設計原則：沈浸感、一致性、降低視覺的衝擊力(讓使用者融入遊戲中)、功能優先、合理的運用視覺等級、遵從習慣<br>(3) 設計流程：確定類型及需求 &gt; 設定遊戲世界觀 &gt; 美術風格 &gt; 規格參數 &gt; 概念設計及草圖繪製 &gt; 線框稿繪製 &gt; 建立視覺規範文檔 &gt; 測試</li><li>APP 設計<br>(1) APP 分類：社交與即時通訊、地圖導航、生活輔助、媒體資訊、休閒娛樂、教育學習、工具<br>(2) 設計模型：<br>瀑布型：需求分析 &gt; 設計 &gt; 實現 &gt; 測試 &gt; 維護<br>敏捷型：拆分可獨立運行的小專案分別完成，開發中此專案仍可運行<br>(3) 設計流程：使用者研究 &gt; 功能定位 &gt; 架構、佈局、草圖<br>(4) 便利性：應減少使用者輸入，可設置預設值、目標值</li></ol><h3>車上型UI設計</h3><p>由於駕駛需要注意當前行駛中的狀況，同時也有可能需要觀看導航或是其他操作，因此UI設計時就更加的重要，比如說危險、提示的警告或是行車導航時的語音服務等等。</p><ol><li>輔助駕駛介面(功能、資訊)</li><li>娛樂介面和車內外資訊互動介面(停車輔助)</li><li>介面視覺體驗(完整、簡潔提示)</li></ol><h3>結語</h3><p>術業有專攻若要打造一個好的產品不單單是一個人的責任，而是一個團隊與使用者之間的反覆溝通與回饋，經由雙向的需求理解和需求確認與溝通打造符合期望的產品才是最重要的！</p><p>[Reference] 以上部分內容是參考<a href="https://www.books.com.tw/products/0010838742">UI設計書籍</a>的重點概述，若想要<a href="https://www.books.com.tw/products/0010838742">了解更多更詳細的內容請點我</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=798c2bf35b45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note] Git ≠ GitHub 學習筆記]]></title>
            <link>https://medium.com/@elliotcs30/e%E7%A0%94%E7%A9%B6%E5%AE%A4-git-github-%E5%AD%B8%E7%BF%92%E7%AD%86%E8%A8%98-325badf91bb0?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/325badf91bb0</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[permission-denied]]></category>
            <category><![CDATA[authentication-failed]]></category>
            <category><![CDATA[github-error-message]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sun, 06 Nov 2022 02:12:57 GMT</pubDate>
            <atom:updated>2024-03-10T10:02:06.596Z</atom:updated>
            <content:encoded><![CDATA[<p>學習 Git 0 ➡ 1 的成長筆記，持續更新</p><h3>簡介</h3><p>Git 是一種版本控制系統，簡單來說就是你改了檔案中的任何內容都會被記錄起來，這些歷史紀錄就可以清楚地知道是誰在什麼時候改了什麼檔案。</p><p>優點：</p><ol><li>免費</li><li>速度快、檔案佔用空間小</li><li>分散式系統(意思是你不需要一台主電腦來提供服務，使用期間你可以更換不同電腦來使用它，就算你執行時沒有網路一樣可以使用，但若要將Git 所有更動的內容推到 GitHub 時，在使用網路同步即可)</li></ol><p>缺點：</p><ol><li>易學難精</li><li>會遇到千奇百怪的問題🤣</li></ol><p>Git ≠ GitHub：</p><p>Git 是版本控制系統。GitHub 是個網站，它的本質是 Git 這個伺服器，使用Web 的方式來呈現，且可以使用 Git 的指令來操作。</p><h3>環境安裝</h3><p>[參考資料] <a href="https://gitbook.tw/chapters/environment/install-git-in-windows">安裝在 Windows 作業系統(高見龍)</a></p><p>[參考資料] <a href="https://gitbook.tw/chapters/environment/install-git-in-mac">安裝在 Mac OSX 作業系統(高見龍)</a></p><p>[參考資料] <a href="https://gitbook.tw/chapters/environment/install-git-in-linux">安裝在 Linux 作業系統(高見龍)</a></p><h3>建立第一個commit</h3><pre>$ git init<br>$ git add .<br>$ git commit -m &quot;add git-demo.html&quot;</pre><h3>上傳至遠端</h3><pre>$ git remote add origin &lt;repo_url&gt;<br>$ git push -u origin main</pre><h3>新增分支</h3><pre>$ git branch &lt;branch_name&gt; // git branch feature/a</pre><h3>查看分支</h3><pre>$ git branch       // 列出所有分支清單<br>$ git branch -v    // 查看本地各分支最新 commit<br>$ git branch --all // 查看本地、遠端分支</pre><h3>切換分支</h3><pre>$ git checkout &lt;branch_name&gt; // git checkout feature/a</pre><h3>推送分支到遠端</h3><pre>$ git push &lt;remote_repo&gt; &lt;branch&gt; // git push origin feature/a</pre><h3>重新命名分支</h3><pre>$ git branch -m feature/a feature/b</pre><h3>刪除分支</h3><pre>$ git branch -d feature/a // 無法刪除正在使用的分支<br>$ git branch -D feature/a // 當分支有更新內容, 需要使用 -D</pre><h3>合併分支</h3><p>master 合併到新功能分支</p><pre>$ git checkout master // 先切換到要合併的分支<br>$ git merge feature/a // 若無發生衝突 master會直接到feature/a<br>$ git merge feature/a --no-ff // 會刻意留下一個commit(紀錄master與feature/a合併動作)<br></pre><h3>查看當前commit線路圖</h3><pre>$ git log --oneline</pre><h3>狀況處理</h3><p>狀況1: 若commit錯誤時…</p><pre>$ git log --oneline // 確定Git紀錄<br>$ git reset main^   // 回到上一次main分支未commit的紀錄</pre><h3><strong>錯誤處理</strong></h3><h4>錯誤1: 合併衝突</h4><pre>$ git status // 先看一下當前的狀態, 解決衝突後<br>$ git add .<br>$ git commit // 解決衝突不輸入訊息, 會直接 Merge branch &#39;feature/a&#39;</pre><h4><strong>錯誤2: 權限問題</strong></h4><p><strong>當遇到無法 push 本地端到遠端的 git repo 以下是解法</strong></p><pre>$ git remote -v // 確認遠端<br>$ git branch -v // 確認當前 branch<br>$ git push      // 把本地端的 code 推到遠端 repo，顯示錯誤</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RTTpZq7qxIkBnOIcYIqtsw.png" /></figure><pre>$ git push --set-upstream origin feat/13</pre><p>顯示 Please make sure you have the correct access rights<br>and the repository exists.</p><p>由此可知，是因為權限的問題所以推不上去</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqjtL5V1xaJbBr00vngwtw.png" /></figure><pre>$ ssh-keygen -t rsa -b 4096 -C &quot;your email@gamil.com&quot;</pre><pre>Enter file in which to save the key (/Users/user name/.ssh/id_rsa): <strong>input your password or press Enter</strong></pre><pre>Enter passphrase (empty for no passphrase): <strong>input your password or press Enter</strong></pre><pre>Enter same passphrase again: <strong>input your password or press Enter</strong></pre><pre>$ eval &quot;$(ssh-agent -s)&quot;<br>$ ssh-add ~/.ssh/id_rsa<br>$ cat ~/.ssh/id_rsa.pub</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XgZ4IlJO7r-LFwUdPxeinw.png" /></figure><p>到 Github 點選 Settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5P_rqf0AZFLHOjGoG-N0wg.png" /></figure><p>點選 SSH and GPG keys</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Soj4sTZud2FoGv55vZNSRw.png" /></figure><p>點選 New SSH key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4DJiRQpNlAlrX6OEQLylVg.png" /></figure><p>輸入 Title &gt; 貼上你的 ssh-rsa &gt; 點選 Add SSH key</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eF4oaEUgtLWQWDwEDJ_scQ.png" /></figure><p>完成畫面如下：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ckds55AXjLIeq1WI-XjvBA.png" /></figure><p>到本地端的 repo 要 commit 的路徑輸入</p><pre>$ git push</pre><p>[參考資料] <a href="https://tw.alphacamp.co/curriculum">Alpha Camp 線上課程</a><br>[參考資料]<a href="https://gitbook.tw/chapters/using-git/reset-commit">【狀況題】剛才的 Commit 後悔了，想要拆掉重做…</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉<br>If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=325badf91bb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[note]VS Code 文字樣式設定]]></title>
            <link>https://medium.com/@elliotcs30/e%E7%A0%94%E7%A9%B6%E5%AE%A4-vs-code-%E6%96%87%E5%AD%97%E6%A8%A3%E5%BC%8F%E8%A8%AD%E5%AE%9A-f027dba08e2?source=rss-19cf6567f906------2</link>
            <guid isPermaLink="false">https://medium.com/p/f027dba08e2</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[firacode-style]]></category>
            <category><![CDATA[fira-code]]></category>
            <category><![CDATA[vs-code-equal-style]]></category>
            <dc:creator><![CDATA[Elliot]]></dc:creator>
            <pubDate>Sat, 05 Nov 2022 11:44:22 GMT</pubDate>
            <atom:updated>2024-03-10T10:03:16.477Z</atom:updated>
            <content:encoded><![CDATA[<p>跟上前輩的腳步👣👣👣</p><p>前陣子在學習 AC 課程的時候看到很酷的樣式，如下：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEM0Edkl8E3LEKortkHBsA.png" /><figcaption>FiraCode style</figcaption></figure><p>但人就是這樣子在越忙的時候，越想幹點什麼大事🤪</p><p>上網找了很多關鍵字，最後終於被我找到原來就是 FiraCode 的文字樣式</p><p>接下來讓我們一起跟上前輩的腳步吧！💪</p><ol><li>Choice your OS and download Visual Studio Code [<a href="https://code.visualstudio.com/download">link</a>]</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8vlCzWg_NpgWzG3oIxtvw.png" /><figcaption><a href="https://code.visualstudio.com/download">圖片來源 Visual Studio Code</a></figcaption></figure><p>2. Download the FireCode file and open the folder [<a href="https://github.com/tonsky/FiraCode/releases/download/1.206/FiraCode_1.206.zip">link</a>]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TI2wThGt2ganJDvBqoUYpA.png" /><figcaption>unzip and open the folder</figcaption></figure><p>3. Open ttf folder &gt; run everyone .ttf file(5 files need to run) &gt; click install</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9ogTkXLToGegYFmmFS_pQ.png" /></figure><p>4. Open Visual Studio Code App</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/62/1*kTNcw72-1sW2YQ3cNsGRCg.png" /><figcaption>Visual Studio Code App</figcaption></figure><p>5. Click Code &gt; Preferences &gt; Settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7y_QEFxj1zkaxo7QVygk7g.png" /></figure><p>6. Click Open Settings(JSON) icon &gt; Paste settings code &gt; Save file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-hDhIPap_4m5DbXkdY6tg.png" /><figcaption>Open Settings (JSON) icon</figcaption></figure><pre>{</pre><pre>  &quot;editor.fontFamily&quot;: &quot;Fira Code&quot;,</pre><pre>  &quot;editor.fontSize&quot;: 14,</pre><pre>  &quot;editor.fontLigatures&quot;: true</pre><pre>}</pre><p>7. Restart Visual Studio Code &gt; input code test</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DEM0Edkl8E3LEKortkHBsA.png" /></figure><p>[Reference] <a href="https://oranwind.org/-iot-studio/">Visual Studio Code 中使用 FiraCode 教學</a></p><pre>若你喜歡我的文章請拍個手！ 若有興趣一起討論的話，請留言讓我知道你是誰！😉If you like my article, please clap your hands! If you are interested in discussing together, please leave a message and let me know who you are! 😉</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f027dba08e2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>