Skip to content

Instantly share code, notes, and snippets.

@d--b
d--b / async_query_and_chart.sbd
Last active August 29, 2015 14:04
Updated through Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_1"
},
"calctree": {
"0": [
["MSFT", "CSCO", "AAPL"],
["2013-01-01", "=A2", "=B2"],
["2014-01-01", "=A3", "=B3"],
@d--b
d--b / bivariate_simulation.sbd
Created August 4, 2014 11:32
Created on Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_1",
"2": "table_2",
"3": "table_3"
},
"calctree": {
"0": [
["Inv CDF", "=function NormSInv(p) {\n var a1 = -39.6968302866538, a2 = 220.946098424521, a3 = -275.928510446969;\n var a4 = 138.357751867269, a5 = -30.6647980661472, a6 = 2.50662827745924;\n var b1 = -54.4760987982241, b2 = 161.585836858041, b3 = -155.698979859887;\n var b4 = 66.8013118877197, b5 = -13.2806815528857, c1 = -0.00778489400243029;\n var c2 = -0.322396458041136, c3 = -2.40075827716184, c4 = -2.54973253934373;\n var c5 = 4.37466414146497, c6 = 2.93816398269878, d1 = 0.00778469570904146;\n var d2 = 0.32246712907004, d3 = 2.445134137143, d4 = 3.75440866190742;\n var p_low = 0.02425, p_high = 1 - p_low;\n var q, r;\n var retVal;\n if (p < 0 || p > 1) {\n alert('NormSInv: Argument out of range.');\n retVal = 0;\n } else if (p < p_low) {\n q = Math.sqrt(-2 * Math.log(p));\n retVal = (((((c1 * q + c2) * q
@d--b
d--b / brownian_motion_simulation.sbd
Last active August 29, 2015 14:04
Updated through Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_1",
"2": "table_2"
},
"calctree": {
"0": [
["=function () {\n hist = Array.apply(null, Array(1000)).map(function (x) {\n return 0;\n });\n setInterval(function () {\n spreadboard.SetFormulaNoRecalc(0, 0, 1, '=Math.random()');\n spreadboard.CalculateAll();\n }, 1);\n return 'init done.';\n}()", "=Math.random()", "=function NormSInv(p) {\n var a1 = -39.6968302866538, a2 = 220.946098424521, a3 = -275.928510446969;\n var a4 = 138.357751867269, a5 = -30.6647980661472, a6 = 2.50662827745924;\n var b1 = -54.4760987982241, b2 = 161.585836858041, b3 = -155.698979859887;\n var b4 = 66.8013118877197, b5 = -13.2806815528857, c1 = -0.00778489400243029;\n var c2 = -0.322396458041136, c3 = -2.40075827716184, c4 = -2.54973253934373;\n var c5 = 4.37466414146497, c6 = 2.93816398269878, d1 = 0.00778469570904146;\n var d2 = 0.32246712907004, d3 = 2.445134137143, d4 = 3.75440866190742;\n var p_low
@d--b
d--b / temperature.sbd
Created August 4, 2014 11:36
Created on Spreadboard
{
"tablenames": {
"0": "table_0"
},
"calctree": {
"0": [
["", "", "now", "t+1", "t+2", "t+3", "t+4"],
["lyon", ">yql('select * from weather.bylocation where location = \"' + A2 + '\"')", "=B2.weather.rss.channel.item.condition.temp", "=$B2.weather.rss.channel.item.forecast[col - 3].low + ' / ' + $B2.weather.rss.channel.item.forecast[col - 3].high", "=$B2.weather.rss.channel.item.forecast[col - 3].low + ' / ' + $B2.weather.rss.channel.item.forecast[col - 3].high", "=$B2.weather.rss.channel.item.forecast[col - 3].low + ' / ' + $B2.weather.rss.channel.item.forecast[col - 3].high", "=$B2.weather.rss.channel.item.forecast[col - 3].low + ' / ' + $B2.weather.rss.channel.item.forecast[col - 3].high"],
["paris", ">yql('select * from weather.bylocation where location = \"' + A3 + '\"')", "=B3.weather.rss.channel.item.condition.temp", "=$B3.weather.rss.channel.item.forecast[col - 3].low + ' / ' + $B3.weather.rss.channel.item.forecast[col - 3].high", "=$B3.weather.rss.channel.item.forecast
@d--b
d--b / simple.sbd
Created August 4, 2014 11:45
Created on Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_1"
},
"calctree": {
"0": [
["", "", "", "", ""],
["", "A", 45, "", ""],
["", "B", 22, "", ""],
@d--b
d--b / bollinger_bands.sbd
Created February 16, 2015 00:33
Created on Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_0_format",
"2": "table_1",
"3": "table_1_format"
},
"tableformats": {
"0": 1,
"2": 3
@d--b
d--b / demo.sbd
Last active September 9, 2015 18:49
Updated through Spreadboard
{
"tablenames": {
"0": "table_0",
"1": "table_0_format"
},
"tableformats": {
"0": 1
},
"calctree": {
"0": [