initial transfer from Overleaf

This commit is contained in:
Rolf Martin Glomsrud 2024-04-12 13:54:05 +02:00
commit b35069875a
20 changed files with 2178 additions and 0 deletions

301
.gitignore vendored Normal file
View file

@ -0,0 +1,301 @@
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
.*.lb
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Build tool directories for auxiliary files
# latexrun
latex.out/
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# comment
*.cut
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
*.lzo
*.lzs
*.slg
*.slo
*.sls
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist
# gnuplot
*.gnuplot
*.table
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.glog
*.gtex
# htlatex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files
# *.tikz
*-tikzDictionary
# listings
*.lol
# luatexja-ruby
*.ltjruby
# makeidx
*.idx
*.ilg
*.ind
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# newpax
*.newpax
# nomencl
*.nlg
*.nlo
*.nls
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# svg
svg-inkscape/
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# tcolorbox
*.listing
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# titletoc
*.ptc
# todonotes
*.tdo
# vhistory
*.hst
*.ver
# easy-todo
*.lod
# xcolor
*.xcp
# xmpincl
*.xmpi
# xindy
*.xdy
# xypic precompiled matrices and outlines
*.xyc
*.xyd
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# LyX
*.lyx~
# Kile
*.backup
# gummi
.*.swp
# KBibTeX
*~[0-9]*
# TeXnicCenter
*.tps
# auto folder when using emacs and auctex
./auto/*
*.el
# expex forward references with \gathertags
*-tags.tex
# standalone packages
*.sta
# Makeindex log files
*.lpz
# xwatermark package
*.xwm
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib

18
README.md Normal file
View file

@ -0,0 +1,18 @@
# LaTeX template for masteroppgaver ved Institutt for informatikk ved UiB
Denne LaTeX templaten er basert på Diddern sin [UiB-LaTeX-Template](https://github.com/Diddern/UiB-LaTeX-Template) (se fork).
## Komme i gang
Clone og kompiler med din favoritt [TeX-distribusjon](https://www.latex-project.org/get/).
## Logo
Logo for ditt fakultet?
[UiB profilmanual](http://kapd.h.uib.no/profilmanual/99LastNed/99a_lastned.html)
Endre til `canvas.png` hvis du ønsker kun logo uten fakultet.
## Lisens
UiB logo: Copyright (C) tilhørende Universitetet i Bergen.
University Assignment Title Page: CC BY-NC-SA 3.0 WikiBooks

BIN
build/report.pdf Normal file

Binary file not shown.

65
chapter/ch3/ch3.tex Normal file
View file

@ -0,0 +1,65 @@
\section{Collecting User Feedback for Syntactic Proposals}
The goal for this project is to utilize users familiarity with their own code to gain early and worthwhile user feedback on new
syntactic proposals for EcmaScript.
\subsection{The core idea}
Users of EcmaScript have a familiarity with code they themselves have written. This means they have knowledge of how their own code works and why they might have written it a certain way. This project aims to utilize this pre-exisiting knowledge to showcase new proposals for EcmaScript. Showcasing proposals this way will allow users to focus on what the proposal actually entails, instead of focusing on the examples written by the proposal author.
% Should this be moved to chapter 2?
A proposal for EcmaScript is a suggestion for a change to the language. These changes come with a set of problems that if the proposal is included as a part of EcmaScript, those problems should be solved by utilizing the additions contained within the proposal.
Further in this chapter, we will be discussing the \textit{old} and \textit{new} way of solving a problem. What we are referring to in this case is whatever set of problems a proposal is trying to solve, if that proposal is allowed into EcmaScript as part of the language, there will be a \textit{new} way of solving said problems. The \textit{old} way is the current status quo when the proposal is not part of EcmaScript, and the \textit{new} way is when the proposal is part of EcmaScript and we are utilizing the new features of said proposal.
\subsection{Applying a proposal}
The way this project will use the pre-existing knowledge the user harbors of their own code is to use it as a base, and \textit{apply} the proposal to that base.
When a proposal is \textit{applied} to a piece of code there are some main steps. A code snippet where the proposal might be used has to be identified. That same code snippet has to be transformed to use the new features the proposal implements. Then both the original and the transformed code snippet has to be showcased to the user.
Identifying a code snippet where the proposal might be utilized, the problem a proposal is solving allows us to iden
\subsection{Syntactic proposal}
A proposal for EcmaScript is a suggested change for the language, in the case of EcmaScript this comes in the form of an addition to the language, as EcmaScript does not allow for breaking changes. There are many different kinds of proposals, one such example is a Syntactic proposal
A syntactic proposal, is a proposal that contains only changes to the syntax of a language. This means, the proposal contains either no, or very limited change to functionality, and no changes to semantics.
This is an example of a very simple syntactic proposal.
Consider a imaginary proposal \exProp. This proposal describes adding an optional keyword for declaring numerical variables if the expression of the declaration is a numerical literal.
This proposal will look something like this:
\begin{lstlisting}[language={JavaScript}, caption={Example of imaginary proposal \exProp}, label={ex:proposal}]
// Original code
let x = 100;
let b = "Some String";
let c = 200;
// Code after application of proposal
int x = 100;
let b = "Some String";
let c = 200;
\end{lstlisting}
See that in \ref{ex:proposal} the change is optional, and is not applied to the declaration of \textit{c}, but it is applied to the declaration of \textit{x}. Since the change is optional to use, and essentially is just \textit{syntax sugar}, this proposal does not make any changes to functionality or semantics, and can therefore be categorized as a syntactic proposal.
\subsection{Showcasing syntactic proposals}
The application of a proposal on a program will then be utilized as a way of presenting the proposal to developers using EcmaScript(hereby referred to as users). If the code used for the application is already familiar to the user, we can severely limit the amount of time spent to understand the functionality of the initial code used in the application of the proposal. This allows the users more focus on the actual change presented by the proposal, which in turn might present itself in better feedback on the proposal, as well as presenting issues about the proposal earlier in the process.
This showcase is done by, The user being presented with two pieces of code. One being the original version with no changes, and the other being the transformed code after, this will allow the user to see how it was written before, and see how the proposal could have been applied here. This will give a low barrier of entry to understand a proposal and give meaningful feedback to the committee.
This paper does not focus on showcasing and gathering user feedback, however focusing more on the process of applying a proposal to some piece of code, while maintaining its functionality.
\subsection{\DSL}
In order to match ......
\subsection{Using the \DSL with an actual syntactic proposal}

64
chapter/introduction.tex Normal file
View file

@ -0,0 +1,64 @@
\chapter{Introduction}
Natum mucius vim id. Tota detracto ei sed, id sumo sapientem sed. Vim in nostro latine gloriatur, cetero vocent vim id. Erat sanctus eam te, nec assueverit necessitatibus ex, id delectus fabellas has.
Lorem ipsum dolor sit amet, iisque feugait quo eu, sed vocent commodo aliquid an. Minim suavitate dissentiet te eos. Dicunt eirmod adolescens no sed. Esse nonumy melius an mel, mei ut maiorum luptatum. Eu eum iudico scripta, movet option assueverit mel ex, mea at odio noluisse efficiendi. Ad vidisse atomorum conceptam quo, saepe volumus philosophia eos eu, delenit conceptam no usu.
Vituperata sadipscing deterruisset ei mel, at qui nonumy blandit. Delectus dissentiet et sea, ut rebum regione numquam nam, cum ex augue constituto. Te per nihil semper. Posse voluptatum qui an, aliquando democritum disputando id quo, everti perpetua cu vim. Laudem fabellas mei an, eu reprimique quaerendum usu. Quidam prompta fabellas ne est.
\section{Background}
Lorem ipsum dolor sit amet, cu graecis propriae sea. Eam feugiat docendi an, ei scripta blandit pri. Nonumes delicata reprimique nam ut. Eu suas alterum concludaturque est, ferri mucius sensibus id sed~\cite{raftAlg}.
We can do glossary for acronymes and abriviations also: \gls{saas}. As you see the first time it is used, the full version is used, but the second time we use \gls{saas} the short form is used. It is also a link to the lookup.
\subsection{Listings}
You can do listings, like in Listing~\ref{ListingReference}
\begin{lstlisting}[caption={[Short caption]Look at this cool listing. Find the rest in Appendix~\ref{Listing}},label=ListingReference]
$ java -jar myAwesomeCode.jar
\end{lstlisting}
You can also do language highlighting for instance with Golang:
And in line~\ref{LineThatDoesSomething} of Listing~\ref{ListingGolang} you can see that we can ref to lines in listings.
\begin{lstlisting}[caption={Hello world in Golang},label=ListingGolang,escapechar=|]
package main
import "fmt"
func main() {
fmt.Println("hello world") |\label{LineThatDoesSomething}|
}
\end{lstlisting}
\subsection{Figures}
Example of a centred figure
\begin{figure}[H]
\centering
\includegraphics[scale=0.5]{figures/Flowchart}
\caption{Caption for flowchart}
\medskip
\hspace*{15pt}\hbox{\scriptsize Credit: Acme company makes everything \url{https://acme.com/}}
\label{FlowchartFigure}
\end{figure}
\subsection{Tables}
We can also do tables. Protip: use \url{https://www.tablesgenerator.com/} for generating tables.
\begin{table}[H]
\centering
\caption{Caption of table}
\label{TableLabel}
\begin{tabular}{|l|l|l|}
\hline
Title1 & Title2 & Title3 \\ \hline
data1 & data2 & data3 \\ \hline
\end{tabular}
\end{table}
\subsection{\gls{git}}
\gls{git} is fun, use it!

BIN
figures/Flowchart.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
figures/canvas.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 97 KiB

20
generators/abstract.tex Normal file
View file

@ -0,0 +1,20 @@
\pagenumbering{roman}
\begin{abstract}
\noindent Lorem ipsum dolor sit amet, his veri singulis necessitatibus ad. Nec insolens periculis ex. Te pro purto eros error, nec alia graeci placerat cu. Hinc volutpat similique no qui, ad labitur mentitum democritum sea. Sale inimicus te eum.
No eros nemore impedit his, per at salutandi eloquentiam, ea semper euismod meliore sea. Mutat scaevola cotidieque cu mel. Eum an convenire tractatos, ei duo nulla molestie, quis hendrerit et vix. In aliquam intellegam philosophia sea. At quo bonorum adipisci. Eros labitur deleniti ius in, sonet congue ius at, pro suas meis habeo no.
\end{abstract}
\renewcommand{\abstractname}{Acknowledgements}
\begin{abstract}
Est suavitate gubergren referrentur an, ex mea dolor eloquentiam, novum ludus suscipit in nec. Ea mea essent prompta constituam, has ut novum prodesset vulputate. Ad noster electram pri, nec sint accusamus dissentias at. Est ad laoreet fierent invidunt, ut per assueverit conclusionemque. An electram efficiendi mea.
\vspace{1cm}
\hspace*{\fill}\texttt{Your name}\\
\hspace*{\fill}\today
\end{abstract}
\setcounter{page}{1}
\newpage

View file

@ -0,0 +1,5 @@
\chapter{Generated code from Protocol buffers}
\begin{lstlisting}[caption={Source code of something},label=Listing]
System.out.println("Hello Mars");
\end{lstlisting}

2
generators/commands.sty Normal file
View file

@ -0,0 +1,2 @@
\newcommand{\DSL}{DSL NAME HERE?}
\newcommand{\exProp}{\textbf{optional let to int for declaring numerical literal variables}}

52
generators/frontpage.tex Normal file
View file

@ -0,0 +1,52 @@
\begin{titlepage}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here
\center % Center everything on the page
%----------------------------------------------------------------------------------------
% HEADING SECTIONS
%----------------------------------------------------------------------------------------
\textsc{\LARGE University of Bergen \\ Department of Informatics}\\[1.5cm] % Name of your university/college
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\HRule \\[0.5cm]
\begin{Huge}
\bfseries{Title of your master thesis}\\[0.7cm] % Title of your document
\end{Huge}
\HRule \\[0.5cm]
%----------------------------------------------------------------------------------------
% AUTHOR SECTION
%----------------------------------------------------------------------------------------
\large \emph{Author:} Your name\\
\large \emph{Supervisors:} Name of supervisors\\[2cm]
%----------------------------------------------------------------------------------------
% LOGO SECTION
% This will require the graphicx package
% Change the line to comment if you only want the UiB Logo
% Logo for other faculties here: http://kapd.h.uib.no/profilmanual/99LastNed/99a_lastned.html
%----------------------------------------------------------------------------------------
\centerline{\includegraphics[scale=1.9]{figures/canvasWithFaculty}}
%\centerline{\includegraphics[scale=0.15]{figures/canvas}} %change for your faculty
%----------------------------------------------------------------------------------------
% DATE SECTION
%----------------------------------------------------------------------------------------
{\large \monthyeardate\today}\\[3cm] % Date, change the \today to a set date if you want to be precise
%----------------------------------------------------------------------------------------
% LOGO SECTION
%----------------------------------------------------------------------------------------
\vfill % Fill the rest of the page with whitespace
\end{titlepage}

13
generators/glossary.tex Normal file
View file

@ -0,0 +1,13 @@
%\makeglossaries % alt 1
\makenoidxglossaries % alt 2
\renewcommand*{\acronymname}{List of Acronyms and Abbreviations}
\renewcommand{\glsnamefont}[1]{\textbf{#1}}
%Create acronyms here.
\newacronym{saas}{SaaS}{Software as a Service}
\newacronym{vcs}{VCS}{Version Control System}
%You can also do explanations.
\newglossaryentry{git}{name={Git},
description={Git is a \gls{vcs} for tracking changes in computer files and coordinating work on those files among multiple people}}

80
generators/imports.sty Normal file
View file

@ -0,0 +1,80 @@
\usepackage[utf8]{inputenc} % This defines the font-\usepackage[utf8]{inputenc}
\usepackage{url}
\def\UrlBreaks{\do\/\do-}
\usepackage[square, numbers]{natbib}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{floatpag}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{float}
\usepackage{geometry}
\usepackage{wrapfig}
\usepackage{amssymb}
\usepackage[colorinlistoftodos,prependcaption,textsize=tiny]{todonotes}
\usepackage{soul}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage[integrals]{wasysym}
\usepackage{latexsym}
\DeclareRobustCommand{\VAN}[3]{#2}
\usepackage{amssymb}
\renewcommand{\labelenumii}{\theenumii}
\renewcommand{\theenumii}{\theenumi.\arabic{enumii}.}
\usepackage{hyperref}
\tolerance=1000
\usepackage{amsmath}
\usepackage{titlesec}
\usepackage{setspace}
\onehalfspacing
\usepackage{fullpage}
\graphicspath{{figures/}}
\usepackage{listings}
\usepackage{generators/listings-golang}
\usepackage{generators/listings-js}
\usepackage{generators/commands}
\lstset{
frame=single,
basicstyle=\linespread{0.8}\footnotesize\ttfamily,
keywordstyle=\color{red},
numbers=left,
numbersep=5pt,
showstringspaces=false,
stringstyle=\color{blue},
commentstyle=\color{gray},
breakatwhitespace=true,
breaklines=true,
postbreak=\mbox{\textcolor{violet}{$\hookrightarrow$}\space},
tabsize=4,
language=Golang
}
\newlength\glsdescwidth
\setlength{\glsdescwidth}{1\hsize}
\usepackage{datetime}
\newdateformat{monthyeardate}{%
\monthname[\THEMONTH], \THEYEAR}
\newcommand\blankpage{%
\null
\thispagestyle{empty}%
\addtocounter{page}{-1}%
\newpage}
\usepackage{enumitem, kantlipsum}
\renewcommand{\maketitle}{}
\usepackage{paralist}
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=1pt
\plparsep=1pt
\usepackage[acronym,nonumberlist,toc,nogroupskip]{glossaries}

View file

@ -0,0 +1,23 @@
%% Golang definition for listings
%% http://github.io/julienc91/lstlistings-golang
%%
\RequirePackage{listings}
\lstdefinelanguage{Golang}%
{morekeywords=[1]{package,import,func,type,struct,return,defer,panic,%
recover,select,var,const,iota},%
morekeywords=[2]{string,uint,uint8,uint16,uint32,uint64,int,int8,int16,%
int32,int64,bool,float32,float64,complex64,complex128,byte,rune,uintptr,%
error,interface},%
morekeywords=[3]{map,slice,make,new,nil,len,cap,copy,close,true,false,%
delete,append,real,imag,complex,chan,},%
morekeywords=[4]{for,break,continue,range,goto,switch,case,fallthrough,if,%
else,default,},%
morekeywords=[5]{Println,Printf,Error, err, Print,},%
sensitive=true,%
morecomment=[l]{//},%
morecomment=[s]{/*}{*/},%
morestring=[b]',%
morestring=[b]",%
morestring=[s]{`}{`},%
}

View file

@ -0,0 +1,31 @@
\RequirePackage{listings}
\lstdefinelanguage{JavaScript}{
keywords={typeof, new, true, false, catch, function, return, null, catch, switch, var, if, in, while, do, else, case, break},
keywordstyle=\color{blue}\bfseries,
ndkeywords={class, export, boolean, throw, implements, import, this},
ndkeywordstyle=\color{darkgray}\bfseries,
identifierstyle=\color{black},
sensitive=false,
comment=[l]{//},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
morestring=[b]',
morestring=[b]"
}
\lstset{
language=JavaScript,
backgroundcolor=\color{lightgray},
extendedchars=true,
basicstyle=\footnotesize\ttfamily,
showstringspaces=false,
showspaces=false,
numbers=left,
numberstyle=\footnotesize,
numbersep=9pt,
tabsize=2,
breaklines=true,
showtabs=false,
captionpos=b
}

1436
generators/myplainnat.bst Normal file

File diff suppressed because it is too large Load diff

14
generators/refs.bib Executable file
View file

@ -0,0 +1,14 @@
@inproceedings{raftAlg,
author = {Ongaro, Diego and Ousterhout, John},
title = {In Search of an Understandable Consensus Algorithm},
booktitle = {Proceedings of the 2014 USENIX Conference on USENIX Annual Technical Conference},
series = {USENIX ATC'14},
year = {2014},
isbn = {978-1-931971-10-2},
location = {Philadelphia, PA},
pages = {305--320},
numpages = {16},
acmid = {2643666},
publisher = {USENIX Association},
address = {Berkeley, CA, USA},
}

View file

@ -0,0 +1,6 @@
{
\tableofcontents
\let\cleardoublepage\clearpage \listoffigures
\let\cleardoublepage\clearpage \listoftables
\let\cleardoublepage\clearpage \lstlistoflistings
}

48
report.tex Normal file
View file

@ -0,0 +1,48 @@
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[12pt,oneside,final,a4paper]{report}
\usepackage{generators/imports}
\include{generators/glossary}
\begin{document}
\include{generators/frontpage} % This is the titlepage
\include{generators/abstract}
\include{generators/tableOfContentsAndListings}
\pagenumbering{arabic}
\setcounter{page}{1}
\setlength{\parskip}{0.5cm plus4mm minus3mm}
\include{chapter/introduction}
\include{chapter/ch3/ch3}
% Include more chapters as required.
%%=========================================
% Alternative 1 of printing glossaries & acronymes
%\renewcommand{\glossarypreamble}{\footnotesize}
%\printglossary[style=super, type=\glsdefaulttype] \let\cleardoublepage\clearpage
%\printglossary[style=super, type=\acronymtype]
%Alternative 2
%Simplified way of printing glossaries, slower than alt 1, but has better compatibility
\printnoidxglossaries
% Include more appendices as required.
%%=========================================
\clearpage
\DeclareRobustCommand{\VAN}[3]{#3}
\addcontentsline{toc}{chapter}{Bibliography}
\bibliographystyle{generators/myplainnat}
\bibliography{generators/refs}
\appendix
\titleformat{\chapter}[display]
{\normalfont\large\bfseries}% <- font for label "Appendix A", default \huge
{\chaptertitlename\ \thechapter}
{20pt}
{\large}% <- font for title, default \Huge
\include{generators/appendix-a}
\end{document}