Skip to content

Instantly share code, notes, and snippets.

View 648trindade's full-sized avatar
🏠
Working from home

Rafael Trindade 648trindade

🏠
Working from home
View GitHub Profile
@648trindade
648trindade / defines.h
Created March 18, 2016 03:22
Arquivo de cabeçalho com definições rápidas para auxiliar na resolução de problemas de programação competitiva
/*
Arquivo de cabeçalho com definições rápidas para auxiliar na resolução de
problemas de programação competitiva.
Retirado do livro "Competitive Programming: Increasing the Lower Bound of
Programming Contests", de HALIM, S. e HALIM, F.
*/
// Atalhos para tipos de dados 'comuns' em competições
typedef long long ll;
typedef vector<int> vi;
@648trindade
648trindade / Makefile
Last active March 24, 2017 23:15
Makefile para demos de Computação Gráfica
################################################################################
# Makefile para sistemas GNU/Linux #
# Alvo: Demos com canvas do prof. Cesar Tadeu Pozzer, docente da disciplina #
# de Computação Gráfica da UFSM, disponível no link #
# http://www-usr.inf.ufsm.br/~pozzer/disciplinas/cg_demos.rar #
# Instruções: Coloque esse arquivo no diretório raiz do projeto. Compile com #
# 'make' a partir de qualquer shell como bash, sh, zsh, etc. #
# Para evitar possíveis erros, crie manualmente uma pasta 'build' no di- #
# retório raiz do projeto.
# Obs.: Esse Makefile não faz uso das bibliotecas disponibilizadas juntamente #
@648trindade
648trindade / DBFileGenerator.py
Last active September 21, 2022 21:01
Python script to convert the text file that is inside the compressed .bak project file from software Magic Set Editor to a .db sqlite3 file. Please read the comments to custom it your way
#!/usr/bin/python3
"""
The MIT License (MIT)
Copyright (c) 2016 Rafael Gauna Trindade
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
@648trindade
648trindade / stats-obi.py
Created June 4, 2016 21:51
Scripts para consultas em lote ao sistema de certificados da Olimpiada Brasileira de Informatica
#!/usr/bin/python3
# Script para consultas em lote ao sistema de certificados da Olimpiada Brasileira de Informatica
# http://olimpiada.ic.unicamp.br/
# Obs.: Emissao de certificados inicia em 2005 (OBI iniciou em 1999)
# Adaptado da versão original em bash escrito pela prof. Andrea
# Dependencias: python3-requests
# Author: Rafael
import requests
@648trindade
648trindade / pokemons.pl
Last active July 4, 2016 18:37
Base de conhecimento prolog sobre pokemons
grass(bulbasaur).
grass(ivysaur).
grass(venusaur).
grass(oddish).
grass(gloom).
grass(vileplume).
grass(paras).
grass(parasect).
grass(bellsprout).
grass(weepinbell).
@648trindade
648trindade / PyGameOfLife.py
Created November 5, 2016 20:12
PygGame Of Life
import pygame
from pygame import gfxdraw
pygame.init()
size = (800,600)
display = pygame.display.set_mode(size)
surface = [None, None]
surface[0] = pygame.Surface((size[0]/10, size[1]/10))
surface[1] = pygame.Surface((size[0]/10, size[1]/10))
@648trindade
648trindade / eduroam.config
Created August 24, 2017 14:22
UFSM eduroam network configuration file for systems with connman
# Rafael Gauna Trindade - 24/08/17
# save this as /var/lib/connman/eduroam.config
[service_eduroam]
Type=wifi
Name=eduroam
EAP=ttls
Phase2=PAP
# replace XXXXXXXXXXX by your CPF number
[email protected]
@648trindade
648trindade / cifar10.prototxt
Created April 24, 2018 17:06
cifar10 caffe
name: "CIFAR10_quick"
layer {
name: "cifar"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@648trindade
648trindade / googlenet.prototxt
Created April 26, 2018 08:11
googlenet prototxt
name: "GoogleNet"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@648trindade
648trindade / GGJScrapper.py
Created January 29, 2019 06:03
GGJ 2019 Scrapper
from bs4 import BeautifulSoup
from requests import get
from multiprocessing import Pool
from timeit import default_timer as timer
import csv
countries = (("AF", "Afghanistan"), ("AX", "Aland Islands"), ("AL", "Albania"), ("DZ", "Algeria"), ("AS", "American Samoa"), ("AD", "Andorra"), ("AO", "Angola"), ("AI", "Anguilla"), ("AQ", "Antarctica"), ("AG", "Antigua and Barbuda"), ("AR", "Argentina"), ("AM", "Armenia"), ("AW", "Aruba"), ("AU", "Australia"), ("AT", "Austria"), ("AZ", "Azerbaijan"), ("BS", "Bahamas"), ("BH", "Bahrain"), ("BD", "Bangladesh"), ("BB", "Barbados"), ("BY", "Belarus"), ("BE", "Belgium"), ("BZ", "Belize"), ("BJ", "Benin"), ("BM", "Bermuda"), ("BT", "Bhutan"), ("BO", "Bolivia"), ("BA", "Bosnia and Herzegovina"), ("BW", "Botswana"), ("BV", "Bouvet Island"), ("BR", "Brazil"), ("IO", "British Indian Ocean Territory"), ("VG", "British Virgin Islands"), ("BN", "Brunei"), ("BG", "Bulgaria"), ("BF", "Burkina Faso"), ("BI", "Burundi"), ("KH", "Cambodia"), ("CM", "Cameroon"), ("CA", "Canada"), ("CV",