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
<html> | |
<body> | |
<img src="http://maps.google.com/maps/api/staticmap?center=50.8661,4.6806&zoom=15&size=320x480&markers=icon:http://www.fietsroute.org/Logo/markers/markers/marker74.png%7C50.8661,4.6806&sensor=false"/> | |
</body> | |
</html> |
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 isPrime(n): | |
"""Returns True if n is prime http://stackoverflow.com/a/1801446/2987382""" | |
if n == 2 or n==3: return True | |
if n < 2 or n % 2 == 0: return False | |
if n % 3 == 0: return False | |
i = 5 | |
w = 2 | |
while i * i <= n: | |
if n % i == 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
import re | |
with open('29-01-14 20-53-27.tcx', 'rt') as f: | |
for line in f: | |
print line, | |
match = re.match('\s+<Speed>(\d+.\d+)',line) | |
if match: | |
speed = float(match.group(1)) | |
speed_in_kmperh = speed/1000.0*60.0*60.0 | |
power_in_watt = int(speed_in_kmperh/6.0*50.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
"""vpower.py. Add power to TCX file for Garmin Tacx Blue Motion indoor trainer | |
Usage: | |
vpower.py [--lever=<lv>] INPUT | |
Arguments: | |
INPUT Required .TCX input filename | |
Options: | |
-h --help Show this. |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<gpx creator="StravaGPX" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.x |
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 xml.dom import minidom | |
import datetime | |
tracks = {} | |
def parseTrack(trk): | |
name = trk.getElementsByTagName('name')[0].firstChild.data | |
if not name in tracks: | |
tracks[name] = [] | |
for trkseg in trk.getElementsByTagName('trkseg'): | |
for trkpt in trkseg.getElementsByTagName('trkpt'): |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<gpx creator="StravaGPX" version="1.1" xmlns="http://www.topografix.com/GPX/1/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd http://www.garmin.com/xmlschemas/GpxExtensions/v3 http://www.garmin.com/xmlschemas/GpxExtensionsv3.x |
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
Verifying that +cast42 is my openname (Bitcoin username). https://onename.io/cast42 |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> | |
<script src="https://cdn.firebase.com/js/client/1.1.1/firebase.js"></script> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.37/Bacon.min.js"></script> | |
<meta charset="utf-8" /> |
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 https://github.com/ogrisel/parallel_ml_tutorial/blob/master/rendered_notebooks/05%20-%20Model%20Selection%20and%20Assessment.ipynb | |
from itertools import cycle | |
colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k'] | |
markers = ['+', 'o', '^', 'v', '<', '>', 'D', 'h', 's'] | |
for i, c, m in zip(np.unique(y), cycle(colors), cycle(markers)): | |
plt.scatter(X_pca[y == i, 0], X_pca[y == i, 1], | |
c=c, marker=m, label=i, alpha=0.5) | |
OlderNewer