Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
/* Returns probability of occuring below and above target price. */ | |
function probability(price, target, days, volatility) { | |
var p = price; | |
var q = target; | |
var t = days / 365; | |
var v = volatility; | |
var vt = v*Math.sqrt(t); | |
var lnpq = Math.log(q/p); |
% From http://phaseportrait.blogspot.com/2008/06/sinc-interpolation-in-matlab.html | |
% Ideally "resamples" x vector from s to u by sinc interpolation | |
function y = sinc_interp(x,s,u) | |
% Interpolates x sampled sampled at "s" instants | |
% Output y is sampled at "u" instants ("u" for "upsampled") | |
% (EXPECTS x, s, and u to be ROW VECTORS!!) | |
% Find the period of the undersampled signal | |
T = s(2)-s(1); |
var el = ( function () { | |
var doc = document; | |
var directProperties = { | |
'class': 'className', | |
className: 'className', | |
defaultValue: 'defaultValue', | |
'for': 'htmlFor', | |
html: 'innerHTML', |
def bresenham(startPoint, endPoint): | |
startPoint = [int(startPoint[0]),int(startPoint[1]),int(startPoint[2])] | |
endPoint = [int(endPoint[0]),int(endPoint[1]),int(endPoint[2])] | |
steepXY = (abs(endPoint[1] - startPoint[1]) > abs(endPoint[0] - startPoint[0])) | |
if(steepXY): | |
startPoint[0], startPoint[1] = startPoint[1], startPoint[0] | |
endPoint[0], endPoint[1] = endPoint[1], endPoint[0] |
// Linear Congruential Generator | |
// Variant of a Lehman Generator | |
var lcg = (function() { | |
// Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes | |
// m is basically chosen to be large (as it is the max period) | |
// and for its relationships to a and c | |
var m = 4294967296, | |
// a - 1 should be divisible by m's prime factors | |
a = 1664525, | |
// c and m should be co-prime |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
''' | |
Non-parametric computation of entropy and mutual-information | |
Adapted by G Varoquaux for code created by R Brette, itself | |
from several papers (see in the code). | |
This code is maintained at https://github.com/mutualinfo/mutual_info | |
Please download the latest code there, to have improvements and | |
bug fixes. |
"","word","word_count","corpus","corpus_date" | |
"1","hive",1,"loverscomplaint",1609 | |
"2","plaintful",1,"loverscomplaint",1609 | |
"3","Are",1,"loverscomplaint",1609 | |
"4","Than",1,"loverscomplaint",1609 | |
"5","attended",1,"loverscomplaint",1609 | |
"6","That",7,"loverscomplaint",1609 | |
"7","moisture",1,"loverscomplaint",1609 | |
"8","praised",1,"loverscomplaint",1609 | |
"9","particular",1,"loverscomplaint",1609 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.8.1/mapbox-gl.js'></script> | |
<script src='http://gpstrails.info/ex/gl/style/streets7.json'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.8.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> |