This file contains hidden or 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
""" | |
Adapted from work by Ian Glover (https://gist.github.com/manicai/922976) | |
""" | |
import numpy as np | |
__all__ = ["kalmanfilt1d"] | |
def kalmanfilt1d(x, time_step=0.1, n_init_samples=10, mesurement_noise=30, process_variance=0.01): | |
"""1-D Kalman filter with x1 = vt + x0 dynamics. |
This file contains hidden or 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
//N = Math.ceil((x1 - x0) / d + 1)) | |
/** | |
* @param {Number} k Gamma. | |
* @param {Number} x Interpolation value [0, 1] | |
*/ | |
const f = (k, x) => (Math.exp(k * Math.max(0, Math.min(1, x)))-1)/(Math.exp(k)-1) | |
/** | |
* @param {Number} k Gamma |
This file contains hidden or 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
import React from "react"; | |
import PropTypes from "prop-types"; | |
const Link = ({ text, url }) => ( | |
<a href={url}>{text}</a>; | |
); | |
Link.propTypes = { | |
text: PropTypes.string.isRequired, | |
url: PropTypes.instanceOf(URL).isRequired, |
This file contains hidden or 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
echo '{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}]]}' > .babelrc | |
echo 'console.info(" ** It works: node_modules/.bin/nodemon --exec babel-node index.js")' > index.js | |
npm i --save-dev @babel/node @babel/preset-env @babel/core nodemon | |
code index.js & | |
node_modules/.bin/nodemon --exec babel-node index.js |
This file contains hidden or 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
/** | |
@example: | |
<div class="modal"> | |
<h1 class="title">Hox!</h1> | |
<hr/> | |
</div> | |
*/ | |
body { | |
background: #ddd; |