<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    JUST DO IT ~

    我只想當個程序員

    2013年9月2日

         摘要: 檢查宏定義
    WIN32
    _DEBUG
    _WINDOWS
    _USRDLL  閱讀全文
    posted @ 2017-08-16 10:43 小高 閱讀(402) | 評論 (0)編輯 收藏

    GDB筆記

    概覽

    基礎

    用戶態會話

    調試模式

    • 轉儲文件調試

      瞬間靜態分析,進程死狀態。
      gdb –core=file

    • 交互調試

      1. 調試新進程
        gdb exe
        gdb –args exe [args]

      2. 調試已經運行的進程
        gdb –pid= 進程號

      3. 內核調試

    3種調試已有進程

    gdb exe

    .

    gdb –args exe [args]

    .

    gdb
    file exe
    run [args]

    .

    gdb –args gcc a.c -o a

    命令行參數

    show args

    set args 多次運行設置命令行參數

    環境變量和執行路徑

    path directory

    .

    show paths

    .

    show environment [varname]

    .

    set environment varname[=value] 清除或者設置環境變量

    工作目錄

    繼承進入gdb工作目錄

    改變工作目錄

    cd dirctory

    顯示路徑

    pwd

    輸入輸出

    info terminal
    run > a.txt
    tty /dev/ttyb

    遠程調試可用這些輔助。

    inferior 下層 多個進程調試

    inferior gdb維護的一系列對象,每個inf對應一個調試目標進程。

    info inferior 顯示下層信息
    NULL 程序沒有跑或者已經終止
    clone-inferior -copies 2 復制當前下層2份

    (gdb) info inferiors
    Num Description Executable
    * 1 process 10087 /home/gao/code/a
    (gdb) clone-inferior -copies 2
    Added inferior 2.
    Added inferior 3.
    (gdb) info inferiors
    Num Description Executable
    3 程序沒有跑或者已經終止 /home/gao/code/a
    2 /home/gao/code/a
    * 1 process 10087 /home/gao/code/a
    (gdb)

    切換下程

    inferior 2 切換2這個下程。
    進程號是0,沒開始運行。
    run 運行起來。

    .

    增加一個運行下層

    add-inferior -exec executeable 增加一個運行下層
    比如說調試一個服務端程序,一個客戶端程序。

    remove-inferior n 刪掉一個下層
    detach inferior 繼續運行 quit
    kill inferior 調試進程退了,但是inferior紀錄還在。

    Tab 幫助

    (gdb) remove-
    remove-inferiors remove-symbol-file
    (gdb) remove-
    remove-inferiors remove-symbol-file
    (gdb) remove-

    file 命令

    file a.exe 可自行文件和符號文件是一個文件

    可自行文件和符號文件分開

    exec-file 指定目標文件

    .

    symbol-file 指定符號文件

    run 開始運行
    可以支持 run > >> < 重定向

    set args 清理命令行參數

    附加到進程

    gdb –pid= pid

    attach pid

    終止調試進程

    detach pid 分離進程繼續運行

    .

    quit 進程退出

    .

    q
    ctrl + D

    執行控制

    斷點

    軟件斷點

    break 普通
    tbreak 一次性
    rbreak 正則表達式一批斷點

    • 基于cpu斷點指令,x86 int3機器碼0xcc。
    • 替換斷點位置的指令
    • CPU自執行這里觸發斷點異常。
    • 沒有斷點數量限制。

    硬件斷點

    • 基于cpu調試寄存器,dr0~dr7,數量限制。x86可以設定4個斷點。數量限制。
    • 不修改代碼,在只讀內存上設置斷點。EEPROM上的代碼設置。
    • 有數量限制。

    location

    • linespec

    1. 行號
    2. -/+ 偏移
    3. 文件名 :行號
    4. 函數名
    5. 函數:標號
    6. 文件名:函數
    7. 標號

    • explicit

    1. -source linename
    2. -function function
    3. -label label
    4. -line number

    • address location break * address

    實踐

    file banner
    b main 中斷在main函數
    info funciton useage 顯示useage函數地址
    info *0x88888e4 直接寫地址設定斷點
    info b 顯示所有斷點
    list usage 顯示useage函數
    b line.c:11
    b +2 當前顯示到14行+2行所以設定在17行

    虛擬機設定硬件斷點會失敗.
    (gdb)hbreak hd_ioctl
    (gdb) info b
    物理機可以設定.

    (gdb) hbreak v
    Hardware assisted breakpoint 2 at 0x40053a: v. (2 locations)
    (gdb) info b
    Num Type Disp Enb Address What
    1 breakpoint keep y
    breakpoint already hit 1 time
    1.1 y 0x000000000040054f in main at a.c:10 inf 1
    1.2 y 0x000000000040054f in main at a.c:10 inf 2
    2 hw breakpoint keep y
    2.1 y 0x000000000040053a in v at a.c:4 inf 1
    2.2 y 0x000000000040053a in v at a.c:4 inf 2
    (gdb)

    管理斷點

    info b 顯示斷點
    delete 1 刪除
    disable 1
    enable 1
    delete 刪除所有的斷點
    clear sum 刪除sum函數入口的所有斷點

    擴展斷點

    watchpoint 監視一個表達式,值變化中斷。

    watch a*b+c/d
    watch *( int * )

    watch fd 監控局部變量fd
    c 繼續運行
    info b //
    注意,x86硬件調試,寫操作,執行過這一行,gdb顯示下一行,要看上一行。hw watchpoint,在x86平臺wachtpoint基于硬件實現,其他平臺可能是基于軟件實現。 vc6純軟件執行,執行目標速度低。
    執行位置超過當前區域,無效監視點會被刪除。

    訪問監視點
    rwatch 讀停下來。
    awatch 讀或寫停下來。 awatch fd
    watch -l

    b hd_ioctl thread 1

    info threads 帶* 當前線程

    繁忙函數解決方案

    b hd_ioctl thread 1 if fd > 0

    當斷點,斷了后執行命令
    ()command 12
    ()silent
    ()print “fd is %d\n”,fd
    ()continue
    ()end

    動態ping不修改代碼。

    tracepoint 遠程主機通訊調試,前端stub立刻恢復執行,但會記錄下來。

    catchpoint

    執行控制

    進入子函數內部。單步 step

    匯編 stepi

    stepi 4
    類似nexti

    不要進入子函數

    next

    繼續執行

    continue

    跑起來直到3號斷點命中

    until 3
    跑起來直到3號斷點命中,快捷禁止其他斷點。

    恢復執行直到函數返回。

    finish

    調用函數!

    gdb 杜撰代碼調用函數。
    call sum(1,2) …

    強制返回

    強制main函數 return。
    return 1

    觸發中斷

    異常或斷點進入調試器。
    調試器發起中斷,讓程序中斷下來。ctrl+C,app收到中斷信號,進入調試器。

    符號

    調試器讀區 調試符號。

    二進制-調試符號-源碼

    linux dwarf 存儲調試符號信息。gcc

    readelf -h filename
    里面如果有line location debug標示

    readelf -w 導出調試文件

    gcc -g 才能輸出符號

    ubuntu 符號服務器
    < ddebs.ubuntu.com/pool/main/>
    分離操作
    strip

    安裝ubunte的linux 內核符號
    https://askubuntu.com/questions/197016/how-to-install-a-package-that-contains-ubuntu-kernel-debug-symbols

    安裝libc符號

    dpkg -s /lib/x86_64-linux-gun/libc-2.15.so
    dpkg -s libc.so.6
    sudo apt-get -c aptproxy.conf install libc6-dbg

    libc 調試符號

    sudo apt-get install libc6-dbg

    符號路徑

    gdb 使用file 或 symbol-file 加載符號文件
    自動搜索 path 路徑

    (gdb)i share
    * 共享庫沒調試信息

    搜索符號
    info vaiables regex 類名/函數名/變量名

    內存地址與符號互換

    info addriess 函數名

    info symbol 地址

    (gdb) info address main
    Symbol “main” is a function at address 0x400547.
    (gdb) info symbol 0x400547
    main in section .text of /home/gao/code/a

    .

    info os

    查看加載的文件內存位置

    info files

    列出全局變量

    info variable
    info va

    顯示源碼

    list
    list -
    dir 源碼路徑
    show dir

    常用命令源碼

    安裝系統工具源碼和調試

    apt-get source coreutils
    sudo apt-get install coreutils-dbgsym
    gdb /bin/ls
    list main
    dir ~/src/coreutils-7.4/src
    list main

    libc

    sudo apt-get source libc6-dev
    /home/ge/eglibc-2.15

    dir 搜索路徑 :分割
    $cdir 編譯路徑
    cwd 當前工作路徑

    查看調試目標

    觀察寄存器
    info reg


    子函數返回地址
    函數參數
    局部變量

    bt n 觀察函數返回地址
    frame n 切換棧幀
    up n
    down n
    info frame [address]
    info args
    info locals

    注意,切換棧幀之后可能會發生,本地變量值不準確,因為值存在寄存器中需要小心。

    觀察內存
    print

    p /f 表達式 表達式要打印位置
    xduotcf

    x

    x /Nuf
    N 打印幾個單元
    u 每個單元大小 b-1byte w-2byte h-4byte g-8byte

    f s字符串i指令格式

    x/s 0xfffff81946000 打印字符串

    x /32bx arg bit 16禁制

    (gdb) x /32bx &i
    0x7fffffffc76c: 0x01 0x00 0x00 0x00 0x70 0x05 0x40 0x00
    0x7fffffffc774: 0x00 0x00 0x00 0x00 0x40 0xfa 0xa2 0xf7
    0x7fffffffc77c: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
    0x7fffffffc784: 0xff 0x7f 0x00 0x00 0x58 0xc8 0xff 0xff
    (gdb)

    p arg[0]
    p arg[i]

    p *&a[0]@10 a0數組開始的10個元素

    反匯編

    disas main main反匯編代碼
    x/5i schedule 這個地址開始的5條匯編指令。

    gdb mov 從左往右賦值at&t匯編。

    高級技巧

    信號

    • info signals 異常/同步/中斷

    stop 要不要中斷下來看
    printf 打印信息
    pass 要不要傳遞給應用程序。

    • handle 修改規則 handle signal act print noprint stop nostop pass nopass

    handle SIGPIPE 不要中斷下來,打印一個信息,網絡程序常用

    (gdb) handle SIGPIPE nostop
    Signal Stop Print Pass to program Description
    SIGPIPE No Yes Yes Broken pipe

    Thread

    info threads

    LWP-light weight process 線程編號。
    * gdb當前線程

    切換當前線程

    thread 2

    打印所有線程

    thread apply all bt 針對一群線程的命令避免切換來看。

    線程改名字

    thread name [name]

    我自己經驗 LWP 可以很好的觀察線程負載情況。

    posted @ 2017-05-24 14:18 小高 閱讀(316) | 評論 (0)編輯 收藏
         摘要: 繪圖控件重繪->其他操作->繪圖控件重繪

    進入了這樣一個死循環,函數堆棧空間分配不足夠.  閱讀全文
    posted @ 2017-04-18 10:32 小高 閱讀(169) | 評論 (0)編輯 收藏
    eclipse 配置遇到 object 找不到問題 ?
    The type java.lang.object cannot be resolved - Eclipse buildpath not working

    因為替換了 jvm版本.
    解決辦法: 
    build->library -> add library->add jre library.


    tomcat部署問題.?
    1.清理 部署 重啟.  
    2.先刪掉部署項目,可以重新配置config.

    tomcat 找不到oracle 驅動程序?
    Tomcat error: java.sql.SQLException: No suitable driver found for jdbc
    catalina_home/lib 中已經放入了jar文件后還是報錯.
    請在 context.xml 中配置
     <WatchedResource>WEB-INF/web.xml</WatchedResource>
     <ResourceLink global="jdbc/oracle" name="jdbc/oracle" type="javax.sql.DataSource"/>
     
    在 server.xml

           <Resource
            name="jdbc/oracle"
            auth="Container"
            type="javax.sql.DataSource"
            maxActive="100" maxIdle="30" maxWait="10000"
            driverClassName="oracle.jdbc.OracleDriver"
            url="jdbc:oracle:thin:@10.243.140.111:1521:test"
            username="core"
            password="core"/>

    eclipse 項目屬性, web deployment assembly設置   source: /webcontent   deploypath: / 


        
    tomcat 開啟gzip壓縮
    http://blog.csdn.net/hbcui1984/article/details/5666327



    Setting property 'source' to 'org.eclipse.jst.jee.server 這個不是問題.

    解決Setting property 'source' to 'org.eclipse.jst.jee.server的問題.
    http://blog.csdn.net/foreversilent/article/details/11147847

    posted @ 2017-03-09 10:02 小高 閱讀(194) | 評論 (1)編輯 收藏
         摘要:   閱讀全文
    posted @ 2016-12-15 09:34 小高 閱讀(500) | 評論 (0)編輯 收藏
         摘要: qt ubuntu 安裝和中文  閱讀全文
    posted @ 2016-12-01 16:30 小高 閱讀(342) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2016-05-13 15:59 小高 閱讀(235) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-12-27 17:07 小高 閱讀(492) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-12-15 15:57 小高 閱讀(271) | 評論 (0)編輯 收藏
         摘要: 解決socket 太多問題.  閱讀全文
    posted @ 2015-12-10 10:39 小高 閱讀(322) | 評論 (0)編輯 收藏

    C面向對象編程匯集

    參考資料:
    Object-oriented Programming with ANSI-C
    1993年,第一份c如何編寫OO的資料,free.
    OOC.PDF
    https://www.cs.rit.edu/~ats/books/ooc.pdf

    中文翻譯:
    https://code.google.com/p/ooc/downloads/detail?name=ooc-translate-preview-r26.pdf&can=2&q=

    輕量級的C語言面向對象編程框架
    http://sinojelly.blog.51cto.com/479153/281184

    UML—OOPC嵌入式C語言開發精講
    里面有一套框架可以 c寫OO.
    http://pan.baidu.com/share/link?shareid=3402978666&uk=3188261067&adapt=pc&fr=ftw#path=%252FC%25E8%25AF%25AD%25E8%25A8%2580

    你試過這樣寫C程序嗎 --函數式編程
    < >

    我所偏愛的 C 語言面向對象編程范式--云風
    http://blog.codingnow.com/2010/03/object_oriented_programming_in_c.html

    C語言面向對象編程 -- 6篇專欄
    http://blog.csdn.net/column/details/object-orient-c.html

    posted @ 2015-11-24 23:32 小高 閱讀(418) | 評論 (0)編輯 收藏

    測試代碼的locality。
    數組的讀區方式不同,按照行讀,被cache也是按行連續加載的。
    如果按照列讀區,那么效率很低,除非cache足夠大,而且也要遍歷所有的數據,并且cache hash算法也好,實現的硬件還是多路組相聯的cache硬件實現。

    ** valgrind --tool=cachegrind ./test2**

    code1:

    #include <stdio.h>
    #define MAXROW 8000
    #define MAXCOL 8000
    int main () {
    int i,j;
     static int x[MAXROW][MAXCOL];
     printf ("Starting!\n");
           for (i=0;i<MAXROW;i++)
           for (j=0;j<MAXCOL;j++)
                  x[i][j] = i*j;
                 printf("Completed!\n");
    return 0;                                                    
     }
    

    code2:

    #include <stdio.h>                                                         
     #define MAXROW 8000
     #define MAXCOL 8000
     int main () {
     int i,j;
     static int x[MAXROW][MAXCOL];
     printf ("Starting!\n");
              for (j=0;j<MAXCOL;j++)
                             for (i=0;i<MAXROW;i++)
                     x[i][j] = i*j;
     printf("Completed!\n");
     return 0;
     }
     ```
    
    ##結果
    
    

    Command: ./test1
    Starting!
    Completed!

    I refs: 905,721,688
    I1 misses: 4,177
    LLi misses: 2,808
    I1 miss rate: 0.00%
    LLi miss rate: 0.00%

    D refs: 514,830,867 (386,118,735 rd + 128,712,132 wr)
    D1 misses: 4,025,828 ( 23,565 rd + 4,002,263 wr)
    LLd misses: 4,008,456 ( 6,997 rd + 4,001,459 wr)

    D1 miss rate: 0.8% ( 0.0% + 3.1% )
    LLd miss rate: 0.8% ( 0.0% + 3.1% )

    LL refs: 4,030,005 ( 27,742 rd + 4,002,263 wr)
    LL misses: 4,011,264 ( 9,805 rd + 4,001,459 wr)
    LL miss rate: 0.3% ( 0.0% + 3.1% )

    gcc -o test2 test2.c
    ** valgrind --tool=cachegrind ./test2**

    I refs: 905,720,801
    I1 misses: 4,113
    LLi misses: 2,811
    I1 miss rate: 0.00%
    LLi miss rate: 0.00%

    D refs: 514,830,348 (386,118,427 rd + 128,711,921 wr)
    D1 misses: 64,025,705 ( 23,462 rd + 64,002,243 wr)
    LLd misses: 4,016,427 ( 6,977 rd + 4,009,450 wr)
    D1 miss rate: 12.4% ( 0.0% + 49.7% )
    LLd miss rate: 0.8% ( 0.0% + 3.1% )

    LL refs: 64,029,818 ( 27,575 rd + 64,002,243 wr)
    LL misses: 4,019,238 ( 9,788 rd + 4,009,450 wr)
    LL miss rate: 0.3% ( 0.0% + 3.1% )

    Starting!
    Completed!
    ```

    參考:

    valgrind調試CPU緩存命中率和內存泄漏
    http://laoxu.blog.51cto.com/4120547/1395236

    posted @ 2015-11-15 22:20 小高 閱讀(274) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-09-23 11:26 小高 閱讀(240) | 評論 (0)編輯 收藏
         摘要: <未完成>
    容錯系統的研究.
    豆瓣可以搜索幾本書.  閱讀全文
    posted @ 2015-09-16 14:05 小高 閱讀(242) | 評論 (0)編輯 收藏
         摘要: 未完成.  閱讀全文
    posted @ 2015-08-26 14:49 小高 閱讀(305) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-08-26 14:41 小高 閱讀(317) | 評論 (0)編輯 收藏
         摘要: 待學.  閱讀全文
    posted @ 2015-08-26 13:33 小高 閱讀(316) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-08-26 10:53 小高 閱讀(289) | 評論 (0)編輯 收藏
         摘要: wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
    echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.bashrc
    . $HOME/.bashrc   閱讀全文
    posted @ 2015-08-25 16:26 小高 閱讀(1805) | 評論 (0)編輯 收藏
         摘要: 未完成.  閱讀全文
    posted @ 2015-08-25 15:38 小高 閱讀(246) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-08-25 13:42 小高 閱讀(828) | 評論 (0)編輯 收藏
         摘要: typedef struct AA
    {
    AA * ptr;
    }AA ;  閱讀全文
    posted @ 2015-08-24 13:57 小高 閱讀(4592) | 評論 (0)編輯 收藏
         摘要: sysctl.conf  閱讀全文
    posted @ 2015-08-20 18:24 小高 閱讀(334) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-08-13 10:10 小高 閱讀(222) | 評論 (0)編輯 收藏
         摘要: 未完成.  閱讀全文
    posted @ 2015-08-02 12:12 小高 閱讀(222) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-28 16:51 小高 閱讀(247) | 評論 (0)編輯 收藏
         摘要: EXEC sp_configure 'remote query timeout', 0 ;
    GO
    RECONFIGURE ;
    GO  閱讀全文
    posted @ 2015-07-28 13:54 小高 閱讀(267) | 評論 (0)編輯 收藏
         摘要: ldd -r aa.so   閱讀全文
    posted @ 2015-07-26 18:08 小高 閱讀(421) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-23 22:18 小高 閱讀(300) | 評論 (0)編輯 收藏
         摘要: 未完成.  閱讀全文
    posted @ 2015-07-21 13:20 小高 閱讀(234) | 評論 (0)編輯 收藏
         摘要: 1. 用戶提交
    2. 有1/3重做日志緩沖區未被寫入磁盤
    3. 有大于1M的重做日志緩沖區未被寫入磁盤
    4. 每隔3 秒鐘
    5. DBWR 需要寫入的數據的SCN大于LGWR記錄的SCN,DBWR 觸發LGWR寫入。   閱讀全文
    posted @ 2015-07-20 16:24 小高 閱讀(834) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-19 23:11 小高 閱讀(499) | 評論 (0)編輯 收藏
         摘要: 待完成.  閱讀全文
    posted @ 2015-07-19 23:00 小高 閱讀(360) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-19 22:40 小高 閱讀(486) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-19 16:26 小高 閱讀(253) | 評論 (0)編輯 收藏
         摘要: time dd if=/dev/zero bs=1024 count=1000000 of=./1Gb.file
    dd if=./1Gb.file bs=64k |dd of=/dev/null
    dd if=./1Gb.file bs=1MB |dd of=/dev/null  閱讀全文
    posted @ 2015-07-19 12:12 小高 閱讀(512) | 評論 (0)編輯 收藏
         摘要: mac為什么主機名.local
    搞不清楚為什么.也許區分本地網絡,進程間通訊優化? 為了程序方便 /ect/hosts 添加127.0.0.1 指向主機名.
    sudo vim /etc/hosts   閱讀全文
    posted @ 2015-07-19 10:59 小高 閱讀(915) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-17 23:12 小高 閱讀(2253) | 評論 (0)編輯 收藏
         摘要: 未完成.  閱讀全文
    posted @ 2015-07-17 21:34 小高 閱讀(280) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-12 10:49 小高 閱讀(208) | 評論 (0)編輯 收藏
         摘要: 待完成.  閱讀全文
    posted @ 2015-07-12 09:27 小高 閱讀(340) | 評論 (0)編輯 收藏
         摘要: 待完成.  閱讀全文
    posted @ 2015-07-12 00:32 小高 閱讀(203) | 評論 (0)編輯 收藏
         摘要: 待完成.  閱讀全文
    posted @ 2015-07-12 00:27 小高 閱讀(347) | 評論 (0)編輯 收藏
         摘要: 待完成  閱讀全文
    posted @ 2015-07-12 00:17 小高 閱讀(330) | 評論 (0)編輯 收藏
         摘要: 待完成.  閱讀全文
    posted @ 2015-07-12 00:13 小高 閱讀(204) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-10 16:45 小高 閱讀(326) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-10 15:39 小高 閱讀(218) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-07 09:53 小高 閱讀(1004) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 15:20 小高 閱讀(214) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 15:13 小高 閱讀(303) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 15:08 小高 閱讀(253) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 14:39 小高 閱讀(218) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 14:39 小高 閱讀(165) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 14:36 小高 閱讀(269) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-07-06 14:09 小高 閱讀(489) | 評論 (0)編輯 收藏
         摘要: #ifdef WIN32
    WSADATA wsa_data;
    WSAStartup(0x0201, &wsa_data);
    #endif  閱讀全文
    posted @ 2015-07-06 12:33 小高 閱讀(883) | 評論 (0)編輯 收藏
         摘要: 待填坑.  閱讀全文
    posted @ 2015-07-01 13:52 小高 閱讀(284) | 評論 (0)編輯 收藏
         摘要: 在windows上編譯openssl 和 libevent.
    libevent-2.0.22-stable
    openssl-1.0.2c   閱讀全文
    posted @ 2015-07-01 10:36 小高 閱讀(2589) | 評論 (0)編輯 收藏
    libevent windows構建
    warning LNK4098: 默認庫“LIBCMT”與其他庫的使用沖突
    問題原因:
    exe 是debug版本.
    靜態庫是release版本.
    編譯libevent 
    C:\dev\mylibevent\libevent-2.0.22-stable>nmake /f Makefile.nmake

    原來的修改 relase 版本多線程靜態庫  CFLAGS=    /MT

    編譯的時候需要配置合適的線程庫 

    拷貝出一個Makefile_D.nmake  多線程debug靜態庫
    CFLAGS= ....    /MTd

    工程中鏈接對應的版本的lib文件.

    參考: 

    https://msdn.microsoft.com/zh-cn/library/vstudio/abx4dbyh(v=vs.110).aspx

    http://www.cnblogs.com/luxiaoxun/p/3603399.html
    http://zyan.cc/libevent_windows/

    posted @ 2015-06-30 11:21 小高 閱讀(508) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-30 10:05 小高 閱讀(281) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-29 14:48 小高 閱讀(255) | 評論 (0)編輯 收藏
         摘要: 高性能Linux服務器構建實戰:運維監控、性能調優與集群應用

    構建高可用Linux服務器 2  閱讀全文
    posted @ 2015-06-28 20:37 小高 閱讀(239) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-23 14:42 小高 閱讀(225) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-23 14:39 小高 閱讀(397) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-22 22:23 小高 閱讀(293) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-22 21:21 小高 閱讀(328) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-22 15:21 小高 閱讀(312) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-21 14:28 小高 閱讀(236) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-21 12:15 小高 閱讀(219) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-21 11:54 小高 閱讀(253) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-19 18:03 小高 閱讀(275) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-18 10:28 小高 閱讀(559) | 評論 (0)編輯 收藏
         摘要: 1.網絡io文件大小未定,作為類庫的設計者.
    小文件太多,不好.IO性能差.
    單個文件太大,如果都用memorybuffer,內存占用會非常的大.
    設計者考慮2邊的靈活性.  閱讀全文
    posted @ 2015-06-17 21:12 小高 閱讀(295) | 評論 (0)編輯 收藏
         摘要: 8.8.8.8
    114.114.114.114
    223.5.5.5
    223.6.6.6  閱讀全文
    posted @ 2015-06-16 17:00 小高 閱讀(244) | 評論 (0)編輯 收藏
         摘要: xee下載地址
    https://code.google.com/p/xee/downloads/detail?name=Xee2.2.zip&can=1&q=
    自己開了一個分支
    https://github.com/gddg/xee   閱讀全文
    posted @ 2015-06-16 16:34 小高 閱讀(1035) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-06-08 14:41 小高 閱讀(303) | 評論 (0)編輯 收藏
         摘要: 0.1000M 網絡.
    1.8口交換機
    2.支持vlan
    3.支持Qos
    4.支持端口聚合.
    Cisco SG200-08
    5.POE 通過網線供電給USB CAM 功能.
      閱讀全文
    posted @ 2015-06-06 16:54 小高 閱讀(313) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-29 18:16 小高 閱讀(224) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-29 18:04 小高 閱讀(218) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-20 17:21 小高 閱讀(294) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-19 22:57 小高 閱讀(313) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-15 15:51 小高 閱讀(220) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-11 14:51 小高 閱讀(253) | 評論 (0)編輯 收藏
    Error running 'requirements_debian_libs_install gawk libreadline6-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool',
    showing last 15 lines of /home/gao/.rvm/log/1431136216_ruby-2.2.2/package_install_gawk_libreadline6-dev_libssl-dev_libyaml-dev_libsqlite3-dev_sqlite3_autoconf_libgdbm-dev_libncurses5-dev_automake_libtool.log
    sudo:/var/lib/sudo 對非所有者可寫(040777),模式應該為 0700
    對不起,請重試。
    正在讀取軟件包列表...
    正在分析軟件包的依賴關系樹...
    正在讀取狀態信息...
    有一些軟件包無法被安裝。如果您用的是 unstable 發行版,這也許是
    因為系統無法達到您要求的狀態造成的。該版本中可能會有一些您需要的軟件
    包尚未被創建或是它們已被從新到(Incoming)目錄移出。
    下列信息可能會對解決問題有所幫助:
    下列軟件包有未滿足的依賴關系:
     libssl-dev : 依賴: libssl1.0.0 (= 1.0.1f-1ubuntu2) 但是 1.0.1f-1ubuntu2.4 正要被安裝
    E: 無法修正錯誤,因為您要求某些軟件包保持現狀,就是它們破壞了軟件包間的依賴關系。
    ++ return 100
    ++ return 100

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    解決辦法? 
    posted @ 2015-05-09 09:53 小高 閱讀(2292) | 評論 (0)編輯 收藏

    Jumping Into C++ 完整英文版 
    http://vdisk.weibo.com/s/lFnhClqHrmi
    posted @ 2015-05-08 16:34 小高 閱讀(242) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-08 10:47 小高 閱讀(217) | 評論 (0)編輯 收藏
         摘要: http://askubuntu.com/questions/50704/sudo-error-is-mode-0777-should-be-0440
      閱讀全文
    posted @ 2015-05-07 22:48 小高 閱讀(1411) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-07 22:35 小高 閱讀(923) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-07 14:03 小高 閱讀(226) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-07 14:01 小高 閱讀(239) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-07 10:59 小高 閱讀(386) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-06 07:50 小高 閱讀(217) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-02 08:59 小高 閱讀(251) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-01 22:43 小高 閱讀(375) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-05-01 13:34 小高 閱讀(981) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-28 13:27 小高 閱讀(202) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-23 07:11 小高 閱讀(689) | 評論 (0)編輯 收藏
         摘要: iconv -f gb2312 -t utf-8 20150422_0.log >>a.log  閱讀全文
    posted @ 2015-04-23 07:10 小高 閱讀(259) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-20 18:00 小高 閱讀(200) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-20 14:15 小高 閱讀(387) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-15 16:17 小高 閱讀(256) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-15 14:55 小高 閱讀(301) | 評論 (0)編輯 收藏
         摘要: echo "IRB.conf[:PROMPT_MODE] = :DEFAULT" > ~/.irbrc

    echo "IRB.conf[:PROMPT_MODE] = :SIMPLE" > ~/.irbrc  閱讀全文
    posted @ 2015-04-13 21:03 小高 閱讀(181) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-12 21:58 小高 閱讀(184) | 評論 (0)編輯 收藏
         摘要: 非常喜歡的一篇文章.介紹了execption c# 設計思路.  閱讀全文
    posted @ 2015-04-12 11:38 小高 閱讀(232) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-11 22:46 小高 閱讀(2373) | 評論 (0)編輯 收藏
         摘要: vim ~/.bash_profile
    alias ls='ls -F'
    alias cls='clear'
    alias grep='grep --color=auto'
    CLICOLOR="xterm-color"
    LSCOLORS="gxfxcxdxcxegedabagacad"
    export CLICOLOR LsCOLORS  閱讀全文
    posted @ 2015-04-11 22:28 小高 閱讀(281) | 評論 (0)編輯 收藏
         摘要: 這個終端主題顏色配置很舒服.各種軟件對應的主題都有.

    http://ethanschoonover.com/solarized/files/solarized.zip  閱讀全文
    posted @ 2015-04-11 20:52 小高 閱讀(618) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-11 15:30 小高 閱讀(188) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-11 12:02 小高 閱讀(238) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-10 18:25 小高 閱讀(206) | 評論 (0)編輯 收藏
         摘要: 技術樹概覽

    http://html5ify.com/fks/#index_內容貢獻者

    前端文摘:Web 開發模式演變歷史和趨勢
    http://www.cnblogs.com/lhb25/p/web-development-mode-evolve.html

    A brief history of web design for designers
    http://blog.froont.com/brief-history-of-web-design-for-designers/  閱讀全文
    posted @ 2015-04-10 14:48 小高 閱讀(230) | 評論 (0)編輯 收藏
         摘要: http://tonybai.com/2010/12/14/create-libraries-with-libtool/

    使用 GNU Libtool 創建庫
    https://www.ibm.com/developerworks/cn/aix/library/1007_wuxh_libtool/  閱讀全文
    posted @ 2015-04-10 14:19 小高 閱讀(258) | 評論 (0)編輯 收藏
         摘要: Git Community Book 中文版
    http://gitbook.liuhui998.com/1_1.html

    臺灣ihower寫的
    https://ihower.tw/git/  閱讀全文
    posted @ 2015-04-09 21:36 小高 閱讀(230) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-04-09 17:46 小高 閱讀(260) | 評論 (0)編輯 收藏
         摘要: 七周七并發模型  閱讀全文
    posted @ 2015-04-09 17:41 小高 閱讀(211) | 評論 (0)編輯 收藏
         摘要: Ruby on Rails 實戰聖經
    https://ihower.tw/rails4/

    笨方法學 Ruby
    http://lrthw.github.io/  閱讀全文
    posted @ 2015-04-09 10:14 小高 閱讀(238) | 評論 (0)編輯 收藏
         摘要: brew install coreutils
    gun tools 替換掉osx
    PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
    MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"  閱讀全文
    posted @ 2015-04-04 17:33 小高 閱讀(445) | 評論 (0)編輯 收藏
         摘要: 下載key替換工具 karabiner
    control_L to command_L
    option_R to delete
    FN 鍵盤+F1 F2 如果你想替換成直接按F1就調用的話,可以macosx 鍵盤里面找到。發現FN鍵盤無法移到別的鍵上。
    目前還沒看出來mac上option,control 鍵的原生用途。
    鍵程和windows很不一樣。  閱讀全文
    posted @ 2015-04-04 11:24 小高 閱讀(618) | 評論 (0)編輯 收藏
         摘要: brew install libtool
    brew install autoconf
    brew install automake
    glibtool --help
    sh autogen.sh
    ./configure
    make
    make check  閱讀全文
    posted @ 2015-03-26 20:35 小高 閱讀(1712) | 評論 (0)編輯 收藏
         摘要: cobertura   閱讀全文
    posted @ 2015-03-26 10:27 小高 閱讀(1443) | 評論 (0)編輯 收藏
         摘要: Docroot is: /usr/local/var/www
    /usr/local/etc/nginx/nginx.conf to 8080
    ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
    nginx  閱讀全文
    posted @ 2015-03-22 22:09 小高 閱讀(228) | 評論 (0)編輯 收藏
         摘要: brew install ??   閱讀全文
    posted @ 2015-03-22 21:55 小高 閱讀(203) | 評論 (0)編輯 收藏
         摘要: chmod -R 777 /usr/local/
    GMac:~ XXXX$ brew install cmake  閱讀全文
    posted @ 2015-03-22 11:36 小高 閱讀(5407) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-22 10:21 小高 閱讀(231) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-21 23:16 小高 閱讀(416) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-21 23:11 小高 閱讀(286) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-21 23:07 小高 閱讀(441) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-21 22:22 小高 閱讀(410) | 評論 (0)編輯 收藏
         摘要: pmset -g
    sudo pmset -a hibernatemode 3  閱讀全文
    posted @ 2015-03-21 22:18 小高 閱讀(436) | 評論 (0)編輯 收藏
         摘要: Go to System Preferences -> Keyboard -> Keyboard tab -> Modifier keys
    Swap the Control and Cmd keys  閱讀全文
    posted @ 2015-03-21 21:58 小高 閱讀(432) | 評論 (0)編輯 收藏
         摘要: 目前知名的mq :
    zeromq -- c++ 實現
    ActiveMQ
    JMS -- java的消息服務,j2ee 各家實現不同
    MS Queue --
    RabbitMQ
    nanomsg
    lightq  閱讀全文
    posted @ 2015-03-20 23:02 小高 閱讀(746) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-20 09:39 小高 閱讀(1922) | 評論 (0)編輯 收藏
         摘要: Sublime Text 2
    安裝插件:
    https://gitcafe.com/ghosTM55/sublime-config  閱讀全文
    posted @ 2015-03-19 16:41 小高 閱讀(193) | 評論 (0)編輯 收藏

    1.vc  編譯

    V52$HM2(%G~9EQ7}NBWF%[5

    頭文件

    #include <omp.h

    omp_set_num_threads(threadNumber);
    #pragma omp parallel default(shared) private(i,riskId) 
        {
    #pragma  omp for   

    }

    }

     

    GCC配置

    1. 編譯

    -fopenmp
    設定線程數量 export OMP_NUM_THREADS=6
     
     
     
    參考

    通過 GCC 學習 OpenMP 框架

    http://www.ibm.com/developerworks/cn/aix/library/au-aix-openmp-framework/
     
    posted @ 2015-03-19 16:31 小高 閱讀(329) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-18 17:18 小高 閱讀(193) | 評論 (0)編輯 收藏
         摘要: SQLnet.ora
    DIAG_ADR_ENABLED=OFF
    DIAG_SIGHANDLER_ENABLED=FALSE
    DIAG_DDE_ENABLED=FALSE
      閱讀全文
    posted @ 2015-03-18 17:16 小高 閱讀(567) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-16 18:37 小高 閱讀(179) | 評論 (0)編輯 收藏
         摘要: 總結一些看法  閱讀全文
    posted @ 2015-03-15 13:07 小高 閱讀(264) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-03-12 14:07 小高 閱讀(281) | 評論 (0)編輯 收藏
         摘要: 待總結  閱讀全文
    posted @ 2015-03-12 13:55 小高 閱讀(206) | 評論 (0)編輯 收藏
         摘要: 1.ms sql 的配置

    安裝了 sql- server2005 express ,安裝默認會關閉網絡連接的等.需要打開ip:1433端口.

    賬戶密碼需要使用,ms sql–server 登錄登錄.

    2.sqlapi 的使用.

    正確的sqlapi ++ ms sql server 串
    char * dbname = "127.0.0.1\\SQL2005EXPRESS@master";
      閱讀全文
    posted @ 2015-03-10 17:19 小高 閱讀(1109) | 評論 (0)編輯 收藏
         摘要: typedef unsigned short WORD;
    #define WORD unsigned short
    沖突
    解決辦法:
    1.因為2個頭文件來自不同項目. 修改源文件徹底解決掉這個問題.
    2.先后引用位置 .
    3.隱藏不必要的 .h文件,只有需要cpp才添加h引用.這樣防止不必要的引用.  閱讀全文
    posted @ 2015-02-26 18:20 小高 閱讀(2258) | 評論 (0)編輯 收藏
    代碼分支預判斷
    http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array
    給出了2段代碼c和java:
    1.隨機數插入數組中。
    2.sum統計相加 。

    c 結果不sort 需要21秒,排序后7秒。
    java  5秒。
    問題在哪里? 



    分支預測資料: 

    Hidden Features and Dark Corners of C++/STL 

    http://comp.lang.cpp.moderated.narkive.com/oZn86c9y/hidden-features-and-dark-corners-of-c-stl
    http://en.wikipedia.org/wiki/Branch_predictor

    http://zh.wikipedia.org/wiki/%E5%88%86%E6%94%AF%E9%A0%90%E6%B8%AC%E5%99%A8

     



    posted @ 2015-02-24 21:13 小高 閱讀(207) | 評論 (0)編輯 收藏
         摘要: 關閉oracle api 異常偵測 sqlnet.ora

    DIAG_ADR_ENABLED=FALSE
    DIAG_DDE_ENABLED=FALSE
    DIAG_SIGHANDLER_ENABLED=FALSE
    DIAG_RESTRICTED=FALSE
      閱讀全文
    posted @ 2015-02-05 16:28 小高 閱讀(498) | 評論 (0)編輯 收藏

    打開root 用戶 

    http://www.macx.cn/thread-2051799-1-1.html  
    http://support.apple.com/zh-cn/HT1528

    太難找了,竟然在菜單里,打開root 。 

    su root 
    whoami

    sudo su
    密碼不對

    Mac OS X:sudo 命令需要非空的管理員密碼





    posted @ 2015-01-31 13:14 小高 閱讀(270) | 評論 (1)編輯 收藏
    c# oledb odbc  foxpro driver win 64 驅動不兼容. 
    解決辦法:
    c#工程里面選擇 x86. 
    安裝foxpro odbc驅動.  
    posted @ 2015-01-30 14:37 小高 閱讀(213) | 評論 (0)編輯 收藏

    Intellij IDEA和Android Studio默認使用JDK6,所以你有如下選擇:

    1,安裝JDK6

    2,安裝其他版本的JDK,然后修改IDE的指向。

    如果選擇2,那么修改方式為:

    打開應用的.app包,然后在Contents這個目錄下,有個文件info.plist,修改JVMVersion這個key對應的value,從1.6*修改為你安裝的版本即可。


    1 用文本編輯器打開
    /Applications/IntelliJ IDEA 13.app/Contents/Info.plist

    2 搜索JVMVersion,將其值改為1.7*

    3 再次運行應用即可看到應用成功運行

    from :
    http://www.zhihu.com/question/26086376


    posted @ 2015-01-29 23:02 小高 閱讀(451) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-01-05 10:43 小高 閱讀(191) | 評論 (0)編輯 收藏
         摘要: 分析表空間
    execute dbms_stats.gather_schema_stats('CORE');   閱讀全文
    posted @ 2015-01-04 18:03 小高 閱讀(249) | 評論 (0)編輯 收藏
         摘要: 1.種方法
    #define WIN32_LEAN_AND_MEAN
    放在windows.h 之前.

    2. 先引入socket2.h文件.

    3. 項目 -> 屬性 -> C/C++ -> 預處理器 -> 預處理器定義
    在其中添加 : WIN32_LEAN_AND_MEAN  閱讀全文
    posted @ 2015-01-04 15:16 小高 閱讀(910) | 評論 (0)編輯 收藏
         摘要:   閱讀全文
    posted @ 2015-01-01 21:08 小高 閱讀(531) | 評論 (0)編輯 收藏
         摘要: 中間件  閱讀全文
    posted @ 2015-01-01 17:31 小高 閱讀(255) | 評論 (0)編輯 收藏

    linux DNS 設置 

    sudo vim /etc/resolv.conf

    http://www.alidns.com/setup/#linux

    wget http://www.alidns.com/static/soft/SetAliDNS.sh -O SetAliDNS.sh && chmod +x SetAliDNS.sh && sudo ./SetAliDNS.sh

    卸載

    sudo ./SetAliDNS.sh restore



    鍵盤修改 

    xmodmap -e  "keycode 105=Delete"



    posted @ 2015-01-01 13:39 小高 閱讀(180) | 評論 (0)編輯 收藏

     

     

    API對設計流程的影響——Joshua Bloch訪談

    http://blog.sina.com.cn/s/blog_6310e0b20100o7cv.html 

     

    工程師Joshua Bloch談如何設計一款優秀的API【附PPT】

    http://www.csdn.net/article/2014-02-18/2818441-How-to-design-a-good-API

     
    《Effective Java》: Joshua Bloch訪談

    http://eastsun.iteye.com/blog/195861

    posted @ 2014-12-19 13:23 小高 閱讀(216) | 評論 (0)編輯 收藏

     

    The Java? Tutorials

    http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html

     

    1.5

    New Features and Enhancements J2SE 5.0

    http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html

    Experiences with the New Java 5 Language Features

    Pages: 1, 2, 3, 4

     

    1.6

    Highlights of Technology Changes in Java SE 6

    http://www.oracle.com/technetwork/java/javase/features-141434.html

     

    1.7

    Highlights of Technology Changes in Java SE 7

    http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html

     

    http://www.javacodegeeks.com/2014/05/java-8-features-tutorial.html

    posted @ 2014-12-17 17:19 小高 閱讀(247) | 評論 (0)編輯 收藏

    學習步驟
    1.c 
    2.c object 
    3. stl
    4. linux os api
    5. socket  
    6. 分布式
    7. web html5 
    8. mac UI  
    9. obj c
    10.算法。


    一些想法:
    微博上關注的人很多淘寶系的很多都不搞技術了,原因是阿里上市了,足夠的錢退休了,還有些人離職去創業了,
    可能氛圍比較好,看來創業的都有滋有味。大規模的系統搞過了,心里有底氣了,知道方向,估計成功率也會比較高。
    一些人技術人靠知乎刷存在感,靠名氣說話 。
    一些2流技術角色投稿文章csdn,寫專題blog。很多毫無營養。
    國內的技術書,還是一如既往類似官方教程的翻譯版。

     

    blog

    http://preshing.com/ 

     

    Jeff Atwood 大stackoverflo

    http://blog.codinghorror.com/

    https://github.com/coding-horror

     

    陳皓

    http://coolshell.cn/ 

     

    云風

    http://blog.codingnow.com/ 

     

    何_登成

    http://weibo.com/2216172320/BcUmvbyvW?type=repost#_rnd1418722416088

     

    http://ifeve.com/

     

    http://www.importnew.com/14105.html

     

    網絡教學:

    http://www.codecademy.com/

     

    PLSQL

    http://plsql-tutorial.com/plsql-functions.htm

    posted @ 2014-12-17 10:55 小高 閱讀(274) | 評論 (0)編輯 收藏

     

    先確保執行這個. win7 以上才支持 WER windows error report 功能 .

    windows 彈出提示框, 然后進程管理器,右鍵手工導出也行.

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
    "DumpFolder"="c:\\"
    "DumpCount"=dword:00000030
    "DumpType"=dword:00000002
    "CustomDumpFlags"=dword:00000000

    c++ debug版本 + pdb文件

    另外需要注意不是所有情況都生成core.

    windows 改了注冊表不生成core的原因:

    Requirements and limitations

    · Debugging dump files of optimized code can be confusing. For example, compiler inlining of functions can result in unexpected call stacks and other optimizations might change the lifetime of variables.

    · Dump files from 64-bit machines must be debugged on an instance of Visual Studio that is running on a 64-bit computer.

    · In versions of Visual Studio before VS 2013, dumps of 32-bit apps that were run on 64-bit machines that were collected by some tools (such as Task Manager and 64-bit WinDbg) could not be opened in Visual Studio. This limitation has been removed in VS 2013.

    · Visual Studio can debug dump files of native apps from ARM devices. Visual Studio can also debug apps dump files of managed apps from ARM devices, but only in the native debugger.

    · To debug kernel-mode dump files in Visual Studio 2013, download the Windows 8.1 Version of Debugging Tools for Windows. See Kernel Debugging in Visual Studio.

    · Visual Studio can't debug dump files saved in the older dump format known as a full user-mode dump. Note that a full user-mode dump is not the same a dump with heap.

    · To debug with the SOS.dll (SOS Debugging Extension) in Visual Studio, you must install the Debugging Tools for Windows that is part of the Windows Driver Kit (WDK). See Windows 8.1 Preview: Download kits, bits, and tools.

     

    參考:

    Collecting User-Mode Dumps   --注冊表

    http://msdn.microsoft.com/en-us/library/windows/desktop/bb787181(v=vs.85).aspx

     

    Crash Dump Analysis  --- c++ 自己生成dump

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee416349(v=vs.85).aspx 

     

    Use Dump Files to Debug App Crashes and Hangs in Visual Studio

    http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx#bkmk_requirements_and_limitations

     

    Attach to Running Processes with the Visual Studio Debugger

    http://msdn.microsoft.com/en-us/library/3s68z0b3.aspx

    Just-In-Time Debugging in Visual Studio  ------- 還沒看

    http://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx

    posted @ 2014-12-17 10:44 小高 閱讀(666) | 評論 (0)編輯 收藏

    The Discipline and Method Architecture for Reusable Libraries (2000)



    Citations

    1489The C++ Programming Language - Stroustrup - 1991
    1437Object-Oriented Software Construction - Meyer - 1997
    861Design Patterns - Gamma, Helm, et al. - 1995
    303Purify: Fast detection of memory leaks and access errors - Hastings, Joyce - 1991
    232Rational design process: how and why to fake it - Parnas, Clements - 1986
    118The Art of Computer Programming, Volume 1 - Knuth - 1998
    89Scalable software libraries - Batory, Singhal, et al. - 1993
    67The Library Scaling Problem and the Limits of Concrete Component Reuse - Biggerstaff - 1994
    57Algorithm-oriented generic libraries - Musser, Stepanov - 1994
    47Vmalloc: A general and efficient memory allocator - Vo - 1996
    37Algorithms, 2nd edition - Sedgewick - 1988
    30An Empirical Study of Delta Algorithms - Hunt, Vo, et al. - 1996
    27Empirical measurements of six allocation-intensive C programs - Zorn, Grunwald - 1992
    19Porting Unix to Windows NT - Korn
    19Xept: A software instrumentation method for exception handling - Vo, Wang, et al. - 1997


    18Worst case fragmentation of first fit and best fit storage allocation strategies - Robson - 1977
    17libg++, the GNU C++ library - Lea - 1988
    13On the external storage fragmentation produced by first-fit and best-fit allocation strategies - Shore - 1975
    11C Interfaces and Implementation - Hanson - 1997
    10National Standard for Information Systems { Programming Language C. Technical Report X3J11/89{159, ANSI Accredited Standards Committee, X3 Information Processing Systems - American - 1989
    9Ksh - an extensible high level language - Korn - 1994
    7Associative arrays - Koenig - 1988
    5CDT: A Container Data Type Library - Vo - 1997
    5Making a vector Fit for a Standard - Stroustrup - 1994
    4Vdelta: Differencing and Compression - Korn, Vo - 1995
    4Kiem-Phong Vo. Principles for Writing Reusable Library - Fowler, Korn - 1995
    3Practical Reusable Unix Software - Krisnamurthy - 1995
    2Negotiated Interfaces for Software Reuse - Clements, Parnas, et al. - 1992
    1Concrete software libraries - Vo - 1998
    1Sfio: A Buffered I/O Library. Software---Practice and Experience - Fowler, Korn, et al. - 199




    posted @ 2014-08-26 13:36 小高 閱讀(411) | 評論 (1)編輯 收藏


    #include <sys/stat.h>
    long file_length(char *f)
    {
        struct stat st;
        stat(f, &st);
        return st.st_size;
    }


    If you have the file stream (FILE * f):
    fseek(f, 0, SEEK_END); // seek to end of file
    size = ftell(f); // get current file pointer
    fseek(f, 0, SEEK_SET); // seek back to beginning of file
    // proceed with allocating memory and reading the file
    Or,
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <unistd.h>
    fd = fileno(f); 
    struct stat buf;
    fstat(fd, &buf);
    int size = buf.st_size;
    Or, use stat, if you know the filename:
    #include <sys/stat.h>
    struct stat st;
    stat(filename, &st);
    size = st.st_size;
    posted @ 2014-08-08 16:00 小高| 編輯 收藏

     

     

    relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0

     

    下載地址:

    http://www.codeblocks.org/downloads/26 

    http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/

    codeblocks-13.12-1.el5.x86_64.tar.bz2

     

    安裝的關鍵

    Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.

     

    更新yum的源 很重要

    http://repoforge.org/use/  下載對應的rpm

    cat /etc/redhat-release

    uname –a

     

    wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

    rpm -ivh package-filename

     

    # yum install gcc
    # yum install gcc-c++
    如果之前失敗過  yum erase wxGTK
    # yum install wxGTK
     
    然后
     ]# ls
    codeblocks-12.11-1.el6.i686.rpm
    codeblocks-contrib-12.11-1.el6.i686.rpm
    codeblocks-contrib-devel-12.11-1.el6.i686.rpm
    codeblocks-devel-12.11-1.el6.i686.rpm
    # rpm -ivh codeblocks*
     

    1. 下載repo文件
        下載地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo

    2. 備份并替換系統的repo文件
    [root@localhost ~]# cd /etc/yum.repos.d/
    [root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
    [root@localhost ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo

    3. 執行yum源更新
    [root@localhost ~]# yum clean all
    [root@localhost ~]# yum makecache
    [root@localhost ~]# yum update

     

    yum install gcc gcc-g++ autoconfig automake 
     
     
    參考:
    http://blog.csdn.net/dupei/article/details/6428346
     
    http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
     
     
     
     
    posted @ 2014-07-19 12:17 小高 閱讀(238) | 評論 (0)編輯 收藏

    sqlplus 外面執行正常.

    tomcat調用老有問題.多調用幾次久正常.

     

    可能是包中的全局變量引起的.

     

     

    If so, that's because your package is stateful:

    The values of the variables, constants, and cursors that a package declares (in either its specification or body) comprise its package state. If a PL/SQL package declares at least one variable, constant, or cursor, then the package is stateful; otherwise, it is stateless.

    When you recompile the state is lost:

    If the body of an instantiated, stateful package is recompiled (either explicitly, with the "ALTER PACKAGE Statement", or implicitly), the next invocation of a subprogram in the package causes Oracle Database to discard the existing package state and raise the exception ORA-04068.

    After PL/SQL raises the exception, a reference to the package causes Oracle Database to re-instantiate the package, which re-initializes it...

    You can't avoid this if your package has state. I think it's fairly rare to really need a package to be stateful though, so you should revisit anything you have declared in the package, but outside a function or procedure, to see if it's really needed at that level. Since you're on 10g though, that includes constants, not just variables and cursors.

    But the last paragraph from the quoted documentation means that the next time you reference the package in the same session, you won't get the error and it will work as normal (until you recompile again).

     

    existing state of packages has been discarded means, that your Package had some sort of state.

    This is caused by a global variable (or constant) stored in your Package Body.

    Since the package has already been used in your session, Oracle assumes that this state is relevant for you. Some of these variables might have different values now, and when you recompile the Body, the values are reset.

    This exception is thrown, so that your clients know that they can't rely on those variables any more.

    You could try to remove all global variables and constants from the Package Body, or close your session and reconnect before calling the package again.

     

     

    參考:

    http://stackoverflow.com/questions/2502722/pl-sql-package-invalidated

     

    http://stackoverflow.com/questions/19376440/ora-06508-pl-sql-could-not-find-program-unit-being-called

    posted @ 2014-07-16 21:14 小高 閱讀(1652) | 評論 (0)編輯 收藏

    監聽器配置少了.

    lsnrctl

     

    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (GLOBAL_DBNAME = XE )
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (SID_NAME =XE )
        )
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        )
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        )
      )

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
          (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
        )
      )

    DEFAULT_SERVICE_LISTENER = (XE)

    posted @ 2014-07-11 10:07 小高 閱讀(305) | 評論 (0)編輯 收藏

     

    1.安裝 vnc-server

    找包

    http://www.rpmfind.net/linux/rpm2html/search.php?query=libtermcap&submit=Search+...&system=centos&arch=

    如果window

     

    vncserver :1

    輸入密碼

    vnc登錄后

    xhost +

    解決display問題.

    vncserver -kill :1

     

    vnc 如果進入以后3個 提示選擇 allow clipboard  .

    修改/root/.vnc/xstartup文件,把最后一行 twm& 修改成"startkde &" 或者"gnome-session &"

    不然的話連接linux時只出現了一個終端編輯器窗口。

     

    exec gnome-session &

     

     

     

     

     

    oracle 安裝

    http://blog.itpub.net/7719012/viewspace-1139996

    http://lowendtalk.com/discussion/5396/how-to-install-vnc-on-centos

     

     

    二:使用Xmanager實現xhost掛接圖形

    http://hi.baidu.com/hanyanlovejoy/item/564ed582accef0efe496e017

    posted @ 2014-07-10 12:53 小高 閱讀(160) | 評論 (0)編輯 收藏

    刪除

    :g/.*ABC/m

    :g/kernel32/d

    :[range]g[lobal]/{pattern}/[cmd] :help :g

    vim 查找一個文章段落, 開頭字符 結尾字符

    /.*#tag1\(.\+\n\+\)\{-}#tag2.*

     

    刪除掉 :

    g/.*#tag1\(.\+\n\)\{-}#tag2.*/d

    這句話\(.\+\n\+\) 采用分組

    .\+  .任意字符 + 一個或多個

    \n\+  回車  一個或多個

    \+1 或更多

    \{-} 0 或更多盡可能少. 任意字符

    \n 換行符

    為什么  /This\_.*text/ 不可以,因為\_. 是全緩沖區匹配模式的.

     

    概念分組、捕獲

    http://i.linuxtoy.org/docs/guide/ch26s08.html#id3120909

    abc123.456.def

    \d{3}表示三個數字,(\d{3}\.)表示三個數字加“.”為一組,{2}表示這一組內容重復兩次

     

     

     

    參考:

    http://vimcdoc.sourceforge.net/doc/pattern.html#search-pattern

    ^\(.\+\n\)\{-}#.*tag1

    http://stackoverflow.com/questions/10076834/multi-line-regex-in-vim-filtering-out-blocks-of-text-in-a-file

    Vim 中刪除符合條件的行

    http://timothyqiu.com/archives/delete-lines-matching-pattern-in-vim/ https://github.com/railsinstaller/railsinstaller-windows/releases

    posted @ 2014-06-25 14:24 小高 閱讀(193) | 評論 (0)編輯 收藏

     

    源碼

    https://github.com/embedthis/goahead/blob/master/src/utils/gopass.c

    goAhead 2.5嵌入式web服務器移植到arm9 2440 + linux中

    http://blog.csdn.net/reille/article/details/6784809

    goAhead上實現文件上傳到嵌入式web服務器上

    http://www.xuebuyuan.com/625754.html

     

    3. 資料

    3.1 http://blog.csdn.net/reille/article/details/6871827 本博客轉載的文章

    3.2
    http://www.hackchina.com/r/57970/v2.1.1-_-web-_-upload.htm__html
       前端實現參考

    3.3

    http://www.hackchina.com/r/57970/v2.1.1-_-LINUX-_-upldForm.c__html 服務器端實現參考

    posted @ 2014-06-20 11:01 小高 閱讀(240) | 評論 (0)編輯 收藏

     

    RiskUnit0001.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
    obj/Debug/src/RiskUnit0001/RiskUnit0001.o: could not read symbols: Bad value

     

    為什么需要

     

    解決辦法編譯器已經提示了:recompile with -fPIC
    但是我們應該重新編譯誰帶上這個參數呢?經過我幾番折騰,發現如下情況:
    1、編譯.o文件的時候,沒有加參數-fPIC,這問題個在gcc version 3.4.6版本沒有發生,可能那個編譯器默認都給加上吧。
    2、當前程序中有用到某個靜態庫,那個靜態庫編譯.o文件的時候沒有加上-fPIC(靜態庫其實就是.o文件打包)。補充一點:我發現手寫Makefile時即使不加-fPIC也沒有這個問題,這一點很郁悶,這個只在用automake工具編譯出.a文件時才出現過。
    知道原因了,解決辦法自然有了,保證你編譯.o文件的時候,都加上-fPIC,這樣你才能編譯出動態庫來。

     

    引用

    http://hi.baidu.com/duizhe_memory/item/c4ccbb0831a5998d3d42e212

    posted @ 2014-04-18 11:15 小高 閱讀(330) | 評論 (0)編輯 收藏

     

     

    sqlplus "core/core@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=192.168.75.1)(Port=1521))(CONNECT_DATA=(SID=itmp)))"


    sqlplus core/core@192.168.75.1:1521/itmp

     

    參考一個 :

     

     

    /***
    *    ORACLE客戶端liunx安裝部署說明
    *
    */

    配置步驟:

    1,將本文件夾拷貝到相應的服務器上。
    2,配置環境變量如下: 文件夾所在路徑(/kfts/tools/oracle)
    (永久修改方式)
    vi /etc/profile
    在文件最后添加:
    export LD_LIBRARY_PATH=/kfts/tools/oracle:$LD_LIBRARY_PATH
    export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
    export ORACLE_HOME=/kfts/tools/oracle/
    export PATH=/kfts/tools/oracle/:$PATH
    export TNS_ADMIN=/kfts/tools/oracle/network/admin

    之后運行命令生效:
    source /etc/profile

    posted @ 2014-04-12 11:19 小高 閱讀(1845) | 評論 (0)編輯 收藏

     

     

    relocation error: multiget: symbol _Z23wxHandleFatalExceptionsb, version WXU_2.8 not defined in file libwx_baseu-2.8.so.0

     

    下載地址:

    http://www.codeblocks.org/downloads/26 

    http://sourceforge.net/projects/codeblocks/files/Binaries/13.12-RC1/Linux%20(64bit)/

    codeblocks-13.12-1.el5.x86_64.tar.bz2

     

    安裝的關鍵

    Note: On RedHat/CentOS 5 and older revisions of 6 (up to 6.2 as far as I know) you need to add repoforge (former rpmforge) to your repolist, to be able to install the needed wxGTK-package. Seehttp://repoforge.org/use for an instruction.

     

    更新yum的源 很重要

    http://repoforge.org/use/  下載對應的rpm

    cat /etc/redhat-release

    uname –a

    rpm -ivh package-filename

     

    # yum install gcc
    # yum install gcc-c++
    如果之前失敗過  yum erase wxGTK
    # yum install wxGTK
     
    然后
     ]# ls
    codeblocks-12.11-1.el6.i686.rpm
    codeblocks-contrib-12.11-1.el6.i686.rpm
    codeblocks-contrib-devel-12.11-1.el6.i686.rpm
    codeblocks-devel-12.11-1.el6.i686.rpm
    # rpm -ivh codeblocks*
     
    yum install gcc gcc-g++ autoconfig automake 
     
     
    參考:
    http://blog.csdn.net/dupei/article/details/6428346
     
    http://www.cnblogs.com/magialmoon/archive/2013/05/05/3061108.html
     
     
     
     
    posted @ 2014-04-11 16:19 小高 閱讀(1464) | 評論 (1)編輯 收藏
         摘要:   閱讀全文
    posted @ 2013-10-21 11:10 小高 閱讀(285) | 評論 (0)編輯 收藏

     

    目標緩沖區 小于 實際緩沖區

     

    char *name = "1234567890";
    char name2[6]={0};

    memcpy_s( name2 ,  sizeof(name2) ,  name, strlen(name));

    動態執行失敗 (DEBUG ASSERTION FAILED !) 運行庫和調試庫都會提示出錯.

     

    注意:    指針sizeof( 指針 ) = 4  

    strncpy(name2,name ,sizeof(name) );             打印name2  1234 

     

    strncpy(name2,name ,strlen(name) );            打印name2   123456IOIPNUUY

    優化這個語句,盡量拷貝內容

    strncpy(name2,name ,   strlen(name)>sizeof(name2)? sizeof(name2): strlen(name)   );

     

     

    目標緩沖區 小于 實際緩沖區

    strncpy(name2,name ,sizeof(name2)-1 );

    sizeof(name2)-1 ------------>讓最后一個name2字符留給\0 否則這個字符也被拷貝了.

     

     

     

    看一下LINUX下的兩個函數的源代碼,印象會更加深刻一些
    void * memcpy(void * dest,const void *src,size_t count)
    {
        char *tmp = (char *) dest, *s = (char *) src;
        while (count--)
            *tmp++ = *s++;
        return dest;
    }
    char * strcpy(char * dest,const char *src)
    {
        char *tmp = dest;
        while ((*dest++ = *src++) != '\0')
            /* nothing */;
        return tmp;
    }
    老實講,這兩個函數長得是很帥

     

     

    參考

    http://stackoverflow.com/questions/4593907/difference-between-strncpy-and-memcpy

     

    http://www.cppblog.com/Tim/archive/2011/04/02/143259.aspx

    posted @ 2013-09-18 00:12 小高 閱讀(462) | 評論 (0)編輯 收藏

     

    Visual Studio 2008 命令提示

    cl /EHsc simple.cpp

     

    參考:

    http://msdn.microsoft.com/zh-cn/library/ms235639(v=vs.90).aspx 

    http://msdn.microsoft.com/zh-cn/library/1370z17c.aspx

     

     

     

    Visual C++ 示例應用程序

    Visual Studio 2008

    其他版本


    通用示例

    包含一些示例,這些示例可以在 Visual C++ 的所有版本(包括 Visual C++ 速成版)中使用。

    Visual C++ 2008 中的演練

    包含一些演練鏈接,這些演練重點演示了 Visual C++ 的功能。

    STL 示例

    包含演示標準模板庫功能的一些示例。

    ATL 示例

    包含演示活動模板庫 (ATL) 功能的一些示例。

    編譯器 COM 支持示例

    包含一些示例,這些示例演示 Visual C++ 編譯器對 COM 的內置支持。

    自定義向導示例

    包含一些示例,這些示例說明如何創建您自己的向導來優化與創建自定義應用程序或添加代碼相關的任務。

    事件處理示例

    包含一些示例,這些示例演示 Visual C++ 中的事件處理。

    擴展性

    包含一些示例,這些示例演示如何擴展 Visual Studio 和 Visual C++。

    國際示例

    包含一些示例,這些示例演示如何針對國際市場編寫代碼。

    互操作性示例

    包含一些示例,這些示例演示 COM 和 .NET Framework 之間的互操作性。

    MASM 示例

    包含一些示例,這些示例演示 Visual C++ 中的 Microsoft Macro Assembler (MASM) 源文件支持。

    MFC 示例

    包含一些示例,這些示例演示 Microsoft 基礎類 (MFC) 功能。

    Windows SDK 示例

    包含一個示例,此示例演示 Windows 圖像獲取 (WIA) 應用程序編程接口 (API)。

     

     

    互操作性示例

    http://msdn.microsoft.com/zh-cn/library/wd6032c3.aspx

     

    標準模板庫示例

    http://msdn.microsoft.com/zh-cn/library/f1dtts6s.aspx

    posted @ 2013-09-15 00:27 小高 閱讀(746) | 評論 (0)編輯 收藏

     

    warning MSB8012: TargetPath(C:\dev\APPFF_SQ2\APP\.\Release\APP_SQ1.exe) 與 Linker 的 OutputFile 屬性值(C:\dev\APPFF_SQ2\APP\Release\MDU2FF_SQ.exe)不匹配。這可能導致項目生成不正確。若要更正此問題,請確保 $(OutDir)、$(TargetName) 和 $(TargetExt) 屬性值與 %(Link.OutputFile) 中指定的值匹配。

    warning MSB8012: TargetName(MDU2FF_SQ1) 與 Linker 的 OutputFile 屬性值(MDU2FF_SQ)不匹配。這可能導致項目生成不正確。若要更正此問題,請確保 $(OutDir)、$(TargetName) 和 $(TargetExt) 屬性值與 %(Link.OutputFile) 中指定的值匹配。
    1>  MD .vcxproj -> C:\dev\APPFF_SQ2\APP\.\Release\ .exe

     

    project name 修改名字.

    另外工程配置,鏈接生成--->輸出文件統一.

    posted @ 2013-09-12 14:51 小高 閱讀(1289) | 評論 (0)編輯 收藏
    posted @ 2013-09-12 14:09 小高 閱讀(311) | 評論 (0)編輯 收藏
         摘要:   一般來說,如果你不是MFC工程,需要引用HANDLE的話, 最好自己將其類型改為void*,比如,你本來變量的類型為HANDLE, 你把它改為void*就可以了。   --------------------------------------------------------------------------------    ...  閱讀全文
    posted @ 2013-09-10 14:14 小高 閱讀(534) | 評論 (0)編輯 收藏

    1、工作空間默認
     
    Windows -> Preferrences -> C/C++ -> Editor -> Documentation tool comments
     
    默認為none,修改為Doxygen即可
     
    2、工程特別屬性
    如果不想設置為整個工作空間的默認屬性,可以在工作屬性對話框的這里找到:
     
    Project -> Properties -> C/C++ General -> Enable project specific settings
     
    選擇Doxygen即可
     
    備忘

    posted @ 2013-09-10 14:03 小高 閱讀(269) | 評論 (0)編輯 收藏

    發生在析夠函數中,   vs2010 debug 模式 .

    CriticalSection::~CriticalSection(void){
        DeleteCriticalSection(&m_CritSect); 
    }

     

    我開始推測,必須退出section才能delete ?

        InitializeCriticalSection(&m_CritSect);  
          EnterCriticalSection(&m_CritSect); 
        DeleteCriticalSection(&m_CritSect);   
      實際上這樣退出是可以的.

     

    問題在哪里? 

    一個回調處理函數類注冊到另外一個線程里面.另外一個線程一直有消息推送或者調用其內部函數.

     

    ~主類(){

           aa->release(); //之前沒有這句話 ,內部aa 線程一直在運行 ,可能是排在析構 (DeleteCriticalSection)之后或者之前,損壞了這個變量 m_CritSect

    }

    這里開始調用  DeleteCriticalSection(&m_CritSect);   并且報錯了.

    posted @ 2013-09-10 13:28 小高 閱讀(468) | 評論 (0)編輯 收藏

    別的項目里面拿來的 .h .cpp 

    因為本項目未使用預編譯頭.

    但是預編譯頭這個頭文件存在,里面東西很多.

    導致很多宏  或者 常量重復定義.

    posted @ 2013-09-09 23:34 小高 閱讀(267) | 評論 (0)編輯 收藏
    定義成標準頭
    int main(int argc, char *argv[])
    argv[i]
    非標準
    int main() {
        PWSTR cmdLine = GetCommandLineW();
    
        int argc;
        PWSTR *argv = CommandLineToArgvW(cmdLine, &argc);
    }

     

     

    //參數使用

    if (argc==3)
    {
        if (strcmp(argv[0], "-e")==0)
        {
            iMode = 1;
        } 
        else if (strcmp(argv[0], "-d")==0)
        {
            iMode =2;
        }
        sInput=argv[1];
        sOutput=argv[2];
    }

    _tmain 
    Unicode下就是wmain
    否則就是main

     

    [參考]

    http://stackoverflow.com/questions/16706632/c-tchar-to-stdstring

    posted @ 2013-09-04 16:07 小高 閱讀(241) | 評論 (0)編輯 收藏

    我老是搞錯.

     

    boy.h

    class Boy

     

    boy.cpp

    Boy  g_boy;

     

    使用全局變量

    Collection.h

    #include “boy.h”

    extern Boy g_boy;

     

    似乎更優雅的方式

    #ifdef  _BOY__HH__
    extern  Boy  g_boy ;
    #endif

     

     

    錯誤方式:    定義宏根本解決不了這個問題

    boy.h
    #pragma once
    #ifndef _BOY__HH__
    #define _BOY__HH__ 

    class  boy

    Boy  g_boy;

    #endif

    編譯錯誤

    1> .obj : error LNK2005: "class class 全局變量名 " (?g_CITSCache@@3VMarketCache@@A) 已經在 XXX.obj 中定義
    1>  正在生成非 SAFESEH 映像。
    1>D:\XXX.exe : fatal error LNK1169: 找到一個或多個多重定義的符號

     

    等我看了編譯原理再來解釋.

     

    如何防止循環引用?

    A->b->c->A

    posted @ 2013-09-04 09:35 小高 閱讀(330) | 評論 (0)編輯 收藏

    一直報錯,說找不到引用.

    2>Quote.obj : error LNK2019: 無法解析的外部符號 "public: __thiscall 某類::某類(char *)" (??0某類@@QAE@PAD@Z),該符號在函數 "public: __thiscall Quote::Quote(void)" (??0Quote@@QAE@XZ) 中被引用
    2>Quote.obj : error LNK2001: 無法解析的外部符號 "public: virtual bool __thiscall 某類::Init(void)" (?Init@某類@@UAE_NXZ)
    2>Quote.obj : error LNK2001: 無法解析的外部符號 "public: virtual void __thiscall 某類::Kill(void)" (?Kill@某類@@UAEXXZ)
    2>Quote.obj : error LNK2001: 無法解析的外部符號 "private: virtual int __thiscall 某類::Run(void)" (?Run@某類@@EAEHXZ)
    2>Quote.obj : error LNK2001: 無法解析的外部符號 "private: virtual bool __thiscall 某類::Terminate(void)" (?Terminate@某類@@EAE_NXZ)
    2>Quote.obj : error LNK2019: 無法解析的外部符號 "public: virtual __thiscall 某類::~某類(void)" (??1CW

    1.使用編譯---------> verbose  顯示能找到庫.

    9C[Z)A4`[NZT4PM_%[[$2HB

    2.可以看到那個方法連接到那個庫文件里面的.

    ZH1IBN68EZ@~YHRA@]$EQ61

    3.通過depends  看這個dll暴露出來的方法.

    C}$1@WQ~CKP%KDAQ9GYSLCK

     

     

     

    #ifdef EXPORT_API
    #define MY_API __declspec(dllexport)
    #else
    #define MY_API __declspec(dllimport)
    #endif
    
    class MY_API MyClass {
       ...
    };

     

    #include <e://testClass.h>

    #pragma comment(lib, "//Debug//ServerDLL.lib")

     

     

    參考

    http://www.codeproject.com/Articles/28969/HowTo-Export-C-classes-from-a-DLL

     

    http://www.cppblog.com/suiaiguo/archive/2009/07/21/90734.html

    posted @ 2013-09-03 10:15 小高 閱讀(527) | 評論 (0)編輯 收藏

     

    ****取資源

     

          業務代碼?

         

    ***釋放資源

    posted @ 2013-09-02 20:47 小高 閱讀(294) | 評論 (0)編輯 收藏

    導航

    <2013年9月>
    25262728293031
    1234567
    891011121314
    15161718192021
    22232425262728
    293012345

    統計

    常用鏈接

    留言簿(3)

    隨筆分類(352)

    收藏夾(19)

    關注的blog

    手冊

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产视频精品免费| 亚洲网址在线观看你懂的| 亚洲一卡2卡4卡5卡6卡在线99 | 亚洲精品无码久久久久久| 在线人成免费视频69国产| 免费jlzzjlzz在线播放视频| 亚洲国产日产无码精品| 日本三级在线观看免费| 免费午夜爽爽爽WWW视频十八禁| 亚洲国产情侣一区二区三区| 国产一精品一AV一免费| 亚洲精品无码久久久| 亚洲熟妇成人精品一区| 国产h肉在线视频免费观看| 国产亚洲无线码一区二区| 美女隐私免费视频看| 在线观看免费人成视频| 亚洲欧洲精品国产区| 国产一精品一av一免费爽爽| 亚洲精品网站在线观看不卡无广告| 国产亚洲精品bv在线观看| 99re这里有免费视频精品| 国产亚洲精品美女久久久| 成人午夜影视全部免费看| 国产av无码专区亚洲av毛片搜| free哆啪啪免费永久| 亚洲国产精品久久久久婷婷老年| 日韩黄色免费观看| 亚洲精品亚洲人成在线麻豆| 久久国产乱子伦精品免费强| 精品亚洲一区二区三区在线播放 | 男女猛烈激情xx00免费视频| 日本免费一区尤物| 亚洲日韩精品无码专区加勒比| 黄瓜视频影院在线观看免费| 亚洲综合色丁香麻豆| 最近中文字幕完整版免费高清| 亚洲国产一区二区a毛片| 很黄很污的网站免费| 国产AV无码专区亚洲AVJULIA| 高清永久免费观看|