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
public void testHello() { | |
say("clarin", "hola") | |
.assertButtonType(2, "empecemos", "ayuda") | |
.assertButtonTypeText("Soy el robot de") | |
.assertEnd() | |
say("clarin", "hola") | |
.assertButtonType(2, "ver men.", "ayuda") | |
.assertButtonTypeText("C.mo est.s", "Buenas tardes", "Buenas noches", "Buen.*d.a", "Hola") |
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
final Optional<Pattern> customerNamePattern = filters.stream().filter(m -> "customerName".equals(m.get("t"))) | |
.map(m -> m.get("_id_").toString().trim()) | |
.findAny() | |
.map(pattern -> Pattern.compile(pattern, Pattern.CASE_INSENSITIVE)); | |
final Optional<String> customerEmail = filters.stream().filter(m -> "customerEmail".equals(m.get("t"))) | |
.map(m -> m.get("_id_").toString().trim()) | |
.findAny(); | |
final Predicate<Customer> customerFilter = c -> |
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
private <T> Optional<T> redisApply(final BiFunction<Jedis, Boolean, T> callback) { | |
final List<T> result = new ArrayList<>(); | |
new RetryingHandler().tryClosure((redisServer, results, loggingActivated, isProductionEnvironment) -> { | |
try (final Jedis jedis = redisServer.getPool().getResource()) { | |
result.add(callback.apply(jedis, isProductionEnvironment)); | |
} | |
}, null); | |
return result.stream().findFirst(); | |
} |
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
# Bash script to make png images from svgs | |
mogrify -format png -size 400x400 -extent 764x400 -gravity center *.svg |
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
public static void main(String[] args) { | |
Runner.run(context -> { | |
final String businessId = "holaSim"; | |
final String pageId = "1793427134203438"; | |
final String accessToken = "EAAZABjaJiSJsBANLRDF8czZCuyEAkFDY6JEZBeJGyhOb3wqDVuKOraCarUKsJijGwGcsABxTZBM1Q18NZC8K5rQbr4SxFRbhjOZBYs8MmbvHN9ZC46LZABf905LCEvzibzoQnkpwZAqYEBOrOgI1DD161LuIlyZB3WfmO4TBqriF2HaKKAxAhQ0H5vp45Q7lX7ZAONvU6ZCPiY0ZCOwZDZD"; | |
final ChatChannelDAO chatChannelDAO = context.getDAO(ChatChannelDAO.class); | |
ChatChannel.buildAndSave(businessId, ChatPlatform.MESSENGER, true, pageId, accessToken, null); | |
final List<ChatChannel> channels = chatChannelDAO.findBy(businessId); |
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
curl -X POST -H "Content-Type: application/json" -d '{ | |
"recipient":{ | |
"id":"USER_ID" | |
}, | |
"message":{ | |
"text":"Pick a color:", | |
"quick_replies":[ | |
{ | |
"content_type":"text", | |
"title":"Red", |
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
{ | |
"speech": "The next holiday is in 12 days.\nWhat do you want to do next?", | |
"contextOut": [ | |
{ | |
"name": "_actions_on_google_", | |
"lifespan": 100, | |
"parameters": {} | |
} | |
], | |
"data": { |
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
{ | |
"speech": "Sure!", | |
"contextOut": [ | |
{ | |
"name": "_actions_on_google_", | |
"lifespan": 100, | |
"parameters": {} | |
} | |
], | |
"data": { |
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
{ | |
"expectedInputs": [{ | |
"possibleIntents": [{ | |
"inputValueData": { | |
"listSelect": {"items": [ | |
{ | |
"optionInfo": { | |
"synonyms": [], | |
"key": "La sentida carta del hijo de Débora Pérez Volpin: \"Tranquila mami, estamos bien y te extrañamos muchísimo\"" | |
}, |
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
vocab_size = 5000 | |
sentence_size = 200 | |
(x_train_variable, y_train), (x_test_variable, y_test) = imdb.load_data(num_words=vocab_size) | |
x_train = sequence.pad_sequences( | |
x_train_variable, | |
maxlen=sentence_size, | |
padding='post', | |
value=0) | |
x_test = sequence.pad_sequences( | |
x_test_variable, |
OlderNewer