Skip to content

Instantly share code, notes, and snippets.

View heltonbiker's full-sized avatar

Helton Moraes heltonbiker

  • Porto Alegre, Brazil
View GitHub Profile
@heltonbiker
heltonbiker / index.html
Last active March 19, 2016 03:44
Google and Bing maps side-by-side
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Virtual Earth Maps vs Google Maps</title>
<script charset="UTF-8" type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&mkt=en-us"></script>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAARck2s7GwjD-5_5hS-TFv3hRR0nObJ3x1X4rMexYPx3kuaSeOkRR_VVH0-hifN8CcO99Sww7GbVOOYQ
" type="text/javascript"></script>
<script type='text/javascript'>
#!/usr/bin/env python
# coding: utf-8
import urllib
import json
import os
import matplotlib.pyplot as plt
import datetime
import math
@heltonbiker
heltonbiker / RawRoads.txt
Last active June 8, 2016 16:11
Trying to generate a network of of unique road stretches from a collection of redundant, unstructured roads
-52.26574,-31.18329 -52.26702,-31.1833 -52.2675,-31.18332 -52.26793,-31.18338 -52.26832,-31.18341 -52.26858,-31.1834 -52.26872,-31.18337 -52.26882,-31.18335 -52.26891,-31.18329 -52.2693,-31.183 -52.26936,-31.18298 -52.26943,-31.18296 -52.26952,-31.18296 -52.26974,-31.18298 -52.26988,-31.18298 -52.26997,-31.18297 -52.27009,-31.18294 -52.27071,-31.18258 -52.27077,-31.18255 -52.27083,-31.18255 -52.27095,-31.18255 -52.27121,-31.1826 -52.27162,-31.1827 -52.27171,-31.18274 -52.27187,-31.18283 -52.27234,-31.18325 -52.27247,-31.18334 -52.27253,-31.18336 -52.2726,-31.18337 -52.27268,-31.18335 -52.27276,-31.18331 -52.27285,-31.18326 -52.27297,-31.18311 -52.2731,-31.18285 -52.27331,-31.18232 -52.27335,-31.18226 -52.27342,-31.18219 -52.27348,-31.18217 -52.27357,-31.18215 -52.27364,-31.18215 -52.27373,-31.18215 -52.2738,-31.18218 -52.27395,-31.18225 -52.27396,-31.18225 -52.27428,-31.18237 -52.27439,-31.18239 -52.27447,-31.1824 -52.27457,-31.18239 -52.27495,-31.18234 -52.27563,-31.1823 -52.27578,-31.18227 -52.27585,-31.182
@heltonbiker
heltonbiker / FootprintCompression.py
Last active August 8, 2016 21:32
Compression Alternatives for Foot Pressure Map
import json
footprint = json.load(open('both.json'))
shape = (44,52)
nonzero = 0
for f in footprint:
for l in f:
if l > 0:
@heltonbiker
heltonbiker / Distribute.cs
Created January 12, 2017 19:15
Method that aims to distribute a sequence amongst N other sequences, cyclically, like dealing cards.
using System;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
namespace UnzipRx
{
class Program
{
static void Main(string[] args)
@heltonbiker
heltonbiker / extract_pairs.py
Last active May 22, 2017 19:16
Torso Point Cloud
pdict = {}
for line in open('torso_points.txt'):
vals = [float(v) for v in line.strip().split('; ')]
indice = int(vals[0])
valores = vals[1:]
pdict[indice] = valores
pList = [pdict[key] for key in sorted(pdict.keys())]
@heltonbiker
heltonbiker / GriloTone.ino
Created November 25, 2017 20:14
Gera o som de um grilo - Generates the sound of a cricket
const int pulsos = 7;
const int duracaoPulso = 17;
const int pausa = 360;
const int frequencia = 4000;
const int pinoFalante = 8; // 8 ohm speaker in series with potentiometer
void setup() {
pinMode(pinoFalante, OUTPUT);
}
@heltonbiker
heltonbiker / fftNumpy.py
Last active March 14, 2018 13:40
FFT with Numpy
import numpy as np
import matplotlib.pyplot as plt
lenfft = len(sinal)/2.
nyq = sampling_rate/2.
freq_axis = np.linspace(0, nyq, lenfft+1)
spectrum = np.abs(np.fft.rfft(sinal))
plt.plot(freq_axis, spectrum)
@heltonbiker
heltonbiker / Digraph.cs
Last active April 3, 2018 19:09
Simple Digraph class (for use with GraphViz etc.)
using System.Collections.Generic;
using System.IO;
using System.Text;
using Colorspace;
public class Digraph
{
public List<Dependency> Dependencies = new List<Dependency>();
@heltonbiker
heltonbiker / TratamentoGlobalExcecao.cs
Created July 6, 2018 14:06
Tratamento Global de Exceção
using System;
using System.Windows;
using System.Windows.Threading;
namespace TratamentoGlobalExcecao
{
public partial class App : Application
{
[STAThread]
static void Main(string[] args)