linux_ws2122/examples/examples.tex

247 lines
7.3 KiB
TeX

\section{Übung}
\label{sec:uebung_01}
% ##########################################################################
% ############################### Aufgabe 01 ###############################
% ##########################################################################
\subsection{Aufgabe}
\label{sec:uebung_01.aufgabe_01}
Starten Sie das Skript.
\subsubsection*{Lösung}
\label{sec:uebung_01.aufgabe_01.loesung}
% ##########################################################################
% ################################# Minted #################################
% ##########################################################################
\section{Minted}
% ############################### Begin-Block ##############################
\subsection{Begin-Block}
\subsubsection{AWK-Code}
\begin{awkcode}
if NR > 3 {
print "0";
}
\end{awkcode}
\subsubsection{JSON}
\begin{jsoncode}
{
"name": "Molecule Man",
"age": 29,
"secretIdentity": "Dan Jukes",
"powers": [
"Radiation resistance",
"Turning tiny",
"Radiation blast"
]
}
\end{jsoncode}
\subsubsection{R-Code}
\begin{rcode}
print(match(5, c(2,7,5,3))) # 5 is in 3rd place
print(seq(from=1,to=3,by=.5) %in% 1:3)
\end{rcode}
\subsubsection{SQL-Code}
\begin{sqlcode}
SELECT *
FROM tab;
\end{sqlcode}
\subsubsection{XML}
\begin{xmlcode}
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
\end{xmlcode}
% ################################ Input-File ###############################
\subsection{Inputfile}
\subsubsection{AWK-Code}
\inputsql{examples/test.awk}
\subsubsection{JSON}
\inputsql{examples/test.json}
\subsubsection{R-Code}
\inputsql{examples/test.r}
\subsubsection{SQL-Code}
\inputsql{examples/test.sql}
\subsubsection{XML}
\inputsql{examples/test.xml}
% ################################## Inline #################################
\subsection{Inline}
\subsubsection{SQL-Code}
\sqlinline{SELECT * FROM tab;}
% ##########################################################################
% ################################ Info-Boxen ##############################
% ##########################################################################
\section{Info-Boxen}
% ################################### WARN #################################
\begin{warn-popup}
Warn-Popup
\end{warn-popup}
% ################################### INFO #################################
\begin{info-popup}
Info-Popup
\end{info-popup}
% ################################# Example ################################
\begin{example-popup}
Example-Popup
\end{example-popup}
% ##########################################################################
% ################################# Akronyme ###############################
% ##########################################################################
\section{Akronyme}
\acrfull{acr:sql}\\
\acrlong{acr:sql}\\
\acrshort{acr:sql}\\
% ##########################################################################
% ################################ Text-Boxen ##############################
% ##########################################################################
\section{Text-Boxen}
\begin{textblock*}{\textwidth}(4cm,0cm)
Ich bin eine Textbox
\end{textblock*}
% ##########################################################################
% ############################### Aufzählungen #############################
% ##########################################################################
\section{Aufzählungen}
\begin{itemize}[itemsep=0pt]
\item Item
\item Item
\item Item
\end{itemize}
\begin{enumerate}[itemsep=0pt]
\item Item
\item Item
\item Item
\end{enumerate}
\begin{itemize}[itemsep=0pt]
\item[A)] Item
\item[B)] Item
\item[C)] Item
\end{itemize}
\begin{description}[itemsep=0pt]
\item[Itempoint 1] \mbox{} \\
\lipsum[1]
\bigskip
\item[Itempoint 2] \mbox{} \\
\lipsum[1]
\bigskip
\item[Itempoint 3] \mbox{} \\
\lipsum[1]
\end{description}
% ##########################################################################
% ################################# Tabellen ###############################
% ##########################################################################
\section{Tabellen}
% ################################# tabularx ###############################
\begin{table}[H]
\begin{tabularx}{\textwidth}{X|X|X|X}
\textbf{FIRSTNAME} & \textbf{LASTNAME} & \textbf{BIRTHDAY} & \textbf{HIREDATE} \\
\hline\hline
Maximilian & Arbeitsscheu & 1998-06-21 & 2007-04-18 \\
Henry & Großkreutz & 1990-09-01 & 2009-02-10 \\
Leni & Mayer & 1996-10-15 & 2009-02-10 \\
$[$\dots$]$ & $[$\dots$]$ & $[$\dots$]$ & $[$\dots$]$ \\
\end{tabularx}
\caption{tabularx - beispiel\_01}
\label{tbl:beispiel_01}
\end{table}
% ########################## tabularx - multicolumn ########################
\begin{table}[H]
\begin{tabularx}{\textwidth}{X|X|X|X}
\textbf{FIRSTNAME} & \textbf{LASTNAME} & \textbf{BIRTHDAY} & \textbf{HIREDATE} \\
\hline\hline
\multicolumn{2}{c|}{\textbf{Multi-column}} & 1998-06-21 & 2007-04-18 \\
Henry & Großkreutz & \multicolumn{2}{c}{\textbf{Multi-column}} \\
\multicolumn{3}{c|}{\textbf{Multi-column}} & 2009-02-10 \\
$[$\dots$]$ & $[$\dots$]$ & $[$\dots$]$ & $[$\dots$]$ \\
\end{tabularx}
\caption{tabularx - beispiel\_02}
\label{tbl:beispiel_02}
\end{table}
% ############################ tabularx - multirow #########################
\begin{table}[H]
\ttfamily
\begin{tabularx}{\textwidth}{X|X|X|X}
\textbf{FIRSTNAME} & \textbf{LASTNAME} & \textbf{BIRTHDAY} & \textbf{HIREDATE} \\
\hline\hline
\multirow{2}{*}{\textbf{Multi-row}} & Arbeitsscheu & 1998-06-21 & 2007-04-18 \\
& Großkreutz & 1990-09-01 & 2009-02-10 \\
Leni & Mayer & 1996-10-15 & \multirow{2}{*}{\textbf{Multi-row}} \\
$[$\dots$]$ & $[$\dots$]$ & $[$\dots$]$ & \\
\hline
\end{tabularx}
\caption{tabularx - beispiel\_03}
\label{tbl:beispiel_03}
\end{table}
% ################################## tabular ###############################
\begin{table}[H]
\ttfamily
\begin{tabular}{l|l|l|l}
\cellcolor{light-grey} \textbf{FIRSTNAME} & \textbf{LASTNAME} & \textbf{BIRTHDAY} & \cellcolor{grey} \textbf{HIREDATE} \\
\hline\hline
Maximilian & Arbeitsscheu & \cellcolor{orange}1998-06-21 & 2007-04-18 \\
Henry & \cellcolor{red} Großkreutz & 1990-09-01 & 2009-02-10 \\
\cellcolor{green} Leni & Mayer & 1996-10-15 & \cellcolor{blue} 2009-02-10 \\
$[$\dots$]$ & \cellcolor{yellow} $[$\dots$]$ & \cellcolor{brown} $[$\dots$]$ & $[$\dots$]$ \\
\end{tabular}
\caption{tabular - beispiel\_04}
\label{tbl:beispiel_04}
\end{table}
% ################################## tabular 2 ###############################
\begin{table}[H]
\begin{tabular}{llll}
\toprule[2pt]
\cellcolor{light-grey} \textbf{FIRSTNAME} & \textbf{LASTNAME} & \textbf{BIRTHDAY} & \cellcolor{grey} \textbf{HIREDATE} \\ \midrule[1.5pt]
Maximilian & Arbeitsscheu & \cellcolor{orange}1998-06-21 & 2007-04-18 \\ \midrule
Henry & \cellcolor{red} Großkreutz & 1990-09-01 & 2009-02-10 \\ \midrule
\cellcolor{green} Leni & Mayer & 1996-10-15 & \cellcolor{blue} 2009-02-10 \\ \midrule
$[$\dots$]$ & \cellcolor{yellow} $[$\dots$]$ & \cellcolor{brown} $[$\dots$]$ & $[$\dots$]$ \\
\bottomrule
\end{tabular}
\caption{tabular - beispiel\_05}
\label{tbl:beispiel_05}
\end{table}