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
curl -X PUT -T test_s3.txt -L "https://your-bucket.s3.amazonaws.com/url-stuff" |
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 pyspark.sql.functions import udf | |
from pyspark.sql.types import BooleanType | |
def regex_filter(x): | |
regexs = ['.*ALLYOURBASEBELONGTOUS.*'] | |
if x and x.strip(): | |
for r in regexs: | |
if re.match(r, x, re.IGNORECASE): | |
return True |
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
-module(plists). | |
-export([pmap/2,pforeach/2,npforeach/2, parmap/2]). | |
%%% Map | |
pmap(F, L) -> | |
S = self(), | |
Pids = lists:map(fun(I) -> spawn(fun() -> pmap_f(S, F, I) end) end, L), | |
pmap_gather(Pids). |
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
import time | |
def RateLimited(maxPerSecond): | |
minInterval = 1.0 / float(maxPerSecond) | |
def decorate(func): | |
lastTimeCalled = [0.0] | |
def rateLimitedFunction(*args,**kargs): | |
elapsed = time.clock() - lastTimeCalled[0] | |
leftToWait = minInterval - elapsed | |
if leftToWait>0: |