This file contains 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
(require 'request) | |
(setq mb-emacs-app-token "123456789") ;; create this in account -> app tokens -> edit apps | |
(setq mb-micropub-endpoint "https://micro.blog/micropub") | |
(setq mb-destination-address "https://your.micro.blog") | |
(setq mb-image-upload-timeout 20) ;; seconds | |
(defun mb-get-media-endpoint () | |
(cdr (assoc "media-endpoint" | |
(let (result) |
This file contains 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
from __future__ import division | |
import numpy as np | |
def sliding_window(arr, window_size, step=0): | |
"""Assuming a time series with time advancing along dimension 0, | |
window the time series with given size and step. | |
:param arr : input array. | |
:type arr: numpy.ndarray | |
:param window_size: size of sliding window. |