made with requirebin
Created
March 14, 2014 22:19
-
-
Save brycebaril/9558171 to your computer and use it in GitHub Desktop.
requirebin sketch
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
// try requiring some modules from NPM and then hit Run | |
var s = require('stats-lite') | |
console.log(s.mean([0, 9, 100, 3, 51, 33, Math.random() * 20])) |
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=function e(r,n,t){function u(i,f){if(!n[i]){if(!r[i]){var s="function"==typeof require&&require;if(!f&&s)return s(i,!0);if(o)return o(i,!0);throw Error("Cannot find module '"+i+"'")}var a=n[i]={exports:{}};r[i][0].call(a.exports,function(n){var t=r[i][1][n];return u(t?t:n)},a,a.exports,e,r,n,t)}return n[i].exports}for(var o="function"==typeof require&&require,i=0;t.length>i;i++)u(t[i]);return u}({1:[function(r,n){function t(r){return!isNaN(parseFloat(r))&&isFinite(r)}n.exports=t},{}],IjFXVS:[function(r,n){function t(r){var n=[];if(null==r)return n;for(var t=0;r.length>t;t++)l(r[t])&&n.push(+r[t]);return n}function e(r){return r.sort(function(r,n){return r-n})}function u(r){r=t(r);for(var n=0,e=0;r.length>e;e++)n+=r[e];return n}function o(r){return r=t(r),0===r.length?0/0:u(r)/r.length}function i(r){if(r=t(r),0===r.length)return 0/0;var n=0|r.length/2;return r=e(r),r.length%2?r[n]:(r[n-1]+r[n])/2}function f(r){if(r=t(r),0===r.length)return 0/0;var n=0/0,e={};r.forEach(function(r){var n=e[r]||0;n++,e[r]=n});var u=t(Object.keys(e).sort(function(r,n){return e[n]-e[r]}));return n=u[0],e[u[1]]==e[n]?0/0:n}function s(r){r=t(r);for(var n=o(r),e=[],u=0;r.length>u;u++)e.push(Math.pow(r[u]-n,2));return o(e)}function a(r){return Math.sqrt(s(r))}function c(r,n){if(r=t(r),0===r.length||null==n||0>n)return 0/0;n>1&&(n=1),r=e(r);var u=r.length*n-.5;if((0|u)===u)return r[u];var o=0|u,i=u-o;return(1-i)*r[o]+i*r[o+1]}n.exports.numbers=t,n.exports.sum=u,n.exports.mean=o,n.exports.median=i,n.exports.mode=f,n.exports.variance=s,n.exports.stdev=a,n.exports.percentile=c;var l=r("isnumber")},{isnumber:1}],"stats-lite":[function(r,n){n.exports=r("IjFXVS")},{}]},{},[]);var s=require("stats-lite");console.log(s.mean([0,9,100,3,51,33,20*Math.random()])); |
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
{ | |
"name": "requirebin-sketch", | |
"version": "1.0.0", | |
"dependencies": { | |
"stats-lite": "1.0.1" | |
} | |
} |
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
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; } | |
body, html { height: 100%; width: 100%; }</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment