Skip to content

Instantly share code, notes, and snippets.

View rsnape's full-sized avatar

J. Richard Snape rsnape

  • De Montfort University
  • Leicester
View GitHub Profile
// ==UserScript==
// @name Common Comments Box (Stack Overflow)
// @namespace about:blank
// @include http*://stackoverflow.com/questions/*
// @version 1
// @grant none
// ==/UserScript==
var common_comments = [
"It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on their own. A good way to demonstrate this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the [FAQ] and [ask].",
from math import radians, sin, cos, sqrt, asin, factorial
from itertools import combinations, permutations
# by average circumference instead of authalic radius (assume planes)
# shouldn't actually matter for our purposes as we're using this to generate weights
# been nodes/vertices.
EARTH_RADIUS_KM = 6372.8
def haversine(lat1, long1, lat2, long2, planet_radius=EARTH_RADIUS_KM):