This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To use this script, save the image from the page below as '7sled.png'. | |
# http://imgur.com/C2OLhYj | |
# The script should create a file 'test_bmp_font.bmp' that looks like this: | |
# http://imgur.com/WFJNRTT | |
import atexit | |
import sdl2 | |
import sdl2.ext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import codecs | |
import collections | |
def join(t1, t2, pivots=None, keys=None): | |
keys1 = t1[0]._fields | |
keys2 = t2[0]._fields | |
if pivots is None: | |
pivots = list(set(keys1) & set(keys2)) | |
if keys is None: | |
keys = list(set(keys1) | set(keys2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
"""{escher} -- one-file key-value storage. | |
What? | |
This is a toy application to manage persistent key-value string data. | |
The file {escher} is *both* the application and its data. | |
When you run any of the commands below, the file will be executed and, | |
after data change, it will rewrite itself with updated data. | |
You can copy the file with whatever name to create multiple datasets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
import urllib2 | |
import json | |
import time | |
import sys | |
baseurl = "http://openexchangerates.org/api/latest.json" | |
key = "{{Your Open Exchange Rates App ID here!}}" | |
url = baseurl + "?app_id=" + key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <opencv/cv.h> | |
#include <opencv/highgui.h> | |
typedef struct { | |
unsigned char r; | |
unsigned char g; | |
unsigned char b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
call = "ctags -no - *.c" | |
tags = subprocess.check_output(call, shell=True) | |
funcs = [] | |
for entry in tags.split('\n'): | |
tokens = entry.split('\t') | |
if tokens[-1].strip() == "f": | |
func, source, line, symboltype = tokens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Limiarização de imagens utilizando OpenCV. | |
* | |
* Este programa implementa uma função genérica para limiarização de | |
* imagens em escala de cinza. | |
* | |
* Utilização: thresh file threshold below above | |
* *file - Nome do arquivo da imagem de entrada. | |
* *threshold - Valor real do limiar, no intervalo [0, 1]. | |
* *below - Valor real que deve substituir valores abaixo do (ou iguais ao) | |
* limiar, no intervalo [0, 1]. |
NewerOlder