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
# -*- coding: utf-8 -*- | |
# <nbformat>3.0</nbformat> | |
# <codecell> | |
a = imread('cmb_greyscale.png') | |
aa = mean(a, 2) | |
from math import ceil |
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
def pascal_matrix(size=500, zp=3): | |
''' | |
Creates a matrix of size x size, whose entries are numbers in zp, such that | |
entry M_{ij} is obtained recursively as in pascal triangle. Each diagonal on | |
the matrix corresponds to a row in Pascal's triangle. | |
''' | |
M = ones_matrix(size,size) | |
for i in range(1, size): | |
for j in range(1, size): | |
M[i, j] = M[i - 1, j] + M[i, j - 1] |
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
#This goes in one cell alone | |
class Carpet: | |
''' | |
This class contains the generator for Carpet fractals generated by regular polygons. | |
It generates the carpet vertices recursively, which is not very efficient, but it | |
goes along with the mathematical definition. | |
''' | |
def __init__(self, x, y, sides, r, contraction): | |
''' |
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
Description='A wireless connection using a custom network block configuration' | |
Interface=wlp3s0 | |
Connection=wireless | |
Security=wpa-configsection | |
IP=dhcp | |
WPAConfigSection=( | |
'ssid="university-ssid"' | |
'scan_ssid=1' | |
'key_mgmt=WPA-EAP' | |
'identity="username"' |
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 matplotlib as mpl | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pylab | |
import scipy.interpolate | |
#Lo siguiente es para separar la lista de puntos en los de coordenadas x y los de coordenadas y | |
''' | |
A=[[950,1090],[850,1290],[810,1450], [758,1705], [320, 2340] , [860, 1950] , [750,2875] , [1090,2090] , [1148,3020] , [1360, 2110] , [1650,2805] , [1580,1910] , [1700,1710] , [2040,2050] , [2000,1790] , [1840,1510] , [1740,1350] , [1610,1150]] |
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
#Initialization | |
sum = 0 | |
mult = 3 | |
#Sumamos multiplos de 3 que no sean multiplos de 5 | |
while mult < 1000: | |
if mult % 5 != 0: | |
if mult %3 != 0: | |
sum = sum + mult |
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
from math import sqrt, cos | |
MAX = 1.52097701e8 #km | |
MIN = 1.47098074e8 #km | |
A = (MAX + MIN)/2. | |
C = (MAX - MIN)/2.; | |
E = C/A | |
B = sqrt(A**2-C**2) | |
#theta = var('theta') | |
def R(theta): return A*(1-E**2)/(1 - E*cos(theta)) |
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
''' | |
Simple binary/hexadecimal clock written in python. | |
This programm is an example for my "introduction to numerical analysis class" at Universidad Autonoma de Yucatan. | |
Feel free to copy/modify at your convenience. | |
''' | |
import time | |
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
#!/bin/bash | |
# | |
#rip.sh | |
# | |
#Rip a cd into flac files. | |
# | |
#It uses cd-info and gstreamer 1.0 | |
# | |
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 ruby | |
# | |
# | |
#info2meta | |
# | |
#Reads metadata information as downloaded by cd-info and writes it to flac files. | |
#I use this script together with https://gist.github.com/ixxra/9044268 to rip my | |
#cds into flac format. | |
# |
OlderNewer