Skip to content

Instantly share code, notes, and snippets.

View paflopes's full-sized avatar

Phillipe Lopes paflopes

View GitHub Profile
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.3</version>
</dependency>
INSERT INTO funcionario (id,nome,ativo,cpf,documentosocial,email,senha) VALUES (3,'Analista 1', true, '333.333.333-33', '3.333.333', 'analista@email.com', 'abc123');
INSERT INTO funcionario (id,nome,ativo,cpf,documentosocial,email,senha) VALUES (4,'Sincap backdoor', true, '555.555.555-55', '5.555.555', 'sincap@email.com', 'abc123');
INSERT INTO analistacncdo VALUES (3);
INSERT INTO notificador VALUES (4);
INSERT INTO notificador_instituicaonotificadora VALUES (4, 1);
CREATE TABLE IF NOT EXISTS funcionario_permissao
(
funcionario_id BIGINT NOT NULL,
permissoes_id BIGINT NOT NULL,
FOREIGN KEY (funcionario_id) REFERENCES funcionario (id),
FOREIGN KEY (permissoes_id) REFERENCES permissao (id)
);
CREATE TABLE IF NOT EXISTS permissao
(
id SERIAL PRIMARY KEY NOT NULL,
@paflopes
paflopes / process_monitor.sh
Last active August 29, 2015 14:17
Reinicia um programa caso ocorra uma falha
#!/bin/bash
if [[ -z "$1" ]];then
echo "ERROR: must specify program"
exit 1
fi
while (( 0 == 0 ));do
$@ &
pid=`jobs -l | awk '{print $2}'`
@paflopes
paflopes / Opções de memória JAVA
Created March 25, 2015 14:20
Esse arquivo mostra algumas opções para reduzir o consumo de memória pela JVM
export JAVA_OPTS="-Djava.awt.headless=true -server -Xms48m -Xmx1024M -XX:MaxPermSize=512m
@paflopes
paflopes / quiz7.c
Last active October 23, 2015 20:27
#include <stdio.h>
#include <stdlib.h> // for malloc() and exit()
typedef struct arrival_struct
{
int time; // time of arrival
int count; // number of passengers/seats arriving
} itemtype;
//
// main.c
// itec310.ts01
//
//
// a. Purpose (of Program)
// b. Assumption: What domain of data you are restricting
// c. Input: a formated .txt file
// d. Output: information in .txt file with extra processed information
// e. Algorithm (or processing logic): How to reach output from input
% Phillipe Alcantara Fonseca Lopes BSI 2012/1
triangulo(N) :- triangulo(N,1).
triangulo(_).
triangulo(Espaco,Asterisco) :- Espaco>0,
writeN(Espaco,' '),
writeN(Asterisco,'* '),
nl,
Espaco1 is Espaco - 1,
Asterisco1 is Asterisco + 1,
triangulo(Espaco1,Asterisco1).
% Right triangle -> a² + b² = h²
% Point definition.
point(_, _).
% Calculates the distance between the 2 given points
% Formula is distance = sqrt((A1-B1)² + (A2-B2)²)
edge(point(A1, A2), point(B1, B2), Result) :-
Result is ((A1 - B1)**2 + (A2 - B2)**2)**(0.5).
@paflopes
paflopes / 20-intel.conf
Last active June 19, 2022 17:40
/etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
Option "DRI" "2"
Option "TearFree" "true"
EndSection