原创 C++常量引用作爲函數參數的例子

 #include<iostream> int fun1(const  int & a); int main () {     using namespace std;     int i=3;     cout<<fu

原创 ubuntu 12.0.4 已root登陸到系統

   Ubuntu 12.04默認是不允許root登錄的,在登錄窗口只能看到普通用戶和訪客登錄。以普通身份登陸Ubuntu後我們需要做一些修改,普通用戶登錄後,修改系統配置文件需要切換到超級用戶模式,在終端窗口裏面輸入: su

原创 cuda QUADRO K600

 QUADRO K600 - Product Specifications Memory Size 1 GB GDDR3 Memory Interface 128-bit Memory Bandwidth  29 GB/s CUDA

原创 cuda 6.5 bandwidthTest.exe

 [CUDA Bandwidth Test] - Starting... Running on...  Device 0: Quadro K600  Quick Mode  Host to Device Bandwidth, 1 De

原创 c++ 一維數組轉二維數組

const int a[10] = { 1, 2, 3, 4, 5,6,7,8,9,10 }; int b[2][5]={0}; int i=0; int j=0; for (int m=0;m<10;m++) { i=m

原创 機器學習 ELKI 使用心得 DBSCAN

一下是我們使用elki 在自己的代碼中調用DBSCAN 算法的一個例子 int NumberofDatabase=2730*35; String file="E://RXM_DATA//weka_elki_data//HSV//D

原创 C++ 字符串和二維數組索引

int counterPos = 7;char c1[10]="000000009";printf("%s",c1+counterPos);cout<<endl;cout<<c1+counterPos<<

原创 c/c++ 鞏固

strncmp(char *s1,char *s2,size_t size); 比較字符串的前size個字符是否相等,相等返回0,否則(s1="qwe",s2="qwf",strncmp(s2,s1,3) 這樣返回的是(f-e)值); s

原创 c++ list iterator not incrementable

這段代碼報如下的錯解決方式 for (it = li.begin(); it != li.end();it++){li.erase(it);} for (it = li.begin(); it != li.end();){it = l

原创 cuda 1000 32 block 256 threads 2 改進

#include "cuda_runtime.h" #include "device_launch_parameters.h" #include <stdio.h> #include <iostream> using namespace

原创 求一個正整數的所有質數因子

 #include <iostream> using namespace std; void getResult(long int input) {  for (int i=2;i<=input;i++)  {   while((0=

原创 itk 讀圖像 c++ 0xC0000005: Access violation reading location 0x00000000 出錯總結

int main (){int * p=NULL;int a;a=p[0];cout<<a;} 這個例子大家一定看明白了。就是因爲我們定義了一個空指針。但是我們去訪問的元素。 但是有時大家可能會遇到這樣一個問題覺得你初始化了。昨天我們

原创 cuda 斷點不停可能原因

1. 64 thread block,(40,40) threads per block   顯然這是錯誤的。一塊允許的最大線程數量是1024,每個維上允許的最大的線程數量。一定要搞清這個概念。 所以,最後只能開(32,32)thread

原创 Qt error LNK2019: error LNK2001: vs2010

有很多可能,現在就自己解決的方式做一下總結: 1.Qt5Widgetsd.lib看這個lib 文件有沒有加載 2.要使用QFileDialog  在Qt Progect setting 裏必須加模塊 不然會報錯沒有QfileDial

原创 a pointer to a bound function may only be used to call the function

指針指向的是一個函數,既然是函數必須是加一個括號的(ptrAsa->getStyleName  ptrAsa->getStyleId())