
%%
%% General definitions one needs all the time
%%

%\newlength{\aulen}
% USENIX/NSDI
\newcommand{\aubox}[3]{\parbox[t]{#1}{\centering#2\\\url{#3}}}
% ACM
%\newcommand{\aubox}[3]{\parbox[t]{#1}{\centering\aufnt{#2}\\\affaddr{\url{#3}}}}
%\newcommand{\auboxs}[2]{\parbox[t]{#1}{\centering\aufnt{#2}}}
%\newcommand{\affbox}[3]{\parbox[t]{#1}{\centering\affaddr{#2}\\\url{#3}}}


\newcommand{\mypara}[1]{\vspace{\parsep}\noindent\textbf{#1}\quad}
\newcommand{\myparaend}[1]{\vspace{\parsep}}

\newcommand{\xref}[1]{Section~\ref{#1}}
%\newcommand{\xref}[1]{\S\ref{#1}}
\newcommand{\cref}[1]{Chapter~\ref{#1}}
\newcommand{\pxref}[1]{(\xref{#1})}
\newcommand{\fref}[1]{Figure~\ref{#1}}
\newcommand{\tref}[1]{Table~\ref{#1}}
\newcommand{\first}{\emph{(i)}~}
\newcommand{\second}{\emph{(ii)}~}
\newcommand{\third}{\emph{(iii)}~}
\newcommand{\fourth}{\emph{(iv)}~}
\newcommand{\fifth}{\emph{(v)}~}
\newcommand{\sixth}{\emph{(vi)}~}

\newcommand{\zb}{z.\,B. \@}

\newcommand{\ie}{i.\,e., \@}
\newcommand{\eg}{e.\,g., \@}
\newcommand{\Ie}{I.\,e., \@}
\newcommand{\Eg}{E.\,g., \@}
\newcommand{\cf}{cf. \@}
\newcommand{\Cf}{Cf. \@}

\newcommand{\etal}{et~al.\xspace}

\newcommand{\perc}{\,\%\xspace}
\newcommand{\pert}{\,\textperthousand\xspace}

% requires \usepackage{pifont}
\newcommand{\checked}{\ding{52}\xspace}
\newcommand{\unchecked}{\ding{56}\xspace}

\newcommand{\todo}[1]{\textit{\textcolor{red}{TODO: #1}}}
%\renewcommand{\todo}[1]{{\LARGE TODO:#1}}

% mark changed wording from first submission 
\newcommand{\new}[1]{\textcolor{blue}{#1}}

% for hints and comments
\newcommand{\comment}[1]{\textit{\textcolor{green}{#1}}}

% mark text blocks that need to be discussed, that might affect other parts 
\newcommand{\discuss}[1]{\textit{\textcolor{red}{#1}}}

% mark deleted text blocks
\usepackage[normalem]{ulem}
\newcommand{\del}[1]{\textcolor{red}{\sout{#1}}}


\newcounter{fn1}
\setcounter{fn1}{1}
\newcounter{fn2}
\setcounter{fn2}{2}
\newcounter{fn3}
\setcounter{fn3}{3}
\newcounter{fn4}
\setcounter{fn4}{4}
\newcounter{fn5}
\setcounter{fn5}{5}
\newcounter{tc}
\setcounter{tc}{1}
\newcommand{\fnsym}[1]{$^{\fnsymbol{#1}}$}

\newcommand{\minisec}[1]{\noindent\textbf{#1}:}

\newcommand{\microsecond}{\textmu{}s\xspace}
\newcommand{\millisecond}{ms\xspace}
\newcommand{\microseconds}{\textmu{}s\xspace}
\newcommand{\milliseconds}{ms\xspace}


\newcommand\textpi{\ensuremath{\pi}\xspace}

\newcommand{\ed}[1]{\textsf{\textbf{[#1]}}}


\setlength{\marginparwidth}{0.8in}
\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize \textcolor{blue}{#1}]%
{\raggedright\footnotesize \textcolor{blue}{#1}}}

\newcounter{mpc}
\setcounter{mpc}{1}
\newcommand{\mph}[1]{{\textcolor{blue}{$^{\fnsymbol{mpc}}$\marginpar{\fnsymbol{mpc} #1}\stepcounter{mpc}}}}

\newcommand{\ccg}{\cellcolor[gray]{0.9}} % requires \usepackage{colortbl}
\newcommand{\tcg}[1]{\textcolor[gray]{0.5}{#1}}

\newcommand{\commentout}[1]{}

\newcommand{\ba}{{\bf a}}
\newcommand{\bA}{{\bf A}}
\newcommand{\bb}{{\bf b}}
\newcommand{\bB}{{\bf B}}
\newcommand{\bc}{{\bf c}}
\newcommand{\bC}{{\bf C}}
\newcommand{\bd}{{\bf d}}
\newcommand{\bD}{{\bf D}}
\newcommand{\be}{{\bf e}}
\newcommand{\bE}{{\bf E}}
\newcommand{\bh}{{\bf h}}
\newcommand{\bH}{{\bf H}}
\newcommand{\bi}{{\bf i}}
\newcommand{\bI}{{\bf I}}
\newcommand{\bM}{{\bf M}}
\newcommand{\bs}{{\bf s}}
\newcommand{\bS}{{\bf S}}
\newcommand{\bu}{{\bf u}}
\newcommand{\bU}{{\bf U}}
\newcommand{\bv}{{\bf v}}
\newcommand{\bV}{{\bf V}}
\newcommand{\bw}{{\bf w}}
\newcommand{\bwbar}{\overline{\bw}}
\newcommand{\bwhat}{\widehat{\bw}}
\newcommand{\bwstar}{\bw^\ast}
\newcommand{\bwtilde}{\widetilde{\bw}}
\newcommand{\bW}{{\bf W}}
\newcommand{\bx}{{\bf x}}
\newcommand{\bX}{{\bf X}}
\newcommand{\by}{{\bf y}}
\newcommand{\bY}{{\bf Y}}
\newcommand{\bz}{{\bf z}}
\newcommand{\bZ}{{\bf Z}}
\newcommand{\balpha}{{\bm \alpha}}
\newcommand{\bell}{{\bm \ell}}
\newcommand{\cA}{\mathcal{A}}
\newcommand{\cC}{\mathcal{C}}
\newcommand{\cD}{\mathcal{D}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cG}{\mathcal{G}}
\newcommand{\cH}{\mathcal{H}}
\newcommand{\cL}{\mathcal{L}}
\newcommand{\cM}{\mathcal{M}}
\newcommand{\cN}{\mathcal{N}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\cU}{\mathcal{U}}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\cY}{\mathcal{Y}}
\newcommand{\cZ}{\mathcal{Z}}
\newcommand{\eps}{\varepsilon}
\newcommand{\pistar}{\pi^\ast}
\newcommand{\Qpi}{Q^\pi}
\newcommand{\Qstar}{Q^\ast}
\newcommand{\Vhat}{\widehat{V}}
\newcommand{\Vpi}{V^\pi}
\newcommand{\Vbw}{V^\bw}
\newcommand{\Vbwbar}{V^{\bwbar}}
\newcommand{\Vbwhat}{V^{\bwhat}}
\newcommand{\Vbwstar}{V^{\bwstar}}
\newcommand{\Vbwtilde}{V^{\bwtilde}}
\newcommand{\Vstar}{V^\ast}
\newcommand{\wbar}{\overline{w}}
\newcommand{\what}{\widehat{w}}
\newcommand{\wstar}{w^\ast}
\newcommand{\wtilde}{\widetilde{w}}

\newcommand{\integerset}{\mathbb{Z}}
\newcommand{\naturalset}{\mathbb{N}}
\newcommand{\realset}{\mathbb{R}}

\newcommand{\betapdf}{P_{\mathrm{beta}}}
\newcommand{\betacdf}{F_{\mathrm{beta}}}
\newcommand{\gammapdf}{P_{\mathrm{gamma}}}
\newcommand{\gammacdf}{F_{\mathrm{gamma}}}
\newcommand{\normalpdf}{\cN}
\newcommand{\normalcdf}{F_{\cN}}
\newcommand{\unifpdf}[2]{\mathrm{U}_{[#1, #2]}}
\newcommand{\unifcdf}[2]{F_{\mathrm{U}_{[#1, #2]}}}

\newcommand{\convexhull}[1]{\mathrm{Conv\left[#1\right]}}
\newcommand{\domain}[1]{\mathrm{Dom\left[#1\right]}}
\newcommand{\range}[1]{\mathrm{Rng\left[#1\right]}}
\newcommand{\Parents}{\mathsf{Par}}

\newcommand{\lyapunov}{L}
\newcommand{\lyapunovfactor}{\kappa}

\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\ceils}[1]{\left\lceil#1\right\rceil}
\newcommand{\E}[2]{\mathbb{E}_{#1} \! \left[#2\right]}
\newcommand{\Eabs}[2]{\mathbb{E}_{#1} \! \abs{#2}}
\newcommand{\floors}[1]{\left\lfloor#1\right\rfloor}
\newcommand{\I}[1]{\mathds{1} \! \left\{#1\right\}}
\newcommand{\intin}[2]{\int_{#1} \! \! \! #2 \ud #1}
\newcommand{\maxnorm}[1]{\left\|#1\right\|_\infty}
\newcommand{\maxnormw}[2]{\left\|#1\right\|_{\infty, #2}}
\newcommand{\mode}[1]{\widehat{#1}}
\renewcommand{\neg}[1]{\overline{#1}}
\newcommand{\negpart}[1]{\left[#1\right]^-}
\newcommand{\normw}[2]{\left\|#1\right\|_{#2}}
\newcommand{\pospart}[1]{\left[#1\right]^+}
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\sgn}{\mathrm{sgn}}
\newcommand{\subst}[2]{\left\{#1 = #2\right\}}
\newcommand{\transpose}{^\mathsf{\scriptscriptstyle T}}
\newcommand{\ud}{\, \mathrm{d}}
\newcommand{\var}[2]{\mathrm{var}_{#1} \! \left[#2\right]}
