I hereby claim:
- I am makoc on github.
- I am makoc (https://keybase.io/makoc) on keybase.
- I have a public key whose fingerprint is 89F7 155E C20B F864 E29E 21DF A27F 66F7 7A73 B7EF
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True): | |
"""Create a view of `array` which for every point gives the n-dimensional | |
neighbourhood of size window. New dimensions are added at the end of | |
`array` or after the corresponding original dimension. | |
Parameters | |
---------- | |
array : array_like | |
Array to which the rolling window is applied. | |
window : int or tuple |
"""Impressive little thing how einsum + stride_tricks can beat numpys build in C functions | |
for correlate (for large data). (ok depending on the implementation of np.correlate, the | |
comparison is not fair, but still rather impressive that you can get comparable speeds) | |
""" | |
import numpy as np | |
import stride_tricks as st # stride_tricks.py gist | |
a = np.random.random((100,100,100)).ravel() | |
stamp = np.random.random((3,3,3)).ravel() |
import numpy as np | |
from collections import defaultdict as _dd | |
def rolling_window(array, window=(0,), asteps=None, wsteps=None, axes=None, toend=True): | |
"""Create a view of `array` which for every point gives the n-dimensional | |
neighbourhood of size window. New dimensions are added at the end of | |
`array` or after the corresponding original dimension. | |
Parameters | |
---------- |
import numpy as np | |
from numpy import asarray, add, rollaxis, sort, arange | |
def percentile(a, q, limit=None, interpolation='linear', axis=None, | |
out=None, overwrite_input=False): | |
""" | |
Compute the qth percentile of the data along the specified axis. | |
Returns the qth percentile of the array elements. |
# conda install h5py pytables | |
__import__('tables') # <-- import PyTables; __import__ so that linters don't complain | |
import h5py | |
# now h5py "supports" blosc | |
def blosc_opts(complevel=9, complib='blosc:lz4', shuffle=True): | |
shuffle = 2 if shuffle == 'bit' else 1 if shuffle else 0 | |
compressors = ['blosclz', 'lz4', 'lz4hc', 'snappy', 'zlib', 'zstd'] |
There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.
Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.
His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the
def decode(msg): | |
text = [] | |
for i in range(0, len(msg), 2): | |
text.append(unrot(msg[i: i + 2])) | |
return str.join('', text) | |
def unrot(pair, key=ord('x')): | |
offset = 0 | |
for c in 'cdefgh': |