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 get_point_photos(request, lat, lon, name): | |
'''takes a lat lon pair via an ajax request, and returns a list of photos''' | |
#create a Flickr API object | |
f = flickrapi.FlickrAPI(api_key) | |
#resolve a (lat,long) to a "Flickr Place" which can be used to search for photos. | |
place = f.places_findByLatLon(api_key = api_key, lat=lat, lon = lon) | |
#get the id of the Flickr Place returned | |
place_id = place.find('places').findall('place')[0].attrib['place_id'] | |
#returns an XML response that contains data to construct photo URLs | |
flickr_search = f.photos_search(api_key = api_key, place_id = place_id, content_type = '1', tags = 'nature, landscape, hiking, outdoors, |
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
double latitude = self.mapView.mapCenter.latitude; | |
metersPerPixel *= cos(latitude * (M_PI / 180)); | |
double metersPerUnit = 1609.344; | |
int numberOfUnits = 1; | |
NSString *unitName = MILES_UNIT_STRING; | |
if (metersPerPixel < (1000/maxScaleSize)) { | |
unitName = METERS_UNIT_STRING; | |
metersPerUnit = 1; | |
} else { | |
unitName = KILOMETERS_UNIT_STRING; |
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
on run {input, parameters} | |
tell application "Terminal" | |
set currentTab to do script ("ps ax | grep jekyll | grep -v grep | awk '{ print $1 }' | xargs kill") in front window | |
set currentTab to do script ("jekyll serve --detach;") in front window | |
end tell | |
tell application "Google Chrome" | |
activate | |
set theUrl to "http://0.0.0.0:4000/" | |
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/local/bin/python | |
import sys | |
import urllib | |
''' | |
make a URL that imports a TMS map source into Gaia GPS | |
example |
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 | |
############################################################################### | |
# $Id$ | |
# | |
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 | |
# Global Map Tiles Classes | |
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, | |
# generate a simple HTML viewers based on Google Maps and OpenLayers | |
# Author: Klokan Petr Pridal, klokan at klokan dot cz | |
# Web: http://www.klokan.cz/projects/gdal2tiles/ |
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 boto3 | |
def download_naips(self): | |
s3_client = boto3.client('s3') | |
filename = 'm_3807708_ne_18_1_20130924.tif' | |
s3_client.download_file('aws-naip', 'md/2013/1m/rgbir/38077/{}'.format(filename), filename, {'RequestPayer':'requester'}) |
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
root@8e3b54c9c353:/code# python manage.py shell < real_estate/scripts/generate_neural_net.py | |
fetching AnalysisRecords took 0.0015499591827392578 | |
Fetched 15577 records for properties. | |
annotating years and months took 1.1473767757415771 | |
making value map took 11.682528972625732 | |
Using 15573 properties for analysis. | |
making model took 0.3301811218261719 | |
Model: "model" | |
__________________________________________________________________________________________________ | |
Layer (type) Output Shape Param # Connected to |
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
root@8e3b54c9c353:/code# python manage.py shell < real_estate/scripts/generate_neural_net.py | |
fetching AnalysisRecords took 0.0015206336975097656 | |
Fetched 47555 records for properties. | |
2183530944 - Hashing AnalysisRecords took 3.006469964981079 | |
annotating years and months took 3.25303053855896 | |
making value map took 36.68412470817566 | |
Using 47550 properties for analysis. | |
4202095867 - data_hash | |
4036931971 - value_map_hash | |
making model took 0.8455119132995605 |
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 datetime | |
import math | |
import numpy as np | |
import pandas as pd | |
import pickle | |
import time | |
from django.db.models.functions import Cast | |
from django.db.models import IntegerField | |
from real_estate.models import AnalysisRecord |
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
#include <iostream> | |
using namespace std; | |
// Current Cards | |
// Mountain | |
// Future Cards | |
// Forest | |
// Lightning Bolt, Giant Growth, Earthquake |
OlderNewer