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
Object.keys = Object.keys || (function () { | |
var hasOwnProperty = Object.prototype.hasOwnProperty, | |
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"), | |
DontEnums = [ | |
'toString', | |
'toLocaleString', | |
'valueOf', | |
'hasOwnProperty', | |
'isPrototypeOf', | |
'propertyIsEnumerable', |
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 class Matrizes { | |
private int linhas; | |
private int colunas; | |
private int[][] matriz; | |
private int[] diagonalPrincipal; | |
private int[] diagonalSecundaria; | |
private Boolean isMatrizQuadrada = false; | |
/** |
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
package emporium; | |
// Esta classe modela o caixa do "emporium". Ela deve receber o nome do | |
// cliente e a lista de produtos (conteúdo do "carrinho"). | |
public class Caixa | |
{ | |
// atributos: variáveis que armazenam os dados de um objeto, após este | |
// ser instanciado. | |
private Cliente cliente; | |
private Carrinho carrinho; |
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
#!/bin/bash | |
## npm | |
is_npm_installed=$(dpkg -l | grep -i npm | awk '{print $2}') | |
if [ '$is_npm_installed' == 'npm' ] | |
then | |
is_npm_installed=true | |
else | |
is_npm_installed=false | |
fi |
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
/** | |
* Remove acentos de caracteres | |
* @param {String} stringComAcento [string que contem os acentos] | |
* @return {String} [string sem acentos] | |
*/ | |
function removerAcentos( newStringComAcento ) { | |
var string = newStringComAcento; | |
var mapaAcentosHex = { | |
a : /[\xE0-\xE6]/g, | |
e : /[\xE8-\xEB]/g, |
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
function Slider( containerSlider ){ | |
this.container = document.querySelector( containerSlider ); | |
this.botoesSlider = this.container.querySelectorAll( '.slider-navegacao-botao' ); | |
this.tagImagem = this.container.querySelector( '.slider-imagem' ); | |
this.listaImagens = this.tagImagem.attributes['data-images'].value.split(','); | |
this.areaClicavelImagem = this.container.querySelector( '.area-clicavel-imagem' ); | |
this.botaoRetroceder = this.areaClicavelImagem.querySelector( '.botao-retroceder' ); | |
this.botaoAvancar = this.areaClicavelImagem.querySelector( '.botao-avancar' ); | |
this.posicaoSlider = 0; | |
this.quantidade = this.listaImagens.length; |
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
Compile os arquivos: | |
$ gcc -o executavel_server socket_server.c | |
$ gcc -o executavel_client socket_client.c | |
Inicie o server: | |
$ ./executavel_server | |
Rode o client: | |
$ ./executavel_client |
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
*linear: | |
- somente 1 dimensao | |
- lista finita e sequencial de items | |
A escolha do metodo a ser utilizado depende de: | |
- quantidade de dados envolvidos | |
- volume de operacoes de inclusao/exclusao | |
Algoritmos relacionados à memória primária | |
Busca linear/sequencial |
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
var alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']; | |
function encryption ( word, shift ) { | |
var encryptedWord = ''; | |
for (var i = 0; i < word.length; i++) { | |
var letter = word[i].toUpperCase(); | |
var letterIndex = alphabet.indexOf(letter); | |
var shiftedIndex = letterIndex+shift; | |
var newLetterIndex = shiftedIndex % alphabet.length; |
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
#!/bin/bash | |
current_name=$1 | |
new_name=$2 | |
files=`grep -irl $current_name` | |
num_files=`grep -irl $current_name | wc -l` | |
echo "found $num_files file(s) with import name $current_name" |