XpandNotes

exploring the intersection of technology and creativity

OpenCV 讀檔、寫檔、分離 RGB 通道

安裝 opencv-python $ pip install opencv-python OpenCV 讀檔 將圖片命名為 image.jpg 並放在與下方 python 檔案同一個目錄下。 1 2 3 4 5 # showimg.py import cv2 img = cv2.imread("image.jpg") cv2.imshow("Image", img) cv2.wai...

論文翻譯 A Dynamic Priority Assignment Technique for Streams with (m, k)-Firm Deadlines

摘要 本文將會解決 scheduling multiple streams of real-time customers。首先介紹 (m, k)-firm deadlines 的概念以表達對 real-time stream 計時的限制:任何 k 個連續 customer 中至少有 m 個必須滿足他們的 deadline,則稱此 stream 擁有 (m, k)-firm deadline...

證明 Petersen graph 的圍長為 5

Prove or disprove that Petersen graph has girth 5.

Petersen graph 的定義:https://blueskyson.github.io/2021/11/12/petersen-graph/ Petersen graph 為 simple graph,故沒有 loop 與 multiple edge,也就是沒有 1-cycle 與 2-cycle,見下圖: 形成 3-cycle 需要 3 個所有元素都不...

Petersen graph 簡介

What is Petersen graph?

Def: Petersen graph 是一種 simple graph,其頂點被標記為 5 元素集合的 2 元素子集合 (2-set),邊為不共元素的 2 元素子集合對。 光看解釋會讓人摸不著頭緒,但其實概念很簡單,首先定義一個 5 元素的集合:$\{1,2,3,4,5\}$ 接著列出所有 2 元素子集合,根據 $C^5_3=10$,總共有 10 個子集合: \[\{1,2\},\{...

證明二分圖沒有奇數環(若且唯若)

A graph is bipartite if and only if it has no odd cycle

必要條件: 令 $G$ 為一個 bipartite,因為在 $G$ 中每走過一條邊,就會進入另一組 bipartition,所以要從某一點出發再走回該點,必定要走偶數次,故 $G$ 沒有 odd cycle。 充分條件: 令 $G$ 為無 odd cycle 的圖,並建構 $G$ 的 bipartite,從中選取一個 nontrivial component $H$,再從 $H$ 中選...

Xfce 基本設定

新酷音輸入法 透過 pacman 或 apt 安裝 ibus-chewing。 $ sudo pacman -S ibus ibus-chewing libibus libchewing 新增一個腳本放在 /etc/profile.d $ sudo vim /etc/profile.d/ibus.sh 輸入以下內容以便開機時自動啟用 ibus: 1 2 3 4 GTK_IM_...

C# 動態折線圖

劃出類似 CPU 使用率的動態折線圖 Form1 成員 用途 Chart chart 折線圖物件 int[] xvalue 折線的 x 座標陣列 int[] yvalue 折線的 y 座標陣列 ...

C# Asynchronous Socket

C# 傳統的 Socket 會在斷線時讓系統卡住十幾秒,就算用 try catch 機制也無法避免這個問題。而非同步連線內部的機制就不會讓系統卡住,以下是非同步連線寫出的函式。 1 2 3 4 5 6 7 8 9 10 11 12 13 // Asynchronous Socket public Socket AsyncConnect(string ip, string port) { ...

在 VirtualBox 安裝 Arch Linux

摘要 以下安中步驟主要參考自 youtube,我只是將安裝過程的指令和螢幕截圖下來,如果聽英文沒問題可以直接看影片。對分割、掛載磁碟、設定 Linux 環境很熟悉的人可以直接按照以下摘要的指令安裝: # setfont ter-224b.psf.gz # ping google.com ^C # ls /sys/firmware/efi/efivars # timedatectl set...

Arch Linux 基本設定

終端機字型 在 Arch 官網有一個 Font packages 列表,從中找一個你喜歡的字型,透過 pacman 或 yay 下載,我下載 Terminus。 $ sudo pacman -Syu terminus-font 然後在 /usr/share/kbd/consolefonts/ 就可以發現許多 ter 開頭的字型包,即為剛剛下載的 Terminus 字型。 $ ls ...