This file contains hidden or 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
''' Read and parse SVG files returning a shapely GeometryCollection containing the paths and primitives found. | |
Transforms are applied and all shapes are returned in the SVG root elements coordinate space. Primitives (rect, | |
circle and ellipse) are converted to equivalent paths, and only shape outlines are rendered, stroke properties | |
have no affect and are discarded. | |
Curved paths (arc and bezier commands and rounded rect, ellipse and circle elements) are linearized using a | |
naive approach that attempts to create enough segments to reduce maximum distance to the curve to below a | |
certain threshold, although this is probably not very efficient and most likely implemented in a fairly | |
broken way.''' |
This file contains hidden or 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
# Author: Berin | |
# Sketches repo: https://github.com/berinhard/sketches | |
from collections import namedtuple | |
from abc import ABCMeta, abstractmethod | |
WHITE = color(235, 235, 235) | |
BLACK = color(27, 27, 27) | |
BLUE = color(55,189,182) | |
def setup(): |
This file contains hidden or 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
/* | |
This sketch is an adaptation from Sighack's Gcode Export | |
Blog post: https://sighack.com/post/processing-boilerplate-with-gcode-export | |
Depends on http://www.ricardmarxer.com/geomerative/ | |
TODO: | |
[ ] Select directory dialog | |
[ ] Check file extension |
This file contains hidden or 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
void setup() { | |
Serial.begin(9600); // initialize serial communications @ 9600 | |
} | |
void loop() { | |
int potentiometer = analogRead(A0); // read the input pin | |
int mappedPot = map(potentiometer, 0, 1023, 0, 255); // remap the pot value to fit in 1 byte | |
//Serial.write(mappedPot); // write mappedPot value to the serial port (1 byte) | |
Serial.println(potentiometer); // *or* use println to print out raw potentiometer value with newline as data separator | |
delay(1); // slight delay to stabilize the ADC |
This file contains hidden or 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 tkinter | |
from time import strftime | |
#by Luciano Ramalho | |
clock = tkinter.Label() | |
clock.pack() | |
clock['font'] = 'Helvetica 120 bold' | |
clock['text'] = strftime('%H:%M:%S') | |
This file contains hidden or 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 urllib.request | |
import json | |
url = 'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&esgotoInexistente=on' | |
resp = urllib.request.urlopen(url).read() | |
resp = json.loads(resp.decode('utf-8')) | |
print ('Número de Escolas em funcionamento sem energia, água e esgoto:', resp[0]) | |
for x in resp[1]: | |
print (x['nome'], x['cod']) | |
print (x['cidade'], x['estado'], x['regiao']) | |
print () |
This file contains hidden or 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 urllib.request | |
import json | |
url = 'http://educacao.dadosabertosbr.com/api/escolas/buscaavancada?situacaoFuncionamento=1&energiaInexistente=on&aguaInexistente=on&esgotoInexistente=on' | |
resp = urllib.request.urlopen(url).read() | |
resp = json.loads(resp.decode('utf-8')) | |
print ('Número de Escolas em funcionamento sem energia, água e esgoto:', resp[0]) | |
for x in resp[1]: | |
print (x['nome'], x['cod']) | |
print (x['cidade'], x['estado'], x['regiao']) | |
print () |