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
static class Program | |
{ | |
static void Main(string[] args) | |
{ | |
System.Console.Write("Hello gist"); | |
} | |
} |
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 br.uem.din.verificadorPortas; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.net.DatagramSocket; | |
import java.util.ArrayList; | |
public class Main { |
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
Sete Atitudes para Hackear a Indústria de Software | |
By Klaus Wuestefeld | |
1) Torne-se excelente. | |
Seja realmente bom em alguma coisa. Não fique só choramingando ou | |
querendo progredir às custas dos outros. Não pense q pq vc sentou 4 | |
anos numa faculdade ouvindo um professor falar sobre software q vc | |
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo |
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
module FizzBuzz | |
def as_fb | |
return 'FizzBuzz' if self % 15 == 0 | |
return 'Fizz' if self % 3 == 0 | |
return 'Buzz' if self % 5 == 0 | |
return self.to_s | |
end | |
end | |
class Fixnum |
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
class JokenPo | |
@@precedencia = { | |
:pedra => :tesoura, | |
:papel => :pedra, | |
:tesoura => :papel | |
} | |
def self.jogar(jogador1, jogador2) |
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
class ShuntingYard | |
@@op_precedence = { | |
'+' => 2, | |
'-' => 2, | |
'*' => 3, | |
'/' => 3, | |
'^' => 4 | |
} |
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
class Caixa | |
attr_reader :peso, :capacidade | |
def initialize(peso, capacidade) | |
@peso = peso | |
@capacidade = capacidade | |
end | |
end | |
class Pilha |
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
def prime?(n) | |
(2..Math.sqrt(n)).each do |i| | |
return false if n % 2 > 0 | |
end | |
return true | |
end |
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
... | |
fp = fopen(file_input, "r"); | |
... | |
for (int k = 1; k <= 2*M_arcos; k += 2) | |
{ | |
fscanf(fp, "%s %d %d %d", line_parse, &i, &j, &w); | |
I_arco[k] = i; | |
J_arco[k] = j; | |
I_arco[k+1] = j; | |
J_arco[k+1] = i; |
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
lowerBound = MST | |
upperBound = todos os vértices conectados na raiz | |
G = (V, E) | |
e[] = sort(E) //as arestas serão usadas para particionar o espaço de soluções | |
bestSoFar = upperBound(G) | |
live[] = branch(e.dequeue()) //aqui gera as possibilidade: 1- com p0, 2 - sem p0 |
OlderNewer