取得大檔案大小

_int64 GetFileSize(const char *szFileName){   //低位,高位,錯誤碼   DWORD dwSizeLow = 0, dwSizeHigh = 0;   HANDLE hFile = CreateFile(szFileName,GENERIC_READ,FILE_SHARE_READ,                          NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);   if

編譯ubuntu下面的boost 1.52

編譯ubuntu 下面的boost1.52(下載boost1.52放到/usr/share/  下面)1.使用bootstrap.bat來編譯產生b2和bjam可執行檔。因為預設的boostrap.bat中的工具是msvc,而ubuntu不可能使用msvc的,所以我們修改boostrap.bat檔案如下:::修改前 call .\build.bat %* > ..\..\..\..\bootstrap.log ::修改後 call .\build.bat %* gcc > ..\..

Item 26. Minimizing Compile-time Dependencies part 1

I l@ve RuBoard Item 26. Minimizing Compile-time Dependencies桺art 1Difficulty: 4When we talk about dependencies, we usually think of run-time dependencies like class interactions. In this Item, we will focus instead on how to analyze and manage

在對話方塊上加工具列及在工具列上按下拉式功能表

 標頭檔中加入 afx_msg void OnDropDown(NMHDR* pNotifyStruct, LRESULT*pResult);   BEGIN_MESSAGE_MAP(CDlgFileShare, CDialog) //{{AFX_MSG_MAP(CDlgFileShare) ON_NOTIFY(TBN_DROPDOWN, AFX_IDW_TOOLBAR, OnDropDown) //用於下拉式功能表 //}}AFX_MSG_MAPEND_MESSAGE_MAP()int

ubuntu10.10 document viewer的pdf中文亂碼問題

在ubuntu10.10 下用Document Viewer( 2.24.1)查看PDF檔案時中文出現亂碼1 在terminal中 修改字型設定檔案的許可權,輸入 sudo chmod 777 /etc/fonts/conf.d/49-sansserif.conf 2 在terminal中 輸入 sudo gedit /etc/fonts/conf.d/49-sansserif.conf,修改一個字型設定就OK。例如以下,將倒數第四行的字型改為漢字的字型,我改成了文泉驛正黑。<?xml

統計輸入單詞的個數

struct Pair{ string name; double val;};vector<Pair>pairs;double& value(const string&s){ for(int i = 0; i < pairs.size(); ++i)  if( s == pairs[i].name) return pairs[i].val; Pair p = {s,0}; pairs.push_back(p); return pairs[pairs.size()

指向void 的指標

一個指向任何對象 類型的指標都可以賦值給類型為void* 的變數,void* 可以賦值給另一個void* ,兩個void* 可以比較相等與否,而且可以顯式地將void* 轉換到另一個類型。其它操作都是不安全的,因為編譯器並不知道實際被指的是哪種對象。因此,對void* 做其他任何操作都將引起編譯錯誤。要使用void*,就必須顯式地將經轉換到某個指向特定類型的指標。例:void  Test(int *pi){  void *pv = pi;  //ok ,從 int* 到 void* 的隱式轉換 

SQL中使用WITH AS

一.WITH AS的含義     WITH AS短語,也叫做子查詢部分(subquery factoring),可以讓你做很多事情,定義一個SQL片斷,該SQL片斷會被整個SQL語句所用到。有的時候,是為了讓SQL語句的可讀性更高些,也有可能是在UNION ALL的不同部分,作為提供資料的部分。 特別對於UNION ALL比較有用。因為UNION ALL的每個部分可能相同,但是如果每個部分都去執行一遍的話,則成本太高,所以可以使用WITH AS短語,則只要執行一遍即可。如果WITH

jQuery強大篩選器

在Web應用程式中,大部分的客 戶端操作都是基於對象的操作,要操作對象就必須先擷取對象,jQuery(v1.3.2)提供了強大的選取器讓我們擷取對 象。在這邊,我人為地將jQuery選取器分為兩大部分:選擇對象和篩選條件。選擇對象表示要擷取什麼對象,篩選條件是對擷取的對象進行篩選,最終留下符

ListCtrl的總結

ListCtrl在工作中,常常用到,也常常看到大家發帖問怎麼用這個控制項,故總結了一下自己的使用經驗,以供參考使用。  先註明一下,這裡,我們用m_listctrl來表示一個CListCtrl的類對象,然後這裡我們的ListCtrl都是report形式,至於其他的如什麼大表徵圖,小表徵圖的暫時不講,畢竟report是福士話的使用。其次,我們這裡用條款一,條款二來描述第一點,第二點,這個是參照《Effective C++》的叫法,俺覺得這麼叫比較COOL

使應用程式只能運行一個執行個體

BOOL CSingleDocApp::InitInstance(){ HANDLE hSep = ::CreateSemaphore(NULL,1,1,m_strAppName); if(GetLastError() == ERROR_ALREADY_EXISTS) {        CloseHandle(hSep);  HWND hWnd = ::GetWindow(::GetDesktopWindow(),GW_CHILD);    while(hWnd)  {           

Item 33. Name Lookup and the Interface Principle part 3

Difficulty: 5Take a few minutes to consider some implications of the Interface Principle on the way we reason about program design. We'll revisit a classic design problem: "What's the best way to write operator<<()?"There are two main ways to

做一個與bug共存的程式員

    不知道為什麼,有時候自己寫程式時總會有一種習慣,就是一個任務一定要一口氣寫完。如果在這個過程中被中斷了,做其他事情肯定會心不在焉甚至走神~~bug如果沒調完,心裡總感覺有道坎。    我深深的知道這樣做是何等何等的不好,但是有時候就是很難從中出來。    我們要學會從bug中走出來,畢竟我們周圍很多朋友也都需要我們。    如果我們深陷bug或者被中斷的程式,這就不僅僅是程式的bug,更是我們心靈的bug。   

調整excel列寬

 void AdjustColWidth(const CString& strName){ _Application ExcelApp; Range range,col; COleVariant  varTmp((long)DISP_E_PARAMNOTFOUND,   VT_ERROR);  COleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND,

istream_iterator 與 ostream_iterator 簡單的用法

#include<fstream>#include<iterator>#include<string>#include<vector>#include<algorithm>using namespace std;int main(){ string from,to;  cin>>from>>to; ifstream ifs(from.c_str()); istream_iterator<string>

Asterisk cmd Transfer

Transfer Synopsis  Transfer caller to remote extension Description  Transfer([Tech/]dest[|options]) Requests the remote caller be transferred to a given extension. If TECH (SIP, IAX2, LOCAL etc) is used, only an incoming call with the same channel

Item 31. Name Lookup and the Interface Principle part 1

Difficulty: 9½When you call a function, which function do you call? The answer is determined by name lookup, but you're almost certain to find some of the details surprising.In the following code, which functions are called? Why? Analyze the

移動/縮放視窗

void CDlgLogin::OnLButtonDown(UINT nFlags, CPoint point) { m_btnZoom.GetWindowRect(&m_rect);    ScreenToClient(&m_rect); if(m_rect.PtInRect(point)) {  m_bZoomWindow = TRUE; } else {     m_bMoveWindow = TRUE; } m_Pos =

Item 30. The “Fast Pimpl” Idiom

I l@ve RuBoard Item 30. The "Fast Pimpl" IdiomDifficulty: 6It's sometimes tempting to cut corners in the name of "reducing dependencies" or in the name of "efficiency," but it may not always be a good idea. Here's an excellent idiom to accomplish

Item 34. Name Lookup and the Interface Principle part 4

We conclude this miniseries by considering some implications of the Interface Principle on name lookup. Can you spot the (quite subtle) problem lurking in the following code?What is name hiding? Show how it can affect the visibility of base class

總頁數: 61357 1 .... 15640 15641 15642 15643 15644 .... 61357 Go to: 前往

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.