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
# a->b,a->c,b->c,b->f,c->d,c->e,d->e,f->e | |
# Início: a, fim: e | |
# | |
# (d) | |
# | \ | |
# (c)-(e) | |
# / | | | |
# (a)-(b)-(f) (j)-(k) | |
# | |
# Cada caminho tem um custo associado: |
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
// Cleuton Sampaio | |
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"github.com/emirpasic/gods/utils" | |
"gonum.org/v1/plot" |
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
package com.obomprogramador.stream; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class StreamDemo2 { | |
static class Order { |
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
package com.obomprogramador.stream; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.function.Supplier; | |
import java.util.stream.Collectors; | |
import java.util.stream.Stream; | |
public class StreamDemo { |
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
/* | |
* GET home page. | |
*/ | |
var Promise = require('promise'); | |
var Request = require('request'); | |
exports.index = function(req, res){ | |
var aprovada = function(httpresponse) { |
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
async.waterfall([ | |
function(callback){ | |
// ***** Task 1: Apaga o banco de dados | |
db.once('open', function () { | |
db.db.dropDatabase(function(err) { | |
if(err != null) { | |
console.log('Erro ao apagar o banco: ' + err); | |
} | |
else { |
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
/* | |
* Página default: | |
*/ | |
var Worker = require('webworker-threads').Worker; | |
var redis = require("redis"); | |
var uuid = require('node-uuid'); | |
exports.index = function(req, res){ | |
res.render('index', { title: 'Operação assíncrona', botao: 'Iniciar' }); |
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
/* | |
Copyright 2014 Cleuton Sampaio | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
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
/* | |
* Script de eventos da página index.html | |
*/ | |
var chave = null; | |
var calculando = false; | |
var original = ''; | |
$(document).ready(function(){ | |
$("#btn").click(function(){ | |
if (!calculando) { |
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
// nonblocker.js | |
var restify = require('restify'); | |
var fs = require('fs'); | |
var Worker = require('webworker-threads').Worker; | |
var server = restify.createServer(); | |
// Home page: |
NewerOlder