Skip to content

Instantly share code, notes, and snippets.

@nmilford
Created May 13, 2011 14:34
Show Gist options
  • Save nmilford/970641 to your computer and use it in GitHub Desktop.
Save nmilford/970641 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Cassandra Ring Calculator</title>
</head>
<body>
<input id='numNodes' size=10> <button onClick='calcRing()'>Submit</button>
<script type='text/javascript'>
function calcRing() {
var nodes=document.getElementById('numNodes').value;
for(i=0; i<nodes; i++) {
document.write("Node #" + i + " initial_token: " + (Math.pow(2,127)*i)/nodes)
document.write("<br>");
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment