Shao-Wei Chiu

@swchiu

Joined on May 24, 2017

  • School: National Chiao Tung University Name: Shao-Wei Chiu 2020 spring Hw5 Hw6 Hw7
     Like  Bookmark
  • contributed by < rwe0214 > CS:APP Ch10 System-level I/O Unix 中的 file 是一序列的 bytes 所組成,所有的 I/O ( e.g. networks, disks, terminals, ... ) 皆 model as file。 因為這樣 Unix kernel 就可提供一個simple, low-level application interface ( Unix I/O ),達到驅動所有 I/O 一個統一和方便的方法。 10.4 Robust Reading and Writing with the Rio Package 因為 read 和 write 的回傳值為已讀寫完的 bytes 數量,但在連線不穩定(例如網路 socket connect 等等)的情況下,不一定只執行一次 read/write 就可達到預期讀寫完 n bytes 的結果( i.e. short count > 0 ),所以需要基於使用 read/write 來設計更穩定的 I/O function,可分成 unbuffered 和 buffered 兩種。 Unbuffered I/O Function
     Like  Bookmark
  • Github link How to Compile $ make gcc -g -fPIC -shared -o sandbox.so sandboxso.c -ldl gcc -g -o sandbox sandbox.c How to Run $ ./sandbox no command given.
     Like  Bookmark
  • School: National Chiao Tung University Name: Shao-Wei ( Willy ) Chiu Note: This report was made on Hackmd.io and restricted by the .pdf format, the .gif animation would not display. Please view it on https://hackmd.io/@swchiu/SJQehejA8, thanks. PCA / LDA When dataset's feature space grows into very high dimensions, there would be some useless feature. We prefer to extract the more important features for our dataset. let $$
     Like  Bookmark
  • School: National Chiao Tung University Name: Shao-Wei Chiu Note: This report was made on Hackmd.io and restricted by the .pdf format, the .gif animation would not display. Please view it on https://hackmd.io/@swchiu/BJwOjuc3U, thanks. Kernel K-means Kernel k-means is an approach to k-means algorithm, but mapping the data into higher degree dimentions. And the mapping-function called Kernel. K-means algorithm is that after comparing the data similarity, we cluster the more similarity datas to the same group.
     Like  Bookmark
  • School: National Chiao Tung University Name: Shao-Wei ( Willy ) Chiu Gaussian Process Training data: $\begin{bmatrix} x_1 & y_1 \ . & . \
     Like  Bookmark
  • contributed by <rwe0214> 作業說明 D05: list 生日悖論 如何透過近似的運算式,估算上述機率計算呢?附上有效的 LaTeX 算式 假設 1 年有 365 天
     Like  Bookmark
  • contributed by < rwe0214 > 作業說明 自我檢查清單 [x] 研讀上述 ==Linux 效能分析的提示== 描述,在自己的實體電腦運作 GNU/Linux,做好必要的設定和準備工作 $\to$ 從中也該理解為何不希望在虛擬機器中進行實驗; [x] 研讀上述費氏數列相關材料 (包含論文),摘錄關鍵手法,並思考 clz / ctz 一類的指令對 Fibonacci 數運算的幫助。請列出關鍵程式碼並解說 [ ] 複習 C 語言 數值系統 和 bitwise operation,思考 Fibonacci 數快速計算演算法的實作中如何減少乘法運算的成本; [ ] lsmod 的輸出結果有一欄名為 Used by,這是 "each module's use count and a list of referring modules",但如何實作出來呢?模組間的相依性和實際使用次數 (reference counting) 在 Linux 核心如何追蹤呢?
     Like  Bookmark
  • contributed by < rwe0214 > 作業說明 Homework1 (lab0) 開發過程 在實作過程發現,如果想在 q_insert_tail 達到 $O(1)$ 的時間,不在 queue_t structure 中新增其他的 field 去紀錄額外資訊是很難達到的,所以新增了一個 list_ele_t *tail 指標記錄尾部的位址。 q_size 在 queue 為空的時候回傳 zero ,其他狀況回傳 queue size,使用 !! 可以確保 queue 不為 NULL 的時候,條件判斷式的值為 1。
     Like  Bookmark
  • file descriptors while user open a file, kernel then handle a table called file descriptor table which store the opened file information(i.e., a pointer to the file), and the table index is file descriptor. So, the file descriptor is a non negative integer. stdin stdout, stderr 0 stdin 1 stdout 2 stderr
     Like  Bookmark
  • Chap 4 Decidability 4.1 Decidable Language For Regular Language 為了要證明 $A_{DFA}$ 是 decidable, 先說明 acceptance problems for $DFAs$ ( 在一個特定的 $DFA$ 上檢測特定字串 $w$ 是否 accept ),可以以 language 的方式來呈現,即$A_{DFA} = {<B,w>|B$ is a $DFA$ that accepts input string $w}$ 所以上述問題等同於判斷$<B,w> \in A_ {DFA}$ 是否成立。 回到 $A_{DFA}$ 是否 decidable 的問題,其若且唯若 $<B,w>$ 是否 decidable 。
     Like  Bookmark
  • 2018q1 Homework2 (prefix-search) === contributed by <`rwe0214`> ###### tags: `rwe0214` ## 開發環境 ``` willy@willy-X555LN:~$ lscpu Architecture: x86_64 CPU 作業模式: 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 每核心執行緒數: 2 每通訊端核心數: 2 Socket(s): 1 NUMA 節點: 1 供應商識別號: GenuineIntel CPU 家族:
     Like  Bookmark
  • 2018q1 Homework2 (assessment) === contributed by <`rwe0214`> ###### tags:`rwe0214` ## 課前測驗題參考作答 ### W1Q2 題目: :::info 給定 B 為 2 的某次方 (power of 2),那麼是否 A % B 會等價於 (A & (B - 1))? (a) 是 (b) 否 ::: ::: success 延伸問題: * 為什麼? * 舉出類似案例並解釋 ::: **想法 & 思考** 從取餘數這個角度出發,一開始我先以十進位來做思考,假設我們要取某數 A 除以 power of 10 的餘數,我們很自然就會把 A 的個位數往前數幾個 B 的次方值。 > e.g. 12345$_d$ 除以 10$^2$ 的餘數就是從十進制的個位開始取兩個數 45$_d$。 回到題目並以二進位的角度來看: > e.g. 123$_d$ = 1111011$_b$ 除以 2$^4$ 的餘數就是從二進制的個位開始取四個數 1011$_b$ = 11$_d$ 所以我們可以確定了一件事,當取 power
     Like  Bookmark
  • # 2018q1 Homework1 (phonebook) ###### tags: `rwe0214` ### Reviewed by `nashi5566` * 既然提到資料和現實生活不符,那是不是可以試著用作業中 all-name.txt 的資料做實驗呢? * 推論 hash-alv 對於 cache misses 的影響能不能夠用更詳盡的論述說明推論的理由 > 原本有想到要使用只有 avl 的版本去做比較,但是因為原資料執行 avl 的版本時間耗費太大,又怕只用小資料會造成變因過多,所以就沒有做出 avl 的比較,之後會再思考要用什麼方式呈現[name=Willy Chiu] * github 上多 push 了 phonebook_hash_alv_opt 的 executable file ### Reviewed by `raygoah` * 可以加入解釋 hash table 的 buckets 為什麼選擇 524288 * 可以比較 hash table size 不同時,使用 AVL tree 得到的 cache miss 差異,以及該選擇哪種 hash
     Like  Bookmark