上一页 1 2 3 4 5 6 ··· 11 下一页

2012年7月20日

摘要: std::strncpyC++Strings libraryDefined in header<cstring>char*strncpy(char*dest,constchar*src,std::size_tcount);Ifcountis reached before the entire stringsrcwas copied, the resulting character array is not null-terminated.Copies at mostcountcharacters of the byte string pointed to bysrc(includi 阅读全文
posted @ 2012-07-20 16:02 NLP新手 阅读(675) 评论(0) 推荐(0) 编辑
摘要: (源自:http://blog.csdn.net/suhuaiqiang_janlay/article/details/5963867)首先,用一个简单的例子来重现一下我所遇到的问题:(1)在VS2008的“PropertyPages”属性页中,选择“Configuration Properties”-->“General”,可以看到当前使用的字符集是“Multi-Byte Character Set”,也就是说程序中使用的是多字节字符集。(2)接下来看看ifstream打开txt文件的简单代码: 1 #include "stdafx.h" 2 #include &l 阅读全文
posted @ 2012-07-20 15:30 NLP新手 阅读(9827) 评论(2) 推荐(1) 编辑
摘要: std::basic_string::copyC++Strings librarystd::basic_stringsize_type copy(CharT*dest, size_type count, size_type pos=0);Copies a substring[pos, pos+count)to character string pointed to bydest. If the requested substring lasts past the end of the string, or ifcount==npos, the copied substring is[pos, 阅读全文
posted @ 2012-07-20 13:59 NLP新手 阅读(6401) 评论(0) 推荐(0) 编辑
摘要: 简单来说,<cstring>是包含一些C字符串的操作函数,包含一些常用的C字符串处理函数,比如strcmp、strlen、strcpy之类的函数与原来的<string.h>对应。但头文件的内容在名字空间std 中。<string>包含的是C++的string类。下面是C++头文件的现状:(1)旧的C++头文件名如 <iostream.h>将会继续被支持,尽管它们不在官方标准中。这些头文件的内容不在名字空间std 中。新的C++头文件如 <iostream>包含的基本功能和对应的旧头文件相同,但头文件的内容在名字空间std 中。(在标准 阅读全文
posted @ 2012-07-20 12:22 NLP新手 阅读(3283) 评论(0) 推荐(0) 编辑

2012年7月19日

摘要: 1 #include <string> 2 #include <fstream> 3 #include <iostream> 4 5 using namespace std; 6 7 const string sourceFile="source.txt"; //源文件路径 8 const string resultFile="result.txt"; //结果文件路径 9 const string keyStr="a"; //关键字符串10 11 int _tmain(int argc, _TCH 阅读全文
posted @ 2012-07-19 10:22 NLP新手 阅读(522) 评论(0) 推荐(0) 编辑

2012年7月18日

摘要: 1 #include <iostream> 2 #include <set> 3 #include <fstream> 4 #include <string> 5 using namespace std; 6 7 int main() 8 { 9 set <string> s; 10 string str; 11 ifstream in("source.txt"); 12 ofstream out("result.txt"); 13 14 while(getline(fin,str)) //按行 阅读全文
posted @ 2012-07-18 22:09 NLP新手 阅读(580) 评论(0) 推荐(0) 编辑

2012年7月13日

摘要: 网上给出的方法是,1. 打开终端,在其中输入命令:#gconf-editor并回车。2. 在新开的窗口里,在左边依次展开“apps”、“gedit-2”、“preferences”、“encodings”。结果我打开preference,里面没有encodings。有网友说:12.04是新版本的,输入下面的命令:gsettings set org.gnome.gedit.preferences.encodings auto-detected "['UTF-8','GB18030','GB2312','GBK',' 阅读全文
posted @ 2012-07-13 17:30 NLP新手 阅读(291) 评论(0) 推荐(0) 编辑

2012年7月9日

摘要: 1建表:建表语句形式1:Create table table_name(col_name1 type ,col_name2 type,… ) row format DELIMITED FIELDS TERMINATED BY '\t' location ‘/user/$username/warehouse/tables/table_name’建表实例1:create table hue_fengchao_test23(a int,b string)row format DELIMITED FIELDS TERMINATED BY '\t'location  阅读全文
posted @ 2012-07-09 14:33 NLP新手 阅读(690) 评论(0) 推荐(0) 编辑

2012年7月5日

摘要: (源自:http://blog.csdn.net/kkk9127/article/details/1487686)--查询分析器中执行:--建表table1,table2:create table table1(id int,name varchar(10))create table table2(id int,score int)insert into table1 select 1,'lee'insert into table1 select 2,'zhang'insert into table1 select 4,'wang'insert 阅读全文
posted @ 2012-07-05 10:56 NLP新手 阅读(44279) 评论(1) 推荐(2) 编辑

2012年7月1日

摘要: 自然语言中的关键词检测,首先要了解的数学背景知识有:泊松分布、随机过程、泊松过程和指数分布。我对随机过程的简单理解是连续参数区间上的无穷多个随机变量,或离散参数区间上无穷个随机变量(成为随机序列)。(人生就像是个随机过程,每下一秒都是个随机变量。)泊松过程:首先要明确“累积量”N(t),t>=0,表示在时间间隔 (0,t] 内事件发生次数(这和泊松分布说的是一致的)。泊松过程中时间点对应的随机变量就是这个时刻的“累积量”。提前说明:N(t)>=0;N(t)取正整数;若s<t,则N(s)<=N(t);当s<t,增量N(t)-N(s)等于区间(s,t]中事件发生次数。 阅读全文
posted @ 2012-07-01 14:42 NLP新手 阅读(663) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页

导航