pip install opencv-python
This file contains hidden or 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
| token="" | |
| username="@me" | |
| curl -H "Authorization: Bearer ${token}" \ | |
| "https://api.github.com/search/issues?q=is:issue+commenter:${username}" |
This file contains hidden or 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
| import random | |
| def sort_helper(lst, idx, max_idx, reversed): | |
| # base case | |
| if not lst or len(lst) == 1: | |
| return lst | |
| if idx >= max_idx: | |
| return lst |
This file contains hidden or 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
| #include <cstdio> | |
| #include <utility> | |
| #include <iostream> | |
| template<class T> | |
| class Addition { | |
| protected: | |
| T a_; | |
| public: |
This file contains hidden or 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
| // my_type.hpp | |
| template<typename T> | |
| void foo(T n) { } | |
| // my_type.cpp | |
| #include "my_type.hpp" | |
| #include<iostream> |
This file contains hidden or 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
| string stripSurroundingSpaces(string s) { | |
| int i = 0; | |
| while(i<s.size() && s[i] == ' ') { | |
| i++; | |
| } | |
| int j = s.size()-1; | |
| while(j >= 0 && s[j] == ' ') { | |
| j--; | |
| } |
This file contains hidden or 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| vector<string> tokenize(string data, string sep = " ") { | |
| vector<string> tokens; | |
| if(data.empty()) { | |
| return tokens; | |
| } | |
| size_t lpos = 0, rpos; | |
| while(true) { |
This file contains hidden or 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
| // Forward declaration of the read4 API. | |
| int read4(char *buf); | |
| class Solution { | |
| public: | |
| /** | |
| * @param buf Destination buffer | |
| * @param n Maximum number of characters to read | |
| * @return The number of characters read | |
| */ |
This file contains hidden or 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| class Number{ | |
| private: | |
| int _val; | |
| std::function<void(Number&,int)> _strategy; | |
| public: | |
| Number() : _strategy(nullptr) {} |
This file contains hidden or 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
| Install Anaconda, graphical or command-line installer. If you have command-line installer, then make sure to have ~/.bash_profile: | |
| ``` | |
| export PATH="/Users/yourusername/anaconda3/bin:$PATH" | |
| ``` | |
| Then type in the terminal: | |
| ``` | |
| conda create -n cv_env numpy scipy scikit-learn matplotlib python=3 | |
| source activate cv_env |
NewerOlder