- 可以從 BUD(Bottleneck, Unnecessary, Duplicate) 來思考.
- Bottleneck
- 先拆解演算法步驟
- step 1. 先排序 O(N)
- step 2. 再搜尋 O(logN)
- 則瓶頸在 step 1.
- 針對瓶頸替換演算法或是移除此步驟
- Unnecessary
- 移除過強的 assumption
- e.g. 排序後再..., 排序這動作是不是一定要?
- Duplicate
- 若某一步驟已經做了, 何必再多做一步? 或是可以 early break?
- e.g. 找 a+b+c = 10 的 solution, 已經找出 (a, b) 的值, c = 10-a-b, 直接 O(1) 得到, 你是否還多做了一層 iteration?
- Ref: Cracking the coding interview
2018年9月9日 星期日
[Algorithm] optimize complexity - BUD method
2018年7月21日 星期六
[House] 決策參考
- location, location, location
- 教育
- 生活機能 (便利商店、生鮮超市)
- 地點參考
- 基隆八斗子
- 早安國揚
- 13W/P, 室內 47P, total 65P, 也才 10xx, 相當不錯
2018年7月19日 星期四
[Visual Studio] Error C2471 cannot update program database xxx.pdb
- Problem:
- 在 MSVC下 build code時, 若出現 error C2471: cannot update program database 'xxx.pdb'
- Reason:
- Program database 的 process 未正常關閉.
- Solution:
- Ctrl+Alt+Del 叫出 Task Manager
- 強制關閉 mspdbsrv.exe (Microsoft Program Database)
- Ref: mspdsrv living forever
2018年7月18日 星期三
[Shell] Bash 攻略
| 分類 | 指令 | 用途 |
|---|---|---|
| 移動 | Ctrl-A | 移到最前面 |
| Ctrl-a | 移到最前面 | |
| Ctrl-e | 移到最後面 | |
| Ctrl-u | 清除游標前指令 | |
| Ctrl-k | 清除游標後指令 | |
| 螢幕操作 | Ctrl-l | 清除畫面 |
| 常用指令 | history | 顯示歷史操作, !num可執行該行指令 |
| df -h | 顯示空間容量 | |
| ln -s fileName linkName | 建立 symoblic link to fileName | |
| wc -l | word count | |
| uname -a | show kernel info |
2018年7月7日 星期六
[Software Engineering] use CMake to add version
- Problem: 如何在軟體中加入版號?
- How:
- 工具: CMake (跨平台的 configuration tool, 可建立各平台的 build solution/project file)
- 流程:
- 在 project setting 檔案 (CMakeLists.txt) 內加入版號
set (APP_VERSION_MAJOR 1) set (APP_VERSION_MINOR 0)
// the configured options and settings for App #define APP_VERSION_MAJOR @APP_VERSION_MAJOR@ #define APP_VERSION_MINOR @APP_VERSION_MAJOR@
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
))
- CMakeLists.txt 中加入 target property VERSION 與 SONAME
set(APP_VERSION_STRING ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH})
set_target_properties(App PROPERTIES
VERSION ${APP_VERSION_STRING}
SOVERSION ${APP_VERSION_MAJOR}
)
2018年7月5日 星期四
[DRM] Content protection
- Terminology
- EME (Encrypted Media Extensions)
- 定義 API - 針對加密資料做 playback control 的 APIs
- encryption information
- DASH
- mp4 - cenc
- 若 mp4檔案有用 DRM system 加解密的話, 在 pssh box(atom) 內會有 DRM系統的 SystemID
- SystemID (UUID) list
- Ref:
[Codec] Video Codec container format
- reference: http://l.web.umkc.edu/lizhu/teaching/2016sp.video-communication/ref/mp4.pdf
- box: object orientied
- Boxes start with a header which gives both size and type (16/32 bits)
- syntax description language (SDL)
- extract ES
- YAMB
- FFMPEG
ffmpeg -i input.mp4 -vcodec copy -vbsf h264_mp4toannexb output.h264
- Tools
- MP4Box
- mp4box -raw input.mp4
- tutorial
- MediaInfo
- Intel Video Analyzer
- Reference
- H.264流媒体协议格式中的Annex B格式和AVCC格式深度解析
- 網路抽象層
- Elementary Stream
- ISO-BMFF standard
- MSE segment formats: https://www.w3.org/TR/mse-byte-stream-format-isobmff/
- Awesome broadcasting
- ISO BMFF wiki
訂閱:
文章 (Atom)