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
/** | |
* 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 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 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
/* Um funcionário de uma empresa recebe aumento salarial anualmente. Sabe-se que: | |
* Ele foi contratado em 2005, com salario inicial de 1000 | |
* Em 2006, ele recebeu auento de 1.5% sobre seu salario inicial | |
* A partir de 2007, os aumentos salariais sempre corresponderam ao dobro do percentual do ano anterior | |
* Faça um algoritmo que determine o salário atual (2012) desse funcionário. | |
*/ | |
package lacosdowhile; | |
import java.util.Scanner; |
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
/* | |
* Faça um programa que calcule o fatorial de um número inteiro. | |
* Repita a operação de cálculo X vezes. | |
*/ | |
package cap14; | |
import java.util.Scanner; | |
public class Exercicio03 { |
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
/* | |
* Dado x números entre 0 e 100, apresente a média, o maior e o menor número digitado. | |
* Caso o usuário digite um número diferente do solicitado no intervalo, | |
* peça para informar outro número. | |
*/ | |
package cap14; | |
import java.util.Scanner; | |
public class Exercicio07 { |
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 | |
// openning connection | |
$link = mysqli_connect('host', 'user', 'password', 'database') | |
or die('Could not connect to server'.'<br>'); | |
// uncomment next line to debug | |
//print 'connection opened'.'<br>'; | |
?> |
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
/* | |
* Declare um vetor de 10 posições | |
* preencha com os 10 primeiros números ímpares | |
* escreva na tela o resultado | |
*/ | |
package vetores; | |
public class Exercicio02 { | |
public static void main(String[] args){ |
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
/* | |
* Faça um programa de cálculo de potência que solicite dois números (n e m) | |
* e faça o cálculo de n^m. Repita esse cálculo até o usuário digitar n = 0. | |
*/ | |
package cap14; | |
import java.util.Scanner; | |
public class Exercicio04 { | |
public static void main(String[] args){ |
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
{ | |
"Ansi 6 Color" : { | |
"Green Component" : 0.73333334922790527, | |
"Blue Component" : 0.73333334922790527, | |
"Red Component" : 0 | |
}, | |
"Tags" : [ | |
], | |
"Ansi 12 Color" : { |
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
=begin | |
Recebe uma entrada de dados (palavra(s)), faz a contagem de cada palavra e mostra na tela em ordem crescente por quantidade de repetições | |
=end | |
puts "Enter some text" | |
text = gets.chomp # recebe a entrada de dados | |
words = text.split(" ") # cria um array, onde cada palavra ficará em uma posição | |
# cria um hash vazio para armazenar as palavras e a quantidade de vezes que apareçem |