This small script uses combinatory analysis to figure out the optimal denominations for given number of possible coins to minimize the coins required to produce any amount between 1 cent and 1 dollar. The candidate set of denominations is reduced to keep the combinatory possibilities within reason.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function encode64(data) { | |
var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; | |
var PAD = '='; | |
var ret = ''; | |
var leftchar = 0; | |
var leftbits = 0; | |
for (var i = 0; i < data.length; i++) { | |
leftchar = (leftchar << 8) | data[i]; | |
leftbits += 8; | |
while (leftbits >= 6) { |
For excessively paranoid client authentication.
Organization & Common Name: Some human identifier for this server CA.
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body></body> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript"> | |
// Define the SVG domain in a viewbox to get automatic resize to | |
// window. This is a good alternative to d3.scale for simple stuff | |
svg=d3.select("body") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="svg_interact.js"></script> | |
<script type="text/javascript" src="svg_map.js"></script> | |
</head> | |
<body></body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
</head> | |
<body> | |
<div id="graph"></div> | |
<div id="fps">FPS: <SPAN>?</SPAN></DIV> | |
Number or circles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<STYLE>svg { border: dashed;border-width:1px;}</STYLE> | |
</head> | |
<body> | |
<div id="graph"></div> | |
<div id="fps">FPS: <SPAN>?</SPAN></DIV> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<STYLE>svg { border: dashed;border-width:1px;}</STYLE> | |
</head> | |
<body> | |
<div id="graph"></div> | |
<div id="fps">FPS: <SPAN>?</SPAN></DIV> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://x3dom.org/x3dom/example/x3dom.js"></script> | |
</head> | |
<body> | |
</body> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://raw.github.com/mbostock/d3/v2.4.3/d3.js"></script> | |
<script type="text/javascript" src="http://x3dom.org/x3dom/example/x3dom.js"></script> | |
</head> | |
<body> | |
</body> | |
OlderNewer