Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@tonussi
tonussi / NDVI.py
Created December 17, 2016 19:16 — forked from arnaldorusso/NDVI.py
NDVI.py
# script to merge several individual Tiffs (bands) into one multiband GeoTiff
# and potentially do calculations like NDVI, albedo, etc...
# from: http://archive.publiclaboratory.org/peru/2011-01-18-lima-peru-morflex/misc/NDVI.py
# import the GDAL and numpy libraries
from osgeo import gdal
from numpy import *
# ***************************************************************
# ok lets load in the first 4 bands of Landsat imagery into their own numpy arrays
@tonussi
tonussi / generator.php
Created September 9, 2016 20:20 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();
@tonussi
tonussi / ForwardDiff_Foley_vanDam.pde
Created May 10, 2016 23:21 — forked from awangenh/ForwardDiff_Foley_vanDam.pde
COMPUTE AND DRAW A BICUBIC SURFACE PATCH USING FORWARD DIFFERENCES - This code implements and provides corrections to the algorithm named DrawSurfaceFwdDif presented in Fig.11.46 at page 525 of the book Computer Graphics - Principles and Practice 2.ed in C by James D.Foley et.al.
/* ============================================================================= *
* COMPUTE AND DRAW A BICUBIC SURFACE PATCH USING FORWARD DIFFERENCES *
* *
* This code implements and provides corrections to the algorithm named *
* DrawSurfaceFwdDif presented in Fig.11.46 at page 525 of the book *
* Computer Graphics - Principles and Practice 2.ed in C by Jamed D.Foley et.al. *
* This algorithm was neither corrected nor repeated in the 3rd (present) *
* edition of Foley et.al.'s book. *
* *
* The algorithm, as stated in the book, does not work: There is one error and *
@tonussi
tonussi / config.json
Created January 5, 2016 07:37 — forked from anonymous/config.json
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@tonussi
tonussi / big.c
Created October 6, 2013 06:14 — forked from BohuTANG/big.c
/*
* Such as num is:12345678910, 'from_big1' funcation will be wrong
* since the sign extension: 'cltq' instruction will full fill upper 32 bits with 0xffffffff
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
void to_big(unsigned char *buf, uint64_t v)
.data
#Arranjo a ser ordenado
_v: .word 29,28,27,26,25,24,23,22,21,-1
_k: .word 2 #Valor de k
.text
.globl main
main:
#Inicialização dos parâmetros
la $a0, _v
@tonussi
tonussi / lista.pro
Created September 25, 2013 16:48 — forked from senhorinha/lista.pro
/* 01 =====================
* Predicado: primeiro(L,P)
* Definição: L é uma lista e P é o primeiro dado de L.
*/
primeiro([P|_],P).
/* 02 ====================
@tonussi
tonussi / Fila.java
Created June 28, 2013 17:13 — forked from senhorinha/Fila.java
Resolução questão Fila
public class Fila {
private final int[] dados;
private int inicio, fim, contador;
private final int max;
public boolean filaCheia() {
return contador == max;
}
<html>
<head>
<title> cibeleborg </title>
<style>
body {
background: url("http://24.media.tumblr.com/tumblr_lgjl1fsev41qh644lo1_500.jpg") repeat;
}
</style>
</head>
<body>
@tonussi
tonussi / factorial.py
Created November 22, 2012 17:37 — forked from ghoseb/factorial.py
The evolution of a Python Programmer
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal