Skip to content

Instantly share code, notes, and snippets.

View ihavenonickname's full-sized avatar
🔬
Searching

Gabriel ihavenonickname

🔬
Searching
  • The Future
View GitHub Profile
<?php
class Node
{
public $value = null;
public $left = null;
public $right = null;
public function __construct($value)
{
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):
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),
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
@ihavenonickname
ihavenonickname / crawler.py
Created August 13, 2018 20:50
central do aluno
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}
import grequests
import json
import unicodedata
from bs4 import BeautifulSoup
def download(urls):
def catcher(req, ex):
print(ex)
reqs = map(grequests.get, urls)
import grequests
import json
import unicodedata
from bs4 import BeautifulSoup
def download(urls):
def catcher(req, ex):
print(ex)
reqs = map(grequests.get, urls)
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()
@ihavenonickname
ihavenonickname / knn-test.py
Created July 9, 2018 13:44
To be used by reviewers
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"),
@ihavenonickname
ihavenonickname / space-invaders.java
Created April 25, 2018 00:03
Space Invaders in Processing 3
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;