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 | |
# config | |
IMGS=( | |
" | |
+ o + + o \n\ | |
+ o o + + \n\ | |
+ o + o + \n\ | |
o + 0 \n\ | |
o + + + + \n\ |
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
javascript:( function() { | |
console.group( 'Performance Information for all entries of ' + window.location.href ); | |
console.log( '\n-> Duration is displayed in ms\n ' ) | |
var entries = window.performance.getEntries(); | |
entries = entries.sort( function( a, b ) { | |
return b.duration - a.duration; | |
} ); | |
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
library('testthat'); | |
test_that('The Standard Desviation of n numbers', { | |
x <- c(1, 2, 3, 4, 5, 6, 7, 8); | |
sd <- sd(x); | |
expect_that(sd, equals(2.449490)) | |
}); |
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
# Mathieu Blondel, September 2010 | |
# License: BSD 3 clause | |
import numpy as np | |
from numpy import linalg | |
import cvxopt | |
import cvxopt.solvers | |
def linear_kernel(x1, x2): | |
return np.dot(x1, x2) |
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 as np | |
import pylab as pl | |
import pandas as pd | |
from sklearn import svm | |
from sklearn import linear_model | |
from sklearn import tree | |
from sklearn.metrics import confusion_matrix |
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 requests | |
import json | |
pizza_list = 'http://pizzahut.com.pe/Content/static/jsons/pizza-list.json' | |
#size_list = 'http://pizzahut.com.pe/Content/static/jsons/size-list.json' | |
r = requests.get(pizza_list) | |
pizzas = json.loads(r.text) |
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 json | |
import geojson | |
from shapely.geometry import shape | |
o = { | |
"coordinates": [[[23.314208, 37.768469], [24.039306, 37.768469], [24.039306, 38.214372], [23.314208, 38.214372], [23.314208, 37.768469]]], | |
"type": "Polygon" | |
} | |
s = json.dumps(o) |
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 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
Fecha Local Hora Local Latitud Longitud Profundidad Magnitud "Intensidad - Localidades" | |
05/10/2014 06:05:29 -11.95 -77.59 36 Km 4.0 ML II Ancón, Lima | |
02/10/2014 16:33:57 -12.04 -77.13 60 Km 4.0 ML II-III Lima | |
01/10/2014 18:47:54 -13.69 -76.47 41 Km 4.6 ML III Pisco; II-III Tambo de Mora, Chincha Alta;II San Vicente, Lunahuana, Ica | |
30/09/2014 06:39:22 -13.84 -71.83 8 Km 3.6 ML II Misca | |
27/09/2014 21:35:27 -13.81 -71.89 6 Km 5.1 ML VII Misca;VI Cusibamba, Toroy, Moyoc; V Colcha,Rondocán;IV Paccaritambo, Ccochirihuay;III-IV Yaurisque, Huanoquite;III Cusco, Omacha; II-III Ccapi;II Urubamba, Calca, Anta, Yanaoca, Huancarani | |
25/09/2014 22:54:12 -16.79 -70.60 8 Km 3.8 ML II Calacoa | |
25/09/2014 06:19:10 -12.49 -77.31 24 Km 3.9 ML II Callao, Lima | |
19/09/2014 21:44:36 -15.65 -74.03 66 Km 4.5 ML II-III Chala; II Atico, Yauca, Caraveli | |
17/09/2014 23:19:58 -6.15 -76.35 123 Km 4.9 ML II Lamas, Moyobamba |
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
ops@osm-db:~/learning$ mb-util tiles/planet planet.mbtiles | |
INFO:mbutil.util:Importing disk to MBTiles | |
DEBUG:mbutil.util:tiles/planet --> planet.mbtiles | |
INFO:mbutil.util:metadata from metadata.json restored | |
DEBUG:mbutil.util: Read tile from Zoom (z): 0 Col (x): 0 Row (y): 0 | |
DEBUG:mbutil.util: Read tile from Zoom (z): 2 Col (x): 1 Row (y): 2 | |
DEBUG:mbutil.util: Read tile from Zoom (z): 1 Col (x): 0 Row (y): 1 | |
DEBUG:mbutil.util: Read tile from Zoom (z): 8 Col (x): 75 Row (y): 159 | |
DEBUG:mbutil.util: Read tile from Zoom (z): 5 Col (x): 9 Row (y): 19 | |
DEBUG:mbutil.util: Read tile from Zoom (z): 6 Col (x): 18 Row (y): 39 |
OlderNewer