Skip to content

Instantly share code, notes, and snippets.

View douglascamata's full-sized avatar

Douglas Camata douglascamata

View GitHub Profile
@douglascamata
douglascamata / 1humano.py
Created May 30, 2011 04:03 — forked from rochacbruno/1humano.py
Seres humanos comuns e a reprodução desenfreada orientada a objetos
#encoding: utf-8
class Humano(object):
"""Human Being"""
def __init__(self, nome, pai=None, mae=None):
print "alguem fez besteira e colocou mais um ser Humano no mundo \n"
self.nome = nome
self.pai = pai
self.mae = mae
@douglascamata
douglascamata / tail.py
Created April 27, 2011 04:59
Tail Call Optimization in Python
#!/usr/bin/env python2.4
# This program shows off a python decorator(
# which implements tail call optimization. It
# does this by throwing an exception if it is
# it's own grandparent, and catching such
# exceptions to recall the stack.
import sys
class TailRecurseException:
@douglascamata
douglascamata / gist:889452
Created March 27, 2011 18:42
A buildout Python interpreter
import sys
sys.path[0:0] = [
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/nsi.multimedia-0.1.2-py2.6.egg',
'/mnt/hgfs/nsi/aos/video/eggs/nsi.videoconvert-0.1-py2.6.egg',
'/mnt/hgfs/nsi/aos/video/eggs/celery-2.2.4-py2.6.egg',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/restfulie-0.8.0-py2.6.egg',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/Twisted-10.2.0-py2.6-linux-i686.egg',
@douglascamata
douglascamata / matriz.c
Created March 20, 2011 19:45
matrizes com ponteiros
#include <stdio.h>
#include <stdlib.h>
void le_numeros(int **matriz){
int i;
for(i=0; i<10; i++){
printf("Entre com um número: ");
scanf("%d", (*matriz+i));
}
}