06 2011 档案

摘要:function [y,predict_class] = f_knn(tr,tr_memberships,te,k)%% FUZZY KNN classification%% [y,predict_class] = f_knn(tr,tr_memberships,te,k)%% tr: a NxD-matrix where N is the number of training samples% and D is the dimension of the feature space. Each row is % the representation of a training sample.% 阅读全文
posted @ 2011-06-30 15:46 hailong 阅读(546) 评论(0) 推荐(0) 编辑
摘要:Posted By Mr. Thursday 各位看到標題,如果沒有聽過KNN演算法,會不會覺得疑惑:KNN是甚麼呢?是不是CNN看久了,就變成DNN、ENN、最後變成KNN了呢?當然不是啦 XD!KNN全名是k-th nearest neighbor,中文意思是「第k位最接近的鄰居」。甚麼是「第k位最接近的鄰居」呢?假設在一個廣場上,有100個朋友,每位朋友都是你的鄰居,最接近你的鄰居,就是「第一位距離最近的鄰居」了,比第一位稍微遠一點的鄰居,就是「第二位距離最近的鄰居」了,以此類推,第10位距離最近的鄰居,就是k=10的時候了。至於KNN演算法是甚麼,又有甚麼特別呢?之前提過了「人工智慧與 阅读全文
posted @ 2011-06-30 10:27 hailong 阅读(772) 评论(0) 推荐(0) 编辑
摘要:异常是程序运行时出现的不正常,比如内存耗尽或输入错误。异常机制提供程序中错误检测与错误处理部分的通信。包括:throw表达式:if(expression) throw runtime_error("error");do otherthingtry块try{program}catch(expression){handle-statements;}由标准库定义的一组异常类 阅读全文
posted @ 2011-06-29 20:47 hailong 阅读(316) 评论(0) 推荐(1) 编辑
摘要:就是上一个题目的改写,灰常简单:#include <iostream>#include<string>using namespace std;int main(){ string cur,pre; bool flag = true; cout << "Please input string: " ; while (cin >> cur ) { if (cur == pre && cur[0] >= 'A' && cur[0] <= 'Z') { cou 阅读全文
posted @ 2011-06-29 20:34 hailong 阅读(300) 评论(0) 推荐(0) 编辑
摘要:这次参考之前C++primer的习题答案,的确比较方便:问题是比较输入一系列string,如果发现连续相同的string则输入结束,否则循环进行:#include <iostream>#include<string>using namespace std;int main(){ string cur,pre; bool flag = true; cout << "Please input string: " ; while (cin >> cur ) { if (cur == pre) { if(!cur.empty()) c 阅读全文
posted @ 2011-06-29 20:12 hailong 阅读(291) 评论(0) 推荐(0) 编辑
摘要:比较string大小,其实很简单,练手吧,快改找工作了,谁跟我提点建议啊?谢谢啦只看了C++,据说还要考察操作系统神马的:不说了,把代码贴上吧:#include <iostream>#include<string>using namespace std;int main(){ string s1,s2; bool flag = true; cout << "Please input two strings s1 and s2:" << endl; while (flag == true && cin>&g 阅读全文
posted @ 2011-06-29 19:48 hailong 阅读(332) 评论(0) 推荐(0) 编辑
摘要:比较包含关系:#include <iostream>#include<vector>#include<string>using namespace std;bool my(vector<int> a, vector<int> b, size_t size){ for (size_t i = 0; i < size; ++i) { if(a[i] != b[i]) return false; } return true;}int main(){ vector<int> a,b; int c = 0; cout < 阅读全文
posted @ 2011-06-28 22:36 hailong 阅读(264) 评论(0) 推荐(0) 编辑
摘要:http://www.ittvis.com/UserCommunity/UserForums/tabid/58/forumid/29/postid/8678/scope/posts/Default.aspxENVI does not provide a KNN classification tool except as an option in the Feature Extraction module's object-based classification. In core ENVI, K-means is not the same as KNN. There is the Ma 阅读全文
posted @ 2011-06-27 16:53 hailong 阅读(743) 评论(0) 推荐(0) 编辑
摘要:看了答案之后,我表示我考虑多了,写复杂了,但是还是贴出来吧:the code in c++ primer :#include <iostream>#include<vector>#include<string>using namespace std;int main(){ string preword, currword,repword; int currCnt = 0, maxCnt =1; while (cin >> currword) { if (currword == preword) { ++currCnt; } else { if ( 阅读全文
posted @ 2011-06-26 17:38 hailong 阅读(618) 评论(0) 推荐(0) 编辑
摘要:General imagesegmentation techniques are divided into twomain classes. The first, called pixel-oriented segmentation,considerseach pixel of the image as one graph node. Edgesgenerally connect every pixelto its 3 × 3 neighborhood. Thesecondclass considers regions as graph nodes. Such regions are 阅读全文
posted @ 2011-06-22 21:39 hailong 阅读(212) 评论(0) 推荐(0) 编辑
摘要:神马项目啊,设置了那么多图像库,我弄了那么长时间啊,没成功,彻底放弃! 阅读全文
posted @ 2011-06-20 22:28 hailong 阅读(158) 评论(0) 推荐(0) 编辑
摘要:const int ic;非法,定义const对象时必须同时初始化const int *ic;合法,但是pi可以变,而*pi是常量,哦,这样貌似就可以不初始化了int *const ic;非法,ic指向int型的const指针,未被初始化const int *const ic;非法P113,这是重点也是难点啊 阅读全文
posted @ 2011-06-18 21:34 hailong 阅读(179) 评论(0) 推荐(0) 编辑
摘要:arcgis 9.3安装步骤安装+破解所需文件:arcgis9.3安装包(rar或者iso),约为3.5G;(网上可下载)License_server_setup文件夹(37102011.efl9,LMSetup.exe)license_server_crack文件夹(Arc_info9.lic,Lmgrd,lmtools,arcgis,lmutil)data_interop文件夹(fme_license)。(后面这些破解补丁学院FTP可下载)一、安装ArcGIs Desktop9.31.打开下载的ArcGIS Desktop9.3,找到ESRI光盘启动程序(硬盘上的安装文件也行),打开它。2 阅读全文
posted @ 2011-06-13 15:58 hailong 阅读(395) 评论(0) 推荐(0) 编辑
摘要:在arcgis 环境中将鼠标指向菜单栏,点右键-->选择Editor工具-->start editing-->选择所要编辑的图层-->OK-->使用选择工具,选中所要编辑的图斑-->然后在Editor 工具条的task栏中-->选择Modify tasks-->cut polygon features-->然后使用task旁的编辑工具(铅笔形图标)-->跨越图斑划一条直线,图斑将被分成两半。可以在图斑的任意位置进行分割,分割成任意大小。分割后的面积,在属性表中可以看到。 注意:编辑完成后,点Editor 下拉菜单-->save 阅读全文
posted @ 2011-06-13 15:24 hailong 阅读(1973) 评论(0) 推荐(0) 编辑
摘要:第1章 Java简介及开发环境搭建实验1 JDK的下载、安装与配置【实验目的】(1)熟悉JDK工具包的下载及安装过程。(2)掌握JAVA_HOME、CLASSPATH及Path的设置内容。(3)掌握Java程序运行原理及Javac、Java命令的使用。【实验要求】(1)登录SUN官方网站http://java.sun.com并下载最新版JDK工具包。(2)将JDK工具包安装在D:\java\jdk1.6.0_18\文件夹中。(3)完成JDK环境配置。创建JAVA_HOME变量并设置其值为“D:\java\jdk1.6.0_18”,创建CLASSPATH变量并设置其值为“D:\java\jdk1 阅读全文
posted @ 2011-06-13 15:16 hailong 阅读(3422) 评论(0) 推荐(0) 编辑
摘要:关键是如何把MFC中代表整数的控件,让我想把他换为0-1之内的小数时,如何改变原来的代码,使二者在实现上没有多大差别,这是个问题啊,看来得努力了! 阅读全文
posted @ 2011-06-10 23:06 hailong 阅读(175) 评论(0) 推荐(0) 编辑
摘要:#include <string>#include <iostream>#include<vector>using namespace std;int main(){ vector<int> a(10,0); for (size_t i = 0; i < a.size(); ++i) { a[i] = i+1; }} 阅读全文
posted @ 2011-06-10 20:14 hailong 阅读(182) 评论(0) 推荐(0) 编辑
摘要:普通数组:#include <string>#include <iostream>#include<vector>using namespace std;template<class T>bool is_equal(T *a, int size_a,T * b, int size_b){ if (size_b !=size_a) return false; for (int i = 0; i < size_a; ++i) if (a[i] != b[i]) return false; return true;}int main(){ int 阅读全文
posted @ 2011-06-10 20:04 hailong 阅读(1100) 评论(0) 推荐(0) 编辑
摘要:用模板写一个:#include <string>#include <iostream>#include<vector>using namespace std;template<class T>T* copy(T *a,int size){ T* b = new T[size]; for (int i = 0; i < size; ++i) { b[i] = a[i]; } return b;}int main(){ int a[] = {1,2,3,4}; int size = sizeof(a)/sizeof(*a); int *b = 阅读全文
posted @ 2011-06-10 19:47 hailong 阅读(339) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <vector>using namespace std;int main(){ vector<int> vec(10); for (size_t i = 0; i < 10; ++i) { cin >> vec[i]; } vector<int>::iterator iter = vec.begin(); cout << "The beginning number is:" <<endl; for (; iter != vec.e 阅读全文
posted @ 2011-06-09 09:25 hailong 阅读(206) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <iomanip>#include <fstream>#include <string>#include <iostream>#include <vector>using namespace std;void get_upper(string &s){ for(size_t i = 0; i != s.size(); ++i) { s[i] = toupper(s[i]); }}int main(){ ifstream infile("E:\\tes 阅读全文
posted @ 2011-06-08 22:11 hailong 阅读(5127) 评论(2) 推荐(1) 编辑
摘要:计算临界元素的和并输出#include <iostream>#include <vector>using namespace std;int main(){ vector<int> ivec; int i = 0; while(cin >> i) ivec.push_back(i); size_t len = ivec.size(), j = 0; for (; j != len-1; ++j) { cout << ivec[j]+ivec[j+1] << " "; } if ((j+1)%2) { c 阅读全文
posted @ 2011-06-08 09:27 hailong 阅读(355) 评论(0) 推荐(0) 编辑
摘要:#include <iostream>#include <string>using namespace std;char* my_del_dot(string s){ size_t len = s.size(); char *des = new char[len+1]; int j = 0; for (size_t i = 0; i != len; ++i) { if (isalpha(s[i])) { des[j++] = s[i]; } } des[j] = '\0'; return des;}int main(){ string s; cin &g 阅读全文
posted @ 2011-06-06 11:18 hailong 阅读(692) 评论(2) 推荐(0) 编辑
摘要:argument实参,传递给被调用函数的值buffer缓冲区,一段用来存储数据的区域。cerr绑定要标准错误的ostream对象。class自定义数据结局的C++机制data structure数据以及数据操作的组合成员函数 类定义的操作namespace讲库所定义的名字放到单独的一个地方的机制string literak字符串字面值:以双引号括起的字符序列 阅读全文
posted @ 2011-06-06 10:50 hailong 阅读(245) 评论(1) 推荐(1) 编辑

点击右上角即可分享
微信分享提示