- 博客(14)
- 资源 (1)
- 收藏
- 关注
转载 遍历文件夹及其子文件夹下所有文件
void dfsFolder(string folderPath, ofstream &fout) { _finddata_t FileInfo; string strfind = folderPath + "\\*"; long Handle = _findfirst(strfind.c_str(), &FileInfo); if (Handle ==
2013-10-09 23:47:40
710
转载 建立词袋子模型
int ConstructMap(map>>&mymap,int beginindex,int endindex) { // vector mySplit(string s); setMakeStopSet(); vectorgoodWordsinPieceArticle(string rawtext,setstopwords); CoInitialize
2013-10-06 23:43:27
790
转载 Visual Studio 2010 下 Boost.Regex 库的使用笔记
这个文章很靠谱,我实际使用过。 关键是简单。 原文地址 最近玩了一把 Boost 中的 Regex 库,发现网上很多文章写的晦涩难懂,更让人生气的是按照其指导是做不出来的,综合几篇文章和自己的实际使用的总结,写个笔记备忘。 按照我自己的老习惯来,先直捣黄龙,能够运行实例再说,把东西做出来之后我们再来进一步的了解相关知识点。 开始吧 1,下载 Boost Release
2013-10-06 16:38:46
953
转载 基于BP网络的语言识别代码
%% 该代码为基于BP网络的语言识别 %% 清空环境变量 clc clear %% 训练数据预测数据提取及归一化 %下载四类语音信号 load data1 c1 load data2 c2 load data3 c3 load data4 c4 %四个特征信号矩阵合成一个矩阵 data(1:500,:)=c1(1:500,:); data(501:1000,:)=c2(1:500,:);
2013-10-04 19:51:41
1890
转载 prim算法
prime算法用于解决wikioi 1003题 //1003 电话连线 //http://www.wikioi.com/problem/1003/ /******************************************************************** mst[]用父节点标注法,即mst[j]=i表示j的父亲节点是i ****************
2013-09-30 23:29:34
515
转载 一 造成segment fault,产生core dump的可能原因
转载地址 1.内存访问越界 a) 由于使用错误的下标,导致数组访问越界 b) 搜索字符串时,依靠字符串结束符来判断字符串是否结束,但是字符串没有正常的使用结束符 c) 使用strcpy, strcat, sprintf, strcmp, strcasecmp等字符串操作函数,将目标字符串读/写爆。应该使用strncpy, strlcpy, strncat, str
2013-09-26 20:24:41
504
转载 寻找水王
Type Find(Type* a, int N) //a代表数组,N代表数组长度 { Type candidate; int nTimes, i; for(i = nTimes = 0; i { if(nTimes == 0) { candidate = a[i], nTimes = 1;
2013-09-18 19:14:14
493
转载 Dijkstra源代码
void Dijkstra(){ for(int i=1;i<=n;i++) dis[i] = map[1][i]; int k; for(int i=1;i<n;i++){ int tmin = maxint; for(int j=1;j<=n;j++)
2013-09-15 20:50:40
626
转载 KMP核心代码
计算预处理 P[1]:=0; j:=0; for i:=2 to m do begin while (j>0) and (B[j+1]<>B[i]) do j:=P[j]; if B[j+1]=B[i] then j:=j+1; P[i]:=j; end; KMP匹配 j:=0; for i:=1 to n do begin while (j>0) a
2013-09-15 20:43:08
506
原创 《编程之美》重建二叉树
// test4.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; struct Node{ Node* pLeft; Node* pRight; char chvalue; }; void Rebuild(char* pPreOrder,char* pInOrder,int nTreeLen
2013-09-14 19:54:06
470
原创 《C++ Primer》习题12.38——12.40
习题是关于static成员函数的#include "stdafx.h" #include "iostream" using namespace std; class Foo{ public: Foo(int value) { a=value; } int geta() { return a; } int a; }; class Bar{ public : stati
2013-05-02 23:05:42
486
原创 static成员变量在类的定义体中初始化
一般来说,类的static成员跟普通数据成员一样,不能在类的定义体中初始化。(至于为什么还没想明白),比如下例 class A { public: static const double b=0; }; 但是有之中情况是例外的,就是整形的const static成员,比如下例 #include "stdafx.h" #include "iostream"
2013-05-02 22:24:23
993
原创 使用八叉树将真彩色颜色进行量化
使用八叉树将真彩色颜色进行量化 项目中有一个小模块要求找到一幅图的主色调,并求出主色调的比例,我想到了颜色量化的方法。 由于前几届师兄的论文中有提到使用八叉树进行颜色量化,所以我也就在没有进行任何对比的情况下选择了八叉树颜色量化方法。 使用八叉树量化方法的原理不是很难懂,只是实现起来有很多细节问题值得注意。我到网上找了找程序,最终发现了吴梦华 csdn上叫神曲(seren
2013-04-27 19:06:24
3284
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人