Skip to content

Instantly share code, notes, and snippets.

Fábio Perez fabioperez

Block or report user

Report or block fabioperez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fabioperez
fabioperez / convert_label.py
Created Aug 6, 2019
LSD-seg label conversion
View convert_label.py
import argparse
import json
import os
import numpy as np
from PIL import Image
from tqdm import tqdm
def swap_labels(np_original_gt_im, class_convert_mat):
np_processed_gt_im = np.zeros(np_original_gt_im.shape)
View vega-lite-2.0.0-alpha.6.min.js
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.vl=e()}}(function(){var e;return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i="undefined"!=typeof JSON?JSON:e("jsonify");t.e
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.5.0/d3.min.js"></script>
<script src="https://d3js.org/d3-dsv.v1.min.js"></script>
<script>
console.log(123);
View sp.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
Estacao;Data;Hora;TempMaximaMedia;TempCompensadaMedia;TempMinimaMedia;
83781;31/01/1961;0000;26.570968;21.592903;18.448387;
83781;28/02/1961;0000;26.867857;21.819286;18.775;
83781;31/03/1961;0000;26.174194;20.600645;17.206452;
83781;30/04/1961;0000;25.68;20.200667;16.583333;
83781;31/05/1961;0000;22.525806;17.250968;13.716129;
83781;30/06/1961;0000;22.573333;16.687333;12.82;
83781;31/07/1961;0000;23.364516;16.26129;11.558065;
83781;31/08/1961;0000;25.7;17.735484;12.332258;
83781;30/09/1961;0000;28.293333;20.436;16.143333;
@fabioperez
fabioperez / build-zsh.sh
Last active Jan 6, 2017 — forked from nicoulaj/build-zsh.sh
Build Zsh from sources on Ubuntu
View build-zsh.sh
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
git clone git://git.code.sf.net/p/zsh/code zsh
cd zsh
@fabioperez
fabioperez / tmux_install.sh
Created Aug 23, 2016 — forked from mirskiy/tmux_install.sh
Install tmux 2.2 on Ubuntu 14.04 from source
View tmux_install.sh
sudo apt-get update
sudo apt-get install -y libevent-dev libncurses-dev make
wget https://github.com/tmux/tmux/releases/download/2.2/tmux-2.2.tar.gz
tar xvzf tmux-2.2.tar.gz
cd tmux-2.2/
./configure && make
sudo make install
View classifier_from_little_data_script_2.py
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
View classifier_from_little_data_script_1.py
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
View factorial-1.2.1.c
/* ############ Fábio Perez - fabio.perez [a] students.ic.unicamp.br - Unicamp 2010 ############ */
/* Este programa calcula fatoriais de grandes números. Neste caso, até 1800, mas alterando os */
/* valores de MAX, podemos chegar a números maiores, com perda no tempo de cálculo. Para o cálculo*/
/* de N!, devemos estar cientes de que N * MAX < 18446744073709551615 para que o algoritmo */
/* funcione. Caso contrário, estouraria o valor de um 'unsigned long long int'. Ao reduzirmos o */
/* valor de MAX, podemos aumentar o valor de N, mas com uma certa perda na velocidade de execução */
/* e na memória consumida. */
#include <stdio.h>
You can’t perform that action at this time.