\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{msg} \pdfinfo{ /Title (programmierung-pr-fung-1.pdf) /Creator (Cheatography) /Author (msg) /Subject (Programmierung Prüfung 1 Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Programmierung Prüfung 1 Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{msg} via \textcolor{DarkBackground}{\uline{cheatography.com/177243/cs/37005/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}msg \\ \uline{cheatography.com/msg} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 9th February, 2023.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Java Basics}} \tn % Row 0 \SetRowColor{LightBackground} x+y & Addieren von Variablen \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} x+=y & X ist gleich X + Y (x=x+y) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} x==y & X ist gleich Y \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} x!=y & X ist ungleich Y \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} x\textgreater{}y & X ist gr{\"o}{\ss}er als Y \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} x\textgreater{}=y & X ist gr{\"o}{\ss}er oder gleich Y \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} x\%y & Teilt x durch y und gibt den Rest aus \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} \seqsplit{System.out.println(„Hello} World"); & Textausgabe auf der Konsole \tn % Row Count 13 (+ 2) % Row 8 \SetRowColor{LightBackground} int ersteZahl; & Erstellt int Variable mit dem Namen ersteZahl \tn % Row Count 16 (+ 3) % Row 9 \SetRowColor{white} double ergebnis; & Erstellt double Variable mit dem Namen ergebnis \tn % Row Count 19 (+ 3) % Row 10 \SetRowColor{LightBackground} char einZeichen; & Erstellt char Variable mit dem Namen einZeichen \tn % Row Count 22 (+ 3) % Row 11 \SetRowColor{white} String vieleZeichen; & Erstellt String Variable mit dem Namen vieleZeichen \tn % Row Count 25 (+ 3) % Row 12 \SetRowColor{LightBackground} \seqsplit{ergebnis=zahl1+zahl2;} & Addiert zahl1, 2 und speichert es in der Variablen ergebnis \tn % Row Count 28 (+ 3) % Row 13 \SetRowColor{white} if (Bedingung) \{ Anweisungsblock 1; \} else \{ Anweisungsblock 2; \} & Wenn Bedingung dann Anweisungsblock 1 ansonsten Anweisungsblock 2 \tn % Row Count 32 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Java Basics (cont)}} \tn % Row 14 \SetRowColor{LightBackground} While (Bedingung) \{ Anweisung 1; Anweisung 2; \} & W{\"a}hrend Bedingung führe aus Anweisung und Anweisung 2 \tn % Row Count 3 (+ 3) % Row 15 \SetRowColor{white} do \{ Anweisung 1; Anweisung 2; \} while (Bedingung); & führe aus Anweisung 1 und Anweisung 2 w{\"a}hrend Bedingung \tn % Row Count 6 (+ 3) % Row 16 \SetRowColor{LightBackground} for (int i=1; i\textless{}=5; i++ ) \{ System.out.println („Hello World"); \} & Solange i (i=1) um 1 gr{\"o}{\ss}er wird, bis es 5 ist, gebe aus Hello World \tn % Row Count 10 (+ 4) % Row 17 \SetRowColor{white} import java.util.Scanner; & Importiere die Scanner Klasse \tn % Row Count 12 (+ 2) % Row 18 \SetRowColor{LightBackground} Scanner Objekt = new Scanner(System.in); & Erzeuge einen neuen Scanner der Objekt hei{\ss}t \tn % Row Count 15 (+ 3) % Row 19 \SetRowColor{white} String Name = Objekt.nextLine(); & Dem String Name wird die Eingabe des Scanners Objekt zugewiesen \tn % Row Count 19 (+ 4) % Row 20 \SetRowColor{LightBackground} String{[}{]} Autos = \{"Volvo", "BMW", "Ford", "Mazda"\}; & Ein Array mit dem Namen Autos wurde erzeugt, die Automarken sind die Inhalte des Arrays \tn % Row Count 24 (+ 5) % Row 21 \SetRowColor{white} int{[}{]} Nummer = \{10, 20, 30, 40\}; & Ein Array mit dem Namen Nummer wurde erzeugt, die Zahlen sind die Inhalte des Arrays \tn % Row Count 29 (+ 5) % Row 22 \SetRowColor{LightBackground} System.out.println(Autos{[}0{]}); & Gibt due Automarke aus die an der ersten Stelle des Arrays steht (es wird bei 0 und nicht 1 angefangen) \tn % Row Count 35 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Java Basics (cont)}} \tn % Row 23 \SetRowColor{LightBackground} Autos{[}0{]} = "Opel"; & Ändert die erste Automarke zu Opel und nicht Volvo \tn % Row Count 3 (+ 3) % Row 24 \SetRowColor{white} \seqsplit{System.out.println(cars.length);} & Gibt die Anzahl an Gegenst{\"a}nden im Array aus \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.64 cm} x{5.36 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Javascript basics}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Javascript wird immer zwischen \textless{}script\textgreater{} und \textless{}/script\textgreater{} geschrieben} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{document.write("Ja")} & Gibt "Ja" aus \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} let x, y, z; & Erzeugt x, y, z \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} x = 5; & X wurde der Wert 5 zugewiesen \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} z = x + y; & Die Variable z ist gleich x plus y \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} var & Deklaration einer Variable die in der ganzen Funktion genutzt werden k{\"o}nnen \tn % Row Count 12 (+ 3) % Row 6 \SetRowColor{LightBackground} let & Deklaration einer Variable die nur im aktuellen Block genutzt werden kann \tn % Row Count 15 (+ 3) % Row 7 \SetRowColor{white} return & Beendet die Funktion und kann Text und variablen ausgeben \tn % Row Count 18 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{HTML basics}} \tn % Row 0 \SetRowColor{LightBackground} \textless{}html\textgreater{} \textless{}/html\textgreater{} & Erzeugt ein HTML Dokument \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textless{}head\textgreater{} \textless{}/head\textgreater{} & Erzeugt den Kopf des Dokuments, dies wird nicht angezeigt \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \textless{}body\textgreater{} \textless{}/body\textgreater{} & Erzeugt den K{\"o}rper des Dokuments, dieser wird angezeigt \tn % Row Count 8 (+ 3) % Row 3 \SetRowColor{white} \textless{}title\textgreater{} Titel \textless{}/title\textgreater{} & Der Titel des Dokuments \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} \textless{}p\textgreater{} Text \textless{}/p\textgreater{} & Erzeugt einen neuen Paragraph in dem geschrieben werden kann \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} \textless{}br\textgreater{} & Beendet die Zeile bzw erzeugt eine leere Zeile \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} \textless{}h1\textgreater{} \textless{}/h1\textgreater{} bis zu \textless{}h6\textgreater{} \textless{}/h6\textgreater{} & Erzeugt Überscrhriften, h1 ist das gr{\"o}{\ss}te und h6 das kleinste \tn % Row Count 18 (+ 3) % Row 7 \SetRowColor{white} \textless{}table\textgreater{} \textless{}/table\textgreater{} & Erzeugt eine Tabelle \tn % Row Count 19 (+ 1) % Row 8 \SetRowColor{LightBackground} \textless{}tr\textgreater{} \textless{}/tr\textgreater{} & Erzeugt eine Zeile in der Tabelle \tn % Row Count 21 (+ 2) % Row 9 \SetRowColor{white} \textless{}th\textgreater{} Überschrift \textless{}/th\textgreater{} & Erzeugt eine Überschrift in einer Zeile \tn % Row Count 23 (+ 2) % Row 10 \SetRowColor{LightBackground} \textless{}td\textgreater{} Inhalt \textless{}/td\textgreater{} & Erzeugt den Inhalt der Tabelle in einer Zeile \tn % Row Count 25 (+ 2) % Row 11 \SetRowColor{white} \textless{}a href="URL"\textgreater{}Link hier\textless{}/a\textgreater{} & Erzeugt einen klickbaren Link \tn % Row Count 27 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{4 cm} x{4 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{XML basics}} \tn % Row 0 \SetRowColor{LightBackground} \textless{}?xml version="1.0" encoding="UTF-8"?\textgreater{} & Legt die XML Version fest \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textless{}Frühstück\textgreater{} \textless{}/Frühstück\textgreater{} & Erzeugt eine Kategorie mit dem Namen Frühstück \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} \textless{}Frühstück\textgreater{} Pfannkuchen \textless{}/Frühstück\textgreater{} & Die Information "Pfannkuchen" ist in der Kategorie Frühstück gespeichert \tn % Row Count 9 (+ 4) % Row 3 \SetRowColor{white} \textless{}Frühstück\textgreater{}\{\{nl\}\} \textless{}Vegan\textgreater{} Toast \textless{}/Vegan\textgreater{} \{\{nl\}\}\textless{}/Frühstück\textgreater{} & Eine Unterkategorie mit dem Namen Vegan wurde in der Kategorie Frühstück erzeugt, dort wurde Toast als information gespeichert \tn % Row Count 16 (+ 7) % Row 4 \SetRowColor{LightBackground} \textless{}Essen\textgreater{} \{\{nl\}\} \textless{}Name\textgreater{}Pfannkuchen\textless{}/Name\textgreater{} \{\{nl\}\} \textless{}Preis\textgreater{}3€\textless{}/Preis\textgreater{} \{\{nl\}\} \textless{}/Essen\textgreater{} & Informationen zum Essen Pfannkuchen \tn % Row Count 21 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}