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 decimal | |
from decimal import Decimal | |
import datetime | |
#Read from Microsoft Access | |
#rows = cursor_access.execute("SELECT * FROM Predios") | |
#One record example: | |
row = (98, '11', '04', '57', '01', '01', '004', '005', '000', '00', '000', '1104570101004005', 'EDIFICADO', 'TNTE MAXIMILIANO RODRIGUEZ', 'UNIPROPIEDAD', 'Residencial', 'C:\\FOTOS\\570101\\004\\005.jpg', 'MODESTO BURNEO', 'S/N', 'JACINTA REYES', 'LOJA, SAN SEBASTIAN', 'Natural', None, datetime.datetime(1973, 1, 26, 0, 0), 44, 'Femenino', False, 'CARMEN PAULINA', 'ILLESCAS BURNEO', 'Cédula', '1102962741', '-', '-', 'Casado', 'MANUEL AGUSTIN', 'TOLEDO CUEVA', 'Cédula', '-', '-', '-', 'BURNEO CAMPOVERDE JULIO MARIANA', '-', None, None, None, None, None, None, None, 'Cédula', None, None, None, False, True, 'Loja', 'Celica', '3', datetime.datetime(2011, 10, 7, 0, 0), '254', datetime.datetime(2011, 10, 31, 0, 0), False, 0, 0, 'Compra - venta', True, 'Calle', 'Adoquín de cemento', True, True, True, True, False, True, True, True, False, True, False, False, |
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
# List branches for remote repositorie | |
git ls-remote --heads https://github.com/jquemada/cal_branches |
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 urllib.request | |
import json | |
def analisa_detalhe(cod): | |
url = 'http://educacao.dadosabertosbr.com/api/escola/' | |
resp = urllib.request.urlopen(url+str(cod)).read() | |
resp = json.loads(resp.decode('utf-8')) | |
if int(resp['salasExistentes']) > 1: | |
print ('Salas Existentes:', resp['salasExistentes']) | |
print ('Funcionários:', resp['funcionarios']) |
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 numpy import array | |
a = array([[5.1, 7.4, 3.2, 9.9], | |
[1.9, 6.8, 4.1, 2.3], | |
[2.9, 6.4, 4.3, 1.4]]) | |
#cantidad de elemtos | |
a.size | |
#dimensiones | |
a.shape | |
#Lectura: Obtener un elemento contenido en la matriz | |
a[1, 3] |
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
edades = numpy.array[(20,23,22)] | |
#lectura | |
print (edades[2]) | |
#escritura | |
edades[1] = 27 | |
#presentacion | |
for i in range(0, len(edades)): | |
print (edades[i]) | |
#aunque en python no hace falta el bucle | |
print(edades) |
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 numpy | |
#creacion e inicializacion | |
a = numpy.array([2,4,5,9]) | |
#creacion | |
b = numpy.array() | |
#inicializacion, por defecto el tipo de dato usado es float | |
b = numpy.empty(4) | |
#Mas formas de inicializacion | |
dias = numpy.empty(7) | |
edades = numpy.empty(20, dtype=int) |
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 python | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com |
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
echo "" > /tmp/bads.txt | |
inicio=164 | |
fin=165 | |
for i in `seq $inicio $fin` | |
do | |
ip=10.10.$i.1 | |
if ping $ip -w2 | grep "0 received" | |
then | |
echo $ip >> /tmp/bads.txt | |
fi |
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
## dplyr package notes | |
# dplyr use plyr and haver relation with data.table | |
library(dplyr) | |
# Example | |
ddply(df, ~date, summarise, totalSteps=sum(steps)) | |
## *Complete dni ecuatorian numbers with '0'. If length == 9 | |
## Sometimes usefull when Spreadsheet cut that number at start | |
# ========================================================================================= | |
> head(reporte) |
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
# --------------------------------------------------- | |
# Update LinuxMint to v17 | |
# --------------------------------------------------- | |
sudo sed -i 's/raring/trusty/' /etc/apt/sources.list | |
sudo sed -i 's/olivia/qiana/' /etc/apt/sources.list | |
sudo sed -i 's/raring/trusty/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo sed -i 's/olivia/qiana/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get upgrade |
NewerOlder