read
2011年6月27日 星期一
2011年4月25日 星期一
2011年4月20日 星期三
vim function already exists
現在設定vim當修改了_vimrc(或.vimrc)後,會重新load新的vim設定。
在設定完後,會出現一個錯誤訊息,
vim function already exists
是說自定的function又被重覆定義了一次~
這個時候只需要在定義的function後面加入一個!
如下:
function! MySys ()
return "linux"
endfunction這樣在reload _vimrc時,就不會出現重覆定義的錯誤訊息了
參考資料:
Suppressing function already exist warnings ?
2011年4月12日 星期二
陣列特有的特性
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[])
{
int a[3][4] = {
{0, 1, 2, 3},
{4, 5, 6, 7},
{8, 9, 10, 11}
};
printf ("%d\n", a[2][1]);
printf ("%d\n", *a[2] + 1);
printf ("%d\n", *(*(a + 2) + 1));
printf ("%d\n", *(*a + 9));
system ("PAUSE");
return 0;
}
參考資料:
(原創) 二維陣列與字串陣列有什麼差異? (C/C++) (C)
(原創) 為什麼將二維陣列傳入函數時,還要傳入column數? (C/C++) (C)
在函數中傳入二維陣列
2011年4月3日 星期日
2011年3月16日 星期三
Findstr
先把註解行拿掉
findstr -v "^#" oemconfig.template
再把空白行拿掉
findstr -v "^#" oemconfig.template | findstr -v "^#"
把結果存到oemconfig_remove_mark.temp
findstr -v "^#" oemconfig.template | findstr -v "^$" > oemconfig_remove_mark.temp
透過FOR把每一行印出來
FOR /F "delims=" %i in (oemconfig_remove_mark.temp) do echo %i
把文件中,若有符合H19_EFI_BOOT_BLOCK_SIGN_CHECK = NO
則把H19_EFI_BOOT_BLOCK_SIGN_CHECK = YES
印出來
findstr -v "^#" oemconfig_remove_mark.temp | findstr "^H19_EFI_BOOT_BLOCK_SIGN_CHECK *= *NO *" > NUL && echo H19_EFI_BOOT_BLOCK_SIGN_CHECK = YES
參考資料:
如何從 SQL 錯誤記錄檔或 DBCC 輸出中掃描出錯誤
FINDSTR進階用法
Batch files - FINDSTR