I hereby claim:
- I am mstankie on github.
- I am mstankie (https://keybase.io/mstankie) on keybase.
- I have a public key ASDqlBvzYxBakNUkZJtg5gbJrQ4-SP4oL1-ItZrVqn3W2go
To claim this, I am signing this object:
| # A yaml constructor is for loading from a yaml node. | |
| # This is taken from @misha 's answer: http://stackoverflow.com/a/15942429 | |
| def opencv_matrix_constructor(loader, node): | |
| mapping = loader.construct_mapping(node, deep=True) | |
| mat = np.array(mapping["data"]) | |
| mat.resize(mapping["rows"], mapping["cols"]) | |
| return mat | |
| yaml.add_constructor(u"tag:yaml.org,2002:opencv-matrix", opencv_matrix_constructor) | |
| # A yaml representer is for dumping structs into a yaml node. | 
| import matplotlib.pyplot as plt | 
| # Target function | |
| fitfunc = lambda T, p, x: p[0]*np.cos(2*np.pi/T*x+p[1]) + p[2]*x | |
| # Initial guess for the first set's parameters | |
| p1 = r_[-15., 0., -1.] | |
| # Initial guess for the second set's parameters | |
| p2 = r_[-15., 0., -1.] | |
| # Initial guess for the common period | |
| T = 0.8 | |
| # Vector of the parameters to fit, it contains all the parameters of the problem, and the period of the oscillation is not there twice ! | |
| p = r_[T, p1, p2] | 
| def createLineIterator(P1, P2, img): | |
| """ | |
| Produces and array that consists of the coordinates and intensities of each pixel in a line between two points | |
| Parameters: | |
| -P1: a numpy array that consists of the coordinate of the first point (x,y) | |
| -P2: a numpy array that consists of the coordinate of the second point (x,y) | |
| -img: the image being processed | |
| Returns: | 
| \definecolor{mygreen}{rgb}{0,0.6,0} | |
| \definecolor{mygray}{rgb}{0.5,0.5,0.5} | |
| \definecolor{mymauve}{rgb}{0.58,0,0.82} | |
| \lstdefinestyle{customc}{ | |
| belowcaptionskip=1\baselineskip, | |
| breaklines=true, | |
| frame=L, | |
| xleftmargin=\parindent, | |
| language=C, | |
| showstringspaces=false, | 
| def selectFile(startDir = '.', filter = "All files (*)", title = "Select a file..."): | |
| from PyQt4 import QtGui | |
| app = QtGui.QApplication([dir]) | |
| fname = QtGui.QFileDialog.getOpenFileName(None, title, startDir, filter=filter) | |
| return str(fname) | 
| #!/bin/bash | |
| # obtaining the name of either the remote origin repo or the local directory if no origin defined | |
| DIRNAME=${PWD##*/} | |
| JOBNAME=$(git config --get remote.origin.url | xargs basename || echo $DIRNAME".loc") | |
| # compiling | |
| latexmk -pdf -pdflatex="pdflatex --enable-pipes --shell-escape --enable-write18 %O %S" -jobname=$JOBNAME -output-directory="./build/" document.tex | |
| latexmk -c -jobname=$JOBNAME -output-directory="./build/" | 
| cv::namedWindow("Fullscreen", cv::WINDOW_NORMAL); | |
| cv::setWindowProperty("Fullscreen", cv::WND_PROP_FULLSCREEN, cv::WINDOW_FULLSCREEN); | |
| cv::imshow("Fullscreen", someImage); | |
| cv::waitKey(10); | 
I hereby claim:
To claim this, I am signing this object:
| import numpy as np | |
| x_coords = np.arange(3) | |
| y_coords = np.linspace(-1, 1, 11) | |
| z_coords = [0.0, 0.5, 1.0] | |
| point_grid = np.hstack([c.reshape(-1, 1) for c in np.meshgrid(x_coords, y_coords, z_coords)]) |