Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: payb.tc on September 22, 2011, 03:55:48 AM



Title: Bitcoin clock
Post by: payb.tc on September 22, 2011, 03:55:48 AM
been meaning to do this for a while...   http://bitcoinclock.com/

borrowing a friend's domain+server was the kick i needed to get it done.

enjoy.


Title: Re: Bitcoin clock
Post by: johnj on September 22, 2011, 03:58:10 AM
A+


Title: Re: Bitcoin clock
Post by: nmat on September 22, 2011, 04:08:17 AM
Nice. So, any interesting ideas for the seconds pointer?


Title: Re: Bitcoin clock
Post by: phillipsjk on September 22, 2011, 04:09:26 AM
I disagree: it is more like an A-.

I deduct points for requiring client-side scripting. The idea is original enough and well implemented enough to be worth temporarily enabling JavaScript though.

To do it server side, you would probably have a static image (or SVG) that is autorefreshed (server side) every 10 minutes or so.


Title: Re: Bitcoin clock
Post by: jjiimm_64 on September 22, 2011, 04:10:59 AM

I deduct points for requiring client-side scripting. The idea is original enough and well implemented enough to be worth temporarily enabling JavaScript though.

You use IE ??   ???


Title: Re: Bitcoin clock
Post by: payb.tc on September 22, 2011, 04:12:07 AM
yeah even i wouldn't rate it A-

i'm no javascript guru, i just found a clock and tried to modify it to create the right angles.

no idea what to use the second hand for either, so that's why i disabled it :)




Title: Re: Bitcoin clock
Post by: deslok on September 22, 2011, 04:14:27 AM

I deduct points for requiring client-side scripting. The idea is original enough and well implemented enough to be worth temporarily enabling JavaScript though.

You use IE ??   ???

IE is not universally bad, and some of us running 64 bit operating systems are waiting for the other browsers to catch up as far as that is concerned(although i do use chrome for some things i spend most of my time in IE9)


Title: Re: Bitcoin clock
Post by: phillipsjk on September 22, 2011, 04:15:07 AM
You use IE ??   ???

IE doesn't support Gopher URLs.


Title: Re: Bitcoin clock
Post by: jjiimm_64 on September 22, 2011, 04:15:15 AM
Nice. So, any interesting ideas for the seconds pointer?

Yes.   the seconds hand could be used for the current block

one way is to estimate the time needed for the next block from the last.  ie 10 minutes for full 60 'seconds'

trying to think of a better way using the difficulty and estimate of next block found but I cant think of any...


Title: Re: Bitcoin clock
Post by: payb.tc on September 22, 2011, 04:18:15 AM
Nice. So, any interesting ideas for the seconds pointer?

Yes.   the seconds hand could be used for the current block

one way is to estimate the time needed for the next block from the last.  ie 10 minutes for full 60 'seconds'

trying to think of a better way using the difficulty and estimate of next block found but I cant think of any...


yeah that wouldn't be accurate enough.

the second hand wouldn't hit 12 right when the next block is found :D


Title: Re: Bitcoin clock
Post by: nmat on September 22, 2011, 04:20:25 AM
yeah even i wouldn't rate it A-

i'm no javascript guru, i just found a clock and tried to modify it to create the right angles.

no idea what to use the second hand for either, so that's why i disabled it :)

The division in 60 spaces is not suited for Bitcoin so one improvement would be a custom clock image. But this creates other problems because 210,000 is not divisible by 2016.


Title: Re: Bitcoin clock
Post by: payb.tc on September 22, 2011, 04:22:51 AM
yeah even i wouldn't rate it A-

i'm no javascript guru, i just found a clock and tried to modify it to create the right angles.

no idea what to use the second hand for either, so that's why i disabled it :)

The division in 60 spaces is not suited for Bitcoin so one improvement would be a custom clock image. But this creates other problems because 210,000 is not divisible by 2016.

yeah i only just realised that today... i think previously i assumed difficulty changed every 2100 blocks.

anyway a custom image could be good... especially one with a 'bitcoin' as the background :)


Title: Re: Bitcoin clock
Post by: payb.tc on September 22, 2011, 05:52:25 AM
usually 80% of the value gets done in the first 20% of the time spent.

refining the remaining 20% of the project then takes up the remaining 80% of the total time.

so the most efficient thing to do, is just work until something is 80% good enough (20% of total time to complete a 'perfect' project) and then move on to the next one...

i don't know if that's always true, but i think it's a good rule to keep in mind for anyone trying to break the perfectionists dilemma.

anyway perhaps the whole idea will inspire someone to do a much better clock, and if that happens, i'll probably have no trouble getting your version 2.0 uploaded onto bitcoinclock.com



Title: Re: Bitcoin clock
Post by: Cryptoman on September 22, 2011, 05:56:44 AM
usually 80% of the value gets done in the first 20% of the time spent.

refining the remaining 20% of the project then takes up the remaining 80% of the total time.

so the most efficient thing to do, is just work until something is 80% good enough (20% of total time to complete a 'perfect' project) and then move on to the next one...

Lol, so true.  Also, after that first 20% of the time is put in, it starts to get pretty boring.  Unfortunately, if you're trying to develop something professionally, you have to put in that other 80% of the effort.  This is where delegation comes in handy.  :D


Title: Re: Bitcoin clock
Post by: payb.tc on September 22, 2011, 06:04:05 AM
usually 80% of the value gets done in the first 20% of the time spent.

refining the remaining 20% of the project then takes up the remaining 80% of the total time.

so the most efficient thing to do, is just work until something is 80% good enough (20% of total time to complete a 'perfect' project) and then move on to the next one...

Lol, so true.  Also, after that first 20% of the time is put in, it starts to get pretty boring.  Unfortunately, if you're trying to develop something professionally, you have to put in that other 80% of the effort.  This is where delegation comes in handy.  :D

yes and via delegation the remaining 20% of the project gets redefined as someone else's '100%' and they probably work the same way.

so they spend 20% of their time doing 80% of their part.

therefore 96% (0.8 + 0.2*0.8 ) of the total project gets done in the first 36% (0.2 + 0.8*0.2) of the total time.

everyone just needs to keep delegating when they hit that 20% mark :)


Title: Re: Bitcoin clock
Post by: jjiimm_64 on November 06, 2011, 12:51:35 AM
any chance in spinning up a litecoin clock ?    especially since the diff changes so much faster.


Title: Re: Bitcoin clock
Post by: payb.tc on November 06, 2011, 12:58:09 AM
any chance in spinning up a litecoin clock ?    especially since the diff changes so much faster.

i'm not interested myself, but anyone's welcome to copy what i did... it's pretty simple, and should be easy to modify for litecoin.

index.php:

Code:
<?php
$blockcount=preg_replace('/[^0-9]/','',file_get_contents('http://blockexplorer.com/q/getblockcount'));
?>

<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="60; url=http://bitcoinclock.com/">
<title>Bitcoin Clock</title>

<link rel="stylesheet" type="text/css" href="styles.css">

<!--[if IE]><script type="text/javascript" src="excanvas.js"></script><![endif]-->
<script src="coolclock.php?b=<?php echo $blockcount?>" type="text/javascript"></script>


</head>
<body onload="CoolClock.findAndCreateClocks()">

<div align="center">
<h1>Bitcoin Clock</h1>

<p>
</p>

<canvas id="c1" class="CoolClock:classic:250" width="500" height="500" style="width: 500px; height: 500px; "></canvas>

<br><br>

Block count: <?php echo $blockcount?><br>
Blocks since last difficulty change: <?php echo $blockcount%2016?><br><br>

Hour hand goes around once every 210,000 blocks<br>
(Block reward drops by half every time hour hand reaches 12)<br>
(This should occur approximately once every 4 years)<br><br>
Minute hand goes around once every 2016 blocks<br>
(Difficulty change occurs every time minute hand reaches 12)<br>
(This should occur approximately once every 2 weeks)<br><br>
Second hand goes around once every 144 blocks<br>
(This should occur approximately once every 24 hours)


</div>
</body></html>

coolclock.php:

Code:
<?php

$blockcount=preg_replace('/[^0-9]/','',$_GET['b']);

?>


/**
 * CoolClock 2.1.4
 * Copyright 2010, Simon Baird
 * Released under the BSD License.
 *
 * Display an analog clock using canvas.
 * http://randomibis.com/coolclock/
 *
 */

// Constructor for CoolClock objects
window.CoolClock = function(options) {
return this.init(options);
}

// Config contains some defaults, and clock skins
CoolClock.config = {
tickDelay: 10000,
longTickDelay: 15000,
defaultRadius: 85,
renderRadius: 100,
defaultSkin: "classic",
// Should be in skin probably...
// (TODO: allow skinning of digital display)
showSecs: true,
showAmPm: false,

skins: {
// There are more skins in moreskins.js
// Try making your own skin by copy/pasting one of these and tweaking it
classic/*was gIG*/: {
outerBorder:      { lineWidth: 185, radius: 1, color: "#E5ECF9", alpha: 1 },
smallIndicator:   { lineWidth: 2, startAt: 89, endAt: 94, color: "#3366CC", alpha: 1 },
largeIndicator:   { lineWidth: 4, startAt: 83, endAt: 94, color: "#3366CC", alpha: 1 },
hourHand:         { lineWidth: 5, startAt: 0, endAt: 60, color: "black", alpha: 1 },
minuteHand:       { lineWidth: 4, startAt: 0, endAt: 80, color: "black", alpha: 1 },
secondHand:       { lineWidth: 1, startAt: -20, endAt: 85, color: "red", alpha: .85 },
secondDecoration: { lineWidth: 3, startAt: 0, radius: 2, fillColor: "black", color: "black", alpha: 1 }
},
swissRail: {
outerBorder: { lineWidth: 2, radius:95, color: "black", alpha: 1 },
smallIndicator: { lineWidth: 2, startAt: 88, endAt: 92, color: "black", alpha: 1 },
largeIndicator: { lineWidth: 4, startAt: 79, endAt: 92, color: "black", alpha: 1 },
hourHand: { lineWidth: 8, startAt: -15, endAt: 50, color: "black", alpha: 1 },
minuteHand: { lineWidth: 7, startAt: -15, endAt: 75, color: "black", alpha: 1 },
secondHand: { lineWidth: 1, startAt: -20, endAt: 85, color: "red", alpha: 1 },
secondDecoration: { lineWidth: 1, startAt: 70, radius: 4, fillColor: "red", color: "red", alpha: 1 }
},
chunkySwiss: {
outerBorder: { lineWidth: 4, radius:97, color: "black", alpha: 1 },
smallIndicator: { lineWidth: 4, startAt: 89, endAt: 93, color: "black", alpha: 1 },
largeIndicator: { lineWidth: 8, startAt: 80, endAt: 93, color: "black", alpha: 1 },
hourHand: { lineWidth: 12, startAt: -15, endAt: 60, color: "black", alpha: 1 },
minuteHand: { lineWidth: 10, startAt: -15, endAt: 85, color: "black", alpha: 1 },
secondHand: { lineWidth: 4, startAt: -20, endAt: 85, color: "red", alpha: 1 },
secondDecoration: { lineWidth: 2, startAt: 70, radius: 8, fillColor: "red", color: "red", alpha: 1 }
},
chunkySwissOnBlack: {
outerBorder: { lineWidth: 4, radius:97, color: "white", alpha: 1 },
smallIndicator: { lineWidth: 4, startAt: 89, endAt: 93, color: "white", alpha: 1 },
largeIndicator: { lineWidth: 8, startAt: 80, endAt: 93, color: "white", alpha: 1 },
hourHand: { lineWidth: 12, startAt: -15, endAt: 60, color: "white", alpha: 1 },
minuteHand: { lineWidth: 10, startAt: -15, endAt: 85, color: "white", alpha: 1 },
secondHand: { lineWidth: 4, startAt: -20, endAt: 85, color: "red", alpha: 1 },
secondDecoration: { lineWidth: 2, startAt: 70, radius: 8, fillColor: "red", color: "red", alpha: 1 }
}

},

// Test for IE so we can nurse excanvas in a couple of places
isIE: !!document.all,

// Will store (a reference to) each clock here, indexed by the id of the canvas element
clockTracker: {},

// For giving a unique id to coolclock canvases with no id
noIdCount: 0
};

// Define the CoolClock object's methods
CoolClock.prototype = {

// Initialise using the parameters parsed from the colon delimited class
init: function(options) {
// Parse and store the options
this.canvasId       = options.canvasId;
this.skinId         = options.skinId || CoolClock.config.defaultSkin;
this.displayRadius  = options.displayRadius || CoolClock.config.defaultRadius;
this.showSecondHand = typeof options.showSecondHand == "boolean" ? options.showSecondHand : true;
this.gmtOffset      = (options.gmtOffset != null && options.gmtOffset != '') ? parseFloat(options.gmtOffset) : null;
this.showDigital    = typeof options.showDigital == "boolean" ? options.showDigital : false;
this.logClock       = typeof options.logClock == "boolean" ? options.logClock : false;
this.logClockRev    = typeof options.logClock == "boolean" ? options.logClockRev : false;

this.tickDelay      = CoolClock.config[ this.showSecondHand ? "tickDelay" : "longTickDelay" ];

// Get the canvas element
this.canvas = document.getElementById(this.canvasId);

// Make the canvas the requested size. It's always square.
this.canvas.setAttribute("width",this.displayRadius*2);
this.canvas.setAttribute("height",this.displayRadius*2);
this.canvas.style.width = this.displayRadius*2 + "px";
this.canvas.style.height = this.displayRadius*2 + "px";

// Explain me please...?
this.renderRadius = CoolClock.config.renderRadius;
this.scale = this.displayRadius / this.renderRadius;

// Initialise canvas context
this.ctx = this.canvas.getContext("2d");
this.ctx.scale(this.scale,this.scale);

// Keep track of this object
CoolClock.config.clockTracker[this.canvasId] = this;

// Start the clock going
this.tick();

return this;
},

// Draw a circle at point x,y with params as defined in skin
fullCircleAt: function(x,y,skin) {
this.ctx.save();
this.ctx.globalAlpha = skin.alpha;
this.ctx.lineWidth = skin.lineWidth;

if (!CoolClock.config.isIE) {
this.ctx.beginPath();
}

if (CoolClock.config.isIE) {
// excanvas doesn't scale line width so we will do it here
this.ctx.lineWidth = this.ctx.lineWidth * this.scale;
}

this.ctx.arc(x, y, skin.radius, 0, 2*Math.PI, false);

if (CoolClock.config.isIE) {
// excanvas doesn't close the circle so let's fill in the tiny gap
this.ctx.arc(x, y, skin.radius, -0.1, 0.1, false);
}

if (skin.fillColor) {
this.ctx.fillStyle = skin.fillColor
this.ctx.fill();
}
else {
// XXX why not stroke and fill
this.ctx.strokeStyle = skin.color;
this.ctx.stroke();
}
this.ctx.restore();
},

// Draw some text centered vertically and horizontally
drawTextAt: function(theText,x,y) {
this.ctx.save();
this.ctx.font = '15px sans-serif';
var tSize = this.ctx.measureText(theText);
if (!tSize.height) tSize.height = 15; // no height in firefox.. :(
this.ctx.fillText(theText,x - tSize.width/2,y - tSize.height/2);
this.ctx.restore();
},

lpad2: function(num) {
return (num < 10 ? '0' : '') + num;
},

tickAngle: function(second) {
// Log algorithm by David Bradshaw
var tweak = 3; // If it's lower the one second mark looks wrong (?)
if (this.logClock) {
return second == 0 ? 0 : (Math.log(second*tweak) / Math.log(60*tweak));
}
else if (this.logClockRev) {
// Flip the seconds then flip the angle (trickiness)
second = (60 - second) % 60;
return 1.0 - (second == 0 ? 0 : (Math.log(second*tweak) / Math.log(60*tweak)));
}
else {
return second/60.0;
}
},

timeText: function(hour,min,sec) {
var c = CoolClock.config;
return '' +
(c.showAmPm ? ((hour%12)==0 ? 12 : (hour%12)) : hour) + ':' +
this.lpad2(min) +
(c.showSecs ? ':' + this.lpad2(sec) : '') +
(c.showAmPm ? (hour < 12 ? ' am' : ' pm') : '')
;
},

// Draw a radial line by rotating then drawing a straight line
// Ha ha, I think I've accidentally used Taus, (see http://tauday.com/)
radialLineAtAngle: function(angleFraction,skin) {
this.ctx.save();
this.ctx.translate(this.renderRadius,this.renderRadius);
this.ctx.rotate(Math.PI * (2.0 * angleFraction - 0.5));
this.ctx.globalAlpha = skin.alpha;
this.ctx.strokeStyle = skin.color;
this.ctx.lineWidth = skin.lineWidth;

if (CoolClock.config.isIE)
// excanvas doesn't scale line width so we will do it here
this.ctx.lineWidth = this.ctx.lineWidth * this.scale;

if (skin.radius) {
this.fullCircleAt(skin.startAt,0,skin)
}
else {
this.ctx.beginPath();
this.ctx.moveTo(skin.startAt,0)
this.ctx.lineTo(skin.endAt,0);
this.ctx.stroke();
}
this.ctx.restore();
},

render: function(hour,min,sec) {
// Get the skin
var skin = CoolClock.config.skins[this.skinId];
if (!skin) skin = CoolClock.config.skins[CoolClock.config.defaultSkin];

// Clear
this.ctx.clearRect(0,0,this.renderRadius*2,this.renderRadius*2);

// Draw the outer edge of the clock
if (skin.outerBorder)
this.fullCircleAt(this.renderRadius,this.renderRadius,skin.outerBorder);

// Draw the tick marks. Every 5th one is a big one
for (var i=0;i<60;i++) {
(i%5)  && skin.smallIndicator && this.radialLineAtAngle(this.tickAngle(i),skin.smallIndicator);
!(i%5) && skin.largeIndicator && this.radialLineAtAngle(this.tickAngle(i),skin.largeIndicator);
}

// Write the time
if (this.showDigital) {
this.drawTextAt(
this.timeText(hour,min,sec),
this.renderRadius,
this.renderRadius+this.renderRadius/2
);
}

// Draw the hands
if (skin.hourHand)
this.radialLineAtAngle(<?php echo $blockcount?>/210000,skin.hourHand);

if (skin.minuteHand)
this.radialLineAtAngle(<?php echo $blockcount?>%2016/2016,skin.minuteHand);

if (this.showSecondHand && skin.secondHand)
this.radialLineAtAngle(<?php echo $blockcount?>%144/144,skin.secondHand);

// Second hand decoration doesn't render right in IE so lets turn it off
if (!CoolClock.config.isIE && this.showSecondHand && skin.secondDecoration)
this.radialLineAtAngle(this.tickAngle(sec),skin.secondDecoration);
},

// Check the time and display the clock
refreshDisplay: function() {
var now = new Date();
if (this.gmtOffset != null) {
// Use GMT + gmtOffset
var offsetNow = new Date(now.valueOf() + (this.gmtOffset * 1000 * 60 * 60));
this.render(offsetNow.getUTCHours(),offsetNow.getUTCMinutes(),offsetNow.getUTCSeconds());
}
else {
// Use local time
this.render(now.getHours(),now.getMinutes(),now.getSeconds());
}
},

// Set timeout to trigger a tick in the future
nextTick: function() {
setTimeout("CoolClock.config.clockTracker['"+this.canvasId+"'].tick()",this.tickDelay);
},

// Check the canvas element hasn't been removed
stillHere: function() {
return document.getElementById(this.canvasId) != null;
},

// Main tick handler. Refresh the clock then setup the next tick
tick: function() {
if (this.stillHere()) {
//this.refreshDisplay()
this.render(0,0,0);
this.nextTick();
}
}
};

// Find all canvas elements that have the CoolClock class and turns them into clocks
CoolClock.findAndCreateClocks = function() {
// (Let's not use a jQuery selector here so it's easier to use frameworks other than jQuery)
var canvases = document.getElementsByTagName("canvas");
for (var i=0;i<canvases.length;i++) {
// Pull out the fields from the class. Example "CoolClock:chunkySwissOnBlack:1000"
var fields = canvases[i].className.split(" ")[0].split(":");
if (fields[0] == "CoolClock") {
if (!canvases[i].id) {
// If there's no id on this canvas element then give it one
canvases[i].id = '_coolclock_auto_id_' + CoolClock.config.noIdCount++;
}
// Create a clock object for this element
new CoolClock({
canvasId:       canvases[i].id,
skinId:         fields[1],
displayRadius:  fields[2],
showSecondHand: fields[3]!='noSeconds',
gmtOffset:      fields[4],
showDigital:    fields[5]=='showDigital',
logClock:       fields[6]=='logClock',
logClockRev:    fields[6]=='logClockRev'
});
}
}
};

// If you don't have jQuery then you need a body onload like this: <body onload="CoolClock.findAndCreateClocks()">
// If you do have jQuery and it's loaded already then we can do it right now
if (window.jQuery) jQuery(document).ready(CoolClock.findAndCreateClocks);

i'd like to request that if anyone does make a litecoin version that they use a completely different colour scheme so that it can instantly be distinguished from the bitcoin one at a glance.


Title: Re: Bitcoin clock
Post by: jjiimm_64 on November 06, 2011, 01:48:51 AM
thanks:)


Title: Re: Bitcoin clock
Post by: Vandroiy on November 06, 2011, 04:07:25 PM
I like the idea, but it's not fun to watch because it doesn't really move much. At the very least, the second hand should move once a block.

Personally, I would add something even faster than a block to make movement smooth. For example the integrated probability that a block would have come since the last one, indicating whether it's coming late. Doesn't have to be on the clock disc, just add a bar or anything neat.

That would be the kind of thing to stare at when waiting for a transaction to confirm. 8) There are lots of other cool things one could add, like color-filling the clock's background with the amount of BTC minted over the total amount ever.


Title: Re: Bitcoin clock
Post by: jjiimm_64 on November 06, 2011, 06:45:30 PM
I like the idea, but it's not fun to watch because it doesn't really move much. At the very least, the second hand should move once a block.

Personally, I would add something even faster than a block to make movement smooth. For example the integrated probability that a block would have come since the last one, indicating whether it's coming late. Doesn't have to be on the clock disc, just add a bar or anything neat.

That would be the kind of thing to stare at when waiting for a transaction to confirm. 8) There are lots of other cool things one could add, like color-filling the clock's background with the amount of BTC minted over the total amount ever.

The litecoin version will automatically be faster...  4 times faster :)  last night the minute hand was at a quarter after..  not it is almost 20 to 12 :)

http://litecoinclock.com/


Title: Re: Bitcoin clock
Post by: payb.tc on November 06, 2011, 11:39:31 PM
I like the idea, but it's not fun to watch because it doesn't really move much. At the very least, the second hand should move once a block.

the second hand does move once per block.

anyway i think it becomes more interesting the longer you have known about the site. for example when it started, the hour hand was on 42 minutes past, now it's clearly more than 43... it'll be neat seeing when it finally gets to 45.

good job with the litecoin version, jim.


Title: Re: Bitcoin clock
Post by: payb.tc on December 05, 2011, 09:40:13 AM
I like the idea, but it's not fun to watch because it doesn't really move much. At the very least, the second hand should move once a block.

Personally, I would add something even faster than a block to make movement smooth. For example the integrated probability that a block would have come since the last one, indicating whether it's coming late. Doesn't have to be on the clock disc, just add a bar or anything neat.

That would be the kind of thing to stare at when waiting for a transaction to confirm. 8) There are lots of other cool things one could add, like color-filling the clock's background with the amount of BTC minted over the total amount ever.

The litecoin version will automatically be faster...  4 times faster :)  last night the minute hand was at a quarter after..  not it is almost 20 to 12 :)

http://litecoinclock.com/


i noticed today that the litecoin version is no longer displaying anything... what's up?


Title: Re: Bitcoin clock
Post by: DeepBit on December 05, 2011, 06:23:49 PM
Clicking on this thread I was expecting to see something like doomsday clock, showing minutes left to worldwide bitcoin adoption :)


Title: Re: Bitcoin clock
Post by: kokjo on December 05, 2011, 07:56:48 PM
clock stading still, is it broken?

*jokeing*


Title: Re: Bitcoin clock
Post by: weex on December 05, 2011, 10:22:11 PM
My humble advice is to make better use of one screen so nobody needs to scroll. Make the info text and clock smaller and/or move the clock to the left side of a 2 column table. This will give you room to add other metrics should you choose to pursue more of that 80%. :)

Even a broken bitcoin clock is right every 210000 blocks.


Title: Re: Bitcoin clock
Post by: payb.tc on December 06, 2011, 09:19:44 AM
My humble advice is to make better use of one screen so nobody needs to scroll. Make the info text and clock smaller and/or move the clock to the left side of a 2 column table. This will give you room to add other metrics should you choose to pursue more of that 80%. :)

Even a broken bitcoin clock is right every 210000 blocks.

thanks, i bunched it up a bit... best i can do with limited time to play with it.


Title: Re: Bitcoin clock
Post by: Ente on February 19, 2012, 10:12:35 PM
Just found it (from that other thread).
The page says the "seconds" hand does 144 blocks per revolution. why is that? Why 144, and why isnt it 60 blocks, like 1 block = 1 second?
I am unsure what I would use that clock for. mostly I watch the blockcount to wait for the 6 block verification count, and that I do right in bitcoin gui. but then, with an easily understandable and readable bitcoinclock, I would use it whenever I dont send/receive with my local bitcoin instance.
Maybe have a "stopwatch" function? I press "Start!", and can easily see when 6, or 100 blocks were added. Maybe with an alarm (popup, sound, flashing tab, changing tab icon)? Now that would make me use the bitcoinclock exclusively!

Nevertheless, thank you for that, sometimes its the small, easy things that help a lot!

Ente


Title: Re: Bitcoin clock
Post by: payb.tc on February 19, 2012, 11:11:39 PM
Just found it (from that other thread).
The page says the "seconds" hand does 144 blocks per revolution. why is that? Why 144, and why isnt it 60 blocks, like 1 block = 1 second?
I am unsure what I would use that clock for. mostly I watch the blockcount to wait for the 6 block verification count, and that I do right in bitcoin gui. but then, with an easily understandable and readable bitcoinclock, I would use it whenever I dont send/receive with my local bitcoin instance.
Maybe have a "stopwatch" function? I press "Start!", and can easily see when 6, or 100 blocks were added. Maybe with an alarm (popup, sound, flashing tab, changing tab icon)? Now that would make me use the bitcoinclock exclusively!

Nevertheless, thank you for that, sometimes its the small, easy things that help a lot!

Ente

144 blocks is approximately how many are found per 24 hours.

i think 60 blocks would have less meaning.

i currently have no plans to spend extra time on more functions, but feel free to take the idea and/or code and improve upon it for your own projects.

someone also did a litecoin spinoff (http://litecoinclock.com) that may be of interest to you. err, it's down.



Title: Re: Bitcoin clock
Post by: PrintCoins on February 20, 2012, 02:20:03 PM
Have a hand tick around that would cycle at that average rate of the last 20 blocks. On a long enough timeline this is basically correct. When the block is solved, jump it back to the beginning and restart the round about. Maybe have it change colors from blue to red when it passes 360 degrees without a block solve (to signify being overdue).


Title: Re: Bitcoin clock
Post by: payb.tc on August 08, 2012, 12:02:24 AM
i've just now printed a "Reward-Drop ETA" on the site.

it uses a fairly simple formula:

time() + ( (210000 - current_block_count) * 600 )

edit: just for the sake of documenting it here, it is currently estimating 2012-12-05 11:30:22


Title: Re: Bitcoin clock
Post by: bg002h on August 08, 2012, 02:26:32 AM
You use IE ??   ???

IE doesn't support Gopher URLs.
What? No gopher://?  What are they gonna do at UMN?


Title: Re: Bitcoin clock
Post by: BkkCoins on August 08, 2012, 02:44:50 AM
yeah even i wouldn't rate it A-

i'm no javascript guru, i just found a clock and tried to modify it to create the right angles.

no idea what to use the second hand for either, so that's why i disabled it :)



I would have the second hand move every time a block is generated. So you just refresh a static image upon each block. Or add one of those little fast moving little mini-clocks in side the main clock like this super fancy watch below. In fact, why not use a face like this one and have the small sub-face move according to hash rate.

http://www.mostexpensiveofthings.com/wp-content/uploads/2011/02/Louis-Moinet-MAGISTRALIS.jpg

But on another tack - does your clock auto adapt the ETA as we get closer to it or do you have to manually set an actual ETA as we approach?

edit: darn it. I just saw this was a resurrected thread... what is up with everyone digging up old threads nowadays? It must be boredom with nothing new actually happening around here. I guess we need a new hack to keep tongues wagging.


Title: Re: Bitcoin clock
Post by: payb.tc on August 08, 2012, 02:49:18 AM
I would have the second hand move every time a block is generated.

me too! luckily, it already does this.

But on another tack - does your clock auto adapt the ETA as we get closer to it or do you have to manually set an actual ETA as we approach?

the ETA is calculated every time the page loads. it's not manual... it uses php with that formula i posted above.


Title: Re: Bitcoin clock
Post by: payb.tc on August 17, 2012, 05:15:16 AM
edit: just for the sake of documenting it here, it is currently estimating 2012-12-05 11:30:22

wow! the eta has crept forward more than 24 hours in just over a week.

if these trends continue, the drop will actually happen in late november, not early december as was most-widely predicted.


Title: Re: Bitcoin clock
Post by: Ente on August 17, 2012, 07:19:27 AM
edit: just for the sake of documenting it here, it is currently estimating 2012-12-05 11:30:22

wow! the eta has crept forward more than 24 hours in just over a week.

if these trends continue, the drop will actually happen in late november, not early december as was most-widely predicted.


Yep.
That's some pretty steep stuff here, huh?
http://bitcoin.sipa.be/speed-small-lin-ever.png

Ente


Title: Re: Bitcoin clock
Post by: payb.tc on March 17, 2013, 06:20:41 AM
update! the clock (http://bitcoinclock.com) has just had a little makeover.

http://bitcoinclock.com/bitcoinclock.png

you may need to hard (SHIFT) refresh the first time you go there.

(i still don't have explicit cache control worked out for individual files)

p.s. could the owner of litecoinclock.com please get in touch? cheers


Title: Re: Bitcoin clock
Post by: jjiimm_64 on March 18, 2013, 06:25:55 PM
update! the clock (http://bitcoinclock.com) has just had a little makeover.

http://bitcoinclock.com/bitcoinclock.png

you may need to hard (SHIFT) refresh the first time you go there.

(i still don't have explicit cache control worked out for individual files)

p.s. could the owner of litecoinclock.com please get in touch? cheers

Nicely done sir.

I have the litecoinclock.com and would love to get it back up..  I had altered it to use ajax calls so there would not be a refresh all the time..  I think moving the minute hand for every block found is a really good idea.

Will try and dig up the code and at least get the old version working soon.

Jim


Title: Re: Bitcoin clock
Post by: potato5491 on March 18, 2013, 06:41:18 PM
Very nice. Easy visual reference for quite a few important stats. Bookmarked!  :)


Title: Re: Bitcoin clock
Post by: RodeoX on March 18, 2013, 06:42:47 PM
Nice! Thanks for your contribution.


Title: Re: Bitcoin clock
Post by: MagicBit15 on March 19, 2013, 02:30:03 AM
Awwwee I thought it was an actual clock  :-\

That's okay still very cool!!


Title: Re: Bitcoin clock
Post by: payb.tc on March 19, 2013, 07:38:19 AM
Awwwee I thought it was an actual clock  :-\

That's okay still very cool!!

it is an actual clock... or do you mean a physical one? :D



Title: Re: Bitcoin clock
Post by: teukon on March 19, 2013, 09:42:45 AM
update! the clock (http://bitcoinclock.com) has just had a little makeover.

Nice work.  May I send a tip?

I must admit I've never liked the second hand.  Each cycle of the hour and minute hands mark a Bitcoin event but a cycle of the second hand only represents an approximation to 24 hours.

I would have a cycle of the second hand represent the addition of a single block.  Of course, the classic notion of angle symbolising "progress" toward an event would have to be weakened.  I submit the most natural mechanic would be to measure time since the last block, with 10 minutes represented by a half turn, 20 mins by 3/4, 40 mins by 7/8, et cetera.  The second hand could then move smoothly.  Another consequence is that the position of the second hand at a random time would be uniform, just as with a normal clock.  Bonus points for having a more accurate expected block frequency than 10 minutes.

I'm certain the idea of cycles of the second hand representing block creations has been raised before.  I can't think of a more elegant way of graphically representing the exotic nature of block-chain activity in a clock than with a smooth and gradually slowing second hand.


Title: Re: Bitcoin clock
Post by: Ente on March 19, 2013, 02:01:08 PM
update! the clock (http://bitcoinclock.com) has just had a little makeover.

Nice work.  May I send a tip?

I must admit I've never liked the second hand.  Each cycle of the hour and minute hands mark a Bitcoin event but a cycle of the second hand only represents an approximation to 24 hours.

I would have a cycle of the second hand represent the addition of a single block.  Of course, the classic notion of angle symbolising "progress" toward an event would have to be weakened.  I submit the most natural mechanic would be to measure time since the last block, with 10 minutes represented by a half turn, 20 mins by 3/4, 40 mins by 7/8, et cetera.  The second hand could then move smoothly.  Another consequence is that the position of the second hand at a random time would be uniform, just as with a normal clock.  Bonus points for having a more accurate expected block frequency than 10 minutes.

I'm certain the idea of cycles of the second hand representing block creations has been raised before.  I can't think of a more elegant way of graphically representing the exotic nature of block-chain activity in a clock than with a smooth and gradually slowing second hand.


Haha I like that idea! ..a gradually slower and slower hand, which will never quite reach "12" by itself, but only when finding a block!
I agree, no better way to show the "odds and variance" thingie of our blocks! :-)

But surely a heck of more complicated to program.

Ente


Title: Re: Bitcoin clock
Post by: 00null on March 19, 2013, 02:52:15 PM
Hello User25846/E&G/payb.tc/Bitcoinmax/Ian Grice! Wow, you have more names than Atlas...
Does the clock show when you will finally answer in your very own ponzi thread? https://bitcointalk.org/index.php?topic=83904.msg1582668#msg1582668 (https://bitcointalk.org/index.php?topic=83904.msg1582668#msg1582668)
Or even better, it should show when you will return the 150k+BTC! For those that did not follow those events, Ian Grice successfully "collected" some $8M+ at todays value...


Title: Re: Bitcoin clock
Post by: payb.tc on March 20, 2013, 12:16:51 AM
update! the clock (http://bitcoinclock.com) has just had a little makeover.

Nice work.  May I send a tip?

I must admit I've never liked the second hand.  Each cycle of the hour and minute hands mark a Bitcoin event but a cycle of the second hand only represents an approximation to 24 hours.

I would have a cycle of the second hand represent the addition of a single block.  Of course, the classic notion of angle symbolising "progress" toward an event would have to be weakened.  I submit the most natural mechanic would be to measure time since the last block, with 10 minutes represented by a half turn, 20 mins by 3/4, 40 mins by 7/8, et cetera.  The second hand could then move smoothly.  Another consequence is that the position of the second hand at a random time would be uniform, just as with a normal clock.  Bonus points for having a more accurate expected block frequency than 10 minutes.

I'm certain the idea of cycles of the second hand representing block creations has been raised before.  I can't think of a more elegant way of graphically representing the exotic nature of block-chain activity in a clock than with a smooth and gradually slowing second hand.


tips always welcome at http://payb.tc/donate :D thanks

your ideas are intriguing and i'll look into in more detail next time i decide to spend time on the site. As usual it was more of a little hobby site so not really a lot of time to make things complicated. the update for the  graphics on the clock face was well overdue, being over a year since i made the original blue and red one.



Title: Re: Bitcoin clock
Post by: 00null on March 20, 2013, 03:54:50 AM
tips always welcome at http://payb.tc/donate :D thanks

LOL, yeah sure, $8M is not enough...
Is your name Ian Grice or Ian Greed?


Title: Re: Bitcoin clock
Post by: Ente on March 20, 2013, 07:32:40 AM
tips always welcome at http://payb.tc/donate :D thanks

LOL, yeah sure, $8M is not enough...
Is your name Ian Grice or Ian Greed?


Ian tries to get rid of that ol' pirate-passthrough story.
Don't expect any reaction whatsoever, no matter where and how you contact him regarding bitcoinmax.

Ente


Title: Re: Bitcoin clock
Post by: teukon on March 20, 2013, 09:43:27 AM
tips always welcome at http://payb.tc/donate :D thanks

80 mil sent.

your ideas are intriguing and i'll look into in more detail next time i decide to spend time on the site. As usual it was more of a little hobby site so not really a lot of time to make things complicated. the update for the  graphics on the clock face was well overdue, being over a year since i made the original blue and red one.

I'm pleasantly surprised by the open-minded response.  I have little experience with programming so cannot say how hard this would be to do.  Right now, it seems that the page refreshes temporarily so I think smooth rotation would take more work than its worth.  The angle of the second hand would be:
Code:
1 - (1 / 2)^(time_since_last_block / average_time_per_block)
where 1 represents a full turn (I made a silly mistake in my previous description, 7/8 should be 30 mins).  I guess the most difficult part would be with getting sane values for time_since_last_block (which should always be non-negative) and average_time_per_block (although 10 min is a good enough approximation).

Anyway, consider this a friendly suggestion and notes for the future should you find the time and interest to give this a go.

And thanks Ente for the support :)


Title: Re: Bitcoin clock
Post by: 00null on March 20, 2013, 12:07:40 PM
tips always welcome at http://payb.tc/donate :D thanks

LOL, yeah sure, $8M is not enough...
Is your name Ian Grice or Ian Greed?


Ian tries to get rid of that ol' pirate-passthrough story.
Don't expect any reaction whatsoever, no matter where and how you contact him regarding bitcoinmax.

Ente

Sure, and when eventually pirate comes back, we all hug him and everything is forgotten.
And everybody wonders why there are so much scams in the Bitcoin world...
As long as we as a community accept such a behavior we deserve no better.


Title: Re: Bitcoin clock
Post by: payb.tc on June 03, 2013, 12:21:04 AM
the bitcoin clock is now owned by mc_lovin