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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created on Thu Oct 10 15:29:33 2013 | |
# @author: Danilo J. S. Bellini | |
""" | |
A Hard Day's Night first chord with AudioLazy + PyAudio | |
""" | |
from audiolazy import (white_noise, rint, freq_to_lag, zeros, comb, sHz, | |
str2freq, AudioIO) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created on Mon Sep 09 23:06:21 2013 | |
# @author: Danilo J. S. Bellini | |
""" | |
AudioLazy time-variant resonator helping instantaneous frequency measurements. | |
""" | |
from __future__ import print_function | |
from audiolazy import (sHz, sinusoid, gauss_noise, line, z, inf, resonator, |
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
# | |
# Fisher–Yates Shuffle algorithm | |
# | |
# Implementation by Danilo J. S. Bellini | |
randInt = (k) -> # From 0 to k (i.e., sample space has k + 1 values) | |
Math.round Math.random() * k | |
shuffle = (data) -> | |
for idx in [data.length-1..1] |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created on Tue Jul 2 05:17:13 2013 | |
# @author: Danilo de Jesus da Silva Bellini | |
# Simple Splinter example with both XPath and CSS | |
from splinter import Browser | |
from tempfile import NamedTemporaryFile | |
data = """ |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Created on Sun Jun 16 05:19:49 2013 | |
# Danilo de Jesus da Silva Bellini | |
""" Get some statistics from bible """ | |
from __future__ import print_function, unicode_literals | |
import os, zipfile, random | |
try: # Python 2 | |
from urllib2 import urlopen |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Danilo de Jesus da Silva Bellini | |
# Created on Thu Apr 18 2013 | |
""" | |
Prints all programming languages (from Wikipedia) | |
""" | |
from bs4 import BeautifulSoup # Needs "pip install beautifulsoup4" | |
from urllib2 import Request, build_opener |
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
#!/usr/bin/env py.test | |
# -*- coding: utf-8 -*- | |
# Mastermind guess description | |
# Created on Thu Mar 14 2013 | |
# Danilo de Jesus da Silva Bellini | |
def mastermind(guess, secret): | |
""" |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Mar 27 23:36:30 2013 | |
Descriptor use case example | |
@author: Danilo J. S. Bellini | |
""" | |
class Quantity(object): |
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
# -*- coding: utf-8 -*- | |
# Gram-Schmidt orthonormalization with itertools. | |
# Copyright (C) 2012 Danilo de Jesus da Silva Bellini | |
# | |
# This is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, version 3 of the License. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Wed Jan 16 01:17:27 2013 | |
Copyright (C) 2012 Danilo de Jesus da Silva Bellini | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |