C++ SS 22 - Übung 1

This commit is contained in:
2022-03-28 11:09:42 +02:00
parent 991225af2c
commit f1d3d998a9
4 changed files with 1484 additions and 0 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

+473
View File
@@ -0,0 +1,473 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{iwrexercise}[2020/11/10 v1.1 IWR ParComp exercise / exam class]
\RequirePackage{l3keys2e,xparse,kvoptions,etoolbox}
\RequirePackage[utf8]{inputenc}
\ExplSyntaxOn
\msg_new:nnn { iwrexercise } { options / replaced } { The~'#1'~option~does~not~work~with~this~class,
~use~'#2'~instead. }
\bool_new:N \l_iwr_twosided_bool
\bool_new:N \l_iwr_type_set_bool
\keys_define:nn { iwrexercise }
{
solutions .bool_set:N = \l_iwr_solutions_bool,
hidepoints .bool_set:N = \l_iwr_hidepoints_bool,
nogit .bool_set:N = \l_iwr_nogit_bool,
answers .code: n = \msg_warning:nnnn { iwrexercise }{ options / replaced }{ answers }{ solutions },
noanswers .code: n = \msg_warning:nnnn { iwrexercise }{ options / replaced }{ noanswers }{ solutions },
type .choice:,
type / exam .code:n = {
\bool_set_true:N \l_iwr_type_set_bool
\bool_set_true:N \l_iwr_twosided_bool
\AtEndPreamble{
\iwr@setup@exam
\bool_if:NTF \l_iwr_solutions_bool {
\NewDocumentCommand{\iwr@exercise@title}{}{\examsolutionstitlepage}
\RenewDocumentCommand \iwr@aufgabe@post {} {\vspace*{\stretch{1}}\clearpage}
} {
\NewDocumentCommand{\iwr@exercise@title}{}{\examtitlepage}
\RenewDocumentCommand \iwr@aufgabe@post {} {\vspace*{\stretch{1}}\cleardoublepage}
}
}
},
type / sheet .code:n = {
\bool_set_true:N \l_iwr_type_set_bool
\AtEndPreamble{
\iwr@setup@sheet
\bool_if:NTF \l_iwr_solutions_bool {
\NewDocumentCommand{\iwr@exercise@title}{}{\sheetsolutionstitle}
} {
\NewDocumentCommand{\iwr@exercise@title}{}{\sheettitle}
}
}
},
lang .choice:,
lang / german .code:n = {
\bool_set_true:N \l_iwr_lang_german_bool
},
lang / english .code:n = {
\bool_set_false:N \l_iwr_lang_german_bool
},
subject .tl_set:N = \l_iwr_subject_tl,
subject .value_required:n = true,
subject .initial:n = XXX-SUBJECT-XXX,
shortsubject .tl_set:N = \l_iwr_shortsubject_tl,
shortsubject .value_required:n = true,
shortsubject .initial:n = XXX-SHORTSUBJECT-XXX,
datetime .tl_set:N = \l_iwr_datetime_tl,
datetime .value_required:n = true,
datetime .initial:n = ,
duration .tl_set:N = \l_iwr_duration_tl,
duration .value_required:n = true,
duration .initial:n = 0,
}
\keys_set:nn { iwrexercise } { lang = german }
\NewDocumentCommand \iwr@aufgabe@post {} {}
\ProcessKeysOptions{ iwrexercise }
\bool_if:NF \l_iwr_type_set_bool {
\AtEndPreamble{
\iwr@setup@standalone
}
}
\bool_if:NT \l_iwr_solutions_bool {
\PassOptionsToClass{answers}{exam}
}
\bool_if:nT {\l_iwr_twosided_bool && !\l_iwr_solutions_bool} {
\PassOptionsToClass{twoside}{exam}
}
\ExplSyntaxOff
\PassOptionsToClass{a4paper}{exam}
\PassOptionsToClass{11pt}{exam}
\PassOptionsToClass{addpoints}{exam}
% \DeclareVoidOption{solutions}{}
% \DeclareVoidOption{type}{}
% \DeclareVoidOption{oneside}{\OptionNotUsed}
% \DeclareVoidOption{twoside}{\OptionNotUsed}
% \DeclareVoidOption{titlepage}{\OptionNotUsed}
% %\DeclareVoidOption{answers}{\OptionNotUsed}
% \DeclareVoidOption*{%
% \PassOptionsToClass{\CurrentOption}{exam}
% }
% \ProcessKeyvalOptions{iwrexercise}
% Load exam documentclass
\LoadClass{exam}
\RequirePackage[german]{babel}
\RequirePackage[T1]{fontenc}
\RequirePackage{textcomp}
\RequirePackage{amsmath}
\RequirePackage{amsfonts}
\RequirePackage{amssymb}
\RequirePackage{multicol}
\RequirePackage{dsfont}
\RequirePackage{xcolor}
\RequirePackage{hyperref}
\RequirePackage{wasysym}
\RequirePackage{tikz}
\usetikzlibrary{patterns}
\usetikzlibrary{arrows.meta,calc,decorations.markings,math,arrows.meta}
\RequirePackage{todonotes}
\RequirePackage{parskip}
\RequirePackage{booktabs}
\RequirePackage{enumitem}
\RequirePackage{mathtools}
\RequirePackage{titling}
\RequirePackage{subcaption}
\RequirePackage{minted}
\RequirePackage{catchfile}
\RequirePackage{lmodern}
\hypersetup{
colorlinks,
linkcolor={red!50!black},
citecolor={blue!50!black},
urlcolor={blue!80!black}
}
\newminted{cpp}{autogobble,linenos,mathescape}
\newminted{bash}{autogobble,linenos}
\newmintinline{bash}{}
\newmintinline{cpp}{}
\NewDocumentCommand{\Real}{}{\mathbb{R}}
\NewDocumentEnvironment{aufgabe}{s o o}{%
\IfBooleanTF{#1}{%
\IfNoValueTF{#2}{%
\bonusquestion
}{%
\IfNoValueTF{#3}{%
\question[#2]
}{%
\bonustitledquestion{\thequestion: #3}[#2]
}
}
}{%
\IfNoValueTF{#2}{%
\question
}{%
\IfNoValueTF{#3}{%
\question[#2]
}{%
\titledquestion{\thequestion: #3}[#2]
}
}
}
}{\iwr@aufgabe@post}
\ExplSyntaxOn
\NewDocumentCommand \thesubject {} { \l_iwr_subject_tl }
\NewDocumentCommand \theshortsubject {} { \l_iwr_shortsubject_tl }
\NewDocumentCommand \subject { m o } {
\keys_set:nn {iwrexercise} { subject = {#1} }
\IfNoValueTF{#2}{
\keys_set:nn {iwrexercise} { shortsubject = {#1} }
}{
\keys_set:nn {iwrexercise} { shortsubject = {#2} }
}
}
\NewDocumentCommand \thedatetime {} { \l_iwr_datetime_tl }
\NewDocumentCommand \datetime { m } { \keys_set:nn {iwrexercise} { datetime = {#1} } }
\NewDocumentCommand \theduration {} { \l_iwr_duration_tl }
\NewDocumentCommand \duration { m } { \keys_set:nn {iwrexercise} { duration = {#1} } }
\bool_if:NTF \l_iwr_lang_german_bool {
\AtEndPreamble {
\pointpoints{Punkt}{Punkte}
\bonuspointpoints{Bonuspunkt}{Bonuspunkte}
\hqword{Aufgabe}
\hpgword{Seite}
\hpword{Punkte}
\hsword{Ergebnis}
\htword{\textbf{Gesamt}}
\renewcommand{\solutiontitle}{\noindent\textbf{Lösung:}\par\noindent}
}
\NewDocumentCommand \instword {} {IWR,~Universität~Heidelberg}
\NewDocumentCommand \sdatword {} {Abgabedatum}
\NewDocumentCommand \quesword {} {Aufgabe}
\NewDocumentCommand \pageword {} {Seite}
\NewDocumentCommand \soluword {} {Musterlösung}
} {
\AtEndPreamble {
\hqword{Exercise}
\hpgword{Seite}
\hpword{Points}
\hsword{Score}
\htword{\textbf{Total}}
\renewcommand{\solutiontitle}{\noindent\textbf{Solution:}\par\noindent}
}
\NewDocumentCommand \instword {} {IWR,~Heidelberg~University}
\NewDocumentCommand \sdatword {} {Submission~date}
\NewDocumentCommand \quesword {} {Exercise}
\NewDocumentCommand \pageword {} {Page}
\NewDocumentCommand \soluword {} {Sample~Solution}
}
\bool_if:NTF \l_iwr_hidepoints_bool {
\qformat{\large\textbf{\quesword\ \thequestiontitle \hfill}\vrule depth 1em width 0pt}
\bonusqformat{\large\textbf{\quesword\ \thequestiontitle \hfill}\vrule depth 1em width 0pt}
} {
\qformat{\large\textbf{\quesword\ \thequestiontitle \hfill (\thepoints)}\vrule depth 1em width 0pt}
\bonusqformat{\large\textbf{\quesword\ \thequestiontitle \hfill (\thepoints)}\vrule depth 1em width 0pt}
}
\bool_if:NTF \l_iwr_nogit_bool {
\NewDocumentCommand \iwr@git@id {} {}
} {
% Get name of Git repository
\CatchFileDef{\iwr@git@repo}{"|~git~remote~get-url~origin~|~sed~'s|.*/||'~|~sed~'s|.git$||'"}{} %$
\CatchFileDef{\iwr@git@version}{"|~git~describe"}{}
\NewDocumentCommand \iwr@git@id {} {\iwr@git@repo : \iwr@git@version}
}
\ExplSyntaxOff
\extrawidth{1cm}
\extraheadheight{-.8cm}
% Get rid of the question indentation
\renewcommand{\questionshook}{%
\setlength{\itemsep}{1em}%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}
\AtBeginDocument{
\iwr@exercise@title
}
\ExplSyntaxOn
\NewDocumentCommand \iwr@setup@exam {}{
\headrule
\header{\theshortsubject}{\thetitle,~\thedate}{\pageword\ \thepage{}~/~\numpages}
\bool_if:NTF \l_iwr_solutions_bool {
\pagestyle{headandfoot}
\footrule
\footer{}{\textbf{\soluword}}{}
\extrafootheight{-1cm}
}{
\pagestyle{head}
\extrafootheight{-2cm}
}
\coverextrafootheight{-2cm}
}
\NewDocumentCommand \iwr@setup@sheet {}{
\runningheadrule
\runningheader{\theshortsubject}{\thetitle,~\thedate}{\pageword\ \thepage{}~/~\numpages}
\bool_if:NTF \l_iwr_solutions_bool {
\pagestyle{headandfoot}
\runningfootrule
\runningfooter{}{\textbf{\soluword}}{}
\extrafootheight{-1cm}
}{
\pagestyle{head}
\extrafootheight{-2cm}
}
% add a horizontal line above the first question
\BeforeBeginEnvironment{questions}{%
\noindent\rule{\linewidth}{.5pt}%
\vspace*{.5cm}%
}
}
\NewDocumentCommand \iwrclearpageifnoanswers {}{%
\ifprintanswers%
\else%
\clearpage
\fi%
}
\NewDocumentCommand \iwr@setup@standalone {}{
\printanswers
\extrafootheight{-2cm}
\NewDocumentCommand{\iwr@exercise@title}{}{\standalonetitle}
}
\bool_if:NF \l_iwr_type_set_bool {
% patch aufgabe environment to also start and end the document
% This can't be deferred to the setup command
\BeforeBeginEnvironment{aufgabe}{%
\begin{questions}
}
\AfterEndEnvironment{aufgabe}{%
\end{questions}
}
}
\bool_if:NTF \l_iwr_lang_german_bool {
\NewDocumentCommand \covertext {}{
\begin{itemize}[leftmargin=*]
\item Tragen~Sie~bitte~als~erstes~Ihren~Namen~und~Ihre~Matrikelnummer~auf~dem~Deckblatt~ein.
\item Mit~Ihrer~Unterschrift~bestätigen~Sie,~dass~Sie~körperlich~und~geistig~in~der~Lage~sind,~an~der~Klausur~teilzunehmen.
\item Legen~Sie~bitte~Ihren~Studierendenausweis~zur~Kontrolle~bereit.
\item Sollte~sich~Ihr~Gesundheitszustand~während~der~Klausur~verschlechtern,~teilen~Sie~uns~dies~bitte~sofort~mit.~In~diesem~Fall~sind~Sie~verpflichtet,~direkt~einen~Arzt~aufzusuchen~und~uns~schnellstmöglichst~ein~Attest~zukommen~zu~lassen.
\item Sie~haben~für~die~Klausur~insgesamt~\textbf{\theduration{}~Minuten}~Zeit.
\item Für~die~Klausur~sind~keine~Hilfsmittel~zugelassen.
\item Prüfen~Sie~bitte,~ob~Ihre~Klausur~vollständig~ist.
\item Sie~können~Vorder-~und~Rückseiten~der~einzelnen~Aufgaben~beschreiben.
\item Falls~Sie~mehr~Papier~benötigen,~melden~Sie~sich~bitte~bei~uns.
\end{itemize}
\begin{center}
\vspace*{1em}
\textbf{\large Viel~Erfolg!}
\end{center}
}
\NewDocumentCommand \nameword {}{Name}
\NewDocumentCommand \matrword {}{Matrikulationsnummer}
\NewDocumentCommand \signword {}{Unterschrift}
\NewDocumentCommand \leaveempty {}{Diese~Seite~bitte~freilassen}
}{
\NewDocumentCommand \covertext {}{
\begin{itemize}[leftmargin=*]
\item Please~first~enter~your~name~and~your~matriculation~number~on~the~cover~sheet.
\item With~your~signature~you~confirm~that~you~are~physically~and~mentally~able~to~participate~in~the~exam.
\item Please~have~your~student~ID~card~ready~for~inspection.
\item Should~your~health~deteriorate~during~the~exam,~please~inform~us~immediately.~In~this~case~you~are~obliged~to~see~a~doctor~directly~and~send~us~a~medical~certificate~as~soon~as~possible.
\item You~have~a~total~of~\textbf{\theduration{}~minutes}~for~the~exam.
\item No~study~aids~of~any~kind~are~permitted~for~the~exam.
\item Please~check~whether~your~exam~is~complete.
\item You~can~use~both~sides~of~the~sheets~when~working~on~the~exercises.
\item If~you~need~more~paper,~please~contact~us.
\end{itemize}
\begin{center}
\vspace*{1em}
\textbf{\large Good~Luck!}
\end{center}
}
\NewDocumentCommand \nameword {}{Name}
\NewDocumentCommand \matrword {}{Matriculation~Number}
\NewDocumentCommand \signword {}{Signature}
\NewDocumentCommand \leaveempty {}{Please~leave~this~page~empty}
}
\ExplSyntaxOff
\NewDocumentCommand \examtitlepage {}{%
\begin{coverpages}
\vspace*{\stretch{1}}
\begin{center}
\textbf{\Huge \thetitle}\\[1em]
{\huge \thesubject}\\[1em]
{\Large \thedate\\[.2em] \thedatetime}\\[2em]
\fbox{\fbox{\parbox{.9\textwidth}{
\covertext%
}}}
\end{center}
\vspace*{1cm}
\begin{center}
{
\renewcommand{\arraystretch}{2.2}
\begin{tabular}{|l|p{11cm}|}
\hline
\nameword: & \\
\hline
\matrword: & \\
\hline
\signword: & \\
\hline
\end{tabular}
}
\ \\[2cm]
\gradetable[h]\\
\vspace*{\stretch{1}}
{\footnotesize \iwr@git@id}
\end{center}
\clearpage
\vspace*{\stretch{1}}
\begin{center}
\Large \leaveempty%
\end{center}
\vspace*{\stretch{1}}
\cleardoublepage
\end{coverpages}
}
\NewDocumentCommand \examsolutionstitlepage {}{%
\begin{coverpages}
\vspace*{\stretch{1}}
\begin{center}
\textbf{\Huge \thetitle}\\[1em]
{\huge \thesubject}\\[1em]
{\Large \thedate}\\[6em]
\textbf{\Huge \soluword}\\[1em]
\vspace*{\stretch{1}}
{\footnotesize \iwr@git@id}
\end{center}
\clearpage
\end{coverpages}
}
\NewDocumentCommand \sheettitle {}{%
\noindent\textbf{\thesubject}
\hfill\textbf{\thetitle}\\
\theauthor
\hfill
{\sdatword\ \thedate}\\
\instword
\hfill\texttt{\tiny \iwr@git@id}\\
\vspace*{.5cm}
\begin{center}
\textbf{\Large \thetitle}
\end{center}
}
\NewDocumentCommand \sheetsolutionstitle {}{%
\noindent\textbf{\thesubject}
\hfill\textbf{\thetitle}\\
\theauthor
\hfill
{\sdatword\ \thedate}\\
\instword
\hfill\texttt{\tiny \iwr@git@id}\\
\vspace*{.5cm}
\begin{center}
\textbf{\Large \thetitle}\\[.5em]
{\Large \soluword}
\end{center}
}
\NewDocumentCommand \standalonetitle {}{%
{\noindent\huge Aufgabe: \texttt{\textbf{\jobname}}}\\[.5em]
{\noindent\Large git: \texttt{\textbf{\iwr@git@id}}}\\[1em]
\noindent\rule{\linewidth}{.5pt}%
\vspace*{.5cm}%
}
+326
View File
@@ -0,0 +1,326 @@
\documentclass[12pt,a4paper]{exam}
%\usepackage{german}
\usepackage[utf8]{inputenc}
%\usepackage{epsfig}
%\usepackage[amssymb]{SIunits}
\usepackage{wrapfig}
\usepackage{graphics}
\usepackage{tcolorbox}
\tcbuselibrary{minted}
\tcbuselibrary{xparse}
\definecolor{codebg}{rgb}{.85,.85,.85}
\newminted{cpp}{autogobble,linenos,mathescape,bgcolor=codebg}
\newminted{bash}{autogobble,linenos}
\NewTCBListing{bash}{O{}}{%
listing only,
minted language=bash,
minted options={autogobble,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\NewTCBListing{cpp}{O{}}{%
listing only,
minted language=cpp,
minted options={autogobble,mathescape,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\NewTCBListing{cmake}{O{}}{%
listing only,
minted language=cmake,
minted options={autogobble,mathescape,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\NewTCBListing{plaincode}{O{}}{%
listing only,
minted language=text,
minted options={autogobble,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\NewTCBListing{diff}{O{}}{%
listing only,
minted language=diff,
minted options={autogobble,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\NewTCBListing{python}{O{}}{%
listing only,
minted language=python,
minted options={autogobble,#1},
colframe=black!10!white,
arc=.5mm,
boxsep=1mm,
top=0mm,
bottom=0mm,
flush left,
grow to left by=\leftmargin,
}
\newmintinline{bash}{}
\newmintinline{cpp}{}
%----------------------------------------------------
\begin{document}
%------------------------------------------------------------------------------
\thispagestyle{myheadings}
\begin{center}
{\bf \underline{\Large Tutorium Programmierkurs}}\\
%\hfill\\
%{\bf \large }\\
\hfill\\
{\bf \large Sommer 2022 \hfill Übung 1}\\
\end{center}
\noindent
\begin{tabular}{p{16.6cm}}
\hline
\hline\\
\end{tabular}
\\
\noindent
\begin{tabular}{p{12.0cm}p{4.0cm}}
\\
Ada Lovelace war eine britische Mathematikerin und Gesellschaftsdame, die Tochter des Dichters Lord Byron.\\
Sie arbeitete mit Charles Babbage an der von ihm entwickelten Analytical Engine. Die Analytical Engine wurde zwar niemals fertig gestellt, aber Ada Lovelace erkannte das große Potential dahinter über die Verwendung als Maschine zur Berechnung mathematischer Tafeln hinaus, die ihr Erfinder Charles Babbage zunächst im Auge hatte. Dies manifestierte sich 1843 in selbst hinzugefügten Notizen zu ihrer Übersetzung eines Artikels von Luigi Federico Menabrea über die Analytical Engine, die dreimal so lang waren wie der ursprüngliche Text. Die Erkenntnis, dass die Maschine mehr als nur Zahlen verarbeiten könnte, war bahnbrechend, dies wurde jedoch zu ihrer Lebzeit nicht erkannt. Sie legte in ihren Aufzeichnungen und in der Veröffentlichung auch ein konkretes Programm für die Maschine am Beispiel der Berechnung von Bernoulli-Zahlen vor. Daher gilt sie manchen Historikern als erste Programmiererin der Welt.
&
\begin{wrapfigure}[14]{r}{4.0cm}
\hspace{+0.0cm} \vspace{-1.0cm}
\begin{center}
\fbox{\parbox{3.0cm}{ \includegraphics[width=3cm]{ada.jpg}
%\epsfig{file=Newton.ps,width=3.0cm,angle=0}
}}
\\
\hfill\\
\end{center}
\vspace*{-0.3cm} {\large\it Ada Lovelace.}
\end{wrapfigure}
\\
\\
\end{tabular}
\\
\noindent
\begin{tabular}{p{16.6cm}}
\hline
\hline\\
\end{tabular}
\vspace*{-1.0cm}\\
\noindent
%
\section*{\large Aufgabe 1.1: Kommandozeile}\vspace*{-0.0cm}
%
%\begin{aufgabe}[][Kommandozeile]
%
\begin{parts}
\part%
Benutzen Sie die Kommandozeile, um unter Verwendung der in der Vorlesung vorgestellten Befehle
\bashinline{cd} und \bashinline{mkdir} in Ihrem Home-Verzeichnis ein Verzeichnis
\bashinline{uebungen} und darin ein Verzeichnis \bashinline{uebung01} anzulegen.
\begin{bashcode}
~ $ mkdir uebungen
~ $ cd uebungen
uebungen $ mkdir uebung01
uebungen $ cd uebung01
uebung01 $
\end{bashcode}
Wenn Sie nähere Informationen über einen Befehl möchten, schauen Sie sich die Dokumentation des
Befehls, die sogenannte \emph{manpage} mit dem Befehl \bashinline{man BEFEHL} an, z.B.\
\bashinline{man mkdir}. Sie können in der Ausgabe mit den Pfeiltasten scrollen und mit der Taste
\bashinline{"q"} zur Kommandozeile zurückkehren.
\part%
Erstellen Sie in diesem Verzeichnis mit einem Texteditor Ihrer Wahl die Datei
\bashinline{helloworld.cc} mit folgendem Inhalt:
\begin{minted}[autogobble, linenos, frame=single, samepage]{cpp}
#include <iostream>
int main(int argc, char** argv)
{
std::cout << "Hello world!" << std::endl;
return 0;
}
\end{minted}
Kompilieren Sie das Programm und führen Sie es aus. Zum Kompilieren verwenden
wir hier den Gnu compiler \bashinline{g++}, die Option \bashinline{"-o <name>"}
sagt dem Compiler, wie das erzeugte Programm heißen soll.
\begin{bashcode}
uebung01 $ g++ -o helloworld helloworld.cc
uebung01 $ ./helloworld
Hello world!
uebung01 $
\end{bashcode}
\textbf{Hinweis:} Es ist sinnvoll Warnmeldungen beim Compilieren zu
aktivieren. Ersetzen sie dafür \bashinline{"g++"} durch \bashinline{"g++ -Wall"}.
Für den Fall, dass Sie den \bashinline{clang} compiler verwenden
können sie entsprechend \bashinline{"clang++ -Wall"} benutzen.
\part%
Probieren Sie aus, was passiert, wenn Sie die Option \bashinline{"-o <name>"} weglassen. Zur Erinnerung: Sie können
den Inhalt des aktuellen Verzeichnisses mit dem Befehl \bashinline{ls} anzeigen. Versuchen Sie,
das vom erzeugte Programm ohne ein vorangestelltes \bashinline{"./"} auszuführen.
\part%
Geben Sie die Datei \bashinline{helloworld.cc} mit Hilfe des Programms \bashinline{cat} auf der
Kommandozeile aus. Was passiert, wenn Sie das gleiche mit dem kompilierten Program
\bashinline{helloworld} versuchen?
\part%
Suchen Sie mit Hilfe von \bashinline{grep} in der Datei \bashinline{/usr/include/stdio.h} nach dem
Begriff \emph{FILE}. Probieren Sie auch die Option \bashinline{"-n"} aus.
\part%
Suchen Sie mit Hilfe von \bashinline{grep} in der Datei \bashinline{helloworld.cc} nach
\emph{Hello world}. Was beobachten Sie?
\part%
Die Shell trennt Argumente, sobald ein Leerzeichen auftaucht. Sie können dies umgehen, indem Sie
Argumente, die aus mehreren Wörtern bestehen, in Anführungszeichen setzen. Versuchen Sie, den
Befehl aus dem vorhergehenden Aufgabenteil so zum Laufen zu bringen.
\end{parts}
%\begin{solution}
%\begin{bashcode}
%grep -n FILE /usr/include/stdio.h
%\end{bashcode}
%
%Das klappt nicht:
%
%\begin{bashcode}
%grep -n Hello world helloworld.cc
%\end{bashcode}
%
%Das klappt:
%
%\begin{bashcode}
%grep -n 'Hello world' helloworld.cc
%\end{bashcode}
%
%\end{solution}
%
%\end{aufgabe}
\section*{\large Aufgabe 1.2: Kommandozeile für Fortgeschrittene}\vspace*{-0.0cm}
%Kommandozeile für Fortgeschrittene]
Diese Aufgaben sind für die Fortgeschritteneren unter Ihnen, die sich schon mit der Shell
auskennen. Um diese Aufgaben zu lösen, müssen Sie eventuell die \emph{man pages} der Befehle lesen
und / oder im Internet nach Tips suchen.
%\begin{parts}
%
%\part%
Finden Sie mit Hilfe der Shell, Pipes und den Befehlen \bashinline{find} und \bashinline{wc}
heraus, wie viele C-Header-Dateien (Endung \bashinline{.h}) sich im Verzeichnis
\bashinline{/usr/include} und allen Unterverzeichnissen befinden.
%\part%
Finden Sie mit Hilfe der obigen Befehle sowie \bashinline{xargs} und \bashinline{grep} mit einer
passenden \emph{regular expression} heraus, wie viele \emph{include statements} sich in diesen
Dateien befinden. Include statements bestehen aus einer Zeile, die mit \bashinline{#include}
beginnt, allerdings können vor dem \bashinline{#include} noch beliebig viele Leerzeichen stehen.
%\end{parts}
%\begin{solution}
%\begin{parts}
%
%\part%
%
%\begin{bashcode}
%find /usr/include -name "*.h" | wc -l
%\end{bashcode}
%
%\begin{itemize}
%\item \bashinline{find ...} findet die Dateien und gibt sie auf die
%Kommandozeile aus
%\item \bashinline{wc -l} zählt Zeilen
%\item \bashinline{|} Der Pipe Operator leitet die Ausgabe des ersten
%Befehls an den zweiten weiter.
%\end{itemize}
%
%\part%
%
%Vermutlich ist das ungefähr:
%
%\begin{bashcode}
%find /usr/include -name "*.h" | xargs grep '^\s*#include' | wc -l
%\end{bashcode}
%
%Habe das aber nicht überprüft, so wichtig ist es dann auch wieder
%nicht. Die Lösung ist hier sowieso nicht so relevant. Es geht eher darum,
%dass man sieht, das mit der Kommandozeile komplizierte Dinge gemacht
%werden können.
%
%\begin{itemize}
%\item \bashinline{xargs} Wende Kommando auf Dateien einer Liste an.
%\item \bashinline{grep} Finde Zeilen die ein bestimmtes Pattern matchen.
%\item \bashinline{'^\s*#include'} Regexp, \bashinline{^} am Anfang der
%Zeile, \bashinline{\s} Leerzeichen, \bashinline{*} davon beliebig
%viele, und dann das eigentliche Suchwort.
%\end{itemize}
%\end{parts}
%\end{solution}
%
%\end{aufgabe}
\end{document}
+685
View File
@@ -0,0 +1,685 @@
%%
%% This is file `article.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% classes.dtx (with options: `article')
%%
%% This is a generated file.
%%
%% Copyright 1993 1994 1995 1996 1997
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file.
%%
%% For further copyright information, and conditions for modification
%% and distribution, see the file legal.txt, and any other copyright
%% notices in this file.
%%
%% This file is part of the LaTeX2e system.
%% ----------------------------------------
%% This system is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%%
%% For error reports concerning UNCHANGED versions of this file no
%% more than one year old, see bugs.txt.
%%
%% Please do not request updates from us directly. Primary
%% distribution is through the CTAN archives.
%%
%%
%% IMPORTANT COPYRIGHT NOTICE:
%%
%% You are NOT ALLOWED to distribute this file alone.
%%
%% You are allowed to distribute this file under the condition that it
%% is distributed together with all the files listed in manifest.txt.
%%
%% If you receive only some of these files from someone, complain!
%%
%%
%% Permission is granted to copy this file to another file with a
%% clearly different name and to customize the declarations in that
%% copy to serve the needs of your installation, provided that you
%% comply with the conditions in the file legal.txt.
%%
%% However, NO PERMISSION is granted to generate or to distribute a
%% modified version of this file under its original name.
%%
%% You are NOT ALLOWED to change this file.
%%
%%
%% MODIFICATION ADVICE:
%%
%% If you want to customize this file, it is best to make a copy of
%% the source file(s) from which it was produced. Use a different
%% name for your copy(ies) and modify the copy(ies); this will ensure
%% that your modifications do not get overwritten when you install a
%% new release of the standard system. You should also ensure that
%% your modified source file does not generate any modified file with
%% the same name as a standard file.
%%
%% You can then easily distribute your modifications by distributing
%% the modified and renamed copy of the source file, taking care to
%% observe the conditions in legal.txt; this will ensure that other
%% users can safely use your modifications.
%%
%% You will also need to produce your own, suitably named, .ins file to
%% control the generation of files from your source file; this file
%% should contain your own preambles for the files it generates, not
%% those in the standard .ins files.
%%
%% The names of the source files used are shown above.
%%
%%
%%
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{article}
[1998/05/05 v1.3y
Standard LaTeX document class]
\newcommand\@ptsize{}
\newif\if@restonecol
\newif\if@titlepage
\@titlepagefalse
\if@compatibility\else
\DeclareOption{a4paper}
{\setlength\paperheight {297mm}%
\setlength\paperwidth {210mm}}
\DeclareOption{a5paper}
{\setlength\paperheight {210mm}%
\setlength\paperwidth {148mm}}
\DeclareOption{b5paper}
{\setlength\paperheight {250mm}%
\setlength\paperwidth {176mm}}
\DeclareOption{letterpaper}
{\setlength\paperheight {11in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{legalpaper}
{\setlength\paperheight {14in}%
\setlength\paperwidth {8.5in}}
\DeclareOption{executivepaper}
{\setlength\paperheight {10.5in}%
\setlength\paperwidth {7.25in}}
\DeclareOption{landscape}
{\setlength\@tempdima {\paperheight}%
\setlength\paperheight {\paperwidth}%
\setlength\paperwidth {\@tempdima}}
\fi
\if@compatibility
\renewcommand\@ptsize{0}
\else
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\fi
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
\if@compatibility\else
\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
\fi
\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
\DeclareOption{draft}{\setlength\overfullrule{5pt}}
\if@compatibility\else
\DeclareOption{final}{\setlength\overfullrule{0pt}}
\fi
\DeclareOption{titlepage}{\@titlepagetrue}
\if@compatibility\else
\DeclareOption{notitlepage}{\@titlepagefalse}
\fi
\if@compatibility\else
\DeclareOption{onecolumn}{\@twocolumnfalse}
\fi
\DeclareOption{twocolumn}{\@twocolumntrue}
\DeclareOption{leqno}{\input{leqno.clo}}
\DeclareOption{fleqn}{\input{fleqn.clo}}
\DeclareOption{openbib}{%
\AtEndOfPackage{%
\renewcommand\@openbib@code{%
\advance\leftmargin\bibindent
\itemindent -\bibindent
\listparindent \itemindent
\parsep \z@
}%
\renewcommand\newblock{\par}}%
}
\ExecuteOptions{letterpaper,10pt,oneside,onecolumn,final}
\ProcessOptions
\input{size1\@ptsize.clo}
\setlength\lineskip{1\p@}
\setlength\normallineskip{1\p@}
\renewcommand\baselinestretch{}
\setlength\parskip{0\p@ \@plus \p@}
\@lowpenalty 51
\@medpenalty 151
\@highpenalty 301
\setcounter{topnumber}{2}
\renewcommand\topfraction{.7}
\setcounter{bottomnumber}{1}
\renewcommand\bottomfraction{.3}
\setcounter{totalnumber}{3}
\renewcommand\textfraction{.2}
\renewcommand\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\renewcommand\dbltopfraction{.7}
\renewcommand\dblfloatpagefraction{.5}
\if@twoside
\def\ps@headings{%
\let\@oddfoot\@empty\let\@evenfoot\@empty
\def\@evenhead{\thepage\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection\quad
\fi
##1}}{}}%
\def\subsectionmark##1{%
\markright {%
\ifnum \c@secnumdepth >\@ne
\thesubsection\quad
\fi
##1}}}
\else
\def\ps@headings{%
\let\@oddfoot\@empty
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\markboth
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\thesection\quad
\fi
##1}}}}
\fi
\def\ps@myheadings{%
\def\@oddfoot{\hfil $\stackrel{\Large\bf\Longrightarrow}{\bf b.w.}$}
\def\@evenfoot{}
% \let\@evenfoot\@empty
% \def\@evenhead{\thepage\hfil\slshape\leftmark}%
% \def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\let\@mkboth\@gobbletwo
\let\sectionmark\@gobble
\let\subsectionmark\@gobble
}
\if@titlepage
\newcommand\maketitle{\begin{titlepage}%
\let\footnotesize\small
\let\footnoterule\relax
\let \footnote \thanks
\null\vfil
\vskip 60\p@
\begin{center}%
{\LARGE \@title \par}%
\vskip 3em%
{\large
\lineskip .75em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1.5em%
{\large \@date \par}% % Set date in \large size.
\end{center}\par
\@thanks
\vfil\null
\end{titlepage}%
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
\else
\newcommand\maketitle{\par
\begingroup
\renewcommand\thefootnote{\@fnsymbol\c@footnote}%
\def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
\long\def\@makefntext##1{\parindent 1em\noindent
\hb@xt@1.8em{%
\hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
\if@twocolumn
\ifnum \col@number=\@ne
\@maketitle
\else
\twocolumn[\@maketitle]%
\fi
\else
\newpage
\global\@topnum\z@ % Prevents figures from going at top of page.
\@maketitle
\fi
\thispagestyle{plain}\@thanks
\endgroup
\setcounter{footnote}{0}%
\global\let\thanks\relax
\global\let\maketitle\relax
\global\let\@maketitle\relax
\global\let\@thanks\@empty
\global\let\@author\@empty
\global\let\@date\@empty
\global\let\@title\@empty
\global\let\title\relax
\global\let\author\relax
\global\let\date\relax
\global\let\and\relax
}
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em}
\fi
\setcounter{secnumdepth}{3}
\newcounter {part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]
\renewcommand \thepart {\@Roman\c@part}
\renewcommand \thesection {\@arabic\c@section}
\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
\newcommand\part{\par
\addvspace{4ex}%
\@afterindentfalse
\secdef\@part\@spart}
\def\@part[#1]#2{%
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{part}%
\addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
\else
\addcontentsline{toc}{part}{#1}%
\fi
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >\m@ne
\Large\bfseries \partname~\thepart
\par\nobreak
\fi
\huge \bfseries #2%
\markboth{}{}\par}%
\nobreak
\vskip 3ex
\@afterheading}
\def\@spart#1{%
{\parindent \z@ \raggedright
\interlinepenalty \@M
\normalfont
\huge \bfseries #1\par}%
\nobreak
\vskip 3ex
\@afterheading}
\newcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\normalfont\Large\bfseries}}
\newcommand\subsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\large\bfseries}}
\newcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\newcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\newcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}
\if@twocolumn
\setlength\leftmargini {2em}
\else
\setlength\leftmargini {2.5em}
\fi
\leftmargin \leftmargini
\setlength\leftmarginii {2.2em}
\setlength\leftmarginiii {1.87em}
\setlength\leftmarginiv {1.7em}
\if@twocolumn
\setlength\leftmarginv {.5em}
\setlength\leftmarginvi {.5em}
\else
\setlength\leftmarginv {1em}
\setlength\leftmarginvi {1em}
\fi
\setlength \labelsep {.5em}
\setlength \labelwidth{\leftmargini}
\addtolength\labelwidth{-\labelsep}
\@beginparpenalty -\@lowpenalty
\@endparpenalty -\@lowpenalty
\@itempenalty -\@lowpenalty
\renewcommand\theenumi{\@arabic\c@enumi}
\renewcommand\theenumii{\@alph\c@enumii}
\renewcommand\theenumiii{\@roman\c@enumiii}
\renewcommand\theenumiv{\@Alph\c@enumiv}
\newcommand\labelenumi{\theenumi.}
\newcommand\labelenumii{(\theenumii)}
\newcommand\labelenumiii{\theenumiii.}
\newcommand\labelenumiv{\theenumiv.}
\renewcommand\p@enumii{\theenumi}
\renewcommand\p@enumiii{\theenumi(\theenumii)}
\renewcommand\p@enumiv{\p@enumiii\theenumiii}
\newcommand\labelitemi{\textbullet}
\newcommand\labelitemii{\normalfont\bfseries \textendash}
\newcommand\labelitemiii{\textasteriskcentered}
\newcommand\labelitemiv{\textperiodcentered}
\newenvironment{description}
{\list{}{\labelwidth\z@ \itemindent-\leftmargin
\let\makelabel\descriptionlabel}}
{\endlist}
\newcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries #1}
\if@titlepage
\newenvironment{abstract}{%
\titlepage
\null\vfil
\@beginparpenalty\@lowpenalty
\begin{center}%
\bfseries \abstractname
\@endparpenalty\@M
\end{center}}%
{\par\vfil\null\endtitlepage}
\else
\newenvironment{abstract}{%
\if@twocolumn
\section*{\abstractname}%
\else
\small
\begin{center}%
{\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
\end{center}%
\quotation
\fi}
{\if@twocolumn\else\endquotation\fi}
\fi
\newenvironment{verse}
{\let\\\@centercr
\list{}{\itemsep \z@
\itemindent -1.5em%
\listparindent\itemindent
\rightmargin \leftmargin
\advance\leftmargin 1.5em}%
\item\relax}
{\endlist}
\newenvironment{quotation}
{\list{}{\listparindent 1.5em%
\itemindent \listparindent
\rightmargin \leftmargin
\parsep \z@ \@plus\p@}%
\item\relax}
{\endlist}
\newenvironment{quote}
{\list{}{\rightmargin\leftmargin}%
\item\relax}
{\endlist}
\if@compatibility
\newenvironment{titlepage}
{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse\newpage
\fi
\thispagestyle{empty}%
\setcounter{page}\z@
}%
{\if@restonecol\twocolumn \else \newpage \fi
}
\else
\newenvironment{titlepage}
{%
\if@twocolumn
\@restonecoltrue\onecolumn
\else
\@restonecolfalse\newpage
\fi
\thispagestyle{empty}%
\setcounter{page}\@ne
}%
{\if@restonecol\twocolumn \else \newpage \fi
\if@twoside\else
\setcounter{page}\@ne
\fi
}
\fi
\newcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\renewcommand\thesection{\@Alph\c@section}}
\setlength\arraycolsep{5\p@}
\setlength\tabcolsep{6\p@}
\setlength\arrayrulewidth{.4\p@}
\setlength\doublerulesep{2\p@}
\setlength\tabbingsep{\labelsep}
\skip\@mpfootins = \skip\footins
\setlength\fboxsep{3\p@}
\setlength\fboxrule{.4\p@}
\renewcommand \theequation {\@arabic\c@equation}
\newcounter{figure}
\renewcommand \thefigure {\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\newenvironment{figure}
{\@float{figure}}
{\end@float}
\newenvironment{figure*}
{\@dblfloat{figure}}
{\end@dblfloat}
\newcounter{table}
\renewcommand\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\newenvironment{table}
{\@float{table}}
{\end@float}
\newenvironment{table*}
{\@dblfloat{table}}
{\end@dblfloat}
\newlength\abovecaptionskip
\newlength\belowcaptionskip
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{#1: #2}%
\ifdim \wd\@tempboxa >\hsize
#1: #2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
\newcommand\@pnumwidth{1.55em}
\newcommand\@tocrmarg{2.55em}
\newcommand\@dotsep{4.5}
\setcounter{tocdepth}{3}
\newcommand\tableofcontents{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
\newcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty\@secpenalty
\addvspace{2.25em \@plus\p@}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\large \bfseries #1\hfil \hb@xt@\@pnumwidth{\hss #2}}\par
\nobreak
\if@compatibility
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\fi
\endgroup
\fi}
\newcommand*\l@section[2]{%
\ifnum \c@tocdepth >\z@
\addpenalty\@secpenalty
\addvspace{1.0em \@plus\p@}%
\setlength\@tempdima{1.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode \bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
#1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\endgroup
\fi}
\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
\newcommand\listoffigures{%
\section*{\listfigurename
\@mkboth{\MakeUppercase\listfigurename}%
{\MakeUppercase\listfigurename}}%
\@starttoc{lof}%
}
\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\newcommand\listoftables{%
\section*{\listtablename
\@mkboth{%
\MakeUppercase\listtablename}{\MakeUppercase\listtablename}}%
\@starttoc{lot}%
}
\let\l@table\l@figure
\newdimen\bibindent
\setlength\bibindent{1.5em}
\newenvironment{thebibliography}[1]
{\section*{\refname
\@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}}%
\list{\@biblabel{\@arabic\c@enumiv}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\@arabic\c@enumiv}}%
\sloppy
\clubpenalty4000
\@clubpenalty \clubpenalty
\widowpenalty4000%
\sfcode`\.\@m}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\endlist}
\newcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
\let\@openbib@code\@empty
\newenvironment{theindex}
{\if@twocolumn
\@restonecolfalse
\else
\@restonecoltrue
\fi
\columnseprule \z@
\columnsep 35\p@
\twocolumn[\section*{\indexname}]%
\@mkboth{\MakeUppercase\indexname}%
{\MakeUppercase\indexname}%
\thispagestyle{plain}\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\let\item\@idxitem}
{\if@restonecol\onecolumn\else\clearpage\fi}
\newcommand\@idxitem{\par\hangindent 40\p@}
\newcommand\subitem{\@idxitem \hspace*{20\p@}}
\newcommand\subsubitem{\@idxitem \hspace*{30\p@}}
\newcommand\indexspace{\par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax}
\renewcommand\footnoterule{%
\kern-3\p@
\hrule\@width.4\columnwidth
\kern2.6\p@}
\newcommand\@makefntext[1]{%
\parindent 1em%
\noindent
\hb@xt@1.8em{\hss\@makefnmark}#1}
\newcommand\contentsname{Contents}
\newcommand\listfigurename{List of Figures}
\newcommand\listtablename{List of Tables}
\newcommand\refname{References}
\newcommand\indexname{Index}
\newcommand\figurename{Figure}
\newcommand\tablename{Table}
\newcommand\partname{Part}
\newcommand\appendixname{Appendix}
\newcommand\abstractname{Abstract}
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
\pagestyle{plain}
\pagenumbering{arabic}
\if@twoside
\else
\raggedbottom
\fi
\if@twocolumn
\twocolumn
\sloppy
\flushbottom
\else
\onecolumn
\fi
\endinput
%%
%% End of file `article.cls'.