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 github3 import login | |
# Python 3 | |
prompt = input | |
if __name__ == '__main__': | |
if len(sys.argv) > 1: | |
passwd = prompt('Enter password: ') |
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
(ns haversine | |
(:require [math.numeric-tower :refer [expt sqrt]])) | |
(def RADIUS_OF_EARTH 6371.0088) | |
(defn radians [degrees] | |
(/ (* degrees Math/PI) 180)) | |
(defn haversine | |
[lat1 lon1 lat2 lon2] |
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
(defn split-string [word] | |
(into #{} (clojure.string/split word #""))) | |
(defn anagram-of? [word candidate] | |
(boolean (when (= (count word) (count candidate)) | |
(let [word-list (split-string word) | |
cand-list (split-string candidate)] | |
(= #{} (clojure.set/difference cand-list word-list)))))) |
OlderNewer