-
Notifications
You must be signed in to change notification settings - Fork 4
Update code to .NET 10 with top-level statements where applicable #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f7009f1
Initial plan for issue
Copilot bede202
Update all projects to .NET 9 and convert simple programs to top-leveβ¦
Copilot 97a883f
Convert additional console applications to top-level statements
Copilot e9b3a24
Remove nullable reference types from projects that didn't originally β¦
Copilot eee734d
Add GitHub Actions CI workflow to build all solutions
Copilot bf2f2c9
Fix build issues by updating target framework to net8.0 and fixing miβ¦
Copilot 1457ab2
Update console applications to net9.0 while keeping web applications β¦
Copilot 345efd5
Upgrade all projects to .NET 10 and update CI workflow
Copilot 5b7216f
Merge branch 'master' into copilot/fix-3
hakenr a86df61
Fix CI build issues: add KNearestNeighbors stub entry point and suppoβ¦
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,73 @@ | ||
| name: Continuous Integration | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, master ] | ||
| pull_request: | ||
| branches: [ main, master ] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: '10.0.x' | ||
|
|
||
| - name: List all solutions | ||
| run: | | ||
| echo "Found the following solution files:" | ||
| find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort | ||
| echo "Total solutions: $(find . \( -name '*.sln' -o -name '*.slnx' \) -type f | wc -l)" | ||
|
|
||
| - name: Build all solutions | ||
| shell: bash | ||
| run: | | ||
| set -e | ||
| echo "Building all solutions in the repository..." | ||
|
|
||
| # Create arrays to track results | ||
| declare -a failed_solutions=() | ||
| declare -a successful_solutions=() | ||
|
|
||
| # Build each solution | ||
| while IFS= read -r solution; do | ||
| echo "" | ||
| echo "========================================" | ||
| echo "Building solution: $solution" | ||
| echo "========================================" | ||
|
|
||
| if dotnet build "$solution" --configuration Release --verbosity minimal; then | ||
| echo "β Build successful for $solution" | ||
| successful_solutions+=("$solution") | ||
| else | ||
| echo "β Build failed for $solution" | ||
| failed_solutions+=("$solution") | ||
| fi | ||
| done < <(find . \( -name "*.sln" -o -name "*.slnx" \) -type f | sort) | ||
|
|
||
| # Print summary | ||
| echo "" | ||
| echo "========================================" | ||
| echo "BUILD SUMMARY" | ||
| echo "========================================" | ||
| echo "Total solutions: $((${#successful_solutions[@]} + ${#failed_solutions[@]}))" | ||
| echo "Successful builds: ${#successful_solutions[@]}" | ||
| echo "Failed builds: ${#failed_solutions[@]}" | ||
|
|
||
| if [ ${#failed_solutions[@]} -gt 0 ]; then | ||
| echo "" | ||
| echo "Failed solutions:" | ||
| for solution in "${failed_solutions[@]}"; do | ||
| echo " - $solution" | ||
| done | ||
| exit 1 | ||
| else | ||
| echo "" | ||
| echo "π All solutions built successfully!" | ||
| fi |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,34 +1,24 @@ | ||
| ο»Ώusing System; | ||
| using System.Data.SqlClient; | ||
|
|
||
| namespace DatabaseConnector | ||
| { | ||
| class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| using var conn = new SqlConnection("***"); | ||
| conn.Open(); | ||
| using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn); | ||
| Console.WriteLine(cmd.ExecuteScalar()); | ||
| using var conn = new SqlConnection("***"); | ||
| conn.Open(); | ||
| using var cmd = new SqlCommand("SELECT COUNT(*) FROM Zapisnik", conn); | ||
| Console.WriteLine(cmd.ExecuteScalar()); | ||
|
|
||
| cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('PrvnΓ pokus', 'Hokus pokus')"; | ||
| cmd.ExecuteNonQuery(); | ||
| cmd.CommandText = "INSERT INTO Zapisnik(Jmeno, Obsah) VALUES('PrvnΓ pokus', 'Hokus pokus')"; | ||
| cmd.ExecuteNonQuery(); | ||
|
|
||
| cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik"; | ||
| Console.WriteLine(cmd.ExecuteScalar()); | ||
| cmd.CommandText = "SELECT COUNT(*) FROM Zapisnik"; | ||
| Console.WriteLine(cmd.ExecuteScalar()); | ||
|
|
||
| using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn); | ||
| using (var reader = cmd2.ExecuteReader()) | ||
| { | ||
| while (reader.Read()) | ||
| { | ||
| var firstName = reader["FirstName"]; | ||
| var lastName = reader["LastName"]; | ||
| using var cmd2 = new SqlCommand("SELECT TOP 10 * FROM Customer", conn); | ||
| using (var reader = cmd2.ExecuteReader()) | ||
| { | ||
| while (reader.Read()) | ||
| { | ||
| var firstName = reader["FirstName"]; | ||
| var lastName = reader["LastName"]; | ||
|
|
||
| Console.WriteLine($"NaΔten zΓ‘kaznΓk: {firstName} {lastName}"); | ||
| } | ||
| } | ||
| } | ||
| Console.WriteLine($"NaΔten zΓ‘kaznΓk: {firstName} {lastName}"); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
3 changes: 2 additions & 1 deletion
3
DirectionsReduction/DirectionsReduction/DirectionsReduction.csproj
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,55 +1,43 @@ | ||
| ο»Ώusing System; | ||
| using System.Threading; | ||
| Console.Clear(); | ||
| int score = 0; | ||
| int pokus = 0; | ||
|
|
||
| namespace JackpotGame | ||
| while (true) | ||
| { | ||
| class Program | ||
| { | ||
| static void Main(string[] args) | ||
| { | ||
| Console.Clear(); | ||
| int score = 0; | ||
| int pokus = 0; | ||
|
|
||
| while (true) | ||
| { | ||
| int cislo1 = new Random().Next(10); | ||
| Console.SetCursorPosition(10, 10); | ||
| Console.Write(cislo1); | ||
| int cislo1 = new Random().Next(10); | ||
| Console.SetCursorPosition(10, 10); | ||
| Console.Write(cislo1); | ||
|
|
||
| int cislo2 = new Random().Next(10); | ||
| Console.SetCursorPosition(20, 10); | ||
| Console.Write(cislo2); | ||
| int cislo2 = new Random().Next(10); | ||
| Console.SetCursorPosition(20, 10); | ||
| Console.Write(cislo2); | ||
|
|
||
| int cislo3 = new Random().Next(10); | ||
| Console.SetCursorPosition(30, 10); | ||
| Console.Write(cislo3); | ||
| int cislo3 = new Random().Next(10); | ||
| Console.SetCursorPosition(30, 10); | ||
| Console.Write(cislo3); | ||
|
|
||
| if (Console.KeyAvailable) | ||
| { | ||
| Console.ReadKey(); | ||
|
|
||
| pokus = pokus + 1; | ||
| if (Console.KeyAvailable) | ||
| { | ||
| Console.ReadKey(); | ||
|
|
||
| if (cislo1 == cislo2) | ||
| { | ||
| score = score + 1; | ||
| } | ||
| if (cislo2 == cislo3) | ||
| { | ||
| score = score + 1; | ||
| } | ||
| if (cislo1 == cislo3) | ||
| { | ||
| score = score + 1; | ||
| } | ||
| pokus = pokus + 1; | ||
|
|
||
| Console.SetCursorPosition(1, 1); | ||
| Console.Write($"{score}/{pokus}"); | ||
| Console.Beep(); | ||
| Thread.Sleep(1000); // 1s | ||
| } | ||
| } | ||
| if (cislo1 == cislo2) | ||
| { | ||
| score = score + 1; | ||
| } | ||
| if (cislo2 == cislo3) | ||
| { | ||
| score = score + 1; | ||
| } | ||
| if (cislo1 == cislo3) | ||
| { | ||
| score = score + 1; | ||
| } | ||
|
|
||
| Console.SetCursorPosition(1, 1); | ||
| Console.Write($"{score}/{pokus}"); | ||
| Console.Beep(); | ||
| Thread.Sleep(1000); // 1s | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| ο»Ώ// TODO | ||
| ο»Ώ// TODO: Implement K-Nearest Neighbors algorithm | ||
| Console.WriteLine("TODO: K-Nearest Neighbors - not yet implemented."); |
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.