text:
%%% Ringraziamenti a Luca Chiodini per il frontespizio
%%% https://github.com/lucach/frontespizio-unimib

\begin{titlepage}

    \noindent
    \begin{minipage}[t]{0.18\textwidth}
        \vspace{-4mm}{\includegraphics[scale=1.15]{logo_unimib.pdf}}
    \end{minipage}
    \begin{minipage}[t]{0.8\textwidth}
    {
            \setstretch{1.4}
            {
            \textsc{Università degli Studi di Milano - Bicocca}} \\
            \textbf{Scuola di Scienze} \\
            \textbf{Dipartimento di Informatica, Sistemistica e Comunicazione} \\
            \textbf{Corso di Laurea in Informatica} \\
            \par
    }
    \end{minipage}

\vspace{40mm}

\begin{center}
        {\LARGE{
                \setstretch{1.2}
                \textbf{\thetitle}
                \par
        }}
    \end{center}

    \vspace{50mm}

    \noindent
    {\large \textbf{Relatore:} \supervisor } \\

    \noindent
    {\large \textbf{Co-relatore:} \cosupervisor}

    \vspace{15mm}

    \begin{flushright}
        {\large \textbf{Relazione della prova finale di:}} \\
        \large{\theauthor} \\
        \large{\immatricolation}
    \end{flushright}

    \vspace{30mm}
    \begin{center}
        {\large{\bf \academicyear}}
    \end{center}

    \restoregeometry

\end{titlepage}

domain: tex


text:
\documentclass[aps,pra,notitlepage,amsmath,amssymb,letterpaper,12pt]{revtex4-1}
\usepackage{amsthm}
\usepackage{graphicx}
%  Above uses the Americal Physical Society template for Physical Review A
%  as a reasonable and fully-featured default template

%  Below define helpful commands to set up problem environments easily
\newenvironment{definition}[2][Definition]{\begin{trivlist}
\item[\hskip \labelsep {\bfseries #1}\hskip \labelsep {\bfseries #2.}]}{\end{trivlist}}
\newenvironment{solution}{\begin{proof}[Solution]}{\end{proof}}

% --------------------------------------------------------------
%                   Document Begins Here
% --------------------------------------------------------------

\begin{document}

\title{Calculus}
\author{Atabak Pouya}
\affiliation{CS 510, Schmid College of Science and Technology, Chapman University}
\date{\today}

\maketitle

\section{Derivative} % Specify main sections this way

% x.yz is the problem number
\begin{definition}{1.1}
The derivative of $f(x)$ with respect to $x$ is $f'(x)$ and defined as :
\end{definition}

\begin{proof} %You can also use proof in place of solution
 derivative is the slope of a line at a specific point
\begin{align}
f'(x) = \lim_{x \rightarrow 0} \frac{f(x+\Delta{x})-f(x)}{\Delta{x}}
\end{align}
In this equation, we are saying
find the slope of the tangent line between two points when you add almost zero to go from the first x value to the next.
% Use align environments for equations. The \\ is a newline character. The & is the alignment character.
% Using align* or \nonumber on each line removes equation numbers
\end{proof}

FIG. 1 illustrates the (1) on a curve.

\begin{figure}[h!] % h forces the figure to be placed here, in the text
  \includegraphics[width=0.4\textwidth]{Secant.png}  % if pdflatex is used, jpg, pdf, and png are permitted
  \caption{Secant of line P.}
  \label{fig:figlabel}
\end{figure}

Since $\Delta{x}$ is the variable that approaches 0, $x$ remains constant, and that limit will be a function of x.  Since it will be derived from $f(x)$, we call it the derived function or the derivative of $f(x)$

% Repeat as needed

\end{document}


text:
\documentclass[11pt, a4paper, sans, colorlinks, linkcolor=True]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{black}
\usepackage{ragged2e}
\usepackage[utf8]{inputenc}
\usepackage{enumitem}
\usepackage[left=1in, right=1in, bottom=0.5in, top=0.5in]{geometry}
%\addtolength{\topmargin}{-.875in}
\pagenumbering{gobble}
\usepackage{setspace}

%Personal Details
\name{Oliver James}{Hall}
\title{Coverletter}
\address{European Space Agency (ESA)\\ European Space Research and Technology Centre (ESTEC)\\ Keplerlaan 1}{2201 AZ Noordwijk}{The Netherlands}
\email{ojhall94@gmail.com}
\homepage{https://www.ojhall94.github.io}

\begin{document}
\definecolor{links}{HTML}{3f28bd}
\hypersetup{urlcolor=links}
\recipient{\ }{\ }
\date{\today}
\opening{Dear Dr. Woods,}
\makelettertitle
\justify
\vspace{-0.5cm}

We hope this letter finds you well. We have completed our response to the reviewer, which is attached below this cover letter (and uploaded separately with resubmission). Based on our discussion over email on the reformatting of the original draft, we have done our best to reshuffle the paper's contents. We think the updated draft best matches the Nature format while keeping it accessible to the reader. However the Methods is longer than conventional, so please let us know if you have any suggestions on what we should move to the Supplementary Information, if necessary.

We have also added data and code availability statements. At the moment, our main results table is in Extended Data, as we don't think it is necessary to include it in the main text. Ideally we would publish this table digitally along with the article (as well as host it on Vizier). If you have any input on whether this table should be (partially) included in the main text, or other thoughts on how to best present it in the Nature Astronomy format, we would be grateful also.

The word count breakdown is as follows:
\begin{itemize}
	\item Abstract: 196
	\item Introduction: 500
	\item Main body (incl. Introduction): 2721
	\item Methods: 5145
	\item Supplementary Information: 2544
\end{itemize}

And the number of figures, tables and references are as follows:
\begin{itemize}
	\item Main body: 4 figures (1.2 MB), 51 references
	\item Methods: 0 figures, 57 references
	\item Supplementary Information: 1 figure (298 KB), 25 references
	\item Extended Data: 5 Figures (1.1 MB), 1 Table (4 pages, 29 KB), 10 references
\end{itemize}

The references in the \textbf{Extended Data} are numbered following the references listed under Methods.
\vspace{0.5cm}

Yours sincerely, \\
\vspace{0.5em}
\includegraphics[scale=0.2]{signature.png} \\
\vspace{0.5em}
\textbf{Oliver J. Hall}, on behalf of the authors. \\
\end{document}


text:
\hypertarget{_websocket_event_arg_8cs}{}\section{Websocket\+Event\+Arg.\+cs File Reference}
\label{_websocket_event_arg_8cs}\index{Websocket\+Event\+Arg.\+cs@{Websocket\+Event\+Arg.\+cs}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item
class \mbox{\hyperlink{class_simple_web_socket_server_library_1_1_web_socket_event_arg}{Simple\+Web\+Socket\+Server\+Library.\+Web\+Socket\+Event\+Arg}}
\begin{DoxyCompactList}\small\item\em Contains information about a occured event. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Namespaces}
\begin{DoxyCompactItemize}
\item
namespace \mbox{\hyperlink{namespace_simple_web_socket_server_library}{Simple\+Web\+Socket\+Server\+Library}}
\end{DoxyCompactItemize}


text:
\no{2}\evenverse Labóres mánuum tuárum quia \textit{man}\textit{du}\textbf{cá}bis:~\*\\
\evenverse beátus es, et bene tibi \textbf{e}rit.\\
\no{3}\oddverse Uxor tua sicut vi\textit{tis} \textit{a}\textbf{bún}dans:~\*\\
\oddverse in latéribus domus \textbf{tu}æ.\\
\no{4}\evenverse Fílii tui sicut novéllæ \textit{o}\textit{li}\textbf{vá}rum:~\*\\
\evenverse in circúitu mensæ \textbf{tu}æ.\\
\no{5}\oddverse Ecce sic benedi\textit{cé}\textit{tur} \textbf{ho}mo,~\*\\
\oddverse qui timet \textbf{Dó}minum.\\
\no{6}\evenverse Benedícat tibi Dómi\textit{nus} \textit{ex} \textbf{Si}on:~\*\\
\evenverse et vídeas bona Jerúsalem ómnibus diébus vitæ \textbf{tu}æ.\\
\no{7}\oddverse Et vídeas fílios filió\textit{rum} \textit{tu}\textbf{ó}rum:~\*\\
\oddverse pacem super \textbf{Is}raël.\\
\no{8}\evenverse Glória Pa\textit{tri}, \textit{et} \textbf{Fí}lio,~\*\\
\evenverse et Spirítui \textbf{San}cto.\\
\no{9}\oddverse Sicut erat in princípio, et \textit{nunc}, \textit{et} \textbf{sem}per,~\*\\
\oddverse et in sǽcula sæculórum. \textbf{A}men.\\


text:
\hypertarget{classo_z_1_1_packet}{}\section{oZ\+::Packet Class Reference}
\label{classo_z_1_1_packet}\index{oZ::Packet@{oZ::Packet}}

{\ttfamily \#include $<$Packet.\+hpp$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\mbox{\hyperlink{classo_z_1_1_packet_a5c96f8d5db686e035b199e8aeb0e0cea}{Packet}} (void)=default
\begin{DoxyCompactList}\small\item\em Construct a new \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object. \end{DoxyCompactList}\item
\mbox{\hyperlink{classo_z_1_1_packet_a4affbe387050c6b67f4604f9eaadc074}{Packet}} (\mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}} \&\&byte\+Array, const \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} endpoint, const \mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}} fd=-\/1)
\begin{DoxyCompactList}\small\item\em Construct a new \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object using byte\+Array and an endpoint. \end{DoxyCompactList}\item
\mbox{\hyperlink{classo_z_1_1_packet_a01d80a0c452b1e07dfd160f494be2af5}{$\sim$\+Packet}} (void)=default
\begin{DoxyCompactList}\small\item\em Destroy the \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object. \end{DoxyCompactList}\item
\mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}} \& \mbox{\hyperlink{classo_z_1_1_packet_a8a5d791e4675a3f065928884b64fe7bf}{get\+Byte\+Array}} (void) noexcept
\begin{DoxyCompactList}\small\item\em Get the Byte\+Array of the context. \end{DoxyCompactList}\item
const \mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}} \mbox{\hyperlink{classo_z_1_1_packet_a4919e1356309ad8c9d7595052d0ca498}{get\+Byte\+Array}} (void) const noexcept
\begin{DoxyCompactList}\small\item\em Get the Byte\+Array of the context (constant) \end{DoxyCompactList}\item
\mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} \mbox{\hyperlink{classo_z_1_1_packet_a89367cc491fdfdb6bf88eda9bc4eb219}{get\+Endpoint}} (void) const noexcept
\begin{DoxyCompactList}\small\item\em Get the current context\textquotesingle{}s endpoint. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classo_z_1_1_packet_a2bcd9f2d612cbc1b59a8b7c99d706908}{set\+Endpoint}} (const \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} endpoint) noexcept
\begin{DoxyCompactList}\small\item\em Set the \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} target. \end{DoxyCompactList}\item
\mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}} \mbox{\hyperlink{classo_z_1_1_packet_a65cfd7021de4eaf78f716143b82cd4a1}{get\+File\+Descriptor}} (void) const noexcept
\begin{DoxyCompactList}\small\item\em Get the context\textquotesingle{}s file descriptor. \end{DoxyCompactList}\item
void \mbox{\hyperlink{classo_z_1_1_packet_abf619a065ca7321c05fdcacc6353d47d}{set\+File\+Descriptor}} (const \mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}} fd) noexcept
\begin{DoxyCompactList}\small\item\em Set the context\textquotesingle{}s file descriptor. \end{DoxyCompactList}\item
bool \mbox{\hyperlink{classo_z_1_1_packet_abf9bd4979afb439272832d5a90f7d556}{has\+Encryption}} (void) const noexcept
\begin{DoxyCompactList}\small\item\em Check the usage of encryption port (used for H\+T\+T\+PS) \end{DoxyCompactList}\item
void \mbox{\hyperlink{classo_z_1_1_packet_a7c6fc3f9ca25adf83be8e7c1f5ae5b70}{set\+Encryption}} (const bool value) noexcept
\begin{DoxyCompactList}\small\item\em Set the encryption state. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classo_z_1_1_packet_a5c96f8d5db686e035b199e8aeb0e0cea}\label{classo_z_1_1_packet_a5c96f8d5db686e035b199e8aeb0e0cea}}
\index{oZ::Packet@{oZ::Packet}!Packet@{Packet}}
\index{Packet@{Packet}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{Packet()}{Packet()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily o\+Z\+::\+Packet\+::\+Packet (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}}

Construct a new \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object.

\mbox{\Hypertarget{classo_z_1_1_packet_a4affbe387050c6b67f4604f9eaadc074}\label{classo_z_1_1_packet_a4affbe387050c6b67f4604f9eaadc074}}
\index{oZ::Packet@{oZ::Packet}!Packet@{Packet}}
\index{Packet@{Packet}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{Packet()}{Packet()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily o\+Z\+::\+Packet\+::\+Packet (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}} \&\&}]{byte\+Array,  }\item[{const \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}}}]{endpoint,  }\item[{const \mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}}}]{fd = {\ttfamily -\/1} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

Construct a new \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object using byte\+Array and an endpoint.

\mbox{\Hypertarget{classo_z_1_1_packet_a01d80a0c452b1e07dfd160f494be2af5}\label{classo_z_1_1_packet_a01d80a0c452b1e07dfd160f494be2af5}}
\index{oZ::Packet@{oZ::Packet}!````~Packet@{$\sim$Packet}}
\index{````~Packet@{$\sim$Packet}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{$\sim$Packet()}{~Packet()}}
{\footnotesize\ttfamily o\+Z\+::\+Packet\+::$\sim$\+Packet (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [default]}}

Destroy the \mbox{\hyperlink{classo_z_1_1_packet}{Packet}} object.

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classo_z_1_1_packet_a8a5d791e4675a3f065928884b64fe7bf}\label{classo_z_1_1_packet_a8a5d791e4675a3f065928884b64fe7bf}}
\index{oZ::Packet@{oZ::Packet}!getByteArray@{getByteArray}}
\index{getByteArray@{getByteArray}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{getByteArray()}{getByteArray()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}}\& o\+Z\+::\+Packet\+::get\+Byte\+Array (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Get the Byte\+Array of the context.

\mbox{\Hypertarget{classo_z_1_1_packet_a4919e1356309ad8c9d7595052d0ca498}\label{classo_z_1_1_packet_a4919e1356309ad8c9d7595052d0ca498}}
\index{oZ::Packet@{oZ::Packet}!getByteArray@{getByteArray}}
\index{getByteArray@{getByteArray}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{getByteArray()}{getByteArray()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const \mbox{\hyperlink{namespaceo_z_abfa3f5a46e5c7584615dc1dd33fcafb6}{Byte\+Array}} o\+Z\+::\+Packet\+::get\+Byte\+Array (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Get the Byte\+Array of the context (constant)

\mbox{\Hypertarget{classo_z_1_1_packet_a89367cc491fdfdb6bf88eda9bc4eb219}\label{classo_z_1_1_packet_a89367cc491fdfdb6bf88eda9bc4eb219}}
\index{oZ::Packet@{oZ::Packet}!getEndpoint@{getEndpoint}}
\index{getEndpoint@{getEndpoint}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{getEndpoint()}{getEndpoint()}}
{\footnotesize\ttfamily \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} o\+Z\+::\+Packet\+::get\+Endpoint (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Get the current context\textquotesingle{}s endpoint.

\mbox{\Hypertarget{classo_z_1_1_packet_a65cfd7021de4eaf78f716143b82cd4a1}\label{classo_z_1_1_packet_a65cfd7021de4eaf78f716143b82cd4a1}}
\index{oZ::Packet@{oZ::Packet}!getFileDescriptor@{getFileDescriptor}}
\index{getFileDescriptor@{getFileDescriptor}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{getFileDescriptor()}{getFileDescriptor()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}} o\+Z\+::\+Packet\+::get\+File\+Descriptor (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Get the context\textquotesingle{}s file descriptor.

\mbox{\Hypertarget{classo_z_1_1_packet_abf9bd4979afb439272832d5a90f7d556}\label{classo_z_1_1_packet_abf9bd4979afb439272832d5a90f7d556}}
\index{oZ::Packet@{oZ::Packet}!hasEncryption@{hasEncryption}}
\index{hasEncryption@{hasEncryption}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{hasEncryption()}{hasEncryption()}}
{\footnotesize\ttfamily bool o\+Z\+::\+Packet\+::has\+Encryption (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Check the usage of encryption port (used for H\+T\+T\+PS)

\mbox{\Hypertarget{classo_z_1_1_packet_a7c6fc3f9ca25adf83be8e7c1f5ae5b70}\label{classo_z_1_1_packet_a7c6fc3f9ca25adf83be8e7c1f5ae5b70}}
\index{oZ::Packet@{oZ::Packet}!setEncryption@{setEncryption}}
\index{setEncryption@{setEncryption}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{setEncryption()}{setEncryption()}}
{\footnotesize\ttfamily void o\+Z\+::\+Packet\+::set\+Encryption (\begin{DoxyParamCaption}\item[{const bool}]{value }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Set the encryption state.

\mbox{\Hypertarget{classo_z_1_1_packet_a2bcd9f2d612cbc1b59a8b7c99d706908}\label{classo_z_1_1_packet_a2bcd9f2d612cbc1b59a8b7c99d706908}}
\index{oZ::Packet@{oZ::Packet}!setEndpoint@{setEndpoint}}
\index{setEndpoint@{setEndpoint}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{setEndpoint()}{setEndpoint()}}
{\footnotesize\ttfamily void o\+Z\+::\+Packet\+::set\+Endpoint (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}}}]{endpoint }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Set the \mbox{\hyperlink{classo_z_1_1_endpoint}{Endpoint}} target.

\mbox{\Hypertarget{classo_z_1_1_packet_abf619a065ca7321c05fdcacc6353d47d}\label{classo_z_1_1_packet_abf619a065ca7321c05fdcacc6353d47d}}
\index{oZ::Packet@{oZ::Packet}!setFileDescriptor@{setFileDescriptor}}
\index{setFileDescriptor@{setFileDescriptor}!oZ::Packet@{oZ::Packet}}
\subsubsection{\texorpdfstring{setFileDescriptor()}{setFileDescriptor()}}
{\footnotesize\ttfamily void o\+Z\+::\+Packet\+::set\+File\+Descriptor (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespaceo_z_acbb8d05709257b6414b3979597f88c0c}{File\+Descriptor}}}]{fd }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [noexcept]}}

Set the context\textquotesingle{}s file descriptor.

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
open\+Zia/\mbox{\hyperlink{_packet_8hpp}{Packet.\+hpp}}\end{DoxyCompactItemize}


text:
\documentclass[12pt]{article}
\usepackage{xcolor}
\usepackage{ctex}
\usepackage[paperwidth=185mm,paperheight=260mm,text={148mm,220mm},left=21mm,right=21mm,top=25.5mm]{geometry}

\newcommand{\Done}{{\color{magenta}(已完成)}}

\begin{document}

\begin{center}
  {\huge{\textbf{2018年人生目标和规划}}}
\end{center}
\par
半年时间转眼都过去了，想想自己这半年也没啥真正的收获。%
人也胖了，胖的都已经成为旁边的妹子和别人谈论的话资了，想想确实要减肥了。%
过去的这半年，总想学点什么，但是却又什么都没学到，剩下的这半年确实要规划下目标了。%

\section{科研方面}
\begin{itemize}
\item{完成第二篇小paper的发表，为自己毕业做好准备。\Done}%
\item{努力下，看是否能在粒子ratio问题上发个小文章。}%
\item{看看最近自己领域的热点，尝试切入到该方向。}
\item{出国，总听别人说外面的世界很精彩，希望自己也能去看看。\Done}%
\end{itemize}

\section{计算机视觉和图形学方面}
\begin{itemize}
\item{看完《计算机视觉：算法与应用》、《图像处理、分析与机器视觉》这两本理论书籍。}
\item{学习使用OpenCV库，并看完《learning OpenCV》这本书。}
\item{开始在arXiv和专业的计算机期刊上看别人发表的paper，看下别人在做什么，%
    并尝试完成自己所看书中的算法和别人文章中的算法。}
\end{itemize}

\section{程序方面}
\begin{itemize}
\item{掌握Qt的C++编程方式，完成一个小项目，项目定为HLMind思维导图工具。}
\item{看完和掌握《数据结构、算法与应用：C$++$语言描述》这本书，尝试看完《算法导论》这本书的一半章节。}
\item{有空勤翻翻《深入理解计算机系统》和《代码大全》这两本书。}
\end{itemize}

\section{生活方面}
\begin{itemize}
\item{减肥，减肥，减肥，重要的事情说三遍。45天之内减肥到140斤。}
\item{和女朋友去一个陌生的城市一起去旅游一次。}
\item{每周三次瑜伽锻炼，多参加球类运动。}
\item{省钱，还房贷。}
\end{itemize}

\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:


text:
\documentclass[%
12pt,
master,         % тип документа
natbib,         % использовать пакет natbib для "сжатия" цитирований
subf,           % использовать пакет subcaption для вложенной нумерации рисунков
href,           % использовать пакет hyperref для создания гиперссылок
colorlinks=true % цветные гиперссылки
%,fixint=false  % отключить прямые знаки интегралов
%,times         % шрифт Times как основной
]{disser}

% Original: left - 2.5, right - 1, baseline untouched
\renewcommand{\baselinestretch}{1.5}
\usepackage[
  a4paper, mag=1000,
  left=3cm, right=2cm, top=2cm, bottom=2cm, headsep=0.7cm, footskip=1cm
]{geometry}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
%\usepackage{tabularx,longtable}
\ifpdf\usepackage{epstopdf}\fi
% Номера страниц снизу и по центру
%\pagestyle{footcenter}
%\chapterpagestyle{footcenter}

\usepackage{xcolor}
\usepackage{listings}
\lstset{basicstyle=\ttfamily,
  showstringspaces=false,
%  commentstyle=\color{red},
%  keywordstyle=\color{blue}
}

% Точка с запятой в качестве разделителя между номерами цитирований
%\setcitestyle{semicolon}

% Использовать полужирное начертание для векторов
\let\vec=\mathbf

% Включать подсекции в оглавление
\setcounter{tocdepth}{2}

\graphicspath{{fig/}}

\begin{document}

% Переопределение стандартных заголовков
%\def\contentsname{Содержание}
%\def\conclusionname{Выводы}
%\def\bibname{Литература}

\institution{Министерство образования и науки Российской Федерации\\
			Московский физико-технический институт {\rm(государственный университет)}\\
			Факультет управления и прикладной математики\\
			Кафедра информатики}

% Имя лица, допускающего к защите (зав. кафедрой)
\apname{Петров Игорь Борисович}

\title{ДИССЕРТАЦИЯ\\[-14pt]на соискание ученой степени\\МАГИСТРА}

\topic{Разработка модели среды распределенных вычислений Evergrid для сравнения алгоритмов управления потоками задач и данных}

% Автор
\author       {Колеснев Роман Владимирович} % ФИО
\group        {073а} % Группа
\coursenum    {03.04.01} % Номер направления
\course       {Прикладные математика и физика}
\masterprognum{010956} % Номер магистерской программы
\masterprog   {Математические и информационные технологии}

% Научный руководитель
\sa      {Устюжанин Андрей Евгеньевич}
\sastatus{к.~ф.-м.~н., доцент}

% Рецензент
\rev      {Рыков Владимир Васильевич}
\revstatus{к.~л.~н., доцент}

% Город и год
\city{Москва}
\date{\number2016}

\maketitle

\tableofcontents
\input{intro}
\input{ch1}
\input{ch2}
\input{ch3}
\input{ch4}
\input{ch5}
\input{ch6}
% Заключение
\input{concl}

% Список литературы
\bibliography{thesis}
\bibliographystyle{gost705}

% Приложения
\appendix
%\input{app-a}

\end{document}


text:
\hypertarget{structhope_1_1loophole_1_1detail_1_1def__inserter}{}\doxysection{hope\+::loophole\+::detail\+::def\+\_\+inserter\texorpdfstring{$<$}{<} typename \texorpdfstring{$>$}{>} Struct Template Reference}
\label{structhope_1_1loophole_1_1detail_1_1def__inserter}\index{hope::loophole::detail::def\_inserter$<$ typename $>$@{hope::loophole::detail::def\_inserter$<$ typename $>$}}
\doxysubsection*{Friends}
\begin{DoxyCompactItemize}
\item
\mbox{\Hypertarget{structhope_1_1loophole_1_1detail_1_1def__inserter_aa9f407672457063fa48b43a48a2fec9a}\label{structhope_1_1loophole_1_1detail_1_1def__inserter_aa9f407672457063fa48b43a48a2fec9a}}
constexpr friend auto {\bfseries get\+\_\+impl} (\mbox{\hyperlink{structhope_1_1loophole_1_1detail_1_1def__inserter}{def\+\_\+inserter}})
\end{DoxyCompactItemize}

The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item
lib/hope/components/loophole.\+h\end{DoxyCompactItemize}


text:
\section{Abstract}
The Hopfield network is an important model for understanding the mechanisms behind associative memory, and is an important basis for many state-of-the-art methods in artifical neural networks. In this paper we utilize numerical and analytical methods to show how the Hopfield network with a Hebbian learning rule always converges toward a local equilibrium. By borrowing the concept of energy from physics, we will build an intuitve understanding for how the Hopfield network may be used to model associative memory.


text:
% http://www.recettes.qc.ca/recette/carres-aux-rice-krispies-3838

\preparationtime{15}

\cookingtime{5}

\macerationtime{30}

\totaltime{}

\portions{8}

\begin{ingredients}
    \item 40 guimauves
    \item 4 c. à soupe de beurre
    \item 1/2 c. à thé d'essence de vanille facultatif
    \item 6 tasses de céréale style Rice Krispies
\end{ingredients}

\begin{steps}
    \item Faire fondre le beurre dans une grande casserole.
    \item Ajouter les guimauves et bien remuer. Faire fondre jusqu'à ce que le mélange ait une consistance homogène. Retirer du feu pour ne pas brûler.
    \item Ajouter l'essence de vanille. Mélanger.
    \item Ajouter les céréales et bien mélanger.
    \item Beurrer un moule, d'environ 12 po (30 cm) de largeur. Plus le moule sera petit, plus les carrés seront hauts. Le moule peut être rond, carré ou avoir une autre forme.
    \item Bien tasser le mélange dans le moule à l'aide d'une spatule beurrée. Laisser refroidir 30 min au réfrigérateur.
\end{steps}


text:
\section{time Class Reference}
\label{classtime}\index{time@{time}}

System time interface.

{\ttfamily \#include $<$jerryscript\+\_\+h.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\textbf{ now} ()
\begin{DoxyCompactList}\small\item\em Get actual time in s. \end{DoxyCompactList}\item
\textbf{ now\+\_\+ms} ()
\begin{DoxyCompactList}\small\item\em Get actual time in ms. \end{DoxyCompactList}\item
\textbf{ str} (time\+\_\+d)
\begin{DoxyCompactList}\small\item\em Get actual U\+TC time string. \end{DoxyCompactList}\item
\textbf{ local\+\_\+str} (time\+\_\+d)
\begin{DoxyCompactList}\small\item\em Get actual system time string. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Detailed Description}
System time interface.

Definition at line 483 of file jerryscript\+\_\+h.\+h.

\subsection{Member Function Documentation}
\mbox{\label{classtime_a849383e572aadbebabadf4db9ce39702}}
\index{time@{time}!local\_str@{local\_str}}
\index{local\_str@{local\_str}!time@{time}}
\subsubsection{local\_str()}
{\footnotesize\ttfamily local\+\_\+str (\begin{DoxyParamCaption}\item[{time\+\_\+d}]{ }\end{DoxyParamCaption})}

Get actual system time string.

\begin{DoxyCode}{0}
\DoxyCodeLine{var time\_str;}
\DoxyCodeLine{time\_str = time.local\_str(time.now());}
\end{DoxyCode}

\begin{DoxyParams}{Parameters}
{\em \mbox{[}\+I\+N\mbox{]}} & time\+\_\+d \+: time I\+SO 8601 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
String time and date (Y\+Y\+Y\+Y-\/\+M\+M-\/\+DD H\+H\+:\+MM\+:SS)
\end{DoxyReturn}
\mbox{\label{classtime_a80593ccdc0339775ddd5d82c37ca4f6b}}
\index{time@{time}!now@{now}}
\index{now@{now}!time@{time}}
\subsubsection{now()}
{\footnotesize\ttfamily now (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Get actual time in s.

\begin{DoxyCode}{0}
\DoxyCodeLine{var time\_var;}
\DoxyCodeLine{time\_var = time.now();}
\end{DoxyCode}

\begin{DoxyParams}{Parameters}
{\em } & \\
\hline
\end{DoxyParams}
\mbox{\label{classtime_a94c9883e54d4b8ed4417920c65bd70dc}}
\index{time@{time}!now\_ms@{now\_ms}}
\index{now\_ms@{now\_ms}!time@{time}}
\subsubsection{now\_ms()}
{\footnotesize\ttfamily now\+\_\+ms (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}

Get actual time in ms.

\begin{DoxyCode}{0}
\DoxyCodeLine{var time\_var;}
\DoxyCodeLine{time\_var = time.now\_ms();}
\end{DoxyCode}

\begin{DoxyParams}{Parameters}
{\em } & \\
\hline
\end{DoxyParams}
\mbox{\label{classtime_a582e9110fc17ab45f9b815eadbe15c10}}
\index{time@{time}!str@{str}}
\index{str@{str}!time@{time}}
\subsubsection{str()}
{\footnotesize\ttfamily str (\begin{DoxyParamCaption}\item[{time\+\_\+d}]{ }\end{DoxyParamCaption})}

Get actual U\+TC time string.

\begin{DoxyCode}{0}
\DoxyCodeLine{var time\_str;}
\DoxyCodeLine{time\_str = time.str(time.now());}
\end{DoxyCode}

\begin{DoxyParams}{Parameters}
{\em \mbox{[}\+I\+N\mbox{]}} & time\+\_\+d \+: time I\+SO 8601 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
String time and date (Y\+Y\+Y\+Y-\/\+M\+M-\/\+DD H\+H\+:\+MM\+:SS)
\end{DoxyReturn}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
\textbf{ jerryscript\+\_\+h.\+h}\end{DoxyCompactItemize}


text:
\chapter{Background Information}
\label{ch:Background-Information}
This chapter serves predominantly to explain concepts and methods relevant to the research. This includes dimensionality reduction techniques, such as \glsentryfull{t-sne} and \glsentryfull{umap}, as well as our chosen clustering and forecasting techniques (\glsentryfull{hdbscan} and \glsentryfull{cnn-lstm} respectively). Most, if not all, of the information in this chapter might be considered prior knowledge to most readers but regardless may still suffice as a brisk refresher. Feel free to click \hyperref[ch:Exploratory-Data-Analysis]{here} if you would prefer to skip this chapter.

\section{Dimension Reduction}
\label{sec:Background-Information:Dimension-Reduction}
Depending on how we choose to transform our data set(s) each individual candidate day could be represented by feature vectors of up to 96 temporal dimensions, if not more when taking into consideration supplementary external variables. As a precursory step to our clustering algorithms we can make use of various manifold approximation techniques (such as \gls{t-sne} and \gls{umap} to project our data onto a feature space that is much lower in terms of the overall dimensionality thus allowing us to achieve visibly clearer clusters in terms of days that express high levels of similarity in their overall energy consumption patterns.

\subsection{t-Distributed Stochastic Neighbor Embedding}
\label{subsec:Background-Information:Dimension-Reduction:t-Distributed-Stochastic-Neighbor-Embedding}
\glsentryfull{t-sne}, proposed by \citet{Laurens}, is a statistical, or otherwise stochastic, method, that is utilized primarily for visualizing high-dimensional data. In principle, \gls{t-sne} works by giving each high-dimensional point in the data set a location in an easy-to-digest 2 or 3-dimensional map. In contrast to \gls{pca}, a well-known linear dimensionality reduction technique, \gls{t-sne} is a \textit{non-linear} technique for dimensionality reduction that allows for the separation of our data set in a manner that cannot be separated by any straight line. In order to keep things relatively simple, we can best understand how \gls{t-sne} works by breaking it down and providing an overview of the steps the algorithm undertakes.

\noindent \newline Let us take a data point, from a subset of \textit{N} total data points, $x_i$ in the original, high-dimensional space $R^D$ where D represents the dimensionality of said original space. A map point, $y_i$, that lies in the map space $R^2$ or, less commonly, $R^3$ represents one of our original points in a lower-dimensional mapping that serves as the final representation of our data. To preserve the global structure of the data set in this lower-dimensional space we first define a conditional \textit{similarity}, or conditional probability, that any point $x_i$ would pick another point $x_j$ as its neighbor if neighbors were picked in proportion to their probability density under a Gaussian distribution centered around $x_i$ with a given variance $\sigma^2_i$. This is defined by Equation \ref{eq:tSNE-1}.

\begin{equation}
    p_{j|i} = \frac{\exp\left(-\abs{x_i - x_j}^2 / 2\sigma^2_i\right)}{\sum_{k \neq i} \exp\left(-\abs{x_i - x_k}^2 / 2\sigma^2_i\right)}
\label{eq:tSNE-1}
\end{equation}

\noindent \newline The variance ($\sigma^2_i$) differs between points and is chosen in such a way that points in dense areas are given a smaller variance than points in sparse areas. This is introduced as the concept of \textit{Perplexity} within the realm of the \gls{t-sne} algorithm (determining optimal $\sigma$ for each point) and is defined as:

\begin{equation}
    \text{Perplexity} = 2^{-\sum_j p_{j|i} \log_2 p_{j|i}}
\label{eq:tSNE-2}
\end{equation}

\noindent \newline \textit{Similarity} is the defined as a symmetrized version of the previously defined conditional probability in Equation \ref{eq:tSNE-1}:

\begin{equation}
    p_{ij} = \frac{p_{i|j} + p_{j|i}}{2N}
\label{eq:tSNE-3}
\end{equation}

\noindent \newline Equation \ref{eq:tSNE-3} provides us with a similarity matrix for our original data set that represents the similarity between all of our data points as they lie in their original, high-dimensional space. We then define a similarity matrix for the points that lie on the mapping space as such:

\begin{equation}
    q_{ij} = \frac{\left(1 + \abs{y_i - y_j}^2\right)^{-1}}{\sum_{k \neq i}\left(1 + \abs{y_k - y_i}^2\right)^{-1}}
\label{eq:tSNE-4}
\end{equation}

\noindent \newline The goal then is to minimize the differences between the 2 similarity matrices in order to achieve a good overall representation of our data points in the lower-dimensional, mapping space. To do this the \gls{t-sne} algorithm minimizes the Kullback-Leiber divergence between the 2 distributions $p_{ij}$ and $q_{ij}$:

\begin{equation}
    \text{KL}(P\|Q) = \sum_{ij} p_{ij} \log \frac{p_{ij}}{q_{ij}}
\label{eq:tSNE-5}
\end{equation}

\noindent \newline This \textit{score} is minimized by performing a gradient descent that can be computed analytically and, in essence, represents the magnitude of the pull between data points in our lower-dimensional, mapping space as well as the direction of said pull:

\begin{equation}
    \frac{\partial \text{KL}}{\partial y_i} = 4 \sum_j (p_{ij} - q_{ij})(y_i - y_j)\left(1 + \abs{y_i - y_j}^2\right)^{-1}
\label{eq:tSNE-6}
\end{equation}

\noindent \newline The choice of using the so-called t-Student (or Cauchy) distribution, as seen in Equation \ref{eq:tSNE-4}, for the map points as opposed to the Gaussian distribution used for the original data points is to alleviate the \textit{crowding problem}. This problem is defined in the original paper as follows -- "the area of the two-dimensional map that is available to accommodate moderately distant data points will not be nearly large enough compared with the area available to accommodate nearby data points".

\begin{figure}[H]
    \centering
    \includegraphics[width=\textwidth]{Images/Chapter 3/t-SNE/t-SNE-Illustration-1.pdf}
    \caption{Overlapping both a Gaussian distribution and the t-Student, or Cauchy, distribution. Note the heavy tails on the t-Student distribution.}
    \label{fig:t-SNE-Illustration}
\end{figure}

\noindent \newline In essence, using the same Gaussian distribution for the original data points and the map points would lead to an imbalance in the distribution of the distances of a point's neighbors due to the fact that the distribution of the distances varies vastly between high-dimensional spaces and low-dimensional spaces. By using the t-Student distribution, points close in the high-dimensional, original space get even closer in the lower-dimensional, mapping space while points that are further away from each other in the high-dimensional, original space get even further in the lower-dimensional, mapping space. The differences between both distributions can be seen in Figure \ref{fig:t-SNE-Illustration}.

\noindent \newline To round things off, we note that the \gls{t-sne} algorithm is heavily reliant on the hyperparameters chosen on initialization (predominantly with respect to the chosen value for \textit{perplexity}) and, as it is a stochastic algorithm, different runs performed on the same data set will produce different, albeit similar, results. Furthermore, standard deviations between clusters (or cluster size in terms of bounding box measurements) are not representative of the relative sizes of the actual clusters and generally mean nothing. Finally, distances between clusters in the mapping space does not always give us a good sense of the global geometry -- that is, in the sense that distance between clusters may (or may not) mean anything significant.

\subsubsection{Uniform Manifold Approximation and Projection}
\label{subsec:Background-Information:Dimension-Reduction:t-Distributed-Stochastic-Neighbor-Embedding:Uniform-Manifold-Approximation-and-Projection}
Although \gls{t-sne} is fine to use as a dimensionality reduction technique it is predominantly cited as a visualization heuristic. Interpreting the resulting map obtained from performing or otherwise executing the algorithm must generally be done with some measure of caution. A novel algorithm proposed by \citet{UMAP}, and aptly named \glsentryfull{umap} claims to be competitive with \gls{t-sne} in terms of visualization quality and argues that it preserves more of the global structure present in the data while being superior in terms of run time  performance (\eg taking a mere 3 minutes to project the 784-dimensional, 70,000 point MNIST data set in contrast to the 45 minutes it would take for the \gls{t-sne} algorithm \cite{UMAP2}). Given the novelty of the algorithm, it lacks the rigorous testing and mathematical analysis that its counterpart, the \gls{t-sne} algorithm, is subject to. Nonetheless, we will be making use of the \gls{umap} algorithm for the purpose of this project and refer the reader to the original paper located \href{https://arxiv.org/abs/1802.03426}{here} \cite{UMAP} to better understand the core concepts of the algorithm as well as what differentiates it from the \gls{t-sne} algorithm.

\noindent \newline At its core, \gls{umap} works very similarly to the \gls{t-sne} algorithm. The biggest difference between the output of the \gls{umap} algorithm in comparison to the output of the \gls{t-sne} algorithm is the balance between local as well as global structure. Given that the authors of the \gls{umap} algorithm claim that it is often better at preserving global structure in the final projection in comparison to the \gls{t-sne} algorithm, it is safe to assume that inter-cluster relations are probably more meaningful than the projections made by the \gls{t-sne} algorithm. This preservation of global structure when running both algorithms under a similar set of hyperparameters can be seen in Figure \ref{fig:UMAP-Illustration}

\begin{figure}[H]
    \centering
    \includegraphics[width=0.85\textwidth]{Images/Chapter 3/t-SNE/UMAP-Illustration.pdf}
    \caption{Illustrating how the \gls{umap} algorithm captures more of the global structure in a sample data set (Mammoth data set). Image source: \cite{Wang2}, licensed under CC BY-SA 4.0.}
    \label{fig:UMAP-Illustration}
\end{figure}

\clearpage

\section{Clustering Algorithms}
\label{sec:Background-Information:Clustering-Algorithms}
Throughout the duration of this project we will be making use of the \gls{hdbscan} clustering algorithm. This section serves to both introduce readers to the \gls{dbscan} algorithm that precedes \gls{hdbscan} as well as provide a high-level, intuitive explanation of both algorithms so that we may better understand the differences between them.

\subsection{DBSCAN}
\label{subsec:Background-Information:Clustering-Algorithms:DBSCAN}
\glsentryfull{dbscan}, proposed by \citet{Ester}, is a non-parametric data clustering algorithm that works on the principle of grouping together points that are closely packed together (\ie located in high-density regions) while marking points that lie alone in low-density regions as outliers. This allows the \gls{dbscan} algorithm to find arbitrarily shaped clusters while also rendering it robust to noise present in the data. Furthermore, the \gls{dbscan} algorithm does not require us to specify, or otherwise know ahead of time, the number of clusters that our data contains and instead automatically determines this number based on the input data as well as the hyperparameters passed to the algorithm on its initialization. This leads us to the very first downside associated with the \gls{dbscan} algorithm and that is that it is \textit{exceptionally} sensitive to hyperparameter selection and thus it is imperative to have a solid grasp on the understanding of said hyperparameters so as to obtain ideal and meaningful results.

\noindent \newline The \gls{dbscan} algorithm classifies points in a feature space as either core points, density-reachable points, and outliers. To best understand how this is done we must first define the two hyperparameters that are essential to the initialization of the algorithm. The first, and arguably, most important hyperparameter is labeled $\epsilon$ and defines the maximum distance between two points or, in other words, the radius of a neighborhood with respect to a point. The second hyperparameter is aptly titled \textit{minPts} ($m_{pts}$) and represents the minimum number of points that must be within distance $\epsilon$ of a point to define it as a \textit{core} point. If a point does not contain the minimum number of points within its neighborhood to define it as a core point but \textit{is} within distance $\epsilon$ from a core point then we consider it a \textit{density-reachable point} and it belongs to the cluster. Any points that cannot be reached from any other point are considered outliers or noise points. In essence, any core point forms a cluster together with all points (core or not) that are within distance $\epsilon$ from said core point. Non-core points cannot be used to reach more points and belong to the \textit{"edge"} of the cluster. The pseudocode in Listing \ref{lst:DBSCAN} below depicts an explanation of how this process works.

\noindent \newline \begin{lstlisting}[float=hbt!, frame=tb, caption={The \gls{dbscan} algorithm.},label=lst:DBSCAN]
DBSCAN(D, eps, minPts)
    C = 0
    foreach unvisited point P in dataset D
        P = visited
        neighborPts_P = queryNeighborhood(P, eps)
        if(neighborPts < minPts)
            P = noise
        else
            C = C + 1
            expandCluster(P, neighborPts, C, eps, minPts)

expandCluster(P, neighborPts, C, eps, minPts)
    add P to C
    foreach point Q in neighborPts_P
        if Q = unvisited
            Q = visited
            neighborPts_Q = queryNeighborhood(Q, eps)
            if(neighborPts_Q >=  minPts)
                join(neighborPts_Q, neighborPts_P)
        else
            add Q to C

queryNeighborhood(P, eps)
    return all points within distance eps to P
\end{lstlisting}

\noindent To round things off, we present the main advantages and disadvantages of the \gls{dbscan} algorithm:

\begin{itemize}
    \pro No prior knowledge of the number of clusters is required.
    \pro Can find arbitrarily shaped clusters.
    \pro Contains the notion of noise and outliers.
    \pro Only two hyperparameters need to be set.
    \con Reliant on the distance metric being used.
    \con Choosing a meaningful distance threshold can be quite difficult if the data and scale are not well understood.
\end{itemize}

\begin{figure}[H]
    \centering
    \includegraphics[width=\textwidth]{Images/Chapter 3/DBSCAN/DBSCAN-Illustration.pdf}
    \caption{Depiction of the \gls{dbscan} algorithm at work with minPts set to 4. Here, point A, as well as the other red points, are core points as the area surrounding these points in a radius $\epsilon$ contains at least 4 points (including the point itself). Points B and C are reachable from A through other core points and as a result can be considered density-reachable points. The cluster is made up of the core points as well as points B and C. Point N is neither a core point and cannot be reached through any of the core points and so is considered an outlier. Image source: \cite{Wikipedia_DBSCAN}, licensed under CC BY-SA 3.0.}
    \label{fig:DBSCAN-Illustration}
\end{figure}

\subsection{HDBSCAN}
\label{subsec:Background-Information:Clustering-Algorithms:HDBSCAN}
\glsentryfull{hdbscan}, proposed by \citet{Campello}, is a hierarchical non-parametric clustering algorithm that was designed to overcome the main limitations of \gls{dbscan}. The most substantial changes come in the form of no longer explicitly needing to predefine a value for the distance threshold $\epsilon$. Instead, \gls{hdbscan} generates a complete density-based clustering hierarchy over variable densities from which we can extract a simplified hierarchy composed only of the most significant clusters in our data. Without delving deep into the concepts of cluster stability, minimum spanning trees and hierarchy construction we instead refer the reader to the detailed explanation in the literature \cite{Campello} and leave off with Figure \ref{fig:HDBSCAN-Illustration} that does well to illustrate how \gls{hdbscan} works as a hierarchical clustering algorithm.

\begin{figure}[H]
        \begin{adjustwidth}{-3.0cm}{-3.0cm}%
                \myfloatalign
                \subfloat[\gls{hdbscan} clustering applied in the case of 3 clusters.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-1.1.pdf}
                        \label{fig:HDBSCAN-Illustration-1.1}
                } \quad
                \subfloat[\gls{hdbscan} clustering applied in the case of 2 clusters.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-2.1.pdf}
                        \label{fig:HDBSCAN-Illustration-2.1}
                } \quad
                \subfloat[Cluster hierarchy of \ref{fig:HDBSCAN-Illustration-1.1}.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-1.2.pdf}
                        \label{fig:HDBSCAN-Illustration-1.2}
                } \quad
                \subfloat[Cluster hierarchy of \ref{fig:HDBSCAN-Illustration-2.1}.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-2.2.pdf}
                        \label{fig:HDBSCAN-Illustration-2.2}
                } \quad
                \subfloat[Density landscape of \ref{fig:HDBSCAN-Illustration-1.1}.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-1.4.pdf}
                        \label{fig:HDBSCAN-Illustration-1.4}
                } \quad
                \subfloat[Density landscape of \ref{fig:HDBSCAN-Illustration-2.1}.]
                {
                        \includegraphics[width=0.7\textwidth]{Images/Chapter 3/HDBSCAN/HDBSCAN-Illustration-2.4.pdf}
                        \label{fig:HDBSCAN-Illustration-2.4}
                } \quad
                \caption{An illustration of the hierarchical aspects of the \gls{hdbscan} algorithm. In layman's terms, when presented with the density landscape the \gls{hdbscan} algorithm decides whether peaks of a mountain are part of the same mountain or whether they belong to different mountains where each of these mountains represent a cluster. When multiple peaks represent multiple mountains the sum of their respective volumes tends to be larger than the volume of their base. The opposite is true for when multiple peaks are just features of a singular mountain.}
                \label{fig:HDBSCAN-Illustration}
        \end{adjustwidth}
\end{figure}

\clearpage

\section{Forecasting Models}
\label{sec:Background-Information:Forecasting-Models}
The primary forecasting model that we will be utilizing in our forecasting pipeline is a hybrid \gls{cnn-lstm} network. This section serves to introduce readers to both the \gls{cnn} component as well as the \gls{lstm} component of this network.

\subsection{Convolutional Neural Networks}
\label{subsec:Background-Information:Forecasting-Models:Convolutional-Neural-Networks}
\glsentryfullpl{cnn} first truly started gaining traction in the 1990s when \citet{LeCun} demonstrated that a \gls{cnn} which aggregates simple features into progressively more complex features can be successfully used for the task of recognizing handwritten characters. Since then, their relevance has become more and more widespread with applications in image and video classification, natural language processing \cite{Collobert}, and when working with time series data sets \cite{Tsantekidis}. The following sections will briefly outline key points of the inner machinations of key \gls{cnn} components.


text:
\hypertarget{class_p_h_p_unit___util___configuration_generator}{}\section{P\+H\+P\+Unit\+\_\+\+Util\+\_\+\+Configuration\+Generator Class Reference}
\label{class_p_h_p_unit___util___configuration_generator}\index{P\+H\+P\+Unit\+\_\+\+Util\+\_\+\+Configuration\+Generator@{P\+H\+P\+Unit\+\_\+\+Util\+\_\+\+Configuration\+Generator}}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
/\+Applications/\+X\+A\+M\+P\+P/xamppfiles/htdocs/\+Code\+Igniter/vendor/phpunit/phpunit/src/\+Util/\mbox{\hyperlink{_configuration_generator_8php}{Configuration\+Generator.\+php}}\end{DoxyCompactItemize}


text:
\documentclass{resume}

\usepackage[left=0.75in,top=0.6in,right=0.75in,bottom=0.6in]{geometry}

\name{Hankyul Kim}
\address{ 800 Park Ave, APT 3310 \\ Fort Lee, NJ 07024 }
\address{ 617~$\cdot$~417~$\cdot$~3657 \\ hank.kim@outlook.com }

\def\nameskip{\bigskip}
\def\sectionskip{\medskip}

\begin{document}

  \begin{rSection}{Experience}

    \begin{rSubsection}{Flatiron Health}{January 2021 - Present}{Senior Quantitative Data Analyst}{New York, NY}
    \item Perform statistical analysis and data quality control for data development
    \item Provide analytic guidance to clients for data analysis
    \item Develop and contribute to internal R packages for data wrangling and analysis
    \item Scale growth in team's project delivery by contributing to SOP and efficient and modular programming practices
    \item Mentor new analysts during onboarding
    \end{rSubsection}

    \begin{rSubsection}{Evidera, PPD}{June 2017 - January 2021}{Data Analyst}{Waltham, MA}
    \item Performed statistical analysis / modeling using SAS, PySpark, and R for Real World Evidence projects
    \item Assisted client scientists in writing analysis plans, manuscripts, and poster presentation
    \item Developed Spotfire dashboards for clients to analyze multi-country chart review data
    \item Mentored other analysts and drafted training documents for analytics procedures
    \end{rSubsection}

    \begin{rSubsection}{Winship Cancer Institute}{June 2016 - June 2017}{Graduate Research Fellow}{Atlanta, GA}
    \item Used linear mixed models to analyze changes in health-related quality of life among localized prostate cancer patients using the SEER-Medicare Health Outcomes Survey dataset
    \item Wrote literature review on treatment choices among prostate cancer patients
    \item Presented 2 abstracts at the America Urological Association Meetings as first author
    \end{rSubsection}

    \begin{rSubsection}{Republic of Korea Army}{July 2010 - April 2012}{Sergeant}{Wonju, South Korea}
    \item Led a 20-men squad as sergeant squad leader
    \item Directed new recruits in military trainings
    \item Drafted reports and presentations for commanders' briefings during military exercises
    \end{rSubsection}
  \end{rSection}

  \begin{rSection}{Education}
    {\bf Emory University} \hfill {\em May 2017} \\
    { M.S.P.H. in Health Services Research} \\

    {\bf Emory University} \hfill {\em May 2015} \\
    { B.A. in Economics \& Mathematics}
  \end{rSection}

  \begin{rSection}{Skills}
    \begin{tabular}{ @{} >{\bfseries}l @{\hspace{6ex}} l }
      Computer Languages & R, Python, SQL, SAS \\
      Databases & PostgreSQL, AWS, Snowflake\\
      Tools & Git, Vim
    \end{tabular}
  \end{rSection}

\end{document}


text:
\documentclass[preview]{standalone}
\usepackage[UTF8]{ctex}

\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage{amssymb}
\usepackage{dsfont}
\usepackage{setspace}
\usepackage{tipa}
\usepackage{relsize}
\usepackage{textcomp}
\usepackage{mathrsfs}
\usepackage{calligra}
\usepackage{wasysym}
\usepackage{ragged2e}
\usepackage{physics}
\usepackage{xcolor}
\usepackage{microtype}
%\DisableLigatures{encoding = *, family = * }

\usepackage{centernot}
\usepackage{mathtools}
\usepackage{tipa}
\usepackage{bm}
\newcommand{\C}{\mathbb C} % complex numbers
\newcommand{\cC}{\overline{\mathbb C}} % Riemann sphere
\newcommand{\R}{\mathbb R} % real numbers
\renewcommand{\d}{\,\mathrm{d}} % differential
\newcommand{\with}{\,:\,}
\newcommand{\eps}{\varepsilon}
\newcommand{\wto}{\overset{*}{\rightarrow}}
\newcommand{\const}{\mathrm{const.}}
\renewcommand{\i}{\mathrm{i}}
\newcommand{\e}{\mathrm{e}}

\makeatletter
\newcommand{\cemph}[1]{\@tfor\i:=#1\do{\textsubdot{\i}}}
\makeatother

\linespread{1}

\begin{document}

\begin{align*}
{{{^6\over6!}}}+
\end{align*}

\end{document}


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% Simple LaTeX CV Template %%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE: If you find that it says                                     %%
%%                                                                    %%
%%                           1 of ??                                  %%
%%                                                                    %%
%% at the bottom of your first page, this means that the AUX file     %%
%% was not available when you ran LaTeX on this source. Simply RERUN  %%
%% LaTeX to get the ``??'' replaced with the number of the last page  %%
%% of the document. The AUX file will be generated on the first run   %%
%% of LaTeX and used on the second run to fill in all of the          %%
%% references.                                                        %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Don't like 10pt? Try 11pt or 12pt
\documentclass[10pt]{article}
\RequirePackage[T1]{fontenc}

% LaTeX will typeset using Computer Modern Roman, which a lot of
% non-mathematicians and non-engineers won't like. Also, a few PDF
% viewers may not render CMR very well. Instead, Times New Roman can
% be used. That's what this package does.
%\usepackage{times}
\usepackage{lmodern}

% The automated optical recognition software used to digitize resume
% information works best with fonts that do not have serifs. This
% command uses a sans serif font throughout. Uncomment both lines (or at
% least the second) to restore a Roman font (i.e., a font with serifs).
% (NOTE: This requires the times package above)
%\renewcommand{\familydefault}{\sfdefault}

% This is a helpful package that puts math inside length specifications
\usepackage{calc}

% This package helps LaTeX auto-hyphenate hyphenated words if you use
% special hyphens. For example, bio\-/mimicry will properly hyphenate
% ``mimicry'' if necessary.
\usepackage[shortcuts]{extdash}

% Layout: Puts the section titles on left side of page
\reversemarginpar

%
%         PAPER SIZE, PAGE NUMBER, AND DOCUMENT LAYOUT NOTES:
%
% The next \usepackage line changes the layout for CV style section
% headings as marginal notes. It also sets up the paper size as either
% letter or A4. By default, letter was used. If A4 paper is desired,
% comment out the letterpaper lines and uncomment the a4paper lines.
%
% As you can see, the margin widths and section title widths can be
% easily adjusted.
%
% ALSO: Notice that the includefoot option can be commented OUT in order
% to put the PAGE NUMBER *IN* the bottom margin. This will make the
% effective text area larger.
%
% IF YOU WISH TO REMOVE THE ``of LASTPAGE'' next to each page number,
% see the note about the +LP and -LP lines below. Comment out the +LP
% and uncomment the -LP.
%
% IF YOU WISH TO REMOVE PAGE NUMBERS, be sure that the includefoot line
% is uncommented and ALSO uncomment the \pagestyle{empty} a few lines
% below.
%

%% Use these lines for letter-sized paper
\usepackage[paper=letterpaper,
            %includefoot, % Uncomment to put page number above margin
            marginparwidth=1.2in,     % Length of section titles
            marginparsep=.05in,       % Space between titles and text
            margin=0.75in,            % 0.75 inch margins
            includemp]{geometry}

%% Use these lines for A4-sized paper
%\usepackage[paper=a4paper,
%            %includefoot, % Uncomment to put page number above margin
%            marginparwidth=30.5mm,    % Length of section titles
%            marginparsep=1.5mm,       % Space between titles and text
%            margin=25mm,              % 25mm margins
%            includemp]{geometry}

%% More layout: Get rid of indenting throughout entire document
\setlength{\parindent}{0in}

% Provides special list environments and macros to create new ones
\usepackage[shortlabels]{enumitem}

% Simpler bibsections for CV sections
% (thanks to natbib for inspiration)
%
% * For lists of references with hanging indents and no numbers:
%
%   \begin{bibsection}
%       \item ...
%   \end{bibsection}
%
% * For numbered lists of references (with hanging indents):
%
%   \begin{bibenum}
%       \item ...
%   \end{bibenum}
%
%   Note that bibenum numbers continuously throughout. To reset the
%   counter, use
%
%   \restartlist{bibenum}
%
%   at the place where you want the numbering to reset.

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newlist{bibsection}{itemize}{3}
\setlist[bibsection]{label=,leftmargin=\bibhang,%
        itemindent=-\bibhang,
        itemsep=\bibsep,parsep=\z@,partopsep=0pt,
        topsep=0pt}
\newlist{bibenum}{enumerate}{3}
\setlist[bibenum]{label=[\arabic*],resume,leftmargin={\bibhang+\widthof{[999]}},%
        itemindent=-\bibhang,
        itemsep=\bibsep,parsep=\z@,partopsep=0pt,
        topsep=0pt}
\let\oldendbibenum\endbibenum
\def\endbibenum{\oldendbibenum\vspace{-.6\baselineskip}}
\let\oldendbibsection\endbibsection
\def\endbibsection{\oldendbibsection\vspace{-.6\baselineskip}}
\makeatother

\usepackage{etaremune}

\newenvironment{bibenum*}
  {\renewcommand\labelenumi{[\theenumi]}%
   \etaremune[
     topsep=0pt,
     itemsep=\bibsep,
     parsep=0pt,partopsep=0pt,
     itemindent=-\bibhang,
     leftmargin={\bibhang+\widthof{[999]}}]}
  {\endetaremune}

%% Reference the last page in the page number
%
% NOTE: comment the +LP line and uncomment the -LP line to have page
%       numbers without the ``of ##'' last page reference)
%
% NOTE: uncomment the \pagestyle{empty} line to get rid of all page
%       numbers (make sure includefoot is commented out above)
%
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
%\pagestyle{empty}      % Uncomment this to get rid of page numbers
\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset{\marginparsep+\marginparwidth}
\newlength{\footpageshift}
\setlength{\footpageshift}
          {0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}
\lfoot{\hspace{\footpageshift}%
       \parbox{4in}{\, \hfill %
                    \arabic{page} of \protect\pageref*{LastPage} % +LP
%                    \arabic{page}                               % -LP
                    \hfill \,}}

% Finally, give us PDF bookmarks
\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
\hypersetup{colorlinks,breaklinks,
            linkcolor=darkblue,urlcolor=darkblue,
            anchorcolor=darkblue,citecolor=darkblue}

%%%%%%%%%%%%%%%%%%%%%%%% End Document Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%% Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%% HEADING AT TOP OF CURRICULUM VITAE

% The title (name) with a horizontal rule under it
% (optional argument typesets an object right-justified across from name
%  as well)
%
% Usage: \makeheading{name}
%        OR
%        \makeheading[right_object]{name}
%
% Place at top of document. It should be the first thing.
% If ``right_object'' is provided in the square-braced optional
% argument, it will be right justified on the same line as ``name'' at
% the top of the CV. For example:
%
%       \makeheading[\emph{Curriculum vitae}]{Your Name}
%
% will put an emphasized ``Curriculum vitae'' at the top of the document
% as a title. Likewise, a picture could be included:
%
%   \makeheading[{\includegraphics[height=1.5in]{my_picture}}]{Your Name}
%
% the picture will be flush right across from the name. For this example
% to work, make sure the extra set of curly braces is included. Also
% makes ure that \usepackage{graphicx} is somewhere in the preamble.
\newcommand{\makeheading}[2][]%
        {\hspace*{-\marginparsep minus \marginparwidth}%
         \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
             {\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
                 \rule{\columnwidth}{1pt}%
         \end{minipage}}

%%% SECTION HEADINGS

% The section headings. Flush left in small caps down pseudo-margin.
%
% Usage: \section{section name}
\renewcommand{\section}[1]{\pagebreak[3]%
    \vspace{1.3\baselineskip}%
    \phantomsection\addcontentsline{toc}{section}{#1}%
    \noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
    \vspace{-\baselineskip}\par}

%%% LISTS

% This macro alters a list by removing some of the space that follows the list
% (is used by lists below)
\newcommand*\fixendlist[1]{%
    \expandafter\let\csname preFixEndListend#1\expandafter\endcsname\csname end#1\endcsname
    \expandafter\def\csname end#1\endcsname{\csname preFixEndListend#1\endcsname\vspace{-0.6\baselineskip}}}

% These macros help ensure that items in outer-type lists do not get
% separated from the next line by a page break
% (they are used by lists below)
\let\originalItem\item
\newcommand*\fixouterlist[1]{%
    \expandafter\let\csname preFixOuterList#1\expandafter\endcsname\csname #1\endcsname
    \expandafter\def\csname #1\endcsname{\let\oldItem\item\def\item{\pagebreak[2]\oldItem}\csname preFixOuterList#1\endcsname}
    \expandafter\let\csname preFixOuterListend#1\expandafter\endcsname\csname end#1\endcsname
    \expandafter\def\csname end#1\endcsname{\let\item\oldItem\csname preFixOuterListend#1\endcsname}}
\newcommand*\fixinnerlist[1]{%
    \expandafter\let\csname preFixInnerList#1\expandafter\endcsname\csname #1\endcsname
    \expandafter\def\csname #1\endcsname{\let\oldItem\item\let\item\originalItem\csname preFixInnerList#1\endcsname}
    \expandafter\let\csname preFixInnerListend#1\expandafter\endcsname\csname end#1\endcsname
    \expandafter\def\csname end#1\endcsname{\csname preFixInnerListend#1\endcsname\let\item\oldItem}}

% An itemize-style list with lots of space between items
%
% Usage:
%   \begin{outerlist}
%       \item ...    % (or \item[] for no bullet)
%   \end{outerlist}
\newlist{outerlist}{itemize}{3}
    \setlist[outerlist]{label=\enskip\textbullet,leftmargin=*}
    \fixendlist{outerlist}
    \fixouterlist{outerlist}

% An environment IDENTICAL to outerlist that has better pre-list spacing
% when used as the first thing in a \section
%
% Usage:
%   \begin{lonelist}
%       \item ...    % (or \item[] for no bullet)
%   \end{lonelist}
\newlist{lonelist}{itemize}{3}
    \setlist[lonelist]{label=\enskip\textbullet,leftmargin=*,partopsep=0pt,topsep=0pt}
    \fixendlist{lonelist}
    \fixouterlist{lonelist}

% An itemize-style list with little space between items
%
% Usage:
%   \begin{innerlist}
%       \item ...    % (or \item[] for no bullet)
%   \end{innerlist}
\newlist{innerlist}{itemize}{3}
    \setlist[innerlist]{label=\enskip\textbullet,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt}
    \fixinnerlist{innerlist}

% An environment IDENTICAL to innerlist that has better pre-list spacing
% when used as the first thing in a \section
%
% Usage:
%   \begin{loneinnerlist}
%       \item ...    % (or \item[] for no bullet)
%   \end{loneinnerlist}
\newlist{loneinnerlist}{itemize}{3}
    \setlist[loneinnerlist]{label=\enskip\textbullet,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt}
    \fixendlist{loneinnerlist}
    \fixinnerlist{loneinnerlist}

%%% EXTRA SPACE

% To add some paragraph space between lines.
% This also tells LaTeX to preferably break a page on one of these gaps
% if there is a needed pagebreak nearby.
\newcommand{\blankline}{\quad\pagebreak[3]}
\newcommand{\halfblankline}{\quad\vspace{-0.5\baselineskip}\pagebreak[3]}

%%% FORMATTING MACROS

% Provides a linked \doi{#1} that links doi:#1 to http://dx.doi.org/#1
\usepackage{doi}
% To change the text before the DOI, adjust this command
%\renewcommand\doitext{doi:}

% New command for PMIDs
\newcommand{\pmid}[1]{PMID:\href{https://www.ncbi.nlm.nih.gov/pubmed/#1}{#1}}

% Provides a linked \url{#1} that doesn't require escape characters
\usepackage{url}

% You can adjust the style \url{} uses here:
% (options are: same, rm, sf, tt; defaults to tt)
\urlstyle{same}

% For \email{ADDRESS}, links ADDRESS to the url mailto:ADDRESS
% (uncomment to typeset the e\-/mail address in typewriter font;
%  otherwise, will be typeset in the \urlstyle above)
%\DeclareUrlCommand\emaillink{\urlstyle{tt}}
\providecommand*\emaillink[1]{\nolinkurl{#1}}
\providecommand*\email[1]{\href{mailto:#1}{\emaillink{#1}}}

\providecommand\BibTeX{{B\kern-.05em{\sc i\kern-.025em b}\kern-.08em \TeX}}
\providecommand\Matlab{\textsc{Matlab}}

% Custom hyphenation rules for words that LaTeX has trouble with
\hyphenation{bio-mim-ic-ry bio-in-spi-ra-tion re-us-a-ble pro-vid-er Media-Wiki}

%%%%%%%%%%%%%%%%%%%%%%%% End Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%% Begin CV Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\makeheading[\emph{Curriculum vitae}]{\href{https://alvingthomas.com}{Alvin G. Thomas}}

\section{Contact Information}

% NOTE: Mind where the & separators and \\ breaks are in the following
%       table. Table is one row made up of three parboxes. The left
%       parbox has address info, the middle parbox has a vertical bar,
%       and the right parbox has phone and electronic contact
%       information.
%
% MACROS: \rcollength is the width of the right column of the table
%             (adjust it to your liking; default is 1.85in).
%         \spacewidth is width of area between left and right boxes.
%
\newlength{\rcollength}\setlength{\rcollength}{1.85in}%
\newlength{\spacewidth}\setlength{\spacewidth}{20pt}
%
\begin{tabular}[t]{@{}p{\textwidth-\rcollength-\spacewidth}@{}p{\spacewidth}@{}p{\rcollength}}%

% Address box
\parbox{\textwidth-\rcollength-\spacewidth}{%
%Assistant Professor\\
\href{https://sph.unc.edu/}{The University of North Carolina at Chapel Hill}\\
\href{https://sph.unc.edu/epid/epidemiology-landing/}{School of Public Health, Department of Epidemiology}\\
123 West Franklin Street, Suite 410 \\
Chapel Hill, NC 27516  USA}

&
% Uncomment to add a vertical bar in middle of contact information
%{\vrule width 0.5pt}
\parbox[m][5\baselineskip]{\spacewidth}{} &

% Non-snail-mail contact information
\parbox{\rcollength}{%
\textit{E-mail:} \email{alvin@unc.edu}\\
\textit{Github:} \href{https://github.com/alvinthomas/}{alvinthomas}\\
\textit{Twitter:} \href{https://twitter.com/alvinthomas13}{@alvinthomas13}\\
\textit{LinkedIn:} \href{https://www.linkedin.com/in/alvinthomas13}{@alvinthomas13}}

\end{tabular}

%%
%% In modern CV's, it seems like ``Objective'' is frowned upon. Instead,
%% incorporate it into a well-constructed cover letter. The ``More
%% information'' can go at the end of the CV, but it should not distract
%% from the section giving references available to contact.
%%
%
% \section{Objective}
%
% Placement in an academic position (i.e., faculty, postdoctoral, or
% research scientist) that allows for advanced research in distributed
% complex adaptive systems (i.e., modeling, analysis, design, and
% verification) with a particular focus on the control of engineered
% agents (e.g., for communications, control, software, electronics, and
% sustainability) and the analysis of biological phenomena (e.g.,
% self-organization, ecological rationality)
% \begin{innerlist}
% \item More information and auxiliary documents can be found at\\\url{http://www.tedpavlic.com/facjobsearch/}
% \end{innerlist}

\section{Interests}

\textbf{Healthy Aging:}
We urgently need solutions to address the significant
burden of Alzheimer's Disease, related dementias, and other
chronic diseases prevalent in late life. My research explores
disease and resilience eitology to identify novel interventions that promote health aging.
\vspace{2mm}
\\\textbf{Encoded Belief in Epidemiologic Design:}
As an educator, I hope to train the next generation of public health
practitioners and researchers to identify and critic beliefs and philosophical
theories encoded in epidemiologic design.
\vspace{2mm}
\\\textbf{Patient-Centered eHealth: }
I am an entrepreneur involved in the development of a number of eHealth tools
designed to connect, educate, and empower patients, primarily in the field of
kidney disease and organ transplantation.

\section{Current \\Position}

\textbf{Doctoral Student},
            \href{https://www.jhu.edu/}{The University of North Carolina}
            \hfill {2018-Present}
\begin{innerlist}

    \item[] \href{https://sph.unc.edu/epid/epidemiology-landing/}{School of Public Health, Department of Epidemiology}

\end{innerlist}

%\section{Previous Academic Appointments}

\section{Education}

\href{https://sph.unc.edu/}{\textbf{The University of North Carolina}},
Chapel Hill, NC
\begin{outerlist}

\item[] \href{https://sph.unc.edu/programs/?ppk=epid-phd-r}{PhD},
        \href{http://www.jhsph.edu/departments/international-health/}
             {Epidemiology}, In Progress
        \begin{innerlist}
        \item Foci: \href{https://sph.unc.edu/epid/epidemiology-research/cardiovascular-epidemiology-research/}
          {Cardiovascular Epidemiology},
	\href{https://sph.unc.edu/epid/epidemiology-research/genetic-epidemiology-research/}{Genetic Epidemiology}
        \item Dissertation (In Progress): \emph{Measures and Genetic Drivers of Cognitive Resilience in Aging Populations}
        \item Adviser:
              \href{https://sph.unc.edu/adv_profile/gerardo-heiss-phd/}
                   {Gerardo M. Heiss, MD, PhD}
        \end{innerlist}
\end{outerlist}

\halfblankline

\href{http://www.jhsph.edu/}{\textbf{The Johns Hopkins University}},
Baltimore, MD
\begin{outerlist}

\item[] \href{http://www.jhsph.edu/academics/degree-programs/masters-programs/master-of-science-in-public-health/}{MSPH},
        \href{http://www.jhsph.edu/departments/international-health/}
             {International Health}, May 2016
        \begin{innerlist}
        \item Focus: \href{http://www.jhsph.edu/departments/international-health/program-areas/global-disease-epidemiology-control/index.html}
          {Global Disease Epidemiology and Control (GDEC)}
        \item Thesis: \emph{The mLAKE Community Trial: Using mHealth to
        Empower CHWs to Encourage Combination HIV Prevention}
        \item Adviser:
              \href{http://www.hopkinsmedicine.org/profiles/results/directory/profile/0021498/larry-chang}
                   {Larry W. Chang, MD, MPH}
        \end{innerlist}
\end{outerlist}

\halfblankline

\href{https://www.wlu.edu/}{\textbf{Washington and Lee University}},
Lexington, VA

\begin{outerlist}

\item[] \href{http://catalog.wlu.edu/content.php?catoid=13&navoid=994#BS}{BS},
        \href{https://www.wlu.edu/physics-and-engineering-department}
             {Chemistry-Engineering}, May 2014
        \begin{innerlist}
        \item \emph{Honors} in Engineering
        \item Minor in \href{https://www.wlu.edu/shepherd-program}
                            {Poverty and Human Capabilities}
        \item Thesis: \emph{Plasticity in Dissociated Neuronal Networks under Chronic Stimulation}
        \item Adviser:
              \href{https://www.wlu.edu/physics-and-engineering-department/faculty-and-staff/profile?ID=x4098}
                   {Jonathan Erickson, PhD}
        \end{innerlist}

\end{outerlist}

\section{Awards}

\href{https://reserveandresilience.com/}{3rd Workshop on Research Definitions for Reserve and Resilience in Cognitive Aging and Dementia (2021)}
\begin{innerlist}
  \item Travel Scholarship
\end{innerlist}

\halfblankline

\href{http://atcmeeting.org/}{American Transplant Congress 2019}
\begin{innerlist}
\item Best of Congress Poster for
  \href{https://atcmeetingabstracts.com/abstract/patterns-of-anti-retroviral-use-among-u-s-liver-transplant-candidates-with-hiv/}
  {"Patterns Of Anti-retroviral Use Among US Liver Transplant Candidates With HIV"}
\end{innerlist}


text:
\hypertarget{_experiment_8cpp}{\section{Referencia del Archivo Experiment.\-cpp}
\label{_experiment_8cpp}\index{Experiment.\-cpp@{Experiment.\-cpp}}
}

Código de la clase \hyperlink{class_experiment}{Experiment}.

Dependencia gráfica adjunta para Experiment.\-cpp\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{_experiment_8cpp__incl}
\end{center}
\end{figure}

\subsection{Descripción detallada}
Código de la clase \hyperlink{class_experiment}{Experiment}.

Definición en el archivo \hyperlink{_experiment_8cpp_source}{Experiment.\-cpp}.


text:
%%******************************************%%
        %%                                          %%
        %%        Modello di tesi di laurea         %%
        %%            di Andrea Giraldin            %%
        %%                                          %%
        %%             2 novembre 2012              %%
        %%                                          %%
        %%******************************************%%

% I seguenti commenti speciali impostano:
% 1.
% 2. PDFLaTeX come motore di composizione;
% 3. tesi.tex come documento principale;
% 4. il controllo ortografico italiano per l'editor.

% !TEX encoding = UTF-8
% !TEX TS-program = pdflatex
% !TEX root = tesi.tex
% !TEX spellcheck = it-IT

\documentclass[10pt,                    % corpo del font principale
               a4paper,                 % carta A4
               twoside,                 % impagina per fronte-retro
               openright,               % inizio capitoli a destra
               english,
               italian,
               ]{book}

%**************************************************************
% Importazione package
%**************************************************************

%\usepackage{amsmath,amssymb,amsthm}    % matematica

\usepackage[T1]{fontenc}                % codifica dei font:
                                        % NOTA BENE! richiede una distribuzione *completa* di LaTeX

\usepackage[utf8]{inputenc}             % codifica di input; anche [latin1] va bene
                                        % NOTA BENE! va accordata con le preferenze dell'editor

\usepackage[english, italian]{babel}    % per scrivere in italiano e in inglese;
                                        % l'ultima lingua (l'italiano) risulta predefinita

\usepackage{bookmark}                   % segnalibri

\usepackage{caption}                    % didascalie

\usepackage{chngpage,calc}              % centra il frontespizio

\usepackage{csquotes}                   % gestisce automaticamente i caratteri (")

\usepackage{emptypage}                  % pagine vuote senza testatina e piede di pagina

\usepackage{epigraph}			% per epigrafi

\usepackage{eurosym}                    % simbolo dell'euro

%\usepackage{indentfirst}               % rientra il primo paragrafo di ogni sezione

\usepackage{graphicx}                   % immagini

\usepackage{hyperref}                   % collegamenti ipertestuali

\usepackage[binding=5mm]{layaureo}      % margini ottimizzati per l'A4; rilegatura di 5 mm

\usepackage{listings}                   % codici

\usepackage{microtype}                  % microtipografia

\usepackage{mparhack,fixltx2e,relsize}  % finezze tipografiche

\usepackage{nameref}                    % visualizza nome dei riferimenti

\usepackage[font=small]{quoting}        % citazioni

\usepackage{subfig}                     % sottofigure, sottotabelle

\usepackage[italian]{varioref}          % riferimenti completi della pagina

\usepackage[dvipsnames]{xcolor}         % colori

\usepackage{booktabs}                   % tabelle
\usepackage{tabularx}                   % tabelle di larghezza prefissata
\usepackage{longtable}                  % tabelle su più pagine
\usepackage{ltxtable}                   % tabelle su più pagine e adattabili in larghezza

\usepackage[toc, acronym]{glossaries}   % glossario
                                        % per includerlo nel documento bisogna:
                                        % 1. compilare una prima volta tesi.tex;
                                        % 2. eseguire: makeindex -s tesi.ist -t tesi.glg -o tesi.gls tesi.glo
                                        % 3. eseguire: makeindex -s tesi.ist -t tesi.alg -o tesi.acr tesi.acn
                                        % 4. compilare due volte tesi.tex.

\usepackage{cite,hyperref}
                                        % eccellente pacchetto per la bibliografia;
                                        % produce uno stile di citazione autore-anno;
                                        % lo stile "numeric-comp" produce riferimenti numerici
                                        % per includerlo nel documento bisogna:
                                        % 1. compilare una prima volta tesi.tex;
                                        % 2. eseguire: biber tesi
                                        % 3. compilare ancora tesi.tex.

\usepackage{placeins}

\usepackage{ltablex}

\usepackage{dirtree}

\input{tesi-config}               % file con le impostazioni personali

\begin{document}

%**************************************************************
% Materiale iniziale
%**************************************************************
\frontmatter

\input{inizio-fine/frontespizio}
\input{inizio-fine/colophon}
%\input{inizio-fine/dedica}
%\input{inizio-fine/sommario}
%\input{inizio-fine/ringraziamenti}
%\input{inizio-fine/indici}
\cleardoublepage
\tableofcontents
\listoffigures
%**************************************************************
% Materiale principale
%**************************************************************
\mainmatter

\input{inizio-fine/sommario}
\input{capitoli/capitolo-1}             % Introduzione          %
\input{capitoli/capitolo-2}             % Organizzazione del progetto
\input{capitoli/capitolo-3}             % Analisi dei Requisiti
\input{capitoli/capitolo-4}             % Progettazione e codifica
            % Analisi dei Requisiti
\input{capitoli/capitolo-5}
\appendix
\input{capitoli/capitolo-A}             % Appendice A

%**************************************************************
% Materiale finale
%**************************************************************
\backmatter
\printglossaries
%\input{inizio-fine/bibliografia}

\end{document}


text:
\section{Nube de Conductores}\label{section:NubeConductores}
El núcleo del sistema es una aplicación desplegada en la nube, la cual se ha
denominado Nube de conductores, donde se concentran en una base de datos la
información relativa a ciclistas y vehículos a motor. Un servicio de aplicación
web embebido llamado Jetty se encarga de recibir y atender los mensajes
\Gls{http/1.1} que son enviados desde la parte de vehículos a motor y
ciclistas. Dos \emph{Handler} independientes se encargan de filtrar los
mensajes que no han sido correctamente construidos, es decir, tienen un formato
inválido, e insertar y actualizar los datos de la base de datos.

Para el despliegue de la aplicación se utilizado una máquina virtual
\emph{Ubuntu Server 14.04 LTS} que cuenta con 2048 MiB de memoria \gls{ram} y 2
núcleos para procesamiento. También se ha reservado un dominio público para que
las peticiones puedan ser enviadas al servidor. Gracias a la herramienta Ant se
puede cambiar fácilmente la plataforma donde se distribuya la aplicación,
además esta configurada para poder ser ejecutada directamente con el comando
\emph{run}.

Como puede observarse en la Figura \ref{fig:DiagComponentes-Nube} los clientes
acceden a la nube a través de dos gestores independientes a través de mensajes
\Gls{http/1.1}. Los datos son almacenados en \emph{Hash Map} para acceder
directamente a los datos. Estos datos son empleados por el calculador de
alertas para predecir si dos vehículos pueden colisionarse; en caso de que
pueda suceder, se emplea el emisor de alertas para enviar un mensaje a través
de \Gls{http/1.1} al cliente correspondiente.

\begin{figure}[h]
	\begin{center}
		\includegraphics[scale=0.4]{DiagComponentes-Nube}
		\caption{Arquitectura de la Nube de Conductores}
		\label{fig:DiagComponentes-Nube}
	\end{center}
\end{figure}

\FloatBarrier
\subsection{Procesos}\label{ssection:procesos}
A través del \gls{api} de Jetty la aplicación crea un servidor con dos
\emph{handler} de mensajes, uno para ciclistas y otro para vehículos a motor. A
través de ellos la Nube de conductores recibe datos de ciclistas y vehículos a
motor, almacenándolos en una base de datos interna sin necesidad de utilizar un
\gls{dbms}, ya que no hace falta que los datos sean persistentes más tiempo de
lo que los vehículos estén emitiendo su posición. Cada manejador posee un
\emph{ThreadPool} con el que crea un gestor para cada mensaje recibido, este
esta limitado a un número de hilos para evitar que la aplicación se colapse.

Un registro se considera antiguo cuando no ha sido refrescado en un período de
un minuto. Para evitar que emplee información obsoleta, se ejecuta una rutina
que tan solo mantiene en memoria los registros que periódicamente están siendo
actualizados; esto se realiza gracias al campo de \emph{timestamp}.

Paralelamente, cada vez que un mensaje es recibido en uno de los \emph{handler}
(conductores o ciclistas), otro algoritmo compara la posición obtenida a través
del handler con la de los vehículos existentes. Si se detecta que algún
ciclista o vehículo a motor están próximos - en un rango menor a 200 metros -
se manda a ambos vehículos una alerta avisándoles de su proximidad (Algoritmo
\ref{alg:proximidadVehiculos}). En la sección \ref{ssection:algPrediccion}, se
detalla el funcionamiento del algoritmo que se encarga de predecir si dos
vehículos pueden encontrarse.

\begin{listing}
	\begin{minipage}{.4\textwidth}
		\begin{minted}[linenos=true]{java}
for (Motorist m : lMotorist) {
  for (Cyclist c : lCyclist) {
    if (isCollisionDanger(m, c)) {
      sendWarningToMotorist(c);
      sendCyclistPositionToMotorist(c);
    }
  }
}
		\end{minted}
	\end{minipage}
	\caption{Cálculo de la proximidad de los vehículos}
	\label{alg:proximidadVehiculos}
\end{listing}

\FloatBarrier
\subsection{Algoritmos de predicción}\label{ssection:algPrediccion}
\subsubsection{Posición vehicular relativa}
La posición vehicular relativa se refiere a en qué lado de un vehículo A se
encuentra un vehículo B. Es decir, si se toma como referencia el primer
vehículo, en qué lado se encuentra el segundo; derecha, izquierda, delante o
detrás.

El sistema de coordenadas \gls{gps} emplea un sistema diferente del cartesiano;
el ángulo 0 comienza donde en el sistema tradicional (cartesiano) serían 90º.
Además, en vez de ir aumentando los grados de forma antihoraria lo hace al
contrario, es decir, aumenta los grados en sentido horario (Figura
\ref{fig:rumbo_gps}).

El heading representa la dirección hacia la que un vehículo se está moviendo,
empleando el norte (0º) como referencia. Esta información, junto con la
latitud, longitud y altitud (Alt.) de los ciclistas y vehículos, es obtenida a
través del \gls{gps}. Primero, se calcula el ángulo existente entre los dos
vehículos tomando como referencia al ciclista, con esto se obtiene la posición
del vehículo sin tener en cuenta la dirección hacia la que circula el ciclista.
Seguidamente, se relacionan el heading del ciclista y el ángulo entre los dos
vehículos para obtener el ángulo relativo entre ambos. Es decir, el ángulo
respecto la posición y dirección del ciclista, y la posición del vehículo.
Finalmente, si el ángulo relativo se encuentra entre 15º y 345º, se considera
que está delante; entre 120º y 230º, se encuentra detrás de su posición; entre
15º y 120º se considera que está a su derecha; y entre 230º y 345º, a su
izquierda. Estos cálculos son realizados en cada vehículo. En la Figura
\ref{fig:demo_pos_relativa} se muestra un ejemplo del funcionamiento del
algoritmo en un entorno real.

El funcionamiento del Algoritmo \ref{alg:relative_vehicular_pos} se puede
resumir de la siguiente forma:
\begin{enumerate}
	\item Calcular el ángulo existente entre los dos vehículos, sin tener en
	cuenta la dirección del primer vehículo.

	\item Se resta el heading del vehículo de referencia, al ángulo que hay entre
	los dos vehículos.

	\item Se contrasta con una serie de casos ya conocidos, y se devuelve el
	ángulo relativo.
\end{enumerate}

\begin{listing}
	\begin{minipage}{.4\textwidth}
		\begin{minted}[linenos=true]{javascript}
function calcularPosicionRelativa(heading, oLatitude, oLongitude,
    pLatitude, pLongitude) {
  var degrees = calculateAngleBetweenTwoPoints(oLatitude, oLongitude,
      pLatitude, pLongitude);
  var relativeAngle = correctDegrees(degrees - heading);

  if (relativeAngle <= 15 && >= 0 || relativeAngle >= 345 && relativeAngle < 360)
    return "FRONT";
  else if (relativeAngle >= 120 && relativeAngle <= 230)
    return "BACK";
  else if (relativeAngle < 120 && relativeAngle > 15)
    return "RIGHT";
  else
    return "LEFT";
}

function calcularAnguloEntreDosPuntos(ox, oy, x, y) {
  return toDegrees(Math.atan2(y - oy, x - ox));
}
\end{minted}
\end{minipage}
\caption{Cálculo de la posición relativa vehicular.}
\label{alg:relative_vehicular_pos}
\end{listing}

\begin{figure}[h]
	\begin{center}
		\includegraphics[scale=0.7]{bearing-1427303542791}
		\caption{Rumbo: el ángulo 0º está desplazado 90º con respecto al eje cartesiano.}
		\label{fig:rumbo_gps}
	\end{center}
	\begin{center}
		\includegraphics[scale=0.3]{demo-pos-relativa}
		\caption{Posición relativa vehicular.}
		\label{fig:demo_pos_relativa}
	\end{center}
\end{figure}

\FloatBarrier
\subsubsection{Previsor de accidentes}
El algoritmo de posición vehicular relativa por sí solo no es suficiente para
detectar cuándo dos vehículos pueden encontrarse, tan solo prevé por dónde se
puede encontrar un vehículo. Por lo que para detectar una posible colisión es
necesario un algoritmo que emplee la posición vehicular relativa, la distancia
entre los dos vehículos y el sentido en que circulan ambos.

Mediante el Algoritmo \ref{alg:deteccion_colisiones} se detecta si dos
vehículos pueden cruzarse en un rango de distancia especificado. Para ello,
se requiere la posición de ambos vehículos y la dirección hacia la que
circulan. Se aplica un algoritmo para calcular la nueva posición de ambos
vehículos en el rango de distancia que se desee. Con las cuatro posiciones
obtenidas, primero se calcula si existe un punto de intersección, entre las
dos rectas. Finalmente, se comprueba si las rectas cortan entre las posiciones
hacia la que se dirigen los vehículos.

\subsubsection{Validación de algoritmos}
Para verificar y validar el correcto funcionamiento de los algoritmos
desarrollados para la previsión de colisiones, se ha realizado un pequeño
simulador en JavaScript, HTML y CSS. Se ha elegido estas plataformas ya que
permiten un desarrollo rápido y sencillo, y al no tener mayor trascendencia que
la de dar validez a los algoritmos no se requiere gastar más recursos en el
desarrollo. En la Figura \ref{fig:simulador-algoritmos} se puede observar
representados dos vehículos como triángulos, y una línea recta que representa
la distancia que predice el algoritmo (en este caso, los 100 m por delante
del vehículo). Cuando las dos líneas se cruzan se detecta una colisión entre
los dos vehículos. Como información adicional se provee la posición relativa
vehicular del vehículo rojo respecto del vehículo azul.

\begin{figure}[h]
	\begin{center}
		\includegraphics[scale=0.3]{algorithm-simulator}
		\caption{Simulador de algoritmos de detección de colisiones}
		\label{fig:simulador-algoritmos}
	\end{center}
\end{figure}


text:
% version 1.0
Розглянемо рівняння вигляду
\begin{equation*}
	\frac{\diff y}{\diff x} = f(a x + b y + c)
\end{equation*}
де $a$, $b$, $c$ --- сталі. \parvskip

Зробимо заміну $a x + b y + c = z$. Тоді
\begin{equation*}
	a \diff x + b \diff y = \diff z, \quad \frac{\diff y}{\diff x} = \frac1b \left( \frac{\diff z}{\diff x} - a \right).
\end{equation*}

Підставивши в початкове рівняння, одержимо
\begin{equation*}
	\frac1b \left( \frac{\diff z}{\diff x} - a \right) = f(z),
\end{equation*}
або
\begin{equation*}
	\frac{\diff z}{\diff x} = a + b f (z).
\end{equation*}

Розділивши змінні, запишемо
\begin{equation*}
	\frac{\diff z}{a + b f (z)} - \diff x = 0
\end{equation*}
і
\begin{equation*}
	\int \frac{\diff z}{a + b f (z)} - x = C.
\end{equation*}

Загальний інтеграл має вигляд $\Phi(a x + b y + c, x) = C$.


text:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%      Pretty preamble for Astrophysics     %%
%%  (c) Jakob Lysgaard Rørsted (Mosumgaard)  %%
%%                                           %%
%%              Made for pdfLaTeX            %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Core
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Essentials
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[final]{microtype}

% Code
\usepackage{minted}
\usemintedstyle{friendly}

% Language
\usepackage{babel}

% Fonts
\usepackage{libertine}            % Linux Libertine as text font
\usepackage{libertinust1math}     % New math support for Linux Libertine
\usepackage[scaled=.95]{newtxtt}  % Pretty teletype in correct size

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page 'n' stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Page set-up
\setlrmarginsandblock{4cm}{*}{1}   % Højre-venstre-marginer
\setulmarginsandblock{*}{3.5cm}{1} % Top-bund-marginer
\checkandfixthelayout
\sloppybottom
\strictpagechecktrue

% Basic pagestyle
\makeoddfoot{plain}{}{\sffamily\small\thepage \ / \thelastpage}{}

% Section headings
\setsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\normalsize\bfseries\sffamily\raggedright}

% Chapter headings
\renewcommand*{\chaptitlefont}{\Large\sffamily\bfseries\raggedright}
\renewcommand*{\chapnumfont}{\chaptitlefont}    % To harmonise the font sizes
\renewcommand*{\chapnamefont}{\chaptitlefont}   % idem

% Title
\usepackage{titling}
\pretitle{\begin{center}\sffamily\LARGE}
\posttitle{\end{center}}
\preauthor{\begin{center}\sffamily\large}
\postauthor{\end{center}}
\predate{\begin{center}\sffamily}
\postdate{\end{center}}
\setlength{\droptitle}{-5em}

% Magic  --> If only one page: No header or footer
\AtEndDocument{\ifnum\value{page} = 1\thispagestyle{empty}\fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Figures and floats
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Include graphics
\usepackage{graphicx}

% Width of caption
\captionwidth{.9\linewidth}
\changecaptionwidth

% Trick to automatically end captions with a period
\captiontitlefinal{.}

% Allow subfloats in figure environment
\newsubfloat{figure}

% Cool tables with footnotes
\usepackage{threeparttable, etoolbox}
\appto\TPTnoteSettings{\footnotesize}  % Requires etoolbox

% Pretty colors
\usepackage{xcolor}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Science
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Math
\usepackage{amsmath,amssymb}
\usepackage{mathtools}

% Units
\usepackage{siunitx}
\sisetup{separate-uncertainty=true}
\DeclareSIUnit\au{AU}
\DeclareSIUnit\year{yr}
\DeclareSIUnit\erg{erg}
\DeclareSIUnit\msun{M_{\odot}}
\DeclareSIUnit\lsun{L_{\odot}}

% Delimeters
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\norm{\langle}{\rangle}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% References 'n' stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Smart quotations
\usepackage{csquotes}

% URL's
\usepackage{url}

% Nice itemizations
\usepackage{enumitem}
\firmlists

% Smart references
\usepackage{varioref}
\usepackage{cleveref}

% Debugging
\usepackage[margin,draft]{fixme} \fxusetheme{color}

% Format of date
\usepackage[useregional]{datetime2}
\DTMlangsetup[en-GB]{ord=omit}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Macros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Nice spacing in macros
\usepackage{xspace}

% Small division
\newcommand\starbreak{\medskip\fancybreak{$*$\qquad$*$\qquad$*$}\medskip}

% Seperation in equation
\newcommand\eqsep{\ensuremath{\quad , \quad}}

% Lazyness
\newcommand\teff{\ensuremath{T_{\textup{eff}}}\xspace}
\newcommand\logg{\ensuremath{\log g}\xspace}

% Name
\newcommand\numpy{NumPy\xspace}
\newcommand\scipy{SciPy\xspace}
\newcommand\kepler{\textsl{Kepler}\xspace}

% Diff
\newcommand\diff[2]{\frac{\text{d}#1}{\text{d}#2}}
\newcommand\pdiff[2]{\frac{\partial #1}{\partial #2}}

% More lazy stuff
\newcommand\parname[2]{\left(#1\right)_{\text{#2}}}

% Gradients
\newcommand\radgrad{\ensuremath{\nabla_{\textup{rad}}}\xspace}
\newcommand\adgrad{\ensuremath{\nabla_{\textup{ad}}}\xspace}

% Vectors (we are doing physics!)
\renewcommand{\vec}[1]{\ensuremath{\boldsymbol{#1}}\xspace}

% Nice subscript
\newcommand\var[2]{\ensuremath{#1_{\textup{#2}}\,}\xspace}
%%%%%%%%%%%%%%
%% The end! %%
%%%%%%%%%%%%%%