Skip to content

Instantly share code, notes, and snippets.

View abevieiramota's full-sized avatar
🎯
Focusing

Abelardo Vieira Mota abevieiramota

🎯
Focusing
View GitHub Profile
0> how long before the next flight to Alice Springs?
1> wie lang vor dem folgenden Flug zu Alice Springs?
2> how long before the following flight to Alice jump?
3> wie lang vor dem folgenden Flug zu Alice springen Sie?
4> how long before the following flight to Alice do you jump?
# símbolos #
esi, xii = symbols('esi xii')
Rsdi = As*Es*esi
Rcdi = 0.85*fcd*b*0.8*xii
Rlsdi = Als*Es*((xii - dll)/(d - xii))*esi
faux1 = Rsdi - Rcdi - Rlsdi
esi = solve(faux1, esi)[0]
import matplotlib.pyplot as pl
import matplotlib.animation as animation
import numpy as np
x_min, x_max = 0, 500
y_min, y_max = 0, 500**3
def f1(x):
return x**3
from sklearn.svm import SVC
import numpy as np
from matplotlib import pyplot as pl
X = [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]]
y = [0, 1, 2, 0, 1]
model = SVC()
model.fit(X, y)
from scikits.audiolab import Sndfile
f = Sndfile('01-Ideologia.flac', 'r')
# num de channels
nc = f.channels
# lê 10k frames de 2 canais
# funciona como generator, vai avançando
data = f.read_frames(10000)
@abevieiramota
abevieiramota / gist:1f344143542940584ba4
Last active August 29, 2015 14:01
script para download do livro Digital Signal Processing, disponível gratuitamente em http://www.dspguide.com/pdfbook.htm
import urllib2
caps = range(1, 35)
url_template = 'http://www.dspguide.com/CH%d.PDF'
file_template = 'ch%d.pdf'
for cap in caps:
pdf = urllib2.urlopen(url_template % cap)
@abevieiramota
abevieiramota / Youtube list downloader
Created June 16, 2014 22:55
Script utilizando pytube para realizar o download dos vídeos contidos em uma lista. ex utilização python download_list.py https://www.youtube.com/playlist?list=PLA89DCFA6ADACE599 mp4 360p
import sys
import urllib2
import re
from pytube import YouTube
video_RE = re.compile(r'(?<=data-video-id=").*?(?=")')
BASE = "https://www.youtube.com/watch?v=%s"
yt = YouTube()
{
"metadata": {
"name": "",
"signature": "sha256:83672b62a61a5fd0972e682a5f0abbdc50de88cb2c52348a4bae355fc1e4a49c"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
import datetime
infile = open(input.name,"r")
lines = infile.readlines()
number_of_lines = len(lines)
lista_data, lista_apple, lista_mic = [], [], []
for line in lines[:-1:-1]:
import os
for dir in os.walk('.'):
os.system('manga-downloader --pdf "%s"' % dir[0])