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
var assert = require('assert'); | |
/******************************** | |
* We want make a package of goal kilos of chocolate. We have | |
* inventory of small bars (1 kilos each) and big bars (5 kilos each). | |
* Return the number of small bars to use, assuming we always | |
* use big bars before small bars. Return -1 if it can't be done. | |
* | |
* See the asserts below for examples of input | |
* and expected output. |
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
var assert = require('assert'); | |
/******************************** | |
* Return true if the array contains, somewhere, three increasing | |
* adjacent numbers like .... 4, 5, 6, ... or 23, 24, 25. | |
* | |
* See the asserts below for examples of input | |
* and expected output. | |
* | |
* If you have node installed, all you need to do to test |
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
var data; // loaded asynchronously | |
var path = d3.geo.path() | |
.projection(d3.geo.albersUsa() | |
.scale(1400) | |
.translate([680,360])); | |
var svg = d3.select("#chart").append("svg") | |
.attr("width", 1280) | |
.attr("height", 800); |
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>dojoConfig = {async: true, parseOnLoad: false}</script> | |
<script src='dojo/dojo-release-1.8.0/dojo/dojo.js'></script> | |
<script>dojoConfig = {parseOnLoad: true}</script><script src='../_static/js/dojo/dojo.js'></script> | |
<script> | |
require(["dojo/has", // alias has API to "has" |