Skip to content

Instantly share code, notes, and snippets.

View andrelramos's full-sized avatar
🎯
Focusing

André Ramos andrelramos

🎯
Focusing
View GitHub Profile
@andrelramos
andrelramos / lugares.java
Last active November 24, 2015 17:32
Exemplo do projeto em java do Lucão
import java.util.Scanner;
public class Lugares {
public static void main(String args[]) {
boolean lugares[][] = new boolean[4][12]; //Matriz 4 x 12
//Setando todos lugares como false
for(int fileira = 0; fileira <= 3; fileira++) { //Percorrendo as 4 fileiras da matriz
for(int lugar = 0; lugar <= 11; lugar++) { //Percorrendo cada cadeira dentro da fileira
@andrelramos
andrelramos / fib.pas
Created February 17, 2016 14:51
Pascal Fibonacci
PROGRAM Fib;
VAR
numero_maximo: integer;
PROCEDURE fib(anterior, proximo, maximo: integer);
begin
if(proximo < maximo) then
begin
writeln(proximo);
@andrelramos
andrelramos / Dias.pas
Created February 22, 2016 19:29
Exibe o número de dias existentes entre 2 anos digitados pelo usuário
Program Dias ;
Var
ano, ano_inicio, ano_fim, range, bissextos: integer;
Begin
write('Digite o ano inicial: ');
readln(ano_inicio);
write('Digite o ano final: ');
readln(ano_fim);
@andrelramos
andrelramos / gotoxy.pas
Last active February 26, 2016 23:33
Exemplo de uso do comando gotoxy
Program exemplo ;
var
nome : string[30];
telefone : string[15];
begin
writeln('***************************');
writeln('* AGENDA *');
writeln('*-------------------------*');
writeln('* *');
writeln('* NOME: *');
@andrelramos
andrelramos / detectar_face.py
Last active February 26, 2016 23:31
Detecção facial
from SimpleCV import * #importa FrameWork
import time # importa time
frame = Image("1.jpg").scale(0.8) # abre imagem e subtrai 20% do seu total
face = frame.findHaarFeatures("face.xml") #instancia de face.xml
if face: # se encontrar um rosto
face.draw((0, 255, 0), 3) #desenha cor (R,G,B) LarguraLinha 3
frame.show() #mostra o resultado
time.sleep(10) #segura por 10seg resultado na tela
@andrelramos
andrelramos / controller.py
Created March 14, 2016 17:26
Exemplo de pesquisa AJAX (Controller)
@login_requerido(['administrador', 'auxiliar'], '/')
def consulta_cadastros(request):
form = forms.PesquisaCadastrosForm()
resposta = {}
if request.method == "POST":
form = forms.PesquisaCadastrosForm(request.POST)
if form.is_valid:
@andrelramos
andrelramos / view.html
Created March 14, 2016 17:27
Exemplo de pesquisa AJAX (View)
{% extends "baseSemNavbar.html" %}
{% load inputtags %}
{% block title %}
<title>Consultar Colaboradores</title>
{% endblock %}
{% block scripts %}
<script>
@andrelramos
andrelramos / Main.java
Created May 4, 2016 21:38
Hour exemple in J2ME
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
public class Main extends MIDlet {
private Display display;
private Form frmHour;
private StringItem hour;
Program Portal ;
uses graph;
Type
// Generic types
position = record
x: integer;
y: integer;
end;
@andrelramos
andrelramos / 00.howto_install_phantomjs.md
Last active July 6, 2017 03:58 — forked from rahularyan/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 2.1.1

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev