posts - 25, comments - 69, trackbacks - 0, articles - 2

          2006年11月28日

          /Files/rttw/Excel.zip

          本程序用來將多個excel報表合并成一個文件,取第一個文件的前n行做為報表的題頭,n可自定義。

          1.支持直接添加多個文件

          2.支持直接添加某個文件夾下面的所有excel文件

          3 支持直接將excel文件拖放到程序界面

          4.可以單選或多選記錄然后用右鍵刪除

          5.可以定義excel表頭記錄數(shù)

          6.本版本暫時只支持合并Excel文件的第一個sheet

          7.雙擊某條記錄可直接刪除

          8.開發(fā)環(huán)境 VC6+OFFICE2007,其他版本OFFICE有可能不兼容

          posted @ 2009-01-15 16:20 壯士日志 閱讀(3627) | 評論 (30)編輯 收藏

          北京寄來的件,已經(jīng)第四天了,打電話到廣州中轉(zhuǎn),說還沒到廣州,竟然讓我自己打電話到北京去問.再說了兩句竟然掛了我的電話.簡直是垃圾啊.客戶打電話上來的有問題的件應該是快遞公司內(nèi)部處理解決吧,竟然讓客戶自己去跟蹤??奉勸大家以后千萬不要用申通快遞,切記且記

          posted @ 2007-02-01 12:14 壯士日志 閱讀(887) | 評論 (11)編輯 收藏

          [root@linux-test188 ~]# cdrecord -scanbus
          Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 J枚rg Schilling
          Note: This version is an unofficial (modified) version with DVD support
          Note: and therefore may have bugs that are not present in the original.
          Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
          Note: The author of cdrecord should not be bothered with problems in this version.
          scsidev: 'ATA'
          devname: 'ATA'
          scsibus: -2 target: -2 lun: -2
          Linux sg driver version: 3.5.27
          Using libscg version 'schily-0.8'.
          cdrecord: Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.83-RH '@(#)scsi-linux-sg.c???? 1.83 04/05/20 Copyright 1997 J. Schilling').
          scsibus1:
          ??????? 1,0,0?? 100) 'HL-DT-ST' 'CD-RW GCE-8400B ' '1.02' Removable CD-ROM
          ??????? 1,1,0?? 101) *
          ??????? 1,2,0?? 102) *
          ??????? 1,3,0?? 103) *
          ??????? 1,4,0?? 104) *
          ??????? 1,5,0?? 105) *
          ??????? 1,6,0?? 106) *
          ??????? 1,7,0?? 107) *
          [root@linux-test188 ~]# cdrecord -v speed=8 dev=1,0,0 test.iso

          [root@linux-test188 ~]# mkisofs -r -o cd.iso -m temp ./tempfiles

          posted @ 2006-12-29 13:49 壯士日志 閱讀(542) | 評論 (0)編輯 收藏

          select * from a,b where a.id=b.id(+);
          select * from a left join b on a.id=b.id;

          很多資料說上面兩個語句的效果是一樣的,實際上今天經(jīng)過測試發(fā)現(xiàn)兩者的執(zhí)行計劃大不相同(查詢結(jié)果是一樣的);
          至于為什么會這樣,暫時沒有深究,手頭的一個例子表明按照第一種寫法的效率會高,或許其他的例子結(jié)果不一樣,等有時間的時候再測試一下吧.

          posted @ 2006-12-25 14:30 壯士日志 閱讀(26254) | 評論 (7)編輯 收藏

          同樣的一條語句,一條是在pl/sql里面組裝成sql之后提交執(zhí)行,另外一條是用pro*c程序后綁定執(zhí)行,沒想到執(zhí)行策略和效率天差地別。看來做什么事都不能想當然,要細心學習才行。保留此條語句以做紀念:

          select *
          ? from (select /*+ INDEX(A IDX_HISBUFAREJOUR_ACCOUNT) +*/
          ???????? a.*, f.sort_name
          ????????? from hs_his.hisbufarejour a, hs_fund.faresort f
          ???????? where (((((((a.fare_sort = f.fare_sort and a.client_id = :b0) and
          ?????????????? (:b1 = 0 or a.fund_account = :b2)) and
          ?????????????? a.init_date >= :b3) and a.init_date <= :b4) and
          ?????????????? (trim(:b5) is null or
          ?????????????? instr(((',' || :b6) || ','),
          ???????????????????????? ((',' || a.exchange_type) || ',')) > 0)) and
          ?????????????? (trim(:b7) is null or
          ?????????????? instr(((',' || :b8) || ','),
          ??????????????????????? ((',' || a.money_type) || ',')) > 0)) and
          ?????????????? (trim(:b9) is null or a.position_str > :b10))
          ???????? order by a.position_str)
          ?where rownum <= :b11


          ??????
          b0:130330000516
          b1:595995
          b2:595995
          b3:20061221
          b4:20061221
          b5:1
          b6:1
          b7:2
          b8:2
          b9:
          b10:
          b11:30

          posted @ 2006-12-22 17:45 壯士日志 閱讀(568) | 評論 (1)編輯 收藏

          vc的對話框中,如果直接用picturebox作為對話框的背景,則其他控件會被擋住。經(jīng)過高手指點,重載了WM_ERASEBKGND消息處理函數(shù),很少的解決了這個問題。而且按照這個思路,可以很方便的為dialog增加動態(tài)的skin:

          聲明消息處理函數(shù):

          ?// Generated message map functions
          ?//{{AFX_MSG(Input)
          ?afx_msg BOOL OnEraseBkgnd(CDC* pDC);
          ?afx_msg void OnButtonOk();
          ?afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
          ?afx_msg void OnPaint();
          ?//}}AFX_MSG
          ?DECLARE_MESSAGE_MAP()

          聲明消息循環(huán):
          BEGIN_MESSAGE_MAP(Input, CDialog)
          ?//{{AFX_MSG_MAP(Input)
          ?ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
          ?ON_WM_LBUTTONDBLCLK()
          ?ON_WM_PAINT()
          ?ON_WM_ERASEBKGND()
          ?//}}AFX_MSG_MAP
          END_MESSAGE_MAP()

          實現(xiàn):
          BOOL Input::OnEraseBkgnd(CDC* pDC)
          {
          ?if(m_hBmp)
          ?{
          ??BITMAP bm;
          ??GetObject(m_hBmp,sizeof(bm),&bm);
          ??HDC hMemdc=CreateCompatibleDC(pDC->m_hDC);
          ??if(hMemdc)
          ??{
          ???? HBITMAP hOldBmp=(HBITMAP)SelectObject(hMemdc,m_hBmp);
          ???? if(hOldBmp)
          ???? {
          ????? BitBlt(pDC->m_hDC,0,0,bm.bmWidth,bm.bmHeight,hMemdc,0,0,SRCCOPY);
          ????? SelectObject(hMemdc,hOldBmp);
          ????? DeleteDC(hMemdc);
          ????? DeleteObject(hOldBmp);
          ????? return TRUE;
          ???? }
          ???? else
          ??? DeleteDC(hMemdc);
          ??}
          ?}
          ?return CDialog::OnEraseBkgnd(pDC);
          }

          posted @ 2006-12-07 16:02 壯士日志 閱讀(469) | 評論 (0)編輯 收藏

          posted @ 2006-11-28 18:21 壯士日志 閱讀(269) | 評論 (0)編輯 收藏

          ??????今天系統(tǒng)莫明其妙的故障,以前用的好好的客戶信息匯總統(tǒng)計突然出現(xiàn)異常,查看日志顯示oracle的sql語句異常.
          ??????跟蹤調(diào)試后臺發(fā)現(xiàn)問題出現(xiàn)在sprintf語句上面,sql預定義 char[8000],然后用sprintf來格式化,結(jié)果當語句的數(shù)據(jù)超過8000的時候就不能正常處理了.
          ???? google了一下:

          眾所周知,sprintf不能檢查目標字符串的長度,可能造成眾多安全問題,所以都會推薦使用snprintf.

          snprintf(_snprintf)的聲明是這樣的

          int _snprintf(
          ?? char *buffer,
          ?? size_t count,
          ?? const char *format [,
          ????? argument] ...
          );

          If len < count, then len characters are stored in buffer, a null-terminator is appended, and len is returned.

          If len = count, then len characters are stored in buffer, no null-terminator is appended, and len is returned.

          If len > count, then count characters are stored in buffer, no null-terminator is appended, and a negative value is returned.


          最常見的錯誤用法有:
          1.
          char sa[256]={0};
          _snprintf(sa,sizeof(sa),"%s",sb);
          //錯誤原因:當sb的長度>=256的時候,sa將沒有'\0'結(jié)尾

          2.
          char sa[256];
          _snprintf(sa,sizeof(sa)-1,"%s",sb);
          //錯誤原因:當sb的長度>=255的時候,sa將沒有'\0'結(jié)尾,忘記給sa初始化

          3.
          char sa[256];
          _snprintf(sa,sizeof(sa)-1,"%s",sb);
          sa[sizeof(sa)]=0;
          //錯誤原因:最后一行數(shù)組越界

          正確的用法
          1. //推薦用法
          char sa[256];
          sa[sizeof(sa)-1]=0;
          _snprintf(sa,sizeof(sa),"%s",sb);
          if(sa[sizeof(sa)-1]!=0)
          {
          ?? printf("warning:string will be truncated");
          ?? sa[sizeof(sa)-1]=0;
          }

          2.
          char sa[256]={0};
          int result = _snprintf(sa,sizeof(sa),"%s",sb);
          if(result==sizeof(sa) || result<0)
          {
          ??? printf("warning:sting will be truncated");
          ?? sa[sizeof(sa)-1]=0;
          }

          posted @ 2006-11-28 18:18 壯士日志 閱讀(916) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 错那县| 揭东县| 客服| 晋宁县| 广宗县| 福州市| 汉寿县| 古蔺县| 兴义市| 班戈县| 乐陵市| 三门县| 肃南| 柞水县| 望城县| 新巴尔虎左旗| 广东省| 崇文区| 博兴县| 图片| 大安市| 呈贡县| 尼勒克县| 宾阳县| 黄陵县| 吉水县| 南充市| 昌吉市| 尚义县| 长垣县| 电白县| 个旧市| 天等县| 定结县| 西乡县| 团风县| 太湖县| 平顺县| 伊吾县| 霍城县| 沂源县|