From 88efaac4e9d2f833bf927ab4b5cab98fc8b729b4 Mon Sep 17 00:00:00 2001
From: Balthasar Teuscher <balthasar.teuscher@tum.de>
Date: Mon, 21 Nov 2022 22:30:24 +0100
Subject: [PATCH 1/4] Generate cpp output

---
 Makefile                  |  1 +
 cpp/.gitignore            |  8 +++++++-
 files/libraries_happly.md | 26 ++++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 40f257e..358c7c6 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,7 @@ build_preprocess:
 	./in2md.sh files/cppintro.md.in > files/cppintro.md
 	./in2md.sh files/libraries_happly.md.in > files/libraries_happly.md
 	./in2md.sh files/libraries_happly_boostgeometry.md.in > files/libraries_happly_boostgeometry.md
+	cd cpp && ./maker.sh && cd ..
 
 build_jupyter_books:
 	for book in $(BOOKS) ; do \
diff --git a/cpp/.gitignore b/cpp/.gitignore
index 2158893..02a2d30 100644
--- a/cpp/.gitignore
+++ b/cpp/.gitignore
@@ -1,3 +1,9 @@
-out.ply
+# files without an extension
+*
+!/**/
+!*.*
+
+# specific extensions
 *out
 *.o
+*.ply
\ No newline at end of file
diff --git a/files/libraries_happly.md b/files/libraries_happly.md
index 343291a..b1cc3e4 100644
--- a/files/libraries_happly.md
+++ b/files/libraries_happly.md
@@ -90,10 +90,36 @@ run:
 ````
 ````{tab-item} Build Output
 ```
+g++ -Wall -march=native -Ofast -o libs_pcl_happly libs_pcl_happly.cpp  `pkg-config --cflags --libs eigen3`
 ```
 ````
 ````{tab-item} Run Output
 ```
+./libs_pcl_happly ../data/sofa_0007.off.ply
+1.19209e-07 5.35772e-09           1
+   0.968583    -0.24869 5.35772e-09
+    0.24869    0.968583 1.19209e-07
+X:12.5626 1.57161 62.3903
+Y:12.5626 1.57161 62.3903
+X:10.5998 26.6352  34.551
+Y:10.5998 26.6352  34.551
+X:  -13.9611 -0.0370637   -52.1099
+Y:  -13.9611 -0.0370638   -52.1099
+X:0.212058  8.69847  50.2384
+Y:0.212058  8.69847  50.2384
+X:19.5171 19.3644  53.821
+Y:19.5171 19.3644  53.821
+X:-8.74778 -33.4929 -27.8639
+Y:-8.74778 -33.4929 -27.8639
+X:-2.20324  27.7459  50.2467
+Y:-2.20324  27.7459  50.2467
+X:-5.69343 -27.1792 -50.2527
+Y:-5.69343 -27.1792 -50.2527
+X:-9.87796  38.5962  7.98784
+Y:-9.87796  38.5962  7.98784
+X:-13.9611  28.2719 -8.07317
+Y:-13.9611  28.2719 -8.07317
+Warper
 ```
 ````
 ````` 

From 3b94ef83fdf5da4bc0b6700c51250b6384b4dbc6 Mon Sep 17 00:00:00 2001
From: Balthasar Teuscher <balthasar.teuscher@tum.de>
Date: Mon, 21 Nov 2022 22:32:38 +0100
Subject: [PATCH 2/4] Remove index hack, link to books directly

---
 Makefile   |  1 -
 index.html | 12 ------------
 2 files changed, 13 deletions(-)
 delete mode 100644 index.html

diff --git a/Makefile b/Makefile
index 358c7c6..80d5e29 100644
--- a/Makefile
+++ b/Makefile
@@ -26,7 +26,6 @@ build_merge_html:
 	for book in $(BOOKS) ; do \
 		cp -a _build/$${book}/_build/html/. _html/$${book}/ ; \
 	done
-	cp index.html _html
 
 deploy:
 	cp _html/* /var/www/html/programming -R
diff --git a/index.html b/index.html
deleted file mode 100644
index bb3d77e..0000000
--- a/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<HTML>
-  <BODY>
-    <H1>Note: The scripts have been split into two pieces for your convenience</H1>
-    <UL>
-      <LI>    <A HREF="computational-foundations-1">Computational Foundations I</A>
-      </LI>
-      <LI>
-	<A HREF="principles-of-programming">Principles of Programming </A>
-      </LI>
-    </UL>
-  </BODY>
-  </HTML>

From fa3e058026fba996cf6c3b06f930f18b43e78d53 Mon Sep 17 00:00:00 2001
From: Balthasar Teuscher <balthasar.teuscher@tum.de>
Date: Tue, 22 Nov 2022 14:17:34 +0100
Subject: [PATCH 3/4] Check in cpp outputs

---
 Makefile                          |  2 +-
 cpp/.gitignore                    |  3 +--
 cpp/00_helloworld.makeout         |  1 +
 cpp/00_helloworld.mk              |  4 ++--
 cpp/00_helloworld.runout          |  2 ++
 cpp/01_oldhelloworld.makeout      |  1 +
 cpp/01_oldhelloworld.runout       |  2 ++
 cpp/02_functionsignatures.makeout |  1 +
 cpp/02_functionsignatures.runout  |  3 +++
 cpp/03_library.makeout            |  3 +++
 cpp/03_library.runout             |  3 +++
 cpp/libs_pcl_happly.makeout       |  1 +
 cpp/libs_pcl_happly.runout        | 25 +++++++++++++++++++++++++
 13 files changed, 46 insertions(+), 5 deletions(-)
 create mode 100644 cpp/00_helloworld.makeout
 create mode 100644 cpp/00_helloworld.runout
 create mode 100644 cpp/01_oldhelloworld.makeout
 create mode 100644 cpp/01_oldhelloworld.runout
 create mode 100644 cpp/02_functionsignatures.makeout
 create mode 100644 cpp/02_functionsignatures.runout
 create mode 100644 cpp/03_library.makeout
 create mode 100644 cpp/03_library.runout
 create mode 100644 cpp/libs_pcl_happly.makeout
 create mode 100644 cpp/libs_pcl_happly.runout

diff --git a/Makefile b/Makefile
index 80d5e29..761e94f 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ BOOKS = principles-of-programming computational-foundations-1
 
 all: build deploy
 
-build: build_preprocess build_jupyter_books build_pdflatex build_merge_html
+build: build_jupyter_books build_pdflatex build_merge_html
 
 build_preprocess:
 	./in2md.sh files/cppintro.md.in > files/cppintro.md
diff --git a/cpp/.gitignore b/cpp/.gitignore
index 02a2d30..b6f6e05 100644
--- a/cpp/.gitignore
+++ b/cpp/.gitignore
@@ -3,7 +3,6 @@
 !/**/
 !*.*
 
-# specific extensions
-*out
 *.o
+
 *.ply
\ No newline at end of file
diff --git a/cpp/00_helloworld.makeout b/cpp/00_helloworld.makeout
new file mode 100644
index 0000000..c6f2a9c
--- /dev/null
+++ b/cpp/00_helloworld.makeout
@@ -0,0 +1 @@
+g++ -Wall -o 00_helloworld.out 00_helloworld.cpp
diff --git a/cpp/00_helloworld.mk b/cpp/00_helloworld.mk
index 6879e4c..5ece005 100644
--- a/cpp/00_helloworld.mk
+++ b/cpp/00_helloworld.mk
@@ -1,4 +1,4 @@
 all: 
-	g++ -Wall -o 00_helloworld.out 00_helloworld.cpp
+	g++ -Wall -o 00_helloworld 00_helloworld.cpp
 run: 
-	./00_helloworld.out
+	./00_helloworld
diff --git a/cpp/00_helloworld.runout b/cpp/00_helloworld.runout
new file mode 100644
index 0000000..b7858c1
--- /dev/null
+++ b/cpp/00_helloworld.runout
@@ -0,0 +1,2 @@
+./00_helloworld.out
+Hello World!
diff --git a/cpp/01_oldhelloworld.makeout b/cpp/01_oldhelloworld.makeout
new file mode 100644
index 0000000..d9d4b6d
--- /dev/null
+++ b/cpp/01_oldhelloworld.makeout
@@ -0,0 +1 @@
+g++ -Wall -o 01_oldhelloworld 01_oldhelloworld.cpp
diff --git a/cpp/01_oldhelloworld.runout b/cpp/01_oldhelloworld.runout
new file mode 100644
index 0000000..1e4c1b9
--- /dev/null
+++ b/cpp/01_oldhelloworld.runout
@@ -0,0 +1,2 @@
+./01_oldhelloworld
+Hello World!
diff --git a/cpp/02_functionsignatures.makeout b/cpp/02_functionsignatures.makeout
new file mode 100644
index 0000000..eac84b3
--- /dev/null
+++ b/cpp/02_functionsignatures.makeout
@@ -0,0 +1 @@
+g++ -Wall -o 02_functionsignatures 02_functionsignatures.cpp
diff --git a/cpp/02_functionsignatures.runout b/cpp/02_functionsignatures.runout
new file mode 100644
index 0000000..6aa3ef6
--- /dev/null
+++ b/cpp/02_functionsignatures.runout
@@ -0,0 +1,3 @@
+./02_functionsignatures
+doubled(4)=8
+doubled(4.5)=9
diff --git a/cpp/03_library.makeout b/cpp/03_library.makeout
new file mode 100644
index 0000000..032b701
--- /dev/null
+++ b/cpp/03_library.makeout
@@ -0,0 +1,3 @@
+g++ -c 03_doubled.cpp -o 03_doubled.o
+g++ -c 03_library.cpp -o 03_library.o
+g++ -o 03_library 03_library.o 03_doubled.o
diff --git a/cpp/03_library.runout b/cpp/03_library.runout
new file mode 100644
index 0000000..f8d20da
--- /dev/null
+++ b/cpp/03_library.runout
@@ -0,0 +1,3 @@
+./03_library
+doubled(4)=8
+doubled(4.5)=9
diff --git a/cpp/libs_pcl_happly.makeout b/cpp/libs_pcl_happly.makeout
new file mode 100644
index 0000000..9c49f51
--- /dev/null
+++ b/cpp/libs_pcl_happly.makeout
@@ -0,0 +1 @@
+g++ -Wall -march=native -Ofast -o libs_pcl_happly libs_pcl_happly.cpp  `pkg-config --cflags --libs eigen3`
diff --git a/cpp/libs_pcl_happly.runout b/cpp/libs_pcl_happly.runout
new file mode 100644
index 0000000..1b3ac4b
--- /dev/null
+++ b/cpp/libs_pcl_happly.runout
@@ -0,0 +1,25 @@
+./libs_pcl_happly ../data/sofa_0007.off.ply
+1.19209e-07 5.35772e-09           1
+   0.968583    -0.24869 5.35772e-09
+    0.24869    0.968583 1.19209e-07
+X:12.5626 1.57161 62.3903
+Y:12.5626 1.57161 62.3903
+X:10.5998 26.6352  34.551
+Y:10.5998 26.6352  34.551
+X:  -13.9611 -0.0370637   -52.1099
+Y:  -13.9611 -0.0370638   -52.1099
+X:0.212058  8.69847  50.2384
+Y:0.212058  8.69847  50.2384
+X:19.5171 19.3644  53.821
+Y:19.5171 19.3644  53.821
+X:-8.74778 -33.4929 -27.8639
+Y:-8.74778 -33.4929 -27.8639
+X:-2.20324  27.7459  50.2467
+Y:-2.20324  27.7459  50.2467
+X:-5.69343 -27.1792 -50.2527
+Y:-5.69343 -27.1792 -50.2527
+X:-9.87796  38.5962  7.98784
+Y:-9.87796  38.5962  7.98784
+X:-13.9611  28.2719 -8.07317
+Y:-13.9611  28.2719 -8.07317
+Warper

From 240480810ed263603206aebdbb98993d75cefc7b Mon Sep 17 00:00:00 2001
From: Balthasar Teuscher <balthasar.teuscher@tum.de>
Date: Tue, 22 Nov 2022 14:45:31 +0100
Subject: [PATCH 4/4] Some fixes

---
 Makefile                             | 4 ++--
 computational-foundations-1_intro.md | 1 -
 principles-of-programming_intro.md   | 1 -
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 761e94f..02ec02d 100644
--- a/Makefile
+++ b/Makefile
@@ -22,13 +22,13 @@ build_pdflatex:
 	done
 
 build_merge_html:
-	mkdir -p _html
+	rm -rf _html && mkdir -p _html
 	for book in $(BOOKS) ; do \
 		cp -a _build/$${book}/_build/html/. _html/$${book}/ ; \
 	done
 
 deploy:
-	cp _html/* /var/www/html/programming -R
+	rsync -a --delete _html/ /var/www/html/programming
 
 upload:
 	rsync --no-perms --no-owner --no-group -avz --delete-after  _html/* di67nav@webdev02-tum.lrz.de:~/webserver/htdocs/en/teaching/oer/programming
diff --git a/computational-foundations-1_intro.md b/computational-foundations-1_intro.md
index 3c6fcae..f2b5e5c 100644
--- a/computational-foundations-1_intro.md
+++ b/computational-foundations-1_intro.md
@@ -50,4 +50,3 @@ First the dates in 2022/23:
 |24.01.2023 | Lecture  |
 |31.01.2023 | Lecture  |
 |07.02.2023 | Lecture  |
-|-----------|--------------------|
diff --git a/principles-of-programming_intro.md b/principles-of-programming_intro.md
index 66e0031..a223003 100644
--- a/principles-of-programming_intro.md
+++ b/principles-of-programming_intro.md
@@ -71,7 +71,6 @@ First the dates in 2022/23:
 |24.01.2023 | Lecture + Tutorial |
 |31.01.2023 | Lecture + Tutorial |
 |07.02.2023 | Lecture + Tutorial |
-|-----------|--------------------|
 
 ## Modules