uni

University stuff
git clone git://git.margiolis.net/uni.git
Log | Files | Refs | README | LICENSE

commit 7e73fe90d70cca1faf8d4ddff1ff129edf1cd4d9
parent ae884760af9dca489a5689f91fd2ddd9c3a8e4bb
Author: Christos Margiolis <christos@margiolis.net>
Date:   Tue,  3 May 2022 22:43:32 +0300

gotta finish this pdf...

Diffstat:
Ac_java_distributed_sys/ex2/doc/doc.pdf | 0
Ac_java_distributed_sys/ex2/doc/doc.tex | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ac_java_distributed_sys/ex2/doc/doc.toc | 20++++++++++++++++++++
Ac_java_distributed_sys/ex2/doc/res/uniwalogo.png | 0
Mc_java_distributed_sys/ex2/src/HRClient.java | 6+++---
Mc_java_distributed_sys/ex2/src/Room.java | 4++--
6 files changed, 108 insertions(+), 5 deletions(-)

diff --git a/c_java_distributed_sys/ex2/doc/doc.pdf b/c_java_distributed_sys/ex2/doc/doc.pdf Binary files differ. diff --git a/c_java_distributed_sys/ex2/doc/doc.tex b/c_java_distributed_sys/ex2/doc/doc.tex @@ -0,0 +1,83 @@ +\documentclass{article} +\usepackage[utf8]{inputenc} +\usepackage[greek,english]{babel} +\usepackage{alphabeta} +\usepackage{fancyhdr} +\usepackage{listings} +\usepackage{mathtools} +\usepackage{xcolor} +\usepackage{biblatex} +\usepackage[left=1cm,right=1cm]{geometry} + +\lstset { + basicstyle=\ttfamily, + columns=fullflexible, + breaklines=true, + keepspaces=true, + showstringspaces=false +} + +\title{Εργαστήριο Κατανεμημένων Συστημάτων - Εργασία 2} +\author{Χρήστος Μαργιώλης -- 19390133} +\date{Μάιος 2022} + +\begin{document} + +\begin{titlepage} + \maketitle + \begin{figure}[t!] + \begin{center} + \includegraphics[scale=0.3]{./res/uniwalogo.png} \\ + \Large + \textbf{Πανεπιστήμιο Δυτικής Αττικής} \\ + \large + Τμήμα Μηχανικών Πληροφορικής και Ηλεκτρονικών Υπολογιστών + \end{center} + \end{figure} +\end{titlepage} + +\renewcommand{\contentsname}{Περιεχόμενα} +\tableofcontents + +\section{<++>} + +\section{Εκτέλεση κώδικα} + +<++> + +\section{Ενδεικτικά τρεξίματα} + +<++> + +\section{Κώδικας} + +Ο κώδικας είναι σχολιασμένος στα σημεία που θεωρώ ότι μπορεί να υπάρξει +σύχγηση, και όχι ακόμα και σε σημεία που είναι λίγο-πολύ ξεκάθαρο το τι +συμβαίνει. + +\subsection{\lstinline{HRInterface.java}} + +\lstinputlisting[language=java]{../src/HRInterface.java} +\pagebreak + +\subsection{\lstinline{HRImpl.java}} + +\lstinputlisting[language=java]{../src/HRImpl.java} +\pagebreak + +\subsection{\lstinline{Room.java}} + +\lstinputlisting[language=java]{../src/Room.java} +\pagebreak + +\subsection{\lstinline{HRServer.java}} + +\lstinputlisting[language=java]{../src/HRServer.java} +\pagebreak + +\subsection{\lstinline{HRClient.java}} + +\lstinputlisting[language=java]{../src/HRClient.java} +\pagebreak + +\end{document} diff --git a/c_java_distributed_sys/ex2/doc/doc.toc b/c_java_distributed_sys/ex2/doc/doc.toc @@ -0,0 +1,20 @@ +\boolfalse {citerequest}\boolfalse {citetracker}\boolfalse {pagetracker}\boolfalse {backtracker}\relax +\babel@toc {english}{} +\defcounter {refsection}{0}\relax +\contentsline {section}{\numberline {1}<++>}{1}{}% +\defcounter {refsection}{0}\relax +\contentsline {section}{\numberline {2}Εκτέλεση κώδικα}{1}{}% +\defcounter {refsection}{0}\relax +\contentsline {section}{\numberline {3}Ενδεικτικά τρεξίματα}{1}{}% +\defcounter {refsection}{0}\relax +\contentsline {section}{\numberline {4}Κώδικας}{1}{}% +\defcounter {refsection}{0}\relax +\contentsline {subsection}{\numberline {4.1}\lstinline {HRInterface.java}}{1}{}% +\defcounter {refsection}{0}\relax +\contentsline {subsection}{\numberline {4.2}\lstinline {HRImpl.java}}{2}{}% +\defcounter {refsection}{0}\relax +\contentsline {subsection}{\numberline {4.3}\lstinline {Room.java}}{4}{}% +\defcounter {refsection}{0}\relax +\contentsline {subsection}{\numberline {4.4}\lstinline {HRServer.java}}{6}{}% +\defcounter {refsection}{0}\relax +\contentsline {subsection}{\numberline {4.5}\lstinline {HRClient.java}}{7}{}% diff --git a/c_java_distributed_sys/ex2/doc/res/uniwalogo.png b/c_java_distributed_sys/ex2/doc/res/uniwalogo.png Binary files differ. diff --git a/c_java_distributed_sys/ex2/src/HRClient.java b/c_java_distributed_sys/ex2/src/HRClient.java @@ -6,9 +6,9 @@ import java.util.Scanner; public class HRClient { public static void usage() { System.err.println("usage: java HRClient list <hostname>"); - System.err.println(" java HRClient book <type> <number> <name> <hostname>"); - System.err.println(" java HRClient guests <hostname>"); - System.err.println(" java HRClient cancel <type> <number> <name> <hostname>"); + System.err.println(" java HRClient book <type> <number> <name> <hostname>"); + System.err.println(" java HRClient guests <hostname>"); + System.err.println(" java HRClient cancel <type> <number> <name> <hostname>"); System.exit(1); } diff --git a/c_java_distributed_sys/ex2/src/Room.java b/c_java_distributed_sys/ex2/src/Room.java @@ -23,7 +23,7 @@ public class Room { else if (avail - num >= 0) { guests.put(name, guests.getOrDefault(name, 0) + num); avail -= num; - return "success: " + num * price + "€"; + return "success: " + num * price + " euros"; } else if (avail > 0) return "fail: can only book " + avail + " rooms"; else @@ -80,6 +80,6 @@ public class Room { public String toString() { return avail + " " + type + " (" + desc + - ") rooms available - " + price + "€ per night"; + ") rooms available - " + price + " euros per night"; } }