原创 Django Bug

1. MultiValueDictKeyError Possible cause and solutions: There is no dict key named ‘user’, or you have a naming

原创 Matlab Coding Tricks

算每一列的均值 % X: 1000 * 128 sample_mean = mean(X, 1); % sample_mean: 1 * 128 每個元素減去所在列的均值 sample_mean = mean(X, 1); X =

原创 OpenCV 中 IplImage、CvMat、Mat中的type是怎麼回事?

在使用opencv的過程中,無論使用原始的IplImage和CvMat類型,還是用最新C++版本的Mat類型,在創建和使用過程中,經常會遇到CV_8UC1、CV_8UC3、CV_32FC3等聲明,我以前也經常遇到,曾經看懂了,現在

原创 C#調用C函數(DLL)傳遞參數問題

備忘: 1.C函數參數爲字符串char*。如果是入參,對應C#中string或StringBuilder;如果是出參對應C#中StringBuider;   2.C函數參數爲結構體指針,需在C#中對應定義結構體。如果是入參,C#中

原创 [LeetCode]Delete Digits

題目 Given string A representative a positive integer which has N digits, remove any k digits of the number, the rem

原创 Summary for LeetCode 2Sum, 3Sum, 4Sum, K Sum

Summary for LeetCode 2Sum, 3Sum, 4Sum, K Sum Overview I summarize various solutions (sort, hash, etc) for the le

原创 The backtracking algorithm

Backtracking Backtracking is a form of recursion. The usual scenario is that you are faced with a number of options, an

原创 function 將數據點分配到最近的聚類中心

背景 在對大樣本進行聚類時,由於k-means的計算開銷問題,通常隨機選取部分樣本進行聚類,得到聚類中心。然而往往要得到每個樣本最近聚類中心,這常用在檢索索引構建中,eg. OPQ (PAMI 2014),Inverted Mul

原创 OpenCV Bug集合

OpenCV Bug集合 不定期更新 1.vs2010引用了MotionDll.dll,可是報錯: Error 1 error LNK1104: cannot open file ‘MotionDll.lib’ 解決

原创 leetcode 202 Happy Number

202. Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the

原创 Iterative Quantization: A Procrustean Approach to Learning Binary Codes (ITQ)

Problem Similarity-preserving binary codes for efficient retrieval in large-scale image collections. ITQ Method 1.

原创 OpenCV tricks 筆記

不定時更新 1. cvGet2D函數越界問題 CvScalar cvGet2D( const CvArr* arr, int idx0, int idx1 ); 對於圖像中的某一像素點 P(x, y), 在我們正常的座標系中

原创 Python Coding Tricks

1. Python 二維數組 數據類型轉換 >>> a = [['1','2','5','6','8'],['4', '5', '8', '5', '8']] >>> map(map, [float, float], a) 15:

原创 Mac下git通過SSH進行免密碼安全連接github

某日push至github時出現以下錯誤: Push failed          Failed with error: error: RPC failed; result=56, HTTP code = 200          fa

原创 C++ Coding Tricks Note

持續更新ing… string轉C風格char數組: string A = "1234"; char ch_a[5]; strcpy(ch_a, A.c_str()); *給定目錄路徑 ,讀取該目錄下的所有文件 win7