fdfdd12345628

@fdfdd12345628

Joined on Aug 20, 2019

  • 測驗 4 gcc -lpthread -march=native -latomic lab.c callback 時 refcnt 要加一,結束時要減一,因此需要做兩次的 CAS 才可以 static bool execute_client_callback(bus_client_t *client, void *msg) { /* Load the client with which we are attempting to communicate. */ bus_client_t local_client; __atomic_load(client, &local_client, __ATOMIC_SEQ_CST);
     Like  Bookmark
  • Contributed by < fdfdd12345628 > 作業需求 GitHub Fibonacci 數列 這裡使用 HUGE-Fibonacci ,因為是 MIT licence 所以就直接用了。 它的原理是建構一個 struct 來儲存大數字
     Like  Bookmark
  • contributed by < fdfdd12345628 > 題目 測驗 1 COND1 先來看看原始碼 static list_ele_t *get_middle(struct list_head *list)
     Like  Bookmark
  • contributed by < fdfdd12345628 > 作業要求 q_new: 建立新的「空」佇列 q_free: 釋放佇列所佔用的記憶體 q_insert_head: 在佇列開頭 (head) 加入 (insert) 給定的新元素 (以 LIFO 準則) q_insert_tail: 在佇列尾端 (tail) 加入 (insert) 給定的新元素 (以 FIFO 準則) q_remove_head: 在佇列開頭 (head) 移除 (remove) 給定的元素。 q_size: 計算佇列中的元素數量。
     Like  Bookmark
  • contributed by < fdfdd12345628 > 作業要求 參閱此處 q_new: 建立新的「空」佇列 q_free: 釋放佇列所佔用的記憶體 q_insert_head: 在佇列開頭 (head) 加入 (insert) 給定的新元素 (以 LIFO 準則) q_insert_tail: 在佇列尾端 (tail) 加入 (insert) 給定的新元素 (以 FIFO 準則) q_remove_head: 在佇列開頭 (head) 移除 (remove) 給定的元素。
     Like  Bookmark
  • contributed by < fdfdd12345628 > 問題清單 free software (自由軟體) 和 open source (開放原始碼) 兩者的理念有何落差? 雖然開放原始碼常常被視為自由軟體的子集,但是其實他們打從一開始的出發點就不一樣。根據 Free Software Foundation 內的介紹, free software 的定義如下 The freedom to run the program as you wish, for any purpose (freedom 0). The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this. The freedom to redistribute copies so you can help others (freedom 2). The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.
     Like  Bookmark
  • contributed by < fdfdd12345628 >
     Like  Bookmark
  • contributed by < fdfdd12345628 > Github 連結:proxylab 作業需求 這份作業是 CS:APP3e 中的一個 lab 需要先閱讀課本的第11章再來做這份作業 Proxy 基本認識 使用者透過proxy來與server聯絡,而server也是透過proxy來回復
     Like  Bookmark
  • contributed by < fdfdd12345628 > 測驗一 題目要求作浮點除法,程式碼如下 #include <stdio.h> #include <stdlib.h> double divop(double orig, int slots) { if (slots == 1 || orig == 0)
     Like  Bookmark
  • 測驗一 考慮到下列程式碼,必須要一次判斷 64 位元的資料 #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <string.h> bool is_ascii(const char str[], size_t size) { if (size == 0)
     Like  Bookmark
  • 可能的報告主題 影像辨識、聲音辨識 比起以前,NN如何增進辨識效能或是減少server負載 有什麼新應用是在系統效能提高、延遲降低後出現的 網際網路、www、http、5G 電梯排程 硬碟排程 ✓ 報告大綱
     Like  Bookmark
  • contributed by < fdfdd12345628 > 測驗一 int asr_i(signed int m, unsigned int n) { const int logical = (((int) -1) OP1) > 0; unsigned int fixu = -(logical & (OP2)); int fix = *(int *) &fixu; return (m >> n) | (fix ^ (fix >> n)); }
     Like  Bookmark
  • contributed by < fdfdd12345628 >
     Like  Bookmark
  • contributed by < fdfdd12345628 > AA1, AA2 在前面的程式已經新增一個node,並且將裡面的初始值都訂好了,因此AA1是為了確認該node是否有效,所以為assert(new_node) 接著程式會跑到該list最後,並且加上新的node,因此AA2為*indirect = new_node將最後加上新的node BB1, BB2 由於要每兩個就交換一次,所以理論上每個迴圈都要把指標改成下下個節點,因此在 for 回圈內的 BB1 要換到下下個節點 又考慮到 node 是 pointer 的 pointer ,因此必須要先 dereference 後,才可以取 next 的 next ,最後 assign 時也要將其取址後,才符合 pointer 的 pointer ,因此 BB1 為node = &(*node)->next->next
     Like  Bookmark