Blogs

C/C++:自訂 Debug 訊息

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. #include <stdarg.h> #include <stdio.h> #define COLOR_X "\033[0m" #define COLOR_I "\033[92m" #define COLOR_D "\033[96m" #define COLOR_W …

C++:常用 Filesystem library …

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. 紀錄下目前用過的功能 路徑表示 filesystem::path path 列出目錄(資料夾)的內容 filesystem::directory_iterator(path) 取得最後寫入時間 filesystem::last_write_time() 取出檔名 path.filename() 取出副檔名 path.filename().extension() …

XAMPP+ gmail STMP

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. 前言 最近在做一個可以偵測自己網站是否異常的小程式,為了可以讓網頁發送通知給我,所以就開始研究一個會自動發信件的程式。 目前找到最快的方案就是使用PHP自帶的寄信函數 — mail,從官方文件來看,要測試寄信功能這應該是最快的方式。 一般電腦瀏覽器不支援直接執行PHP,如果要執行就要安裝Apache網頁伺服器來執行PHP程式,不過現在有像XAMPP這種整合程式,基本上要架設 …

Window CMD 常用指令

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. 檔案 cd:移動當前資料夾路徑 dir:顯示目錄結構 /B:只顯示檔名 /A-D:只顯示檔案 /A:D:只顯示目錄 md or makedir rd or rmdir:刪除資料夾 rm /s /S:除指定目錄本身之外,也移除裡面的所有目錄和檔案。 用於移除樹狀目錄結構。 /Q:安靜模式,有 /S 時,刪除目錄樹結構不再要求確認 copy:複製檔案 xcopy:複製目錄、 …

Python:matplotlib …

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. 上次安裝Python之後,用matplotlib秀出多個子圖時出現警告。 主要是"新版matplotlib"中的plt.subplots有更改,現在直接建立一次就好。 先看程式碼 fig, ax = plt.subplots(2,2) ax[0,0].plot(np.arange(10)) …

Linux 常用指令

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面 The content write by Notion, and use Notion API convert to Hugo page. ls:列出檔案資訊 → 類似dos之dir l:列出詳細的檔案資訊 a:列出全部檔案包括隱藏檔 R:遞回列出檔案及子目錄其下的所有子目錄和檔案 x:以多欄方式列出,字母順序由左而右 i:以i -node來列出,會列出每個檔案在磁碟中的編號 t:依檔案的修改時間排序 (由新而舊) u:依檔案上次的存取時間排序 (需與t配合) s:檔案的大小以區塊為單位 (每個區塊block …