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
| def pca(X): | |
| """ | |
| Features are in columns | |
| """ | |
| # Data matrix X, assumes 0-centered | |
| n, m = X.shape | |
| assert np.allclose(X.mean(axis=0), np.zeros(m)) | |
| # Compute covariance matrix |
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
| fig = figure(1); | |
| set(gcf,'units','points','position',[0,0,1200,500]) |
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
| sudo apt-get install liblapack-dev | |
| sudo apt-get install libblas-dev | |
| sudo apt-get install libboost-dev | |
| sudo apt-get install libarmadillo-dev |
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
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/pylon5/lib64 |
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
| (sudo) find /search/directory -type f -name "filename_to.find" |
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
| Ctrl+Alt+F1 |
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
| conda install pip | |
| source activate base (or env...) | |
| pip install [package] |
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
| // subtract IR from BGR | |
| Vec3u tmp; | |
| for (int i = 0; i < ir.rows; i++) { | |
| for (int j = 0; j < ir.cols; j++) { | |
| tmp = bgr.at<Vec3u>(i,j); | |
| tmp[0] = tmp[0] - ir.at<ushort>(i,j); | |
| tmp[1] = tmp[1] - ir.at<ushort>(i,j); | |
| tmp[2] = tmp[2] - ir.at<ushort>(i,j); | |
| bgr.at<Vec3u>(i, j) = tmp; |
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
| def print_object(some_object): | |
| # Check if the object is printable... | |
| try: | |
| printable = str(some_object) | |
| except TypeError: | |
| print("unprintable object") | |
| else: | |
| print(printable) | |
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
| def colored_noise_generator(D, lamb, dt): | |
| """ | |
| An iterable generator function for colored noise. | |
| :param D: Amplitude of the noise | |
| :param lamb: Reciprocal of the characteristic time | |
| :param dt: Time step | |
| :return : yields the successive value | |
| """ |