diff --git a/.scripts/generateREADME.py b/.scripts/generateREADME.py new file mode 100644 index 0000000..ca07ea9 --- /dev/null +++ b/.scripts/generateREADME.py @@ -0,0 +1,49 @@ +import os +import re +from pathlib import Path + +def get_first_title(md_path): + with open(md_path, 'r', encoding='utf-8') as file: + for line in file: + match = re.match(r'^#\s+(.*)', line.strip()) + if match: + return match.group(1) + return "Untitled" + +def extract_leading_number(filename): + match = re.match(r'^(\d{1,2})[_\- ]', filename) + return match.group(1) if match else None + +def generate_markdown_table(directory): + entries = [] + for filename in os.listdir(directory): + if filename.endswith('.md'): + number = extract_leading_number(filename) + if number is None: + continue # Skip files without leading number + filepath = os.path.join(directory, filename) + title = get_first_title(filepath) + entries.append((int(number), number, title, filename)) + + entries.sort(key=lambda x: x[0]) + + table = ["| # | Lecture | Slides |", "|:------|:-----|:------|"] + for _, number, title, filename in entries: + table.append(f"| {number} | [{title}]({filename}) | [Download slides]({Path(filename).stem}-slides.html) |") + + return '\n'.join(table) + +def main(): + directory = "./../" # current directory, or change to any other path + output_file = directory + "README.md" + table_md = generate_markdown_table(directory) + + with open(output_file, 'a', encoding='utf-8') as f: + f.write("# Contents\n\n") + f.write(table_md) + f.write("\n") + + print(f"Index written to {output_file}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/1-introduction-to-csharp-and-dotnet-slides.html b/0-introduction-to-csharp-and-dotnet-slides.html similarity index 94% rename from 1-introduction-to-csharp-and-dotnet-slides.html rename to 0-introduction-to-csharp-and-dotnet-slides.html index 02f9781..38814e4 100644 --- a/1-introduction-to-csharp-and-dotnet-slides.html +++ b/0-introduction-to-csharp-and-dotnet-slides.html @@ -1,4 +1,4 @@ -1. Introduction to C# and .NET
+/* @theme wsuiybveupon7ttrwf1y86brx8jn1excr6rrqrkgej */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}

Introduction to C# and .NET

-
+

Overview

  • C#
  • @@ -25,7 +25,7 @@
  • Base Class Library (BCL)
-
+

C#

@@ -43,7 +43,7 @@
-
+

C# Syntax example

@@ -75,7 +75,7 @@
  • Try out the online compiler!
  • -
    +

    .NET

    • .NET (pronounced dot net) is Microsoft's software framework for building and running web services @@ -89,7 +89,7 @@
    • Type-safe and memory-safe thanks to GC and strict compilers
    -
    +

    .NET vs .NET Framework

    • .NET Framework @@ -111,7 +111,7 @@
    • We will be using .NET Core as the .NET Framework is considered legacy
    -
    +

    Common Language Infrastructure (CLI)

    @@ -130,7 +130,7 @@
    -
    +

    Base Class Library (BCL)

    • Base Class Library (BCL) is a set of libraries that every .NET implementation uses, mostly under the System namespace
    • @@ -143,7 +143,7 @@
    -
    +

    Assignments

    Assignments about this topic can be found here

    diff --git a/1-introduction-to-csharp-and-dotnet.md b/0-introduction-to-csharp-and-dotnet.md similarity index 99% rename from 1-introduction-to-csharp-and-dotnet.md rename to 0-introduction-to-csharp-and-dotnet.md index 68b5b52..a7e3cf7 100644 --- a/1-introduction-to-csharp-and-dotnet.md +++ b/0-introduction-to-csharp-and-dotnet.md @@ -3,7 +3,7 @@ marp: true paginate: true math: mathjax theme: buutti -title: 1. Introduction to C# and .NET +title: 0. Introduction to C# and .NET --- # Introduction to C# and .NET diff --git a/1.5-introduction-to-visual-studio-slides.html b/1-introduction-to-visual-studio-slides.html similarity index 80% rename from 1.5-introduction-to-visual-studio-slides.html rename to 1-introduction-to-visual-studio-slides.html index 4b3e19f..860a243 100644 --- a/1.5-introduction-to-visual-studio-slides.html +++ b/1-introduction-to-visual-studio-slides.html @@ -1,4 +1,4 @@ -1.5. Introduction to Visual Studio
    +/* @theme lwywi31km710qw06yu35mzs18u0xufmawz8jfm3llmh */div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]{columns:initial!important;display:block!important;padding:0!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]:before,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:after,div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content]:before{display:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]{all:initial;display:flex;flex-direction:row;height:100%;overflow:hidden;width:100%}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container][data-marpit-advanced-background-direction=vertical]{flex-direction:column}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split]>div[data-marpit-advanced-background-container]{width:var(--marpit-advanced-background-split,50%)}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background][data-marpit-advanced-background-split=right]>div[data-marpit-advanced-background-container]{margin-left:calc(100% - var(--marpit-advanced-background-split, 50%))}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure{all:initial;background-position:center;background-repeat:no-repeat;background-size:cover;flex:auto;margin:0}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=background]>div[data-marpit-advanced-background-container]>figure>figcaption{position:absolute;border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=content],div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo]{background:transparent!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background=pseudo],div#\:\$p>svg[data-marpit-svg]>foreignObject[data-marpit-advanced-background=pseudo]{pointer-events:none!important}div#\:\$p>svg>foreignObject>section[data-marpit-advanced-background-split]{width:100%;height:100%}

    Introduction to Visual Studio

    -
    +

    Overview

    • Visual Studio An IDE (Integrated development environment) by Microsoft for Windows
    • @@ -30,7 +30,7 @@
    -
    +

    Features

    -
    +

    Visual Studio vs Visual Studio Code (VS VS VSC)

    • Visual Studio is not to be confused with Visual Studio Code, a separate software by Microsoft @@ -63,7 +63,7 @@
    • While both can be used for many programming languages, for C# and ASP.NET Visual Studio is preferred due to its extensive debugging and build tools
    -
    +

    Installing Visual Studio

    • Download Visual Studio Community (the free version) here
    • @@ -88,7 +88,7 @@
    • Note: Installation size can be quite large (8 GB+) depending on which components are already installed on your system
    -
    +

    Projects and solutions

    • In Visual Studio, there are two key concepts, projects and solutions @@ -113,7 +113,7 @@
    -
    +

    Visual Studio UI

    @@ -129,7 +129,7 @@
    -
    +

    Moving windows around

    @@ -148,7 +148,7 @@
    -
    +

    Error highlighting in Visual Studio 2022

    • Visual Studio highlights errors in code automatically.
    • @@ -169,7 +169,7 @@
    -
    +

    Keyboard shortcuts

    -
    +

    Gotchas

    • Some actions are unavailable when your app is running @@ -207,7 +207,7 @@
    -
    +

    Exercise 1. Creating a console application

      @@ -217,7 +217,7 @@
    -
    +

    Exercise 2. Running a console application

      @@ -229,7 +229,7 @@
    1. Try changing the code so that it prints something else!
    -
    +

    Reading

    • Visual Studio Documentation: Overview
    • diff --git a/1.5-introduction-to-visual-studio.md b/1-introduction-to-visual-studio.md similarity index 99% rename from 1.5-introduction-to-visual-studio.md rename to 1-introduction-to-visual-studio.md index b09f30c..905f823 100644 --- a/1.5-introduction-to-visual-studio.md +++ b/1-introduction-to-visual-studio.md @@ -3,7 +3,7 @@ marp: true paginate: true math: mathjax theme: buutti -title: 1.5. Introduction to Visual Studio +title: 1. Introduction to Visual Studio --- # Introduction to Visual Studio diff --git a/README.md b/README.md index c544cf3..334b3b2 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,23 @@ -# Contents - -Material completion denoted with 🌑🌘🌗🌖🌕 . + -| # | Lecture | Materials | Exercises | -|---:|------------------------------------------------------------------------|----------:|----------:| -| 8 | [Inheritance and Abstract Classes](8-inheritance-and-abstract-classes.md) | 🌕 | 🌕 | -| 9 | [Interfaces](9-interfaces.md) | 🌕 | 🌕 | -| 10 | [Static Members, Methods, and Classes](10-static-members-methods-and-classes.md) | 🌕 | 🌕 | -| 11 | [Delegates and Events](11-delegates-and-events.md) | 🌕 | 🌗 | -| 12 | [Files and Streams](12-files-and-streams.md) | 🌕 | 🌕 | -| 13 | [Generics, IEnumberable and LINQ](13-generics-ienumerable-and-linq.md) | 🌕 | 🌕 | -| 14 | [Exceptions, Threads and Tasks](14-exceptions-threads-and-tasks.md) | 🌕 | 🌕 | -| 15 | [Design Patterns in C#](15-design-patterns-in-csharp.md) | 🌗 | 🌑 | +# Contents -Download -[Download2b](/raw/branch/main/5-arrays-and-lists-slides.html "juuh") -[Download3b](5-arrays-and-lists-slides.html "juuh") \ No newline at end of file +| # | Lecture | Slides | +|:---|:--------------------------------------------------------------------------------|:---------------------------------------------------------------------| +| 0 | [Introduction to C# and .NET](0-introduction-to-csharp-and-dotnet.md) | [Download slides](0-introduction-to-csharp-and-dotnet-slides.html) | +| 1 | [Introduction to Visual Studio](1-introduction-to-visual-studio.md) | [Download slides](1-introduction-to-visual-studio-slides.html) | +| 2 | [Variables and Types](2-variables-and-types.md) | [Download slides](2-variables-and-types-slides.html) | +| 3 | [Conditionals](3-conditionals.md) | [Download slides](3-conditionals-slides.html) | +| 4 | [Loops](4-loops.md) | [Download slides](4-loops-slides.html) | +| 5 | [Arrays and Lists](5-arrays-and-lists.md) | [Download slides](5-arrays-and-lists-slides.html) | +| 6 | [Methods](6-methods.md) | [Download slides](6-methods-slides.html) | +| 7 | [Classes And Objects](7-classes-and-objects.md) | [Download slides](7-classes-and-objects-slides.html) | +| 8 | [Inheritance & Abstract Classes](8-inheritance-and-abstract-classes.md) | [Download slides](8-inheritance-and-abstract-classes-slides.html) | +| 9 | [Interfaces](9-interfaces.md) | [Download slides](9-interfaces-slides.html) | +| 10 | [Static Members, Methods and Classes](10-static-members-methods-and-classes.md) | [Download slides](10-static-members-methods-and-classes-slides.html) | +| 11 | [Delegates and events](11-delegates-and-events.md) | [Download slides](11-delegates-and-events-slides.html) | +| 12 | [Files and Streams](12-files-and-streams.md) | [Download slides](12-files-and-streams-slides.html) | +| 13 | [Generics, IEnumerable and LINQ](13-generics-ienumerable-and-linq.md) | [Download slides](13-generics-ienumerable-and-linq-slides.html) | +| 14 | [Exceptions, Threads and Tasks](14-exceptions-threads-and-tasks.md) | [Download slides](14-exceptions-threads-and-tasks-slides.html) | +| 15 | [Design Patterns in C#](15-design-patterns-in-csharp.md) | [Download slides](15-design-patterns-in-csharp-slides.html) |