2010/08/22
Vim plugin - Doxygen
# 1. DoxygenToolkit.vim
let g:doxygenToolkit_authorName="your name"
Usages:
:Dox
:DoxAuthor
:DoxBlock
:DoxUndoc(DEBUG)
:DoxLic
# 2. Doxygen.vim
cd ~/.vim/after/syntax;
ln -s doxygen.vim c.vim;
ln -s doxygen.vim cpp.vim;
ln -s doxygen.vim java.vim;
let g:doxygenToolkit_authorName="your name"
Usages:
:Dox
:DoxAuthor
:DoxBlock
:DoxUndoc(DEBUG)
:DoxLic
# 2. Doxygen.vim
cd ~/.vim/after/syntax;
ln -s doxygen.vim c.vim;
ln -s doxygen.vim cpp.vim;
ln -s doxygen.vim java.vim;
2010/08/10
vimgrep
:vimgrep /pattern/[g][j] file1 file2 ... fileN
vimgrep is using to search pattern from following filelist.
vimgrep accept to ignore case,
If want to using this feature, put /\c in the pattern to ignore case.
ex: vimgrep /pattern\c/ filename
or put /\C in the pattern to match it.
ex: vimgrep /PaTtErn\c/ filename
Without flag 'j', vim jumps to the first match.
With flag 'j', vim only quickfix list is updated.
You can using :clist to list all match location.
and using :cc N to jump to the match.
:cn can jump to the next match location.
:cN can jump back prior match.
more usage, please using :help vimgrep
2010/07/19
vim 一次註解多行
使用VIM時, 註解多行的方式如下:
1. 進入 command mode ,
2. 按ctrl-V, 然後圈選要註解的區塊
3. 按 I 進入 Insert mode
4. 鍵入註解符號或要輸入的內容
5. 按 ESC 兩次, 就可以看到輸入的註解已經套用在所選擇的那幾行
note: 步驟三的 I 可以替換成 A, 這樣就會變成在行尾註解
在C/C++ 註解多行其實可以透過下面的方式簡單完成,
但 VIM 的多行註解則適用於各式語言喔!
#if 0
... 要註解的部份
#endif
vim 加密功能
Command Line 底下執行 VIM 時, 加上 -X 即可開啟檔案加密模式.
# vim -X [檔名]
這樣 vim 在開啟檔案時會要求使用者輸入密碼, 若原本沒有密碼, 則會要求建立密碼.
若密碼輸入錯誤, 同樣可以開啟檔案, 不過內容會呈現亂碼.
加密功能亦可以在編輯檔案時, 透過 :x 指令來加密.
不過要注意檔案在編輯時, vim 自動產生的 swap 檔案是沒有加密的,
因此在編輯檔案時可以考慮將 swap 功能關閉.
使用方法如下:
#vim -X 檔名 -n
或是檔案編輯中使用 :set noswf即可.
# vim -X [檔名]
這樣 vim 在開啟檔案時會要求使用者輸入密碼, 若原本沒有密碼, 則會要求建立密碼.
若密碼輸入錯誤, 同樣可以開啟檔案, 不過內容會呈現亂碼.
加密功能亦可以在編輯檔案時, 透過 :x 指令來加密.
不過要注意檔案在編輯時, vim 自動產生的 swap 檔案是沒有加密的,
因此在編輯檔案時可以考慮將 swap 功能關閉.
使用方法如下:
#vim -X 檔名 -n
或是檔案編輯中使用 :set noswf即可.
2010/03/29
Apple release Mac OS X 10.6.3 with QuickTime X, OpenGL improvements
昨天蘋果釋出 Mac OS 10.6.3 更新雪豹作業系統,
主要改進了QuickTime X 和 OpenGL-base應用程式定址相容性問題.
蘋果建議使用Snow Leopard 的使用者 update 到 10.6.3 版,
這次的更新共佔 437.2 MB的空間.
概略更新的項目如下:
- Improves the reliability and compatibility of QuickTime X
- Addresses compatibility issues with OpenGL-based applications
- Addresses an issue that causes background message colors to display incorrectly in Mail
- Resolves an issue that prevented files with the # or & characters in their names from opening in Rosetta applications
- Resolves an issue that prevented files from copying to Windows file servers
- Improves performance of Logic Pro 9 and Main Stage 2 when running in 64-bit mode
- Improves sleep and wake reliability when using Bonjour wake on demand
- Addresses a color issue in iMovie with HD content
- Improves printing reliability
- Resolves issues with recurring events in iCal when connected to an Exchange server
- Improves the reliability of 3rd party USB input devices
- Fix glowing, stuck, or dark pixels when viewing video from the iMac (Late 2009) built-in iSight camera
2010/03/26
Transport Stream Format.
簡介:
Transport Stream (傳輸串流) 簡稱 TS, 主要根據 ITU-T Rec. H.262 | ISO/IEC 13818-2 and ISO/IEC 13818-3制定而成.
Transport Stream 包含了一個或以上的 Program (節目),
Program 由 Video , Audio 和節目資訊(PSI) 組成,
而 Video 和 Audio 的 Elementary Stream 將被拆解裝載到 PES Packets.
而 PSI 則分為四種如下所列:
- Program Association Table
- Program Map Table
- Conditional Access Table
- Network Information Table
TS 結構分析 :
TS 的長度是固定的, 每個 TS Packet 都是 188 Bytes.
而前四個 Bytes 為同步字元(0x47),
之後則為 PID 等資訊,
解碼時, Client 端裝置會先根據 PID 找到 PAT 表,
在透過 PAT 表內提供的 PMT 之 PID 來找到PMT 所在的位置,
最後再從 PMT 中找到相對應的資料串流, 開始解碼.
因此 , PAT 和 PMT 表是一定必須要提供的部份!
- table_id : 8 bit, PAT table ID 固定為 0x00
- section_syntax_indicator : 1 bit,
- '0' : 1 bit
- reserved : 2 bits
- section_length : 12 bits, ( 0xB000 | PAT HeaderLength )
- transport_stream_id : 16 bits
- reserved : 2 bits
- version_number : 5 bits
- current_next_indicator : 1 bit.
- section_number : 8 bits,
- last_section_number : 8 bits,
- program_number : 16 bits, 與 PMT 表中 program_number 對應
- reserved : 3 bits
- network_PID or program_map_PID : 當 program_number == 0 為 networks PID, 反之為 program PID.
- CRC_32
PMT 結構:
- table_id : 8 bit, PMT table ID 固定為 0x02
- section_syntax_indicator : 1 bit,
- '0' : 1 bit
- reserved : 2 bits
- section_length : 12 bits, ( 0xB000 | PMT HeaderLength )
- program_number : 16 bits, (和 PAT 表中的 Program_number 對應)
- reserved : 2 bits,
- version_number : 5 bitts,
- current_next_indicator : 1 bit.
- section_number : 8 bits,
- last_section_number : 8 bits,
- reserved : 3 bits,
- PCR_PID : 13 bits,
- reserved : 4 bits,
- program_info_length : 12 bits,
- stream_type : 8 bits, (MPEG4 : 0x10, H.264 : 0x1B , etc ...)
- reserved : 3 bits,
- elementary_PID : 13 bits,
- reserved : 4 bits
- ES_info_length : 12 bits,
- CRC32 : 32 bits
2010/03/25
Standard I/O Redirection
Linux 提供三種 I/O Streams 給程式使用
STDIN (0) : default is keyboard.
STDOUT (1) : default is terminal.
STDERR (2) : default is terminal.
而 STDOUT 和 STDERR 可以被重新導向至檔案 ( I/O Redirection ), 作法如下:
$ binary > (將 STDOUT 重新導向)
$ binary 2> (將 STDERR 重新導向)
$ binary &> (將所有輸出重新導向)
$ binary 2>&1 (將 STDERR 重新導向至 STDOUT)
$ binary >&2 (將STDOUT 重新導向至 STDERR)
使用 > 輸出導向的檔案預設會被完全覆蓋, 也可改用 >> 來添加在原檔案的結尾
而關閉 File Description 的方式則如下:
$ n<&- (關閉 Input File Description n)
$ 0<&- , $ <&- (關閉 STDIN)
$ m>&- (關閉 Output File Description m)
$ 1>&- , $ >&- (關閉 STDOUT)reference : http://tldp.org/LDP/abs/html/io-redirection.html
訂閱:
文章 (Atom)