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 decimal import Decimal | |
from math import floor | |
def parcelas(valor, n, div=False, primeira=False): | |
formato = Decimal('0.00') | |
valor = Decimal(valor) | |
if div: | |
parcela = Decimal(floor(valor * 100 / n) / 100) | |
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
package Lojaonline; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.HashSet; | |
import java.util.Set; | |
import javax.swing.text.html.HTMLDocument.Iterator; | |
public class CarrinhoCompras { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 conv(number, from_digits, to_digits): | |
if len(to_digits) == 1: | |
return to_digits * number | |
x = 0 | |
len_from_digits = len(from_digits) | |
for digit in str(number): | |
x = x * len_from_digits + from_digits.index(digit) | |
if x == 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
def valida_q_magico(q_magico): | |
if len(q_magico) == 0 or len(q_magico) != len(q_magico[0]): | |
return False | |
linhas_ok = not sum( | |
1 if sum(linha) != sum(q_magico[0]) else 0 | |
for linha in q_magico | |
) | |
colunas_ok = not sum( | |
sum( | |
linha[i] for linha in q_magico |
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
# python 2.7 | |
import urllib | |
import json | |
resp = urllib.urlopen('http://worldcup.sfg.io/matches').read() | |
for jogo in json.loads(resp.decode('utf-8')): | |
if jogo['status'] == 'completed': | |
print "%s %i x %s %i" % (jogo['home_team']['country'], jogo['home_team']['goals'], jogo['away_team']['country'], jogo['away_team']['goals']) |
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
{ | |
"BA": [ | |
{ | |
"modulo": 7.0, | |
"id_ibge": 2919207, | |
"nome": "Lauro de Freitas" | |
}, | |
{ | |
"modulo": 50.0, | |
"id_ibge": 2921500, |
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
{ | |
"FORMAS_DE_EMANCIPACAO": [ | |
"Casamento", | |
"Ato judicial", | |
"Concess\\u00e3o dos pais", | |
"Cola\\u00e7\\u00e3o de grau em curso de ensino superior", | |
"Exerc\\u00edcio de emprego p\\u00fablico efetivo", | |
"Estabelecimento civil ou comercial, com economia pr\\u00f3pria", | |
"Exist\\u00eancia de rela\\u00e7\\u00e3o de emprego, com economia pr\\u00f3pria" | |
], |
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
{ | |
"profissoes": [ | |
{ | |
"Norma": "Lei n\\u00ba 4.769, de 9 de setembro de 1965 - Disp\\u00f5e sobre o exerc\\u00edcio da profiss\\u00e3o de t\\u00e9cnico de administra\\u00e7\\u00e3o, e d\\u00e1 outras providencias.", | |
"Nome": "Administrador" | |
}, | |
{ | |
"Norma": "Lei n\\u00ba 8.906, de 4 de julho de 1994 - Disp\\u00f5e sobre o estatuto da advocacia e a ordem dos Advogados do Brasil - OAB.", | |
"Nome": " Advogado" | |
}, |
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
{ | |
"profissoes": [ | |
"Administrador", | |
"Advogado", | |
"Aeronauta", | |
"Arquivista / T\\u00e9cnico de Arquivo", | |
"Artista/T\\u00e9cnico em espet\\u00e1culos de divers\\u00f5es", | |
"Assistente Social", | |
"Atleta Profissional de Futebol", | |
"Atu\\u00e1rio", |