This file contains hidden or 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
javascript:(function()%7BEN_CLIP_HOST='http://www.evernote.com';try%7Bvar%20x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new%20Date().getTime()/100000);document.getElementsByTagName('head')%5B0%5D.appendChild(x);%7Dcatch(e)%7Blocation.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);%7D%7D)(); |
This file contains hidden or 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
# Taken almost verbatim from PySpark's doctest | |
from pyspark.accumulators import AccumulatorParam | |
class VectorAccumulatorParam(AccumulatorParam): | |
def zero(self, value): | |
return [0.0] * len(value) | |
def addInPlace(self, val1, val2): | |
for i in xrange(len(val1)): | |
val1[i] += val2[i] | |
return val1 | |
xnew = sc.accumulator([0.0]*p, VectorAccumulatorParam()) |
This file contains hidden or 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 inspect | |
for p in dir(sc): | |
if p[0]=='_': | |
continue | |
if inspect.ismethod(sc.__getattribute__(p)): | |
continue | |
print p, sc.__getattribute__(p) | |
This file contains hidden or 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
% Typesetting | |
%\usepackage[margin=1in]{geometry} | |
%\usepackage{fullpage} | |
\usepackage{verbatim} | |
% Fonts and stuff | |
%\usepackage{times} | |
%\usepackage{soul} | |
\usepackage{color} | |
%\usepackage[usenames,dvipsnames]{color} |
This file contains hidden or 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
\newcommand{\theHalgorithm}{\arabic{algorithm}} | |
%\newtheorem{theorem}{Theorem} | |
%\newtheorem{definition}[theorem]{Definition} | |
%\newtheorem{assumption}[theorem]{Assumption} | |
%\newtheorem{proposition}[theorem]{Proposition} | |
%\newtheorem{lemma}[theorem]{Lemma} | |
%\newtheorem{corollary}[theorem]{Corollary} |
This file contains hidden or 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
part = np.argpartition(abs(x),len(x)-s,axis=0) | |
x[part[:-s]] = 0 |
NewerOlder