Skip to content

Instantly share code, notes, and snippets.

@davidraedev
Last active March 16, 2016 18:57
Show Gist options
  • Save davidraedev/fb614bdcb42d7f731a9d to your computer and use it in GitHub Desktop.
Save davidraedev/fb614bdcb42d7f731a9d to your computer and use it in GitHub Desktop.
fixed functions for ino calc
<!doctype html>
<html>
<head>
</head>
<body>
<script>
var refinerations = 4502212239;
var number_totals = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,2,1,2,4,1,0,3,8,5,6,9,10,10,16,17,18,39,38,193,515,60,79,90,120,1010,157,167,1373,423,284,1732,2408,772,1128,869,3493,4256,2045,2563,4120,3432,3112,5649,7100,7934,8739,8782,7014,14275,13466,19210,15836,13246,20917,22784,23472,30196,36285,35730,38111,52586,37895,46328,53781,61694,74306,71161,79703,92294,107616,110291,131524,122315,144226,144285,157941,168526,173581,189781,210569,215381,245029,269242,293085,290246,320157,354502,377869,389211,441985,445362,472910,534141,583406,574658,612721,676696,705968,764473,766348,832598,873987,915605,991556,1005893,1054458,1093405,1189976,1220235,1308128,1400351,1441210,1476463,1550864,1696165,1748876,1748889,1863404,2004920,2032010,2148236,2229818,2315035,2455139,2466955,2553027,2741707,2709740,2799007,2888558,3083013,3214887,3333478,3460572,3516513,3657490,3744894,3920126,4050648,4170441,4267355,4323937,4563828,4670483,4901185,4949680,5070919,5268215,5417514,5497615,5591567,5748270,5823960,6112522,6267590,6355389,6439995,6745180,6778106,7018633,7171979,7187383,7324177,7566231,7735558,7858461,8113939,8254719,8388369,8522957,8700920,8961222,9144271,9165851,9447868,9447703,9715081,9940886,9955426,10090443,10265011,10536064,10564524,10657506,10937644,11122471,11179112,11488946,11484421,11592307,11902179,11947295,12190604,12082562,12305050,12497564,12749134,12957671,13008744,13114339,13178056,13295364,13612104,13587354,13721043,13738320,13892362,14090925,14381481,14323718,14444635,14726768,14519217,14893879,14953937,14876309,15318108,15259215,15293837,15338408,15496267,15604618,15562426,15659011,15861176,15832495,16107445,16067513,16208872,16370936,16289444,16522349,16455966,16460765,16433874,16631715,16655964,16847160,16911298,16962750,17007790,16932888,17236312,17000053,17035863,17095998,17058546,17187040,17321159,17414160,17222904,17303919,17308692,17317511,17275862,17162997,17397500,17373780,17272229,17374036,17445908,17521792,17481080,17499375,17452432,17256424,17359128,17397926,17359908,17366349,17371696,17470954,17253881,17192858,17415492,17318620,17368848,17083655,17180373,17067206,17040253,17090622,17069113,16989857,17019907,17059251,16979628,17200757,16960844,16775788,16860804,16722953,16744475,16625102,16458483,16474064,16525885,16426342,16193383,16419229,16237026,16248669,16150711,15957844,16274053,15946235,15946670,16048351,15738321,15654464,15862742,15557125,15541053,15626685,15529013,15203808,15279716,15130018,15141777,15028642,15026571,15038987,14929238,14765174,14713791,14669612,14499324,14614258,14432008,14370919,14197840,14166107,14100368,13968794,14010699,13715325,13744351,13674007,13734621,13461700,13474978,13466900,13487461,13250755,13289000,13252200,13005713,13098350,12894232,12799342,12725509,12670221,12560594,12556686,12367244,12325587,12239600,12100519,12163382,11940256,11981214,11787620,11657582,11556594,11588825,11607125,11453779,11259612,11067652,11332834,11082409,11052259,11031391,10924256,10821646,10743408,10737415,10654249,10464100,10407640,10453938,10176047,10177260,10050878,10039325,10064132,9827763,9858308,9850181,9611808,9703843,9463791,9515909,9447623,9223634,9339232,9169956,9073807,9080285,8931302,8940318,8865220,8746637,8731574,8664777,8500338,8440026,8403389,8421752,8289171,8223133,8167976,8140957,7969436,7966129,7892988,7888004,7685883,7696155,7715897,7569217,7438861,7503733,7416938,7390166,7209366,7216398,7088590,7057076,7101623,6851821,6909551,6883308,6769372,6650168,6513285,6696936,6469638,6468152,6499913,6418887,6233889,6357751,6252697,6196676,6165109,5975812,5972800,5825090,5823340,5813328,5833271,5732708,5695215,5614939,5639035,5493733,5483079,5460825,5329641,5358151,5354076,5220842,5173731,5147578,5132196,5063714,5045961,4956421,4884895,4850948,4833083,4808913,4787791,4738494,4697536,4606717,4544343,4540602,4434597,4423149,4404620,4394331,4424983,4305131,4288702,4237055,4215285,4174721,4095030,4108096,4067980,4010518,3965452,3993827,3882889,3813511,3829321,3813473,3770210,3701805,3676970,3603579,3554812,3572457,3572600,3439468,3464677,3502864,3362379,3305719,3259585,3310363,3289240,3233590,3183248,3154124,3133935,3146067,3131126,3028775,3058557,2989918,2973442,2907254,2885656,2846199,2865436,2755035,2829537,2832083,2787395,2717289,2705051,2615553,2628284,2604826,2574408,2544107,2575502,2469694,2532584,2591749,2423225,2427567,2418091,2344838,2363179,2330578,2241682,2345048,2282238,2260246,2186822,2194245,2203400,2130804,2199341,2135272,2106924,2034362,1999748,2057931,1993726,2027563,1986191,2001095,1957151,1921246,1918974,1893226,1820685,1844135,1809593,1852172,1815094,1821686,1807554,1740041,1691347,1747227,1642162,1670188,1569961,1635653,1650187,1648787,1591871,1548570,1556021,1525964,1559682,1562537,1494526,1505656,1461154,1462656,1445967,1441207,1398999,1416618,1399786,1373675,1326895,1303298,1302893,1318758,1284995,1286362,1265772,1276909,1218453,1228462,1258817,1183785,1192786,1186207,1233000,1194222,1168279,1105829,1199788,1112008,1110015,1063062,1127459,1039414,1085147,1044278,1013914,1093747,997437,1044096,961036,1001801,990612,1008142,976892,963223,935596,941627,914132,914807,918832,902926,895144,867062,873545,865831,844071,850186,782092,816100,845668,818954,792251,797823,803789,766550,779191,769021,799486,756607,717508,752760,710351,718219,721025,711234,693744,713557,699563,696511,670015,675137,644053,622612,644663,660743,649313,631594,604944,597363,605218,572607,588026,578518,578997,586561,573891,539869,537909,561686,570235,541567,549453,497335,548340,542164,517289,528062,534405,510482,541439,512177,503225,503512,469420,448733,456588,455740,470942,454081,450572,418422,462377,453238,436733,422026,397084,413830,375276,379471,377284,371780,407744,390785,400100,383989,384561,413935,366917,366853,383397,377565,369653,346076,359774,351542,319645,371805,305893,344934,321150,339909,299560,317514,309878,317360,316186,323756,320749,314174,285401,285687,287207,275669,271901,286857,295741,294914,288295,260733,278688,267897,263967,252078,252697,262757,236197,244715,242204,260976,243365,242373,229547,270076,234748,240362,236321,227853,208283,196858,211179,199785,211018,197530,219823,201858,242034,207311,193036,207604,197062,194841,192014,194846,174191,188513,180933,188277,206330,180449,176242,175059,184443,168761,184819,159698,188446,160509,183231,170901,153240,62775,74606,68784,67560,53347,76412,63164,61294,73849,53098,62169,53607,58158,61577,53203,62348,44087,42142,53077,49399,53188,66640,61388,52657,58602,49894,49463,55654,56694,42270,38342,48680,55005,46183,45247,48173,33772,49569,50700,53570,46047,52022,42521,57043,35761,35600,37271,41432,40827,39538,35001,44050,35709,42722,31756,42362,46980,38037,40616,38223,20756,31818,38232,35717,31555,33148,32694,28150,33143,25269,20672,27268,25135,35840,31478,22302,28202,21453,25450,21789,24989,24755,18622,23505,24922,23329,25173,34313,23799,25182,19275,20993,24748,22608,21653,25188,25672,30063,21381,18286,23854,21810,26089,31262,28761,27965,20271,12439,20216,18119,23650,26785,13853,16011,27260,15112,20864,17954,27092,17626,16222,16743,16764,21039,23224,22035,11137,16630,24475,21286,18217,16330,15900,13864,17421,21899,8484,14888,15895,18419,14854,15580,13090,20428,16135,15022,11764,10857,17427,13908,11765,10501,9779,11551,10854,11371,10603,12447,16547,15268,15128,12944,17072,8054,17685,14886,14783,12617,15554,14886,9550,17105,15476,15860,10270,16010,9490,9967,11034,4840,10517,13195,12630,7126,10117,10640,6991,10259,13184,6888,8398,8600,12239,8055,8551,12699,4353,10975,8162,9621,6315,8171,4855,12604,6799,5658,8485,5942,12728,6291,7266,7520,5211,7742,7669,5090,6536,6458,13511,3831,5033,7634,8010,8928,4468,5914,4783,4389,10580,8446,2495,4431,4908,10514,5042,2102,4528,4702,9288,6848,7581,3840,3083,3651,6475,1565,4839,3173,5808,6413,8174,5001,1874,5219,5813,9911,6823,6238,3838,6085,4003,3634,4723,6735,4824,10256,3555,4623,4004,1989,3320,5439,6996,3219,3512,4230,2321,2036,2306,3711,5091,5331,2585,4267,9102,1864,6109,4682,4477,5345,2075,4354,1025,3209,4874,1602,5522,3046,2247,3079,1269,1559,5547,1828,4972,3475,3933,1445,1851,2803,3241,2194,1042,5490,3703,226,4140,3101,4075,1125,2052,1842,3572,1564,3330,2194,1975,11,1794,2727,947,343,473,1025,1618,4098,0,2216,799,474,2162,2856,4971,3653,2474,117,2011,3146,2601,673,2883,866,472,507,1663,1914,3121,1102,2392,1478,473,2588,854,1690,2541,1089,1413,0,0,3827,1561,675,1088,2216,1468,657,1560,0,475,1085,1733,259,3544,2476,2030,1674,2849,0,473,0,0,768,12,1285,2175,0,0,0,1492,784,638,1087,246,0,592,3012,3594,0,754,1910,571,2286,1121,1087,1082,1087,0,0,558,1558,0,1396,0,965,0,483,0,2877,898,2031,1086,665,728,1963,799,242,474,474,0,2176,474,1562,350,283,0,948,651,490,1275,0,162,703,0,0,0,1394,1560,17,1049,0,473,0,0,474,2033,0,0,383,1420,0,1086,0,949,0,0,475,1089,473,474,0,474,0,474,0,0,0,1085,0,0,0,1141,0,0,0,0,1086,1360,0,0,0,0,133,0,414,1652,0,474,472,0,0,0,0,0,0,0,0,0,0,0,474,460,0,1086,0,0,0,474,0,0,0,0,0,0,0,0,0,474,0,0,217,474,0,0,876,0,0,0,0,0,0,0,478,703,0,0,0,0,0,0,0,210,396,0,0,0,473,0,0,0,0,472,0,1560,1074,0,0,0,0,0,0,0,0,0,1087,0,0,243,0,1086,0,0,606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1090,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,663,472,0,0,426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1087,0,0,0,167,0,0,0,0,0,1027,0,0,1087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,95,0,0,0,0,0,0,1087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1084,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1086,0,0,0,1087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
function zeroStrip( array ) {
// to prevent overwriting the array
//array = JSON.parse( JSON.stringify( array ) );
for ( var i = 0; i < array.length; i++ )
if ( array[ i ] === 0 )
array.splice( i, 1 );
return array;
}
function sum( array ) {
return array.reduce( function( previousValue, currentValue ) {
return ( previousValue + currentValue );
});
}
function mean( array ) {
return ( sum( array ) / array.length );
}
function variance( array ) {
var the_mean = mean( array );
var difference = 0;
for ( var i = 0; i < array.length; i++ )
difference += Math.pow( ( array[ i ] - the_mean ), 2 );
return ( difference / array.length );
}
function standardDeviation( array ) {
return Math.sqrt( variance( array ) );
}
// if we zeroStrip right here, the "number_totals" array gets changed even though the global variable is not referenced...
//zeroStrip( number_totals )
console.log( "number_totals.length = "+ number_totals.length )
console.log( "sum = "+ sum( number_totals ) );
console.log( "mean = "+ mean( number_totals ) );
console.log( "variance = "+ variance( number_totals ) );
console.log( "standardDeviation = "+ standardDeviation( number_totals ) );
console.log( "------------------------------------------------------------------------" )
var stripped = zeroStrip( number_totals );
console.log( "stripped.length = "+ stripped.length )
console.log( "sum = "+ sum( stripped ) );
console.log( "mean = "+ mean( stripped ) );
console.log( "variance = "+ variance( stripped ) );
console.log( "standardDeviation = "+ standardDeviation( stripped ) );
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment