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
# -*- coding:utf-8 -*- | |
vogais = "aeiou" | |
def limpar_console(): | |
import os | |
os.system('cls||clear') | |
def normalizar_dados(): | |
for arquivo in ["arquivo_encript.txt","palavras.txt"]: |
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
<input type="" name="" placeholder="Input 1"> | |
<input type="" name="" placeholder="Input 2"> | |
<input type="" name="" placeholder="Input 3"> | |
<button>Botão 3</button> | |
<script type="text/javascript"> | |
let botoes = document.querySelectorAll("input"); |
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
<?php | |
class Slugfy{ | |
public static function getSlug($string){ | |
$string = stripslashes($string); | |
$string = preg_replace('/[[:punct:]]+/',' ',$string); | |
$string = preg_replace('/[[:space:]]+/',' ',$string); | |
$string = ltrim($string,". "); |
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
Array.prototype.contains = function(valor_desejado){ | |
var quantidade = 0; | |
this.forEach(function(valor_atual,indice){ | |
if (valor_atual === valor_desejado){ | |
quantidade += 1; | |
} | |
}); | |
if (quantidade > 0){ |
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
interface LeitorDeArquivos{ | |
public List<String> ler(File arquivo); | |
} | |
class LeitorTXT implements LeitorDeArquivos{ | |
public ArrayList<String> ler(File arquivo){ | |
//Processamento java para retornar as linhas do arquivo de texto. |
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
from string import ascii_lowercase as lower_letters | |
input_text = str(input()).lower() | |
def to_string_ordered(string): | |
new_string = string.replace(" ","") | |
new_string = list(set(new_string)) | |
new_string.sort() | |
new_string = "".join(new_string) |
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
import unittest | |
class TestData(unittest.TestCase): | |
def test_data_definida_deve_retornar_valores_validos(self): | |
data = Data(11,10,2016) | |
self.assertEqual(data.dia,11) | |
self.assertEqual(data.mes,10) | |
self.assertEqual(data.ano,2016) |
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 Data(object): | |
def __init__(self,dia=None,mes=None,ano=None): | |
if all([dia != None, mes != None , ano != None]): | |
self.dia = dia | |
self.mes = mes | |
self.ano = ano | |
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
existentes = [5,4,2,2] | |
disponiveis = [3,3,2,1] | |
requisitados = [ | |
[2,0,3,1], | |
[3,1,4,2], | |
[0,0,0,0], | |
[1,2,1,1] | |
] |
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 soma(n1,n2): | |
return n1+n2 | |
def subtr(n1,n2): | |
return n1-n2 | |
def mult(n1,n2): | |
result = 0 | |
for i in range(1,n2+1): |