Skip to content

Instantly share code, notes, and snippets.

Avatar

Bernardo Augusto Godinho de Oliveira BernardoGO

View GitHub Profile
@BernardoGO
BernardoGO / dl_install_anaconda.sh
Created Sep 28, 2020
Downloads and installs latest version of Anaconda3 in silent mode
View dl_install_anaconda.sh
#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
View resize.py
from PIL import Image
from glob import glob
import shutil
import random
import os
files = glob("500x500/*/*")
outputPath = "output3/"
newSize = [400, 400]
View split.py
from glob import glob
import shutil
import random
import os
classes = glob("500x500/*")
outputPath = "output/"
test_percentage = 0.1
View compile
g++ main.cpp -o output `pkg-config --cflags --libs opencv`
View gist:58d207bf230216496cfa0814f259bed5
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
View gist:497a2697f4a8311a53a7bb3e13a461bc
#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 Jun 11, 2017
PUC Minas - Grafos 2014/1
View grafos.cc
//=====================================================================
// BIBLIOTECAS
//=====================================================================
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <unistd.h>
#include <vector>
@BernardoGO
BernardoGO / onAdLoad.java
Last active Nov 2, 2016
AdMob Ad visible onLoad
View onAdLoad.java
//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 Oct 1, 2016
Fix trec file for eval
View fixtrec.py
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
View label.py
import tensorflow as tf
import sys
import cv2
from PIL import Image
import tensorflow as tf
import numpy as np
from random import randint
import os
import PIL
You can’t perform that action at this time.