Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@tonussi
tonussi / captura.js
Created November 8, 2014 14:00
captura.js
captura_simbolos: function () {
var simbolos = [];
for (var i = 0; i < this.transicoes.length; i++) {
var tr = this.transicoes[i];
for (var j = tr.lb; j < tr.ub; j++) {
simbolos.push(j);
}
}
}
@tonussi
tonussi / foreman.rb
Last active August 29, 2015 14:08
foreman.rb
[lucastonussi:/home/lucastonussi/git/lyrebird] master(+155/-64,9) 16 ± foreman start
10:45:22 web.1 | started with pid 3736
10:45:23 web.1 | Example app listening at http://0.0.0.0:5000
10:45:27 web.1 | {}
10:45:28 web.1 | GET / 200 795.521 ms - 818
10:45:28 web.1 | GET /stylesheets/style.css 200 4.069 ms - 2794
10:45:31 web.1 | {}
10:45:31 web.1 | GET /regex 200 40.046 ms - 1686
10:45:31 web.1 | GET /stylesheets/style.css 200 1.375 ms - 2794
@tonussi
tonussi / erro.js
Created November 8, 2014 03:01
erro
Not Found
404
Error: Not Found
at app.use.res.render.message (/home/lucastonussi/git/lyrebird/app.js:69:15)
at Layer.handle [as handle_request] (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/layer.js:82:5)
at trim_prefix (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:270:13)
at /home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:237:9
at Function.proto.process_params (/home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:312:12)
at /home/lucastonussi/git/lyrebird/node_modules/express/lib/router/index.js:228:12
@tonussi
tonussi / aula15-db1.sql
Last active August 29, 2015 14:07
aula15-sql
drop table "cliente" cascade;
drop table "animal" cascade;
drop table "tipo" cascade;
drop table "treinamento" cascade;
drop table "relatorio" cascade;
create table "cliente" ( "codigo" integer not null
, "nome" varchar(16) not null
, "RG" integer not null
, "sexo" varchar(1) not null
@tonussi
tonussi / agenda.sql
Created May 10, 2014 13:41
agenda.sql
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
COMMENT ON SCHEMA public IS 'standard public schema';
create table secretaria
(
nome character varying(32),
id integer,
constraint secretaria_pk primary key (id)
@tonussi
tonussi / 2.21.1.b.asm
Created May 4, 2014 20:52
patterson exercise 2-21-1b
.data
my_global: .word 100
.text
.globl main
main:
la $t0, my_global
lw $t1, 0($t0)
addi $t1, $t1, 1
sw $t1, 0($t0)
addi $a0, $t1, 0
@tonussi
tonussi / 2.21.1.a.asm
Created May 4, 2014 20:51
patterson exercise 2-21-1a
.data
my_global: .word 100
.text
.globl main
main:
addi $s0, $0, 10
addi $s1, $0, 20
addi $a0, $s0, 0
addi $a1, $s1, 0
jal my_funct
@tonussi
tonussi / exercicio2.asm
Created April 28, 2014 13:53
exercicio2.asm
.data
_array : .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 3
_size : .word 11
.text
.globl main
main:
@tonussi
tonussi / pop_carros.py
Created April 25, 2014 21:40
populador de carros
# encoding:utf-8
import random
import os
def main():
population = PopulateDatabase(1899, 2014)
population.generate_population()
class PopulateDatabase(object):
@tonussi
tonussi / relacoes.java
Created April 13, 2014 00:53
relacoes de amigos
PostgreSQL 9.1.13 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1, 64-bit
(Amigo=520656478): tem os seguintes amigos: [781909429, 1110305437, 100000457609775, 100000812625301, 100002501892899, 100004799408219]
(Amigo=529899682): tem os seguintes amigos: [575665265, 745660785, 781909429, 1110305437, 1238432251, 100000077490764, 100000180614378, 100000189691899, 100000300160728, 100000428181906, 100000457609775, 100000613955023, 100000777734096, 100000812625301, 100000960315423, 100002011676407, 100002038690476, 100002395436942, 100002501892899, 100002898593720, 100003599447454, 100004799408219, 100005483854341, 100005640431865]
(Amigo=568122832): tem os seguintes amigos: [580905942, 660857627, 745660785, 1221380516, 100000330878130, 100000743104362, 100000815109580, 100001297788224, 100001851762074, 100002807197544]
(Amigo=573918917): tem os seguintes amigos: [575665265, 580905942, 589557800, 647155272, 660857627, 687699461, 745660785, 763745050, 1076230774, 1131573494, 12213