This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
sudo yum install -y python-devel numpy # 2.6.9 | |
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.10/opencv-2.4.10.zip | |
unzip opencv-2.4.10 | |
cd opencv-2.4.10 | |
mkdir build | |
cd build | |
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_NEW_PYTHON_SUPPORT=ON -D BUILD_EXAMPLES=ON .. | |
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am hitigon on github. | |
* I am hitigon (https://keybase.io/hitigon) on keybase. | |
* I have a public key whose fingerprint is 642F 79D4 C749 7F7B 9FA5 ACAF 896D 47B4 4A31 EAAF | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// O(n) | |
int split(vector<string> &tokens, const string &str, const string &delim) | |
{ | |
int count = 0; | |
auto begin = str.begin(); | |
auto it = str.begin(); | |
auto end = str.end(); | |
while (begin != end && it != end) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//naive way to implement C++ string split | |
//In the worst case, it costs O(n^2) time | |
int split(string tokens[], string str, string d) { | |
int i = 0; | |
size_t n = str.length(); | |
if (d.length() > n || str.find(d) == string::npos) return -1; | |
size_t pos; |