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 |
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
% 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
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
# 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
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
# Screen Options ## | |
shell bash # Tell screen your default shell | |
startup_message off # Turn off start message | |
defscrollback = 5000 | |
shelltitle '$ |bash' # Dynamic window titled for running program | |
msgwait 1 # Set messages timeout to one second | |
nethack on # Turn on nethack error messages | |
backtick 0 0 0 whoami # Set "%0`" to equal the output of "whoami" | |
#escape ^Oo |
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
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just | |
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime | |
" you can find below. If you wish to change any of those settings, you should | |
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten | |
" everytime an upgrade of the vim packages is performed. It is recommended to | |
" make changes after sourcing debian.vim since it alters the value of the | |
" 'compatible' option. | |
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. |
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 matplotlib.pyplot as plt | |
%matplotlib inline | |
%config InlineBackend.figure_format = 'svg' |
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
ssh -N -L localhost:[localport]:[remotelisteninghostname]:[remoteport] -p [remotesshport] [remoteuser]@[remotehost] |
OlderNewer