Skip to content
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

fix: Update 19.02 #796

Draft
wants to merge 1 commit into
base: v12.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Errata.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Zhou Jing | 22 | 1065 - 1066 | Changed 'Thread' to 'Task' and "Application exiti
Zhou Jing | 4 | 161 | Fix `input < 9` to `input < 0` in Listing 4.24
Zhou Jing | 4 | 119 | Show inconsistent size multi-dimensional array in listing 3.16
Zhou Jing | 3 | 114 | Replace `second` with `third` in "// Retrieve third item from the end (Python)"
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
Benjamin Michaelis | 19 | .. | Add a `(` before the `next + 1` to complete the parenthesis.
14 changes: 7 additions & 7 deletions src/Chapter19/Listing19.02.PollingATask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;

#region INCLUDE
using System;
using System.Threading.Tasks;
using AddisonWesley.Michaelis.EssentialCSharp.Shared;
using AddisonWesley.Michaelis.EssentialCSharp.Shared; // EXCLUDE

public class Program
{
Expand All @@ -17,10 +17,10 @@ public static void Main()
#endregion HIGHLIGHT
() => PiCalculator.Calculate(100));

foreach(
foreach (
char busySymbol in Utility.BusySymbols())
{
if(task.IsCompleted)
if (task.IsCompleted)
{
Console.Write('\b');
break;
Expand Down Expand Up @@ -55,15 +55,15 @@ public static IEnumerable<char> BusySymbols()
{
string busySymbols = @"-\|/-\|/";
int next = 0;
while(true)
while (true)
{
yield return busySymbols[next];
next = next + 1) % busySymbols.Length;
next = (next + 1) % busySymbols.Length;
yield return '\b';
}
}
}
#region EXCLUDE
#region EXCLUDE
*/
#endregion EXCLUDE
#endregion INCLUDE
Loading