- Requirements (SRS) / Motivation
- source (where)
- internal
- external
- policy: inside-out, outside-in
- non-feature requirements
- performance
- cpu usage, memory bandwidth, size, latency
- preemption overhead
- init, peak (when)
- security
- Design (HLD)
- architecture design, cooperation model (protocol stack/SW stack)
- HW/SW/ feature team / Project team
- comparison with competitors
- Maintenance
- issue distribution / human resource estimation
- Case study
2020年10月13日 星期二
[SW] Feature development framework
2013年8月17日 星期六
[C++] 印 endl而非 '\n'
- 問題:
- C++中, 平常印訊息用 cout << endl 好, 還是 cout "\n" 好?
- 解法:
- 傾向使用 cout << endl, 原因是, IO的 buffer不會在程式 crash時自動清空 (flush), 也就是有可能一直在錯誤的地方 debug(在程式根本沒執行到的地方 debug, 因為誤以為印出的訊息是正確的), 但 endl中隱含了 flush buffer的動作, 因此可避免此一情形
2013年8月10日 星期六
[CMake] Install command line fail
- 問題
- 在安裝 CMake command line tools可能會發生 "Failed create symlink installation may be incomplete" 的錯誤
- 原因
- 主要原因是之前安裝過其他版本的 CMake而造成的衝突
- 解法
- 自行 link吧!
- 在 /usr/bin中找到以下相關 binary
- ccmake
- cmake
- cmake-gui
- cmakexbuild
- cpack
- ctest
- 刪除其 link, 並建立新的link
- e.g. sudo ln -s /Applications/CMake\ 2.8-11.app/Contents/bin/cmake /usr/bin/cmake
[Development] Memory leak check -Valgrind
- 簡介
- 相信寫 C, C++的人應該不陌生, 該 new空間沒 new, 或是使用完沒 delete, 都會造成 memory的問題, 而 Valgrind便是一套 tool可以幫忙做 memory check
- 安裝
- 目前一般 linux已內建, Mac可藉由 MacPort安裝 (sudo port install valgrind)
- 使用
- 基本流程
- build時候開啓 debug, e.g. g++ -g -o program
- 用 valgrind執行: valgrind --leak-check=full --log-file=memProg.log ./program
- 解讀 log: vi memProg.log
- 官方一頁版快速上手: Valgrind Quick Start Quide
- 網友介紹: Valgrind Tutorial
- 完整 options: Valgrind User Manual
2013年2月2日 星期六
[Mac] Audio Format Utility
在 Mac上若想要查看或編輯音樂檔案, 可使用音樂相關工具程式 (prefix af: Audio Format)
- afinfo: Audio Format Information, 查看音樂檔案相關內容, 包含 sampling rate, data rate, estimation duration
- afconvert: Audio Format Convert, 音樂轉檔功能, 常用選項(option), -b: 指定輸出 bit rate, -f: format
- afplay: 利用 command line來播放音樂
2012年10月14日 星期日
[Development] Loop Unrolling (unwinding)
寫程式時,有個基本的 loop unrolling,白話說,就是將迴圈內容展開。請看以下例子 (例子是 wiki的):
Ref:
-
int x; for (x = 0; x < 100; x++) { delete(x); } -
int x; for (x = 0; x < 100; x+=5) { delete(x); delete(x+1); delete(x+2); delete(x+3); delete(x+4); }
Ref:
2012年9月18日 星期二
2012年9月8日 星期六
[PHP] debug 重複變數
由於 PHP就像 Matlab一樣, 在使用變數時, 是不需要事先宣告的. 所以有可能造成不小心重複使用了變數的情形. 在程式中的判斷其實可以簡單透過 isset($var)來確定是否曾經定義過變數, 另外, 也可以利用 var_dump($var) 來查看變數, 會 dump出資料結構及其值. 另外, 也可以用 print_r 來印出 array的內容.
[PHP] 筆記--php include path
PHP 使用關鍵字 include與 require來載入其他函式或相關程式碼. 功能皆為讀取外部檔案, 而差異的地方, 在於 include讀不到檔時會有 warning, 而 require則是 fatal error.
就像 C++會用 #ifndef 來避免 header file被重複 include, 而 PHP則有 include_once與 require_once兩種機制.
另外, 應該自己注意 php.ini中的 include path設定
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
請依據自己的系統做調整, 注意 UNIX跟 Windows在路徑斜線的方向不同, 分隔符號也不同, 一個是分號一個是冒號.
就像 C++會用 #ifndef 來避免 header file被重複 include, 而 PHP則有 include_once與 require_once兩種機制.
另外, 應該自己注意 php.ini中的 include path設定
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
請依據自己的系統做調整, 注意 UNIX跟 Windows在路徑斜線的方向不同, 分隔符號也不同, 一個是分號一個是冒號.
訂閱:
文章 (Atom)