Skip to content

Instantly share code, notes, and snippets.

View pcostesi's full-sized avatar

Pablo Alejandro Costesich pcostesi

View GitHub Profile
@pcostesi
pcostesi / 0_reuse_code.js
Created April 10, 2014 20:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
from select import select
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# sock.bind((socket.gethostname(), 1234))
sock.bind(('', 1234))
@pcostesi
pcostesi / keybase.md
Created August 21, 2014 20:53
keybase.md

Keybase proof

I hereby claim:

  • I am pcostesi on github.
  • I am pcostesi (https://keybase.io/pcostesi) on keybase.
  • I have a public key whose fingerprint is DEDF 60B2 DD52 4D91 1B09 ADAE F892 BFEA F344 AC8D

To claim this, I am signing this object:

Ocurrió algo inesperado!! Seguro es un bug.
Contacte a su programador favorito ;)
Al reportalo recuerde contar contar como reproducirlo.
Fecha de suceso: Wed Mar 25 17:00:42 ART 2015
Problema raiz: java.util.NoSuchElementException
/***************************************************************************
e-puck_line -- Base code for a practical assignment on behaviour-based
robotics. When completed, the behaviour-based controller should allow
the e-puck robot to follow the black line, avoid obstacles and
recover its path afterwards.
Copyright (C) 2006 Laboratory of Intelligent Systems (LIS), EPFL
Authors: Jean-Christophe Zufferey
Email: jean-christophe.zufferey@epfl.ch
Web: http://lis.epfl.ch
┌──────────────────────────────────────────────────────────┐┌─────────────────────────────┐
│ + ││0: BN993Y (3661, 6311, 3003) │
│ ││Flying │
│ + + ││1: YP076X (5866, 3186, 3328) │
│ ││Flying │
│ ││2: VR129T (350, 3363, 64178) │
│ + ││Flying │
│ ││3: UI178R (1151, 4272, 9089) │
│ @ ││Flying │
│ + ││4: RH254Q (3976, 7508, 4611) │
<?php
if(isset($_POST['img']) && !empty($_POST['img'])) {
$file = uniqid().".jpeg";
$data = explode(",", $_POST['img']);
$width = $_POST['width'];
$height = $_POST['height'];
$image=imagecreatetruecolor($width, $height) or die('no hay GD!');
$i = 0;
for($x=0; $x<=$width; $x++){
int cmp_for_sort(const void * c1, const void * c2){
return strcmp(*(char **) c1, *(char **) c2);
}
int cmp_for_search(const void * c1, const void * c2){
return strcmp((char *) c1, *(char **) c2);
}
int
getCommand()
@pcostesi
pcostesi / simples.py
Created October 5, 2011 04:46
S Interpreter
#!/usr/bin/env python
""" This is a simple and experimental version of an interpreter for the
S language. It doesn't aim to be complete, just correct.
"""
from collections import defaultdict
import re
TAG = r"\s*(\[\s*(?P<tag>[a-eA-E]\d+)\s*\])?\s*"
NXT = r"(?P<nxt>[a-eA-E]\d+)"
@pcostesi
pcostesi / ffek.py
Created November 23, 2011 03:12
FFEK, optimized a bit the bfs part and fixed a bug in the backtracking function
#!/usr/bin/env python
from collections import defaultdict, deque
class Edge(object):
def __init__(self, tail, head, capacity, name=None, flow=0):
self.name = tail + "-" + head if not name else name
self.tail = tail
self.head = head
self.flow = flow
self.capacity = capacity