These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
These are some simple bash functions and scripts for making CSV/TSV files prettier on the command line
see http://stefaanlippens.net/pretty-csv.html for more information.
""" | |
Plot white noise with added sinusoidal signal | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import sys | |
import h5py | |
fs = 4096 # sampling rate [Hz] | |
T = 4 # duration [s] |
On Instance:
pip install jupyter[notebook]
jupyter notebook --generate-config
# nano .jupyter/jupyter_notebook_config.py
echo "c = get_config()
c.NotebookApp.ip = '*'
import java.util.HashMap | |
class Node[K, V](var key: K, var value: V) { | |
var next: Node[K, V] = null | |
override def toString(): String = s"Node($key, $value) -> $next" | |
} | |
class LRUCache[K, V](val size: Int = 5) { | |
require(size > 0, s"Expected size > 0, found $size") | |
val map = new HashMap[K, Node[K, V]]() |
[ | |
{ | |
"title": "How to handle state in React. The missing FAQ.", | |
"author": "Osmel Mora", | |
"url": "https://medium.com/react-ecosystem/how-to-handle-state-in-react-6f2d3cd73a0c" | |
}, | |
{ | |
"title": "You might not need React Router", | |
"author": "Konstantin Tarkus", | |
"url": "https://medium.freecodecamp.com/you-might-not-need-react-router-38673620f3d" |
import unittest | |
def foo(x, y, z): | |
return (x != y and x != z or x and z) | |
def get_test_args(): | |
x = y = z = [True, False] | |
from itertools import product, repeat | |
# for each input arg ---> expected arg | |
input_args = list(product(x, y, z)) |
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
import warnings | |
import numpy as np | |
import pandas as pd | |
import sys | |
__author__ = "Mohsen Mesgarpour" | |
__copyright__ = "Copyright 2016, https://github.com/mesgarpour" | |
__credits__ = ["Mohsen Mesgarpour"] |
angular.module('stateMock',[]); | |
angular.module('stateMock').service("$state", function($q){ | |
this.expectedTransitions = []; | |
this.transitionTo = function(stateName){ | |
if(this.expectedTransitions.length > 0){ | |
var expectedState = this.expectedTransitions.shift(); | |
if(expectedState !== stateName){ | |
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName ); | |
} | |
}else{ |
import contextlib | |
import OpenSSL.crypto | |
import os | |
import requests | |
import ssl | |
import tempfile | |
@contextlib.contextmanager | |
def pfx_to_pem(pfx_path, pfx_password): | |
''' Decrypts the .pfx file to be used with requests. ''' |