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
if (Meteor.isClient) { | |
Test = new Meteor.Collection("test"); | |
Meteor.subscribe("testsub"); | |
} | |
if (Meteor.isServer) { | |
Test = new Meteor.Collection("test", { connection: null }); | |
Meteor.publish("testsub", function () { | |
return Test.find(); | |
}); |
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
# How much does it cost to get from (i1, j) to (i2, j) by going up | |
# or down only? | |
def sum_to(i1, i2, j, matrix): | |
x1 = min(i1, i2) | |
x2 = max(i1, i2) | |
return sum([matrix[x][j] for x in range(x1, x2+1)]) | |
# Returns the minimum path sum that goes from any entry in the | |
# leftmost column to entry (i, j). | |
def compute_min_path_entry(i, j, matrix, min_path): |