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:
# Get i, j, k indices of grid nodes as a list to iterate over | |
import numpy as np | |
GRID_SHAPE = (2, 3, 4) | |
grid_indices: np.ndarray = np.indices(GRID_SHAPE).reshape(len(GRID_SHAPE), -1).T | |
grid_indices.shape # >> (24, 3) | |
# This way we can loop through the indices as array rows | |
for idx in grid_indices: |
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)]) |
I hereby claim:
To claim this, I am signing this object:
cv::namedWindow("Fullscreen", cv::WINDOW_NORMAL); | |
cv::setWindowProperty("Fullscreen", cv::WND_PROP_FULLSCREEN, cv::WINDOW_FULLSCREEN); | |
cv::imshow("Fullscreen", someImage); | |
cv::waitKey(10); |
#!/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/" |
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) |
\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 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: |
# 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] |
import matplotlib.pyplot as plt |