原创 簡單的main(int argc, char* argv[])

#include <iostream> #include <string> #include <fstream> using namespace std; int main(int argc, char* argv[]) //

原创 幾個vba小程序

1.數據彙總——彙總文件夾下所有excel文件的某列,組成新的一列。 Sub 彙總() Dim Fso, Fld, Fl Set Fso = CreateObject("Scripting.FileSystemObjec

原创 字符編碼筆記:ASCII,Unicode和UTF-8

來源:http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html 作者: 阮一峯 日期: 2007年10月28日 今天中午,我突然想搞清楚Uni

原创 c++ string 轉化爲wstring

來自:http://www.cppblog.com/kenwell/archive/2008/05/21/50661.html string 轉 wstring std::wstring s2ws(const std::string &

原创 #ifdef __cplusplus深度剖析

時常在cpp的代碼之中看到這樣的代碼:      #ifdef __cplusplus      extern "C" {      #endif     //一段代碼      #ifdef __cplusplus      }

原创 C++中實現對map按照value值進行排序

map的兩個值分別爲key值和value值,map是按照key值進行排序的,但有時候需要按照value值進行排序,並且按照value的順序輸出key值,排序代碼如下: typedef pair<string, int> PAIR; i

原创 C++ Map 統計文件中的詞頻

#include <iostream> #include <fstream> #include <string> #include <vector> #include <map> using namespace std;

原创 C++輸出兩個文本文件不同的行

假設A,B兩個文件,A文件中100行字符,B文件中200行字符。輸出B中與A中行內容不同的行。 // find different lines from two text #include "iostream" #include

原创 C++ 倒排索引的實現

1.1基本介紹  倒排索引的概念很簡單:就是將文件中的單詞作爲關鍵字,然後建立單詞與文件的映射關係。當然,你還可以添加文件中單詞出現的頻數等信息。倒排索引是搜索引擎中一個很基本的概念,幾乎所有的搜索引擎都會使用到倒排索引。 1.2

原创 python read(),readline(),readlines()

  文本文件:      hello world! this is a test text   read():從當前位置開始,讀完所有的文件,返回字符串。 >>> myfile = open("test.txt","r") >>>

原创 MFC重設光標位置

void CMyDlg::OnIndex() { // TODO: Add your control notification handler code here CString str; m_FileText.GetWindow

原创 如何改變CEdit中顯示的字體大小並使其上下方向居中?

如題!謝謝!   ---------------------------------------------------------------  

原创 C++Primer 學習筆記

2.1.1 整型     signed:帶符號的,unsigned:無符號的。unsigned 後不加其他類型說明符意味着unsigned int。      signed 最常見的策略是用一位作爲符號位。符號位是1,值爲負數;符號位是0

原创 MFC程序在含有中文目錄的情況下打不開的問題

最好還是採用Unicode,之前也是爲了省事每次都改成多字節,後來發現很多問題不好解決。 當然也遇到過樓主同樣的問題,同樣是多字節下的中文路徑的問題

原创 strtok_s use

來源 :http://www.cplusplus.com/forum/general/13058/ #include <iostream> #include <fstream> #include <sstream> #include