原创 三維開發之路1

#include "stdafx.h" #include <vector> #include <cmath> #include <cassert> using namespace std; #define interface class

原创 使用URLDownloadToFile下載文件,有進度

class DownloadDelegate: public IBindStatusCallback { public: HWND m_hMainWnd; DownloadDelegate(HWND hWnd) : m_hMainW

原创 機器學習實踐筆記1

機器學習實踐筆記1 現在machine learning的主流是神經網絡了,它的優勢是不用做feature engineering: deep learning的幾個權威你要認識: hinton, lecun, bengio h

原创 總結

自己總結一下: 一、堆和棧 1,局部變量一般放在棧中,用戶通過malloc和new分配的變量放在堆中 2,堆的容量大,棧的容量有限制,對於每個32位windows程序,其內存爲,用戶區是2G,系統區是2G 3,堆的分配和回收慢,棧分配和回

原创 多線一一程下一一載

#pragma once class CDownloadDlg; class CInternetDownload { public: typedef struct { DWORD nStart;//文件片段的起始位置 DWO

原创 js片段

<mce:script type="text/javascript"><!-- function Node_OnAdd() { var xx = document.getElementById("show"); xx.in

原创 模仿boost::any類型

#include <iostream> #include <typeinfo> #include <map> #include <string> using namespace std; class IMeta { public: v

原创 p2p打洞的功能封裝

把它們封裝一下,正在研究這個東西。   #ifndef _MYSOCKET_H_ #define _MYSOCKET_H_ #include <WinSock2.h> #include "Exception.h" class CMyS

原创 b-encoding 封裝

/* =========================================== date author amend 4/27/2010 bs create file 4/27/2010 bs crea

原创 打印1000內的所有素數,算法複雜度O(n)

#include <stdio.h> static bool result[10000] = {0}; void fun() { bool* p = &result[0]; for (int i = 0; i < 10000; i

原创 檢查頭文件是否互相包含

頭文件互相包含是一種非常見的問題,一旦工程很大,這樣的問題比較難排除,特別是間接互相引用的時候。在項目的移植中常常會遇到這些問題,而sourceinsight中又無法查找頭文件包含關係,所以特寫了一個程序來解決此類問題。我還不知道是否有現

原创 visual c++的一個bug, 2003/2005

//============================== //a.h #pragma once class b; class a { private: b* pb; public: void print(); }; //

原创 打印不大於10000的所有素數(修訂)

基本上是掃描一遍就出來了,counter++放在if語句的前面,最終counter爲10970,如果放在後面最終counter爲9743 #include <stdio.h> static bool result[10000] =

原创 數獨求解

// onlynum.cpp : 定義控制檯應用程序的入口點。 // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc,

原创 大數相加

超大數相加:輸入:n//n個數輸出:結果#include <vector>#include <string>#include <iostream>#i