Skip to content

Instantly share code, notes, and snippets.

View tonussi's full-sized avatar

Lucas Tonussi tonussi

View GitHub Profile
@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
@tonussi
tonussi / ccv_app_tree
Created March 1, 2014 22:15
ccv_app_tree
.
├── bin
│   ├── pom.xml
│   ├── Procfile
│   ├── README.md
│   ├── src
│   │   └── main
│   │   ├── java
│   │   │   └── com
│   │   │   └── example
@tonussi
tonussi / VehicleService.java
Last active August 29, 2015 13:56
Persistencias de Modos Diferentes
@Service
public class VehicleServiceImpl implements VehicleService {
@PersistenceContext
EntityManager em;
/**
* O(1)
*/
@Override
@tonussi
tonussi / Vehicle.java
Last active August 29, 2015 13:56
Method Naming Confusion Problem
@Entity
public class Vehicle {
private Double price;
private String pricestring;
public Double getPrice() {
return price;
}