Skip to content
Snippets Groups Projects
Commit 41ca169e authored by Benjamin Stamm's avatar Benjamin Stamm
Browse files

corrected a few German-related issues in worksheet 0

parent d3357d14
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:16b28ead tags:
# Installation and Setup
Please follow the steps 1-3 outlined in README.md to download and install Julia, and to open the notebook 0_Installation.ipynb in a Jupyter notebook.
%% Cell type:markdown id:31ac33c0-18a9-4cfa-8e04-3ee1a0c909eb tags:
# Installation und Einrichtung
%% Cell type:markdown id:8829affd tags:
## Software and material
The course requires various things: a working installation of [Julia 1.9](https://julialang.org/downloads/), [Jupyter](https://jupyter.org/), [IJulia.jl](https://github.com/JuliaLang/IJulia.jl), the course material and various dependencies. To get everything follow these steps:
### 1) Getting Julia
For following the course you will need **Julia 1.9**.
Julia can be easily obtained in binary form from [Julia downloads](https://julialang.org/downloads/).
### 2) Getting all the rests
To get the remaining files and dependencies start up `julia` and in the resulting REPL shell, copy and paste the following:
```julia
import Downloads
script = Downloads.download("https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/-/raw/main/install.jl?ref_type=heads")
include(script)
```
This [downloads the install.jl script](https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/-/raw/main/install.jl?ref_type=heads) and runs it from julia.
### 2) Getting all the rest (expert version)
As an alternative you can also also run the following commands manually (this requires to have `git` and `julia` available from the commandline):
```
git clone https://gitlab.mathematik.uni-stuttgart.de/stammbn/Julia-seminar/
cd Julia-seminar
julia install-manual.jl
```
### 3) Starting the notebook
#### From Julia REPL
To start the notebook make sure to be in the folder `Julia-seminar` and then run `julia`: an interactive Julia command line will open. In there run this command
```julia
using Pkg
Pkg.activate(pwd())
using IJulia
notebook(dir=pwd())
```
and the notebook will automatically open in a browser.
Navigate the files and open notebook number 0.
#### From command line
Alternatively, one can open the notebook from the command line:
```bash
julia -L start_notebook.jl
```
### \* For users with multiple Julia versions
For users with multiple Julia versions, if the corresponding kernel cannot be found in Jupyter Notebook, please run `installkernel("julia", "--project=@.")` (only once) before executing `notebook(dir=pwd())` to first install the kernel:
```julia
using Pkg
Pkg.activate(pwd())
using IJulia
installkernel("julia", "--project=@.")
notebook(dir=pwd())
```
Now, one should find a new kernel related to the current Julia version, named `julia "Julia-version"`, in Jupyter Notebook.
### Troubleshooting
If you are facing issues, check out
the [great troubleshooting section](https://carstenbauer.github.io/WorkshopWizard.jl/dev/troubleshooting/)
from the WorkshopWizard package by Carsten Bauer (which is being used by `install.jl`).
%% Cell type:markdown id:b495d658-ab7a-41fb-819e-0fef02c10772 tags:
## Software und Material
Der Kurs erfordert verschiedene Dinge: eine funktionierende Installation von [Julia 1.9](https://julialang.org/downloads/), [Jupyter](https://jupyter.org/), [IJulia.jl](https://github.com/JuliaLang/IJulia.jl), das Kursmaterial und verschiedene Abhängigkeiten. Um alles zu herunterzuladen und zu installieren, befolgst Du diese Schritte:
### 1) Julia herunterladen
Um dem Kurs zu folgen, benötigst du **Julia 1.9**.
Julia kann leicht in binärer Form von den [Julia-Downloads](https://julialang.org/downloads/) bezogen werden.
### 2) Alles andere
Um die verbleibenden Dateien und Abhängigkeiten zu erhalten, starte `julia` und kopiere im resultierenden REPL-Shell folgenden Code:
```julia
import Downloads
script = Downloads.download("https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/-/raw/main/install.jl?ref_type=heads")
include(script)
```
Das [lädt das install.jl-Skript herunter](https://gitlab.mathematik.uni-stuttgart.de/stammbn/julia-seminar/-/raw/main/install.jl?ref_type=heads) und führt es in Julia aus.
### 2) Alles andere (Experten-Version)
Als Alternative kannst Du auch die folgenden Befehle manuell ausführen (dies setzt voraus, dass `git` und `julia` von der Kommandozeile aus verfügbar sind):
```
git clone https://gitlab.mathematik.uni-stuttgart.de/stammbn/Julia-seminar/
cd Julia-seminar
julia install-manual.jl
```
### 3) Das Notebook starten
#### Aus der Julia REPL
Um das Notebook zu starten, stellen Sie sicher, dass Sie sich im Ordner `Julia-Seminar` befinden, und führen Sie dann `julia` aus: Eine interaktive Julia-Befehlszeile wird geöffnet. Führen Sie darin den folgenden Befehl aus:
```julia
using Pkg
Pkg.activate(pwd())
using IJulia
notebook(dir=pwd())
```
und das Notebook wird automatisch in einem Browser geöffnet.
Navigieren Sie zu den Dateien und öffnen Sie das Notebook Nummer 0.
#### Über die Befehlszeile
Alternativ kann man das Notebook auch über die Befehlszeile öffnen:
```bash
julia -L start_notebook.jl
```
### \* Für Benutzer mit mehreren Julia-Versionen
Für Benutzer mit mehreren Julia-Versionen, falls der entsprechende Kernel in Jupyter Notebook nicht gefunden werden kann, führen Sie bitte `installkernel("julia", "--project=@.")` (nur einmal) aus, bevor Sie `notebook(dir=pwd())` ausführen, um zuerst den Kernel zu installieren:
```julia
using Pkg
Pkg.activate(pwd())
using IJulia
installkernel("julia", "--project=@.")
notebook(dir=pwd())
```
Nun sollte man in Jupyter Notebook einen neuen Kernel finden, der mit der aktuellen Julia-Version verknüpft ist und den Namen `julia "Julia-Version"` trägt.
### Fehlerbehebung
Wenn Du auf Probleme stößt, werfe einen Blick auf den [ausgezeichneten Problembehandlungsabschnitt](https://carstenbauer.github.io/WorkshopWizard.jl/dev/troubleshooting/) aus dem WorkshopWizard-Paket von Carsten Bauer (das von `install.jl` verwendet wird).
Bitte befolge die in README.md beschriebenen Schritte 1-3, um Julia herunterzuladen und zu installieren, und das Notebook 0_Installation.ipynb in einen Jupyter-notebook zu öffnen.
%% Cell type:markdown id:9161160b-87ff-4b12-bd5a-bca54228672d tags:
## Information about notebooks
Notebooks are tools to interactively run code and display output. They are quite convenient for experimenting with code.
The julia commands are run in a backend julia instance, the browser let's you interact with the notebooks (create new ones, run them, modify them). If the backend program is closed, the browser editor will stop working.
However, if the browser is closed, the backend will keep running. You can get back to it by opening the address:
[http://localhost:8888](http://localhost:8888)
%% Cell type:markdown id:ff3c6951-2bc8-42b9-b2f4-acbb473300c6 tags:
## Informationen zu Notebooks
Notebooks sind Werkzeuge, um interaktiven Code auszuführen und die Ausgabe anzuzeigen. Sie sind sehr praktisch, um mit Code zu experimentieren und eine Programmiersprache neu zu lernen.
Die Julia-Befehle werden in einer separaten Julia-Instanz im Hintergrund ausgeführt, der Browser ermöglicht die Interaktion mit den Notebooks (das Erstellen neuer Notebooks, das Ausführen und Modifizieren von ihnen). Beachte dass der Browser-Editor nicht mehr funktioniert wenn das Backend-Programm geschlossen wird.
Wenn jedoch der Browser geschlossen wird, läuft das Backend weiter. Du kannst darauf zugreifen, indem Du die Adresse öffnest:
[http://localhost:8888](http://localhost:8888)
%% Cell type:markdown id:a915cd2f-dc38-4679-8d79-c2204e2073cf tags:
### Notebooks
Notebooks are files characterized by the extension `.ipynb`. Using the interactive file explorer you can open them.
The notebooks contain code, the output of the code, and can contain additional comments (like these ones). All the material of the course does not contain yet the output of the code, you will get it by running the code first.
The notebooks are automatically saved every now and then, however to make sure they are saved, you can press "Ctrl + S".
%% Cell type:markdown id:c974b7c0-119c-4223-ad80-dce5a3ceead3 tags:
### Notebooks
Notebooks sind Dateien, die durch die Erweiterung `.ipynb` gekennzeichnet sind. Mit dem interaktiven Datei-Explorer kannst Du sie öffnen.
Die Notebooks enthalten Code, die Ausgabe des Codes und können zusätzliche Kommentare enthalten (wie diese hier). Das gesamte Material des Kurses enthält noch nicht die Ausgabe des Codes, Du erhälst sie, indem Du den Code zuerst ausführst.
Die Notebooks werden automatisch alle paar Minuten gespeichert, um jedoch sicherzustellen, dass sie gespeichert sind, kannst Du "Strg + S" drücken.
%% Cell type:markdown id:93606623-16a4-4263-9906-a79dd3fae22f tags:
### Cells
Notebooks are made up of **cells**. There are two main types: **code** and **markdown**. This is a markdown cell, it is used to display text in a formatted way.
The next is a code cell, it is used to run code and display its output. To run it, click on it and press "Shift + Enter".
%% Cell type:markdown id:8c98e5f5-5a92-415a-b9ec-865972d45b6f tags:
### Zellen
Notebooks bestehen aus **Zellen**. Es gibt zwei Hauptarten: **Code** und **Markdown**. Dies ist eine Markdown-Zelle und wird verwendet, um Text auf eine formatierte Weise anzuzeigen.
Die nächste ist eine Code-Zelle und wird verwendet, um Code auszuführen und dessen Ausgabe anzuzeigen. Um sie auszuführen, klicken Sie darauf und drücken Sie Shift + Enter.
%% Cell type:code id:8074a659-e100-49db-b83c-f0738b25cf28 tags:
``` julia
println("Hello World!")
```
%% Cell type:markdown id:5fc38ba1-65d0-490f-8c06-4136a7ff1372 tags:
When you click on a code cell, you can also modify its content.
To modify a markdown cell, you need to double click on it (however this is not required by this course).
It is also possible to transform a code cell in a markdown cell, or the other way around. To do so, go in the top menu, Run, Cell Type.
Finally, new cells can be added by using the `+` symbol in the top menu.
Every time there is an exercise left to the reader, we added an empty code cell.
%% Cell type:markdown id:192dac00-072c-4699-bd06-9af6ae4e3055 tags:
Wenn Du auf eine Code-Zelle klickst, kannst Du auch deren Inhalt ändern. Um eine Markdown-Zelle zu ändern, musst Du darauf doppelklicken (dies ist jedoch für diesen Kurs nicht erforderlich).
Es ist auch möglich, eine Code-Zelle in eine Markdown-Zelle oder umgekehrt zu ändern. Gehe dazu im oberen Menü auf Ausführen, Zellentyp.
Schließlich können neue Zellen hinzugefügt werden, indem Du das `+`-Symbol im oberen Menü verwendest.
Jedes Mal, wenn eine Übung für den Leser übrig bleibt, haben wir eine leere Code-Zelle hinzugefügt.
Jedes Mal, wenn es eine Übung für den Leser gibt, haben wir eine leere Code-Zelle hinzugefügt.
%% Cell type:markdown id:d3d75953 tags:
## Verifying that everything works
To check if the installation was successfull, run the following cell.
%% Cell type:markdown id:e7730114-5064-46d1-b724-e92277ff2f90 tags:
## Überprüfen, ob alles funktioniert
Um zu überprüfen, ob die Installation erfolgreich war, führe die folgende Zelle aus.
%% Cell type:code id:7bb04662 tags:
``` julia
using Plots
p = plot(1, xlim=(0, 3π), ylim=(-1.5, 1.5), title="Sine", marker=2)
N = 100
@gif for i=1:N
x = (i-1) * 3π / N
push!(p, x, sin(x))
end
```
%% Cell type:code id:c7d2870e tags:
``` julia
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment