I hereby claim:
- I am vaer-k on github.
- I am vaer_k (https://keybase.io/vaer_k) on keybase.
- I have a public key ASAidjD7EAmD_XkerK4oiaLvxjD33VC2u0806LaICOVZhQo
To claim this, I am signing this object:
| /** | |
| * An implementation for Quicksort. Doesn't | |
| * perform as well as the native Array.sort | |
| * and also runs the risk of a stack overflow | |
| * | |
| * Tests with: | |
| * | |
| * var array = []; | |
| * for(var i = 0; i < 20; i++) { | |
| * array.push(Math.round(Math.random() * 100)); |
| function regExpMatch(url, pattern) { | |
| try { return new RegExp(pattern).test(url); } catch(ex) { return false; } | |
| } | |
| function FindProxyForURL(url, host) { | |
| if (shExpMatch(url, "*ec2*.amazonaws.com*")) return 'SOCKS5 localhost:8157'; | |
| if (shExpMatch(url, "*.compute.internal*") || shExpMatch(url, "*://compute.internal*")) return 'SOCKS5 localhost:8157'; | |
| if (shExpMatch(url, "*ec2.internal*")) return 'SOCKS5 localhost:8157'; | |
| return 'DIRECT'; | |
| } |
| import numpy as np | |
| from pyspark.ml import Transformer | |
| from pyspark.ml.linalg import Vectors, VectorUDT | |
| from pyspark.sql.functions import udf | |
| from pyspark import keyword_only | |
| from pyspark.ml.param.shared import HasInputCol, HasOutputCol | |
| class WaveTime(Transformer, HasInputCol, HasOutputCol): | |
| """Transform time field into sin/cos of seconds elapsed since midnight""" | |
| @keyword_only |
| import os | |
| import json | |
| from tqdm import tqdm | |
| from urllib import request | |
| PATH = '~/Downloads/twitch_emotes' | |
| EMOTE_URI = 'https://twitchemotes.com/api_cache/v2/global.json' | |
| path = os.path.expanduser(PATH) | |
| if not os.path.exists(path): |
| %pyspark | |
| import matplotlib.pyplot as plt | |
| z.configure_mpl(width=400, height=300, fmt='svg') | |
| # Example data | |
| people = ('Goku', 'Vegeta', 'Gohan', 'Raditz', 'Trunks') | |
| y_pos = np.arange(len(people)) | |
| performance = 3 + 10 * np.random.rand(len(people)) | |
| error = np.random.rand(len(people)) |
| import math | |
| class Welford(object): | |
| """ Implements Welford's algorithm for computing a running mean | |
| and standard deviation as described at: | |
| http://www.johndcook.com/standard_deviation.html | |
| can take single values or iterables | |
| Properties: | |
| mean - returns the mean |
| (ns clojure.reverse-notation | |
| (:require [clojure.edn :as edn])) | |
| (def operators {'+ + '- - '/ / '* *}) | |
| (defn calc | |
| [expr] | |
| (loop [[e & es] (->> expr (re-seq #"\S+") (map edn/read-string) (replace operators)) | |
| stack '()] |
I hereby claim:
To claim this, I am signing this object:
| {"paragraphs":[{"text":"%md\n\n### [Benefits of FP](https://alvinalexander.com/scala/fp-book/benefits-of-functional-programming#pure-functions-are-easier-to-reason-about)\n1. Pure functions are easier to reason about (referential transparency -> substitution model)\n2. Testing is easier, and pure functions lend themselves well to techniques like property-based testing\n3. Debugging is easier\n4. Programs are more bulletproof (immutability -> determinism)\n5. Programs are written at a higher level, and are therefore easier to comprehend\n6. Function signatures are more meaningful\n7. Parallel/concurrent programming is easier\n\n#### FP excels in:\n- Modularity \n- Reusability \n- Composability \n- Extensibility \n- Testability","user":"anonymous","dateUpdated":"2018-11-13T22:42:58+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"markdown","editOnDblClick":true,"completionKey":"TAB","completionSupport":false},"editorMode":"ace/mode/markdown","editorHide":true," |
| {"paragraphs":[{"text":"%md\n\n### [Benefits of FP](https://alvinalexander.com/scala/fp-book/benefits-of-functional-programming#pure-functions-are-easier-to-reason-about)\n1. Pure functions are easier to reason about (referential transparency -> substitution model)\n2. Testing is easier, and pure functions lend themselves well to techniques like property-based testing\n3. Debugging is easier\n4. Programs are more bulletproof (immutability -> determinism)\n5. Programs are written at a higher level, and are therefore easier to comprehend\n6. Function signatures are more meaningful\n7. Parallel/concurrent programming is easier\n\n#### FP excels in:\n- Modularity \n- Reusability \n- Composability \n- Extensibility \n- Testability","user":"anonymous","dateUpdated":"2018-11-16T01:02:29+0000","config":{"colWidth":12,"fontSize":9,"enabled":true,"results":{},"editorSetting":{"language":"markdown","editOnDblClick":true,"completionKey":"TAB","completionSupport":false},"editorMode":"ace/mode/markdown","editorHide":true," |