-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Console.WriteLine("Hello, World!"); |
11 changes: 11 additions & 0 deletions
11
conferences/2025/00-hello-world/hello-world/hello-world.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters