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
#!/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
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
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
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
function partition( array, left, right ) { | |
var pivot = array[Math.floor((left + right)/2)], | |
i = left, | |
j = right; | |
while ( i <= j ) { | |
while ( array[i] < pivot ) { | |
i++; |
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 codigoSujo = prompt('Digite o número do código de barras'); | |
var codigoLimpo = ''; | |
// mantem somente letras e numeros | |
codigoLimpo = codigoSujo.replace(/\W/g, ''); | |
alert('Aqui está o código de barras limpo: ' + codigoLimpo); |
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 Circle(width, height, color){ | |
/* | |
** @param {Integer} largura | |
** @param {Integer} altura | |
** @param {String} cor | |
*/ | |
this.width = width || 100; | |
this.height = height || 100; | |
this.color = color || 'red'; |
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
/* | |
* This is a near-direct port of Robert Penner's easing equations. Please shower Robert with | |
* praise and all of your admiration. His license is provided below. | |
* | |
* For information on how to use these functions in your animations, check out: | |
* http://www.kirupa.com/html5/animating_with_easing_functions_in_javascript.htm | |
* | |
* -Kirupa | |
*/ |
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
inicio | |
real valorPresente, valorFuturo, taxaJuros, numParcelas, valorPrestacao | |
escrever "Digite o valor presente do bem " | |
ler valorPresente | |
escrever "Digite a taxa de juros em %" | |
ler taxaJuros | |
escrever "Digite a quantidade de parcelas " |