Takes a grid and returns an optimal set of rectangles that fills that grid
For example, the following grid:
[[1,1,0,1,1],
[1,1,1,1,1],
[0,1,1,1,0]]
| var login_counts = [], | |
| j = 30; | |
| for (;j > 0;j--) { | |
| tday.setDate(tday.getDate()+1); | |
| yday.setDate(tday.getDate()+1); | |
| // scope | |
| (function (index, query) { | |
| collection.find({date: query},function (err, cursor) { |
| var login_counts = [], | |
| j = 30, | |
| // functions scope | |
| add_count = function (index, query) { | |
| collection.find({date: query},function (err, cursor) { | |
| cursor.count(function (err, count) { | |
| login_counts[index] = count; | |
| }); | |
| }); | |
| }; |