Skip to content

Commit

Permalink
Update lecture 00
Browse files Browse the repository at this point in the history
  • Loading branch information
apiad committed Sep 24, 2024
1 parent 9233563 commit c1b635e
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ static void Main()
{
Console.WriteLine(Fibonacci(5));
Console.WriteLine(Factorial(10));
Console.WriteLine(MoverTorresHanoi(3, 'A', 'C', 'B'));
MoverTorresHanoi(3, 'A', 'C', 'B');
Console.WriteLine(RecursiveSum(5));
Console.WriteLine(RecursiveMin(new[] { 10, 9, 8, 7, -1, 5, 4, 3, 2, 1 }));
Console.WriteLine(TaxiDriver(10, 10));
Expand All @@ -18,7 +18,7 @@ static int Factorial(int n)
if (n == 0 || n == 1)
return 1;

return n * CalcularFactorial(n - 1);
return n * Factorial(n - 1);
}

static int Fibonacci(int n)
Expand Down
22 changes: 22 additions & 0 deletions conferences/2025/00-hello-world/00-hello-world.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "hello-world", "hello-world\hello-world.csproj", "{1B293DC9-70AC-40FC-A652-AC13C67F4D18}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1B293DC9-70AC-40FC-A652-AC13C67F4D18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B293DC9-70AC-40FC-A652-AC13C67F4D18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B293DC9-70AC-40FC-A652-AC13C67F4D18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B293DC9-70AC-40FC-A652-AC13C67F4D18}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
1 change: 1 addition & 0 deletions conferences/2025/00-hello-world/hello-world/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Hello, World!");
11 changes: 11 additions & 0 deletions conferences/2025/00-hello-world/hello-world/hello-world.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>hello_world</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
99 changes: 99 additions & 0 deletions conferences/2025/00-hello-world/lecture-00.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# 00 - Hello World

## Objectives
1. **Algorithm Design**: Introduce algorithm design through finding the shortest person in a list, including correctness and efficiency.
2. **Terminal Usage**: Learn to create a new .NET solution and project.
3. **First Program**: Write a "Hello World" application.
4. **Project Workflow**: Understand the development process from a blank slate to a working console application, including file locations.
5. **GitHub Introduction**: Create a GitHub profile and upload code to a repository.

## Lecture Structure

### 1. Introduction (5 minutes)
- **Why Learn Programming?**
- Discuss the relevance of programming in various fields and its importance in problem-solving.

### 2. Algorithm Design Activity (30 minutes)
- **Finding the Shortest Person Algorithm**
- Introduce the concept of algorithms and their significance in programming.
- Guide students through designing an algorithm on the blackboard:
- Define inputs (list of heights).
- Use a loop invariant to find the shortest height.

#### Example Algorithm Steps:
1. Initialize `shortest` as infinity.
2. Loop through each height in the list:
- If height < shortest, update shortest.
3. Output shortest height.

- **Correctness**
- Discuss how to prove that the algorithm correctly identifies the shortest person:
- Use examples to demonstrate that for any input list, the algorithm will return the correct result.

- **Efficiency**
- Introduce the concept of efficiency in algorithms, focusing on time complexity.
- Explain that this algorithm runs in $$O(N)$$ time, where $$N$$ is the number of people in the list.

- **Adversary Technique**
- Briefly explain the adversary technique for proving lower bounds:
- Discuss how any algorithm that finds the shortest person must examine each height at least once, thus requiring at least $$N$$ comparisons.
- Emphasize that this establishes a lower bound on time complexity for this problem.

### 3. Setting Up the Environment (15 minutes)
- **Using the Terminal**
- Demonstrate how to open the terminal and navigate directories.
- Command to create a new .NET solution:
```bash
dotnet new sln -n MyFirstSolution
```
- Command to create a new console project:
```bash
dotnet new console -n HelloWorld
```
- **File Structure Overview**
- Explain where generated files are located:
- Solution file (.sln)
- Project folder containing Program.cs and other files.

### 4. Writing Your First Program (15 minutes)
- **Hello World Program**
- Open `Program.cs` and write the following code:
```csharp
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello, World!");
}
}
```
- Run the program using:
```bash
dotnet run
```

### 5. Understanding the Workflow (10 minutes)
- **From Blank Slate to Application**
- Discuss the steps taken from creating a project to running it.
- Highlight important files and their purposes.

### 6. Introduction to GitHub (10 minutes)
- **Creating a GitHub Profile**
- Walk through signing up for GitHub.
- **Uploading Code**
- Demonstrate how to initialize a Git repository:
```bash
git init
git add .
git commit -m "Initial commit"
```
- Show how to create a repository on GitHub and push local changes:
```bash
git remote add origin <repository-url>
git push -u origin master
```

## Conclusion (5 minutes)
- Recap key points covered in the lecture.
8 changes: 8 additions & 0 deletions methodology/2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ Este historial de ejercicios resueltos será tenido en cuenta para toda valoraci
Salvo excepciones, en todas las CP se harán evaluaciones presenciales. El resultado de estas evaluaciones no implicará ninguna penalización para la nota final del curso, pero si puede implicar bonificaciones.

La ausencia a estas evaluaciones presenciales se trata como ausencia al turno, por la primera regla.

## ChatGPT e Internet

El uso de herramientas como ChatGPT, StackOverflow, cualquier cosa en Internet, es válido siempre que sea en un contexto donde queda claro la extensión de su uso, y donde no perjudique el proceso de aprendizaje.

En clases prácticas y exámenes, salvo que se diga lo contrario, solo se puede utilizar la computadora y el conocimiento del estudiante.

Para realizar los proyectos, se permiten todos los recursos externos siempre que se declaren de forma honesta, y se utilicen de manera que no perjudiquen el aprendizaje y no vulneren la demostración de las habilidades que queremos formar.

0 comments on commit c1b635e

Please sign in to comment.