Skip to content

Commit

Permalink
Fix listing
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Apr 4, 2024
1 parent 74bde81 commit 92b6a23
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Errata.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ Zhou Jing | 21 | 1022 | Change "3.1415926535897932384626433832795028841971693993
Zhou Jing | 20 | 1018 | Change paragraph beginning with "The need to support TAP from the UI is one of the key scenarios that led to TAP’s creation." to "Supporting TAP from the UI is a fundamental scenario that led to the development of TAP. Another common scenario occurs on the server side when a client’s request involves retrieving a large dataset from a database. Given that database queries can be time-consuming, it’s crucial to hangle them efficiently. Instead of creating new threads or using threads from the limited thread pool, it’s advisable to utilize asynchronous programming patterns. These patterns avoid blocking threads while waiting for the database response, especially since the actual query operations are executed on a separate machine (the database server). This approach ensures that server resources are used optimally, allowing threads to manage other tasks rather than being idle during I/O operations."
Zhou Jing | 18 | 911 | Change CommandLineRequiredAttribute to CommandLineSwitchRequiredAttribute
Zhou Jing | 18 | 902-903 | Change CommandLineAliasAttribute to CommandLineSwitchAliasAttribute
Zhou Jing | 23 | 1105 | Change `Length = 10` in listing 23.20 to `Length = 12` to show entire output message
Zhou Jing | 23 | 1105 | Change `Length = 10` in listing 23.20 to `Length = 12` to show entire output message
Jinhang He | 5 | 255 | Edit listing 5.20 to used `image[index]` for the second print statement
9 changes: 3 additions & 6 deletions src/Chapter05.Tests/Listing05.20.ReturningAReference.Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ public class ProgramTests
public void Main_InputInigoMontoya_WriteFullName()
{
string expected = @"image\[*\]=Red
image\[*\]=Black";
image\[*\]=Yellow";

IntelliTect.TestTools.Console.ConsoleAssert.ExpectLike(expected,
() =>
{
Program.Main();
});
IntelliTect.TestTools.Console.ConsoleAssert.ExpectLike(expected,
() => Program.Main());
}
}
6 changes: 3 additions & 3 deletions src/Chapter05/Listing05.20.ReturningAReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ public static void Main()
#region HIGHLIGHT
// Obtain a reference to the first red pixel
ref byte redPixel = ref FindFirstRedEyePixel(image);
// Update it to be Black
redPixel = (byte)ConsoleColor.Black;
// Update it to be Yellow
redPixel = (byte)ConsoleColor.Yellow;
#endregion HIGHLIGHT
Console.WriteLine(
$"image[{index}]={(ConsoleColor)image[redPixel]}");
$"image[{index}]={(ConsoleColor)image[index]}");
}
#endregion INCLUDE
}

0 comments on commit 92b6a23

Please sign in to comment.