I hereby claim:
- I am nickbauman on github.
- I am nickbbuzzfeed (https://keybase.io/nickbbuzzfeed) on keybase.
- I have a public key whose fingerprint is 98DD 9A39 33A9 9607 756A 1816 07E7 7FC3 9629 7825
To claim this, I am signing this object:
| package future_value | |
| import "math" | |
| func futureValue(investmentAmount, interestRate, inflationRate, years float64) (float64, float64) { | |
| furtureValue := investmentAmount * math.Pow(1+interestRate/100, years) | |
| futureRealValue := furtureValue / math.Pow(1+inflationRate/100, years) | |
| return furtureValue, futureRealValue | |
| } |
| (defn make-change | |
| [target-amount coins] | |
| (let [sorted (reverse (sort coins))] | |
| (loop [amount target-amount | |
| coins-frequency {}] | |
| (if (zero? amount) | |
| coins-frequency | |
| (let [coin (first (filter #(<= % amount) sorted)) | |
| count (quot amount coin)] | |
| (recur (- amount (* count coin)) (merge-with + coins-frequency {coin count}))))))) |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Random; | |
| import java.util.Arrays; | |
| import java.util.TreeSet; | |
| /* | |
| Report the frequency of 100k random selections of strings in an array | |
| */ |
| (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)))))) |
| (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] |
| from github3 import login | |
| # Python 3 | |
| prompt = input | |
| if __name__ == '__main__': | |
| if len(sys.argv) > 1: | |
| passwd = prompt('Enter password: ') |
| The goal is to insert an integer into an ordered list-like thingy. | |
| Here's Go. | |
| // Given g | |
| g := []int{1, 2, 3, 4} | |
| // Insert 44 in the middle of it | |
| append(g[:2], append([]int{44}, g[2:]...)...) |
| (defentity AnotherEntity [content saved-time int-value]) | |
| (deftest test-query-language | |
| (testing "query entity with predicates" | |
| (let [entity (save! (create-AnotherEntity "Some content woo" (t/date-time 1980 3 5) 6)) | |
| entity2 (save! (create-AnotherEntity "Other content" (t/date-time 1984 10 12) 17))] | |
| ; query all | |
| (is (= (list entity entity2) (query-AnotherEntity []))) | |
| ; equality | |
| (is (= (list entity) (query-AnotherEntity [:content = "Some content woo"]))) |
| # For the ~/.gitconfig file: | |
| [alias] | |
| st = status | |
| co = checkout | |
| ci = commit | |
| cp = cherry-pick | |
| br = branch | |
| undo = reset HEAD~1 --mixed | |
| back = stash pop |
I hereby claim:
To claim this, I am signing this object: