Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@tonussi
tonussi / serial.ino
Created November 20, 2012 01:08
serial
int sensorPino = A0;
int delPino = 5; //pwm
byte sensorValor;
int sensorMax = 0;
int sensorMin = 1023;
//const int nroLeituras = 10;
//int leituras[nroLeituras];
//int indice=0;
//int total=0;
//int media=0;
@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
@tonussi
tonussi / v.pde
Created March 13, 2013 17:13
estudando vetores em processing.
int x, y;
void setup() {
size(800, 450);
background(255);
fill(0, 0, 100, 20);
strokeWeight(1.8);
stroke(0, 0, 100, 80);
}
<html>
<head>
<title> cibeleborg </title>
<style>
body {
background: url("http://24.media.tumblr.com/tumblr_lgjl1fsev41qh644lo1_500.jpg") repeat;
}
</style>
</head>
<body>
@tonussi
tonussi / Main.java
Created March 15, 2013 01:50
generics application
package generics;
import static java.lang.Math.*;
import static java.lang.System.*;
import java.util.ArrayList;
import java.util.List;
class Main {
public static void main(String[] tristana) {
@tonussi
tonussi / Elemento.java
Created April 5, 2013 02:36
Fila acorrentada.
public class Elemento<E> {
public Elemento(Elemento<E> elemento, Object object) {
}
public Elemento<E> getProx() {
return null;
}
public void setProx(Elemento<?> topo) {
@tonussi
tonussi / deslocadornbit.vhdl
Last active May 29, 2016 22:14
deslocador n bits
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity deslocadornbit is generic(tamanho: natural := 0); port(
controle: in std_logic_vector(tamanho-1 downto 0);
entrada: in std_logic_vector(tamanho-1 downto 0);
saida: out std_logic_vector(tamanho-1 downto 0));
end entity;
@tonussi
tonussi / FlashRect.pde
Last active December 15, 2015 22:29
MIT Media Labs Logo (Getting Closer)
public class FlashLightRect {
float tamanho, path;
color rectcolor;
int x, y;
PVector caminho, direcao;
FlashLightRect (color c) {
tamanho = 100;
//muda as cores
@tonussi
tonussi / Cgg.pde
Created April 14, 2013 17:47
/** * Esse é um exercício clássico da Computação Visual/Gráfica, onde você forma uma imagem * de algo aleatório. Server para que genemos imagems como o QrCode pode exemplo. */
class Cgg {
PFont font;
float x, y, espessura;
int fields[][];
Cgg() {
espessura = 5;
fields = new int[width][height];
font = createFont("Ubuntu", 4);
textFont(font);
@tonussi
tonussi / Main.java
Created April 19, 2013 14:10
text2re
// URL that generated this code:
// http://txt2re.com/index-java.php3?s=55998-episode-0-8-4-news-roundup.mp3&6&-55&-2&-56&46&-57&52&-58&48&-59&7&1
import java.util.regex.*;
class Main
{
public static void main(String[] args)
{
String txt="55998-episode-0-8-4-news-roundup.mp3";