Skip to content

Commit

Permalink
doc: Added further readme files to demo programs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximilian Krebs committed Aug 20, 2024
1 parent bb74aa7 commit c1d2e5c
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 50 deletions.
20 changes: 20 additions & 0 deletions demo/code/gauss-seidel-solver/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Gauss Seidel Solver

This example program implements a gauss seidel solver which multiplies two matricies. After the multiplication
the program solves a system of linear equations.

The code makes use of a matrix struct that saves the number of rows, the number of columns and the data.
the file `solver.cpp` implements multiple methods to operate on the matrices.

The order of operations should not be altered:

1) Create the matrices A and B
2) Populate the matrices A and B with their resprective values
3) Create a third matrix C
4) Multiply A and B and save the result in C
5) Create the coefficient matrix and populate it with values
6) Create the bound vector and populate it with values
7) Create a result matrix
8) Call the solve method and execute the solver

The program can be build using the `builder.sh` script
12 changes: 12 additions & 0 deletions demo/code/openssl-encrypt/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OpenSSL encrypt

The program implements a simple application that uses openSSL to generate a keypair and encrypt the given `rawData.txt`.

The code uses openssl als library.

The order of operations should not be altered:

1) Generate the keypair
2) Encrypt the `rawData.txt` file

Further information about the methods provided by openssl can be found [here](https://docs.openssl.org/master/man1/)
1 change: 0 additions & 1 deletion demo/code/openssl-encrypt/includes/keygenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ void init(EVP_PKEY_CTX *context) {


void generateKeyPair(EVP_PKEY *keypair) {
// can change EVP_PKEY_RSA to something else here
EVP_PKEY_CTX *context = EVP_PKEY_CTX_new_id( EVP_PKEY_RSA, nullptr );

init(context);
Expand Down
28 changes: 5 additions & 23 deletions demo/code/openssl-handshake/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
## DEMO: Class based raytracer
# OpenSSL handshake

This example shows the capabilities of the spear viewer regarding implementations using system libraries.
The openssl handshake program makes use of the openssl crypto library to implement a simple program that receives a URL from the user and tries to perform a SSL handshake with the host.

The program will ask the user for a hostname (without the protocol https://www.example.com -> www.example.com). After the user input the program will perform an SSL handshake with the url and print the answer of the hostnames server.
The code uses openssl als library.

### Usage
The order of operations should not be altered:

Create a build dir and generate the build files using cmake. Afterwards build the projekt using make.
```
mkdir build
cmake ..
make
```
The compiled program can be executed by the following command
```
./openssl-handshake
```

### Analysis

Open the project using a vscode instance running the spear-viewer. The `spear.yml` file should already be configured. The following step-by-step guide should yield an useable analysis:

1) Make sure spear and its dependencies are installed
2) Generate a profile using the spear sidebar
3) After the profile generation use the Button `SPEAR Analysis` in the bottom bar of the editor to generate the analysis data.
4) The results of the analysis should be automaticly focused and be visible in the SPEAR sidebar.
Further information about the methods provided by openssl can be found [here](https://docs.openssl.org/master/man1/)
29 changes: 3 additions & 26 deletions demo/code/raytracer/README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,9 @@
## DEMO: Class based raytracer
# Class based raytracer

This example shows the capabilities of the spear viewer regarding implementations using object oriented concepts.

The program generates a ppm image with a sphere in the center of the viewpoint.
The program implements a raytracer using an object oriented approach.
On execution the application will generate a ppm image with a sphere in the center of the viewpoint.

### Attribution;

The demo code is based on the book [_Ray Tracing in One Weekend_](https://raytracing.github.io/books/RayTracingInOneWeekend.html)
by Peter Shirley et al. The implementation follows the first five chapters.

### Usage

Create a build dir and generate the build files using cmake. Afterwards build the projekt using make.
```
mkdir build
cmake ..
make
```
The compiled program can be executed by the following command
```
./raytracer
```

### Analysis

Open the project using a vscode instance running the spear-viewer. The `spear.yml` file should already be configured. The following step-by-step guide should yield an useable analysis:

1) Make sure spear and its dependencies are installed
2) Generate a profile using the spear sidebar
3) After the profile generation use the Button `SPEAR Analysis` in the bottom bar of the editor to generate the analysis data.
4) The results of the analysis should be automaticly focused and be visible in the SPEAR sidebar.
14 changes: 14 additions & 0 deletions demo/code/sha256-calculator/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SHA256 calculator

The SHA256-calculator will use the given `samplefile.txt` and calculates the SHA256 hash value.

The program uses openssl as library.

The order of operatons should not be changed:

1) Calculate the first hash value
2) Read the input file
3) Calculate the second hash value
4) Read the input file

Further information about the methods provided by openssl can be found [here](https://docs.openssl.org/master/man1/)
13 changes: 13 additions & 0 deletions demo/code/weather-data/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Weather data

The weather data program uses the given file `temps.csv` and prints the contained values after calculating some statistical values.

The order of operations should be altered:

1) Read the data from the file into the program
2) Print the read values for the station with the id 757
3) Calculate the average value
4) Calculate the minimal temperature
5) Calculate the maximal temperatur
6) Print the temeperature at each month
7) Print average, min and max temperature

0 comments on commit c1d2e5c

Please sign in to comment.