This file contains hidden or 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
/* | |
* Used in our tests to make the RESTful calls | |
*/ | |
private ResultActions invokeAllHeroes() throws Exception { | |
return mvc.perform(get(BASE_URL).accept(MediaType.APPLICATION_JSON)); | |
} | |
private ResultActions invokeSearchHeroes(String term) throws Exception { | |
return mvc.perform(get(BASE_URL + "search/name?contains=" + term).accept(MediaType.APPLICATION_JSON)); |
This file contains hidden or 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
# | |
# Google interview question: find all combinations that sum up to a value | |
# | |
require 'set' | |
def summables(vector, remainder, so_far) | |
return Set.new if remainder < 0 #did not find a sum | |
return [so_far].to_set if remainder == 0 #found a sum | |
car = vector[0] |
This file contains hidden or 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
import json | |
import re | |
import sys | |
# | |
# Replace all template variables in input file with configured values | |
# from the JSON config. Template variables are distiguished by enclosing | |
# double braces. eg {{ template.variable }}. This would match templatevalue | |
# in JSON config {"template": {"variable": "templatevalue"}} | |
# |
OlderNewer