原创 PHP使用SyntaxHighlighter顯示xml文件
<?php header("Content-Type: text/html; charset=gb2312"); if(!isset($_GET["key"])) { header("Location: /skinhelp/index.
原创 python用http.server實現的http服務器
import os import shutil from io import StringIO from pymongo import MongoClient, ASCENDING from urllib.parse import url
原创 virtualbox中安裝配置ubuntu桌面版系統
在virtualbox中安裝了個ubuntu,學學linux。virtualbox虛擬機功能強大,而且還免費。 virtualbox下載:https://www.virtualbox.org/wiki/Downloads ubuntu下
原创 GUI單元測試方法
GUI自動化測試有很多方法,但對於貼近於單元測試方面的GUI測試方法卻不是很多,可能最主要的原因是在於消息循環比較難處理。 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevI
原创 成員函數指針表
函數指針和成員函數指針的一個公共用途是,將它們存儲在函數表中。函數表是函數指針的集合,在運行時從中選擇給定調用。 對具有幾個相同類型成員的類而言,可以使用這樣的表來從這些成員的集合中選擇一個。假定擴展screen類以包含幾個成員函數,其中
原创 [vs 2005]vector雙參數構造流程
源代碼:#include <vector> using namespace std; int main() { vector<int> vec(20, 10); return 1; } 分析:vector實現中有兩個函數,一個是
原创 vba調用vs2005使用atl開發的com組件
1、新建工程 New -- Project -- ATL Project 勾選Allow merging of proxy/stub code 2、添加接口 右鍵工程 -- Add -- ATL Simple Object
原创 win32com調用ATL編寫的COM組件
IDL文件 import "oaidl.idl"; import "ocidl.idl"; [ object, uuid(B325C169-61FA-4513-9DB1-0CC231CCB633), dual, nonexten
原创 指向函數的指針數組
我們可以創建一個有趣的結構式指向函數的指針數組。爲了選擇一個函數,只需要使用數組的下標,然後間接引用這個指針。這種方式支持表格式驅動碼(table-driven code)的概念;可以根據狀態變量(或狀態變量的組合值)去選擇被執行函數,而
原创 evhttp實現的http服務器
/* A trivial static http webserver using Libevent's evhttp. This is not the best code in the world, and it does so
原创 bufferevent實現的echoserver
// echoserver.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <event2/liste
原创 bufferevent實現的簡易http client
#include "stdafx.h" #include <event2/dns.h> #include <event2/bufferevent.h> #include <event2/buffer.h> #include <event2
原创 win7下libevent實現的rot13服務器
// libev_rot13.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <event2/eve
原创 windows下使用vs2005編譯libevent 2.0.21
使用makefile編譯 1、打開vs2005編譯控制檯。 cd /d E:\an_ui\Demo\Projects\libevent-2.0.21 nmake /F Makefile.nmake clean nmake /F Makef
原创 MFC可停靠菜單欄的創建過程
VS2010創建的MFC單文檔工程中,菜單欄也是可停靠,本文簡單分析一下停靠菜單的創建過程。 首先呢,給出一下類圖結構 CMainFrame有一個 CMFCMenuBar m_wndMenuBar 成員,從名字中可以推斷出它代表了菜單