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
for i in range(nb_epochs): | |
np.random.shufle(data) | |
for example in data: | |
params_grad = evaluete_gradient(loss_function, example, params) | |
params = params - learning_rate * params_grad |
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
for i in range(nb_epochs): | |
np.random.shufle(data) | |
for example in get(batches(data, batch_size=50): | |
params_grad = evaluate_gradient(loss_function, batch, params) | |
params = params - learning_rate * params_grad |
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
############################### | |
Install Docker | |
############################### | |
# get a docker instalation script | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
# execute the instalation script | |
sudo sh get-docker.sh | |
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
################################ | |
# Instalação do Docker no Ubuntu | |
################################ | |
# Verificar a versão do sistema | |
lsb_release -a | |
# Obter o script de isntação oficial do Docker | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "Hello, This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", | |
"version": "1.0.0", | |
"title": "Swagger Petstore", | |
"termsOfService": "http://swagger.io/terms/", | |
"contact": { | |
"email": "[email protected]" | |
}, |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "MovilePay Wallet API", | |
"version": "1.0.0", | |
"title": "MovilePay API" | |
}, | |
"host": "internal-abc2a9727492711eab43e028429ac920-2080467542.sa-east-1.elb.amazonaws.com", | |
"basePath": "/v1", | |
"tags": [ |
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 kotlin.system.* | |
fun main() { | |
val executionTime = measureTimeMillis { | |
val task1 = addTen(1) | |
val task2 = addTen(2) | |
println("async task 1: ${task1}") | |
println("async task 2: ${task2}") | |
} | |
println("execution time: [$executionTime] ms") | |
} |
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 kotlinx.coroutines.* | |
import kotlin.system.* | |
fun main() = runBlocking { | |
val executionTime = measureTimeMillis { | |
val asyncTask1 = async{addTen(1)} | |
val asyncTask2 = async{addTen(2)} | |
println("task 1: ${asyncTask1.await()}") | |
println("task 2: ${asyncTask2.await()}") | |
} | |
println("execution time: [$executionTime] ms") |
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
interface Continuation<in T> { | |
val context: CoroutineContext | |
fun resumeWith(result: Result<T>) | |
} |
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
public static final Object addTen(int n, Continuation continuation) { | |
switch (continuation.label) { | |
case 0: { | |
continuation.n = n; | |
continuation.label = 1; | |
if (delay(1000L, continuation) == COROUTINE_SUSPENDED) | |
return COROUTINE_SUSPENDED; | |
} | |
case 1: { |
OlderNewer