Use 20 runs per 600 pa as baseline and scale from there, eg, 23.3 runs per 700 pa.
(13*hr+3*bb-2*k)/ip
| # models.py: | |
| # ---------- | |
| from django.contrib.gis.db import models as geomodels | |
| class Place(geomodels.Model): | |
| woe_id = geomodels.IntegerField() | |
| place_id = geomodels.CharField(max_length=255) | |
| place_type = geomodels.CharField(max_length=255) | |
| place_type_id = geomodels.IntegerField() |
| # -*- coding: utf8 -*- | |
| """ | |
| Download and import US census data from | |
| `http://www.census.gov/geo/www/cob/z52000.html` | |
| # shapefile mapping: | |
| zipcode_mapping = { | |
| 'area' : 'AREA', | |
| 'perimeter' : 'PERIMETER', |
| from django.contrib.gis.db import models as geomodels | |
| class Place(geomodels.Model): | |
| woe_id = geomodels.IntegerField() | |
| place_id = geomodels.CharField(max_length=255) | |
| place_type = geomodels.CharField(max_length=255) | |
| place_type_id = geomodels.IntegerField() | |
| label = geomodels.CharField(max_length=255) | |
| created = geomodels.DateTimeField() | |
| geometry = geomodels.PolygonField(srid=4326) |
| import sys | |
| from math import log, sqrt | |
| def pnormaldist(qn): | |
| b = [1.570796288, 0.03706987906, -0.8364353589e-3, | |
| -0.2250947176e-3, 0.6841218299e-5, 0.5824238515e-5, | |
| -0.104527497e-5, 0.8360937017e-7, -0.3231081277e-8, | |
| 0.3657763036e-10, 0.6936233982e-12] | |
| if qn < 0.0 or 1.0 < qn: |
| # quick & dirty example | |
| def get_placemark_point(raw_location): | |
| """Attempt to resolve ``raw_location`` using Google's geocoder. | |
| Returns a tuple with the canonical address and GEOS point | |
| """ | |
| import cjson | |
| from urllib import urlencode | |
| from urllib2 import urlopen |
| def test_map_reduce_finalize(self): | |
| """Ensure finalize is running by simulating "hotness" | |
| ranking with Reddit algorithm. | |
| """ | |
| from time import mktime | |
| class Link(Document): | |
| title = StringField() | |
| up_votes = IntField() | |
| down_votes = IntField() |
| curl -w '\nLookup time:\t%{time_namelookup}\nConnect time:\t%{time_connect}\nPreXfer time:\t%{time_pretransfer}\nStartXfer time:\t%{time_starttransfer}\n\nTotal time:\t%{time_total}\n' -o /dev/null -s http://www.domain.com/ |
| #!/usr/bin/env python | |
| """ | |
| corrupt | |
| usage: ./corrupt.py --source=input.jpg [--output=corrupted.jpg] [--iterations=10] | |
| originally: http://www.recyclism.com/corrupt.php | |
| ported: @mattdennewitz | |
| """ |
| from boto.s3.connection import S3Connection | |
| file_to_upload = "e434b232c2e4f70aa2819d708dfd30fb4cebcf6c.zip" | |
| s3 = S3Connection(YOUR_AWS_ACCESS_KEY, YOUR_AWS_SECRET_KEY) | |
| bucket = s3.get_bucket(YOUR_BUCKET_NAME) | |
| # user will receive "mixtape.zip" instead of "e434b232c2e4f70aa2819d708dfd30fb4cebcf6c.zip" | |
| s3_headers = {'Content-Disposition': "attachment; filename=mixtape.zip"} |