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 random import randint | |
class DniPeru: | |
def __init__(self): | |
self.numbers = (6, 7, 8, 9, 0, 1, 1, 2, 3, 4, 5) | |
self.letters = ('K', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J') | |
self.multiples = (3, 2, 7, 6, 5, 4, 3, 2) | |
def __index(self, dni): |
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
var rgbaSum = function(c1, c2){ | |
var a = c1.a + c2.a*(1-c1.a); | |
return { | |
r: (c1.r * c1.a + c2.r * c2.a * (1 - c1.a)) / a, | |
g: (c1.g * c1.a + c2.g * c2.a * (1 - c1.a)) / a, | |
b: (c1.b * c1.a + c2.b * c2.a * (1 - c1.a)) / a, | |
a: a | |
} | |
} | |
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
# Descargar archivos.xml desde http://www.servel.com/archivos.xml | |
import xml.etree.ElementTree as ET | |
import urllib2, os, sys | |
def progress(nregion, comuna, download, response, chunk_size=8192, report_hook=None): | |
total_size = float(response.headers["Content-Length"]) | |
bytes_size = 0.0 | |
data = [] | |
while 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
<?php | |
/* Parámetros a modificar */ | |
$data = simplexml_load_file('DATOS_EXPORTADOS_WORDPRESS.XML'); | |
$user = "XXXXXXXXXXXXXX"; | |
$url = "http://$user.files.wordpress.com/"; | |
$total = count($data->channel->item); | |
echo "###########################################################\n\r"; |