Skip to content

Instantly share code, notes, and snippets.

View BernardoGO's full-sized avatar

Bernardo Augusto Godinho de Oliveira BernardoGO

  • Pontifical Catholic University of Minas Gerais
  • Belo Horizonte - Brazil
View GitHub Profile
import base64
import json
import requests
URL = 'https://api.imgur.com/3/image'
AUTHORIZATION = 'Client-ID c9a6efb3d7932fd'
with open("download.png", 'rb') as f:
@BernardoGO
BernardoGO / dl_install_anaconda.sh
Created September 28, 2020 17:25
Downloads and installs latest version of Anaconda3 in silent mode
#Downloads and installs latest version of Anaconda3
latestVer=$(curl 'https://repo.anaconda.com/archive/' | grep -oP 'href="Anaconda3-\K[0-9]+\.[0-9]+' | sort -t. -rn -k1,1 -k2,2 -k3,3 | head -1)
curl "https://repo.anaconda.com/archive/Anaconda3-${latestVer}-Linux-x86_64.sh" > /tmp/install_anaconda.sh
bash /tmp/install_anaconda.sh -b -p
from PIL import Image
from glob import glob
import shutil
import random
import os
files = glob("500x500/*/*")
outputPath = "output3/"
newSize = [400, 400]
from glob import glob
import shutil
import random
import os
classes = glob("500x500/*")
outputPath = "output/"
test_percentage = 0.1
g++ main.cpp -o output `pkg-config --cflags --libs opencv`
pi@raspberrypi:~/cellular_automata $ make
g++ main.c -O0 -o main -std=c++11
./main
Regra: 30
Iteracoes: 100000
Celulas: 64
Total: 1128036912ns
pi@raspberrypi:~/cellular_automata $ make
g++ main.c -O0 -o main -std=c++11
./main
#include<stdio.h>
#include<stdlib.h>
#include <sys/time.h>
#include <math.h>
#include<time.h>
#include <chrono>
#include <iostream>
#define BOOL(x) (!(!(x)))
@BernardoGO
BernardoGO / grafos.cc
Created June 11, 2017 03:29
PUC Minas - Grafos 2014/1
//=====================================================================
// BIBLIOTECAS
//=====================================================================
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <unistd.h>
#include <vector>
@BernardoGO
BernardoGO / onAdLoad.java
Last active November 2, 2016 15:23
AdMob Ad visible onLoad
//Add the following imports to the activity code
import com.google.android.gms.ads.AdListener;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
@BernardoGO
BernardoGO / fixtrec.py
Created October 1, 2016 19:41
Fix trec file for eval
fixed = ""
with open('trec10.res') as f:
previous = ""
for line in f:
print(line)
if line.split()[2] == previous:
continue
previous = line.split("\t")[2]
fixed += line