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 Node | |
{ | |
public $value = null; | |
public $left = null; | |
public $right = null; | |
public function __construct($value) | |
{ |
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 os | |
import csv | |
import unicodedata | |
import sqlite3 | |
from os.path import join, isfile | |
from collections import namedtuple | |
Linha = namedtuple('Linha', 'cidade,cargo,partido,candidato,zona') | |
def ler_dataset(caminho): |
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 matplotlib.pyplot as plt | |
PIB = [ | |
('São Paulo', 628064882), | |
('Rio de Janeiro', 299849795), | |
('Brasília', 197432059), | |
('Belo Horizonte', 87656760), | |
('Curitiba', 78892229), | |
('Manaus', 67572523), | |
('Porto Alegre', 63990644), |
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
function [ ] =bissec1(f,a,b,Erro,x, x2), | |
//******************************************************************// | |
//calcula a raiz de f(x) no intervalo [a,b] pelo método da bissecção | |
//Entrada: f = função a ser avaliada | |
// a = limite inferior do intervalo | |
// b = limite superior do intervalo | |
// erro = precisão desejada | |
// x1=limite inferior para plotar o gráfico da função em estudo | |
// x1=limite superior para plotar o gráfico da função em estudo | |
//Saída: raiz |
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 bs4 import BeautifulSoup | |
from requests import Session | |
from collections import namedtuple | |
Disciplina = namedtuple('Disciplina', 'nome nota semestre') | |
def get_disicplinas(cod_aluno, senha, cod_curso): | |
session = Session() | |
form_login = {'codpessoa': cod_aluno, 'senhabib': senha} |
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 grequests | |
import json | |
import unicodedata | |
from bs4 import BeautifulSoup | |
def download(urls): | |
def catcher(req, ex): | |
print(ex) | |
reqs = map(grequests.get, urls) |
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 grequests | |
import json | |
import unicodedata | |
from bs4 import BeautifulSoup | |
def download(urls): | |
def catcher(req, ex): | |
print(ex) | |
reqs = map(grequests.get, urls) |
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 requests | |
from bs4 import BeautifulSoup | |
import json | |
import unicodedata | |
def normalize(text): | |
nfkd_form = unicodedata.normalize('NFKD', text) | |
only_ascii = nfkd_form.encode('ASCII', 'ignore') | |
return only_ascii.lower().decode() |
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 review import KNNPoint, predict | |
dataset = [ | |
KNNPoint([842.0, 2.2, 7.0, 2.0, 2549.0], "medium cost"), | |
KNNPoint([1021.0, 0.5, 53.0, 3.0, 2631.0], "high cost"), | |
KNNPoint([563.0, 0.5, 41.0, 5.0, 2603.0], "high cost"), | |
KNNPoint([615.0, 2.5, 10.0, 6.0, 2769.0], "high cost"), | |
KNNPoint([1821.0, 1.2, 44.0, 2.0, 1411.0], "medium cost"), | |
KNNPoint([1859.0, 0.5, 22.0, 1.0, 1067.0], "medium cost"), | |
KNNPoint([1821.0, 1.7, 10.0, 8.0, 3220.0], "very high cost"), |
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
int pixelsize = 4; | |
int gridsize = pixelsize * 7 + 5; | |
Player player; | |
ArrayList enemies = new ArrayList(); | |
ArrayList bullets = new ArrayList(); | |
int direction = 1; | |
boolean incy = false; | |
int score = 0; | |
PFont f; |
NewerOlder