Bitcoin Forum

Bitcoin => Project Development => Topic started by: Cyberdyne on July 31, 2013, 08:45:39 AM



Title: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com (CLAIMED)
Post by: Cyberdyne on July 31, 2013, 08:45:39 AM
Update: ibittler has claimed this bounty.


I'm not sure yet how difficult (excuse the pun) or time-consuming this would be yet, so if the bounty amount is inappropriate or offensive, please post a counter-offer.

What I'd like is some php code that generates an image with everything you see here:

http://bitcoin.sipa.be/speed-small-lin.png

Preferably the code would use some blockchain.info or other api for the data. If that's not possible, then code that relies on a bitcoind instance would also be acceptable.

I tried messaging Pieter Wuille (owner of bitcoin.sipa.be) but haven't had any response as yet.


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: mscharleneb on July 31, 2013, 09:02:58 AM
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');

$datay1 = array(20,15,23,15);
$datay2 = array(12,9,42,8);
$datay3 = array(5,17,32,24);

// Setup the graph
$graph = new Graph(300,250);
$graph->SetScale("textlin");

$theme_class=new UniversalTheme;

$graph->SetTheme($theme_class);
$graph->img->SetAntiAliasing(false);
$graph->title->Set('Filled Y-grid');
$graph->SetBox(false);

$graph->img->SetAntiAliasing();

$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

$graph->xgrid->Show();
$graph->xgrid->SetLineStyle("solid");
$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->xgrid->SetColor('#E3E3E3');

// Create the first line
$p1 = new LinePlot($datay1);
$graph->Add($p1);
$p1->SetColor("#6495ED");
$p1->SetLegend('Line 1');

// Create the second line
$p2 = new LinePlot($datay2);
$graph->Add($p2);
$p2->SetColor("#B22222");
$p2->SetLegend('Line 2');

// Create the third line
$p3 = new LinePlot($datay3);
$graph->Add($p3);
$p3->SetColor("#FF1493");
$p3->SetLegend('Line 3');

$graph->legend->SetFrameWeight(1);

// Output line



Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: mscharleneb on July 31, 2013, 09:10:14 AM
<?php // content="text/plain; charset=utf-8"
require_once ('jpgraph/jpgraph.php');
require_once ('jpgraph/jpgraph_line.php');

$datay1 = array(20,7,16,46);
$datay2 = array(6,20,10,22);

// Setup the graph
$graph = new Graph(350,230);
$graph->SetScale("textlin");

$theme_class= new UniversalTheme;
$graph->SetTheme($theme_class);

$graph->title->Set('Background Image');
$graph->SetBox(false);

$graph->yaxis->HideZeroLabel();
$graph->yaxis->HideLine(false);
$graph->yaxis->HideTicks(false,false);

$graph->xaxis->SetTickLabels(array('A','B','C','D'));
$graph->ygrid->SetFill(false);
$graph->SetBackgroundImage("tiger_bkg.png",BGIMG_FILLFRAME);

$p1 = new LinePlot($datay1);
$graph->Add($p1);

$p2 = new LinePlot($datay2);
$graph->Add($p2);

$p1->SetColor("#55bbdd");
$p1->SetLegend('Line 1');
$p1->mark->SetType(MARK_FILLEDCIRCLE,'',1.0);
$p1->mark->SetColor('#55bbdd');
$p1->mark->SetFillColor('#55bbdd');
$p1->SetCenter();

$p2->SetColor("#aaaaaa");
$p2->SetLegend('Line 2');
$p2->mark->SetType(MARK_UTRIANGLE,'',1.0);
$p2->mark->SetColor('#aaaaaa');
$p2->mark->SetFillColor('#aaaaaa');
$p2->value->SetMargin(14);
$p2->SetCenter();

$graph->legend->SetFrameWeight(1);
$graph->legend->SetColor('#4E4E4E','#00A78A');
$graph->legend->SetMarkAbsSize(8);


// Output line
$graph->Stroke();

?>


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: Cyberdyne on July 31, 2013, 09:10:44 AM
Well, thanks. Did you just write that yourself? I wonder if I should pay for something that's just been open-sourced.

Just kidding :)

If it works, information will seek freedom...

Edit: Nevermind, I see that your code has nothing to do with bitcoin difficulty at all and is just a general graph script. Something to play with anyway.


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: mscharleneb on July 31, 2013, 09:12:13 AM
Well, thanks. Did you just write that yourself? I wonder if I should pay for something that's just been open-sourced.

Just kidding :)

If it works, information will seek freedom...


No worries. Just wanted to help you out :)


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: metacoin on July 31, 2013, 06:45:51 PM
What exactly is the significance of the "window estimates", are they supposed to represent the expected difficulty increase vs actual difficulty increase? How exactly should those three estimates arrive at a value?

It appears that the graph you posted uses an analysis of percentage increase over 3, 7, and 14 day periods then extrapolates that data on top of the graph using the same X coordinate. Is this true?


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: ibittler on July 31, 2013, 09:32:09 PM
I've sent you a PM :)


Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com
Post by: Cyberdyne on August 01, 2013, 02:57:44 AM
Not to discourage anyone, but more of a heads up: ibittler is making good progress on this so far.

Oh, and metacoin, I think you're pretty much correct on how the estimates graphs work.  I won't know for sure until someone programs me something similar :)



Title: Re: [BOUNTY] 0.5 BTC from BitcoinDifficulty.com (CLAIMED)
Post by: Cyberdyne on August 03, 2013, 08:38:20 AM
ibittler has claimed this bounty - Thanks!