Giter VIP home page Giter VIP logo

fourth-edition's Introduction

Head First C#, 4th Edition

This GitHub project contains source code, downloadable PDFs, graphics, and additional files for the projects in the 4th edition of Head First C#: A Learner's Guide to Real-World Programming with C# and .NET Core (O'Reilly Media 2020).


How to use the code in this repository to follow along with the book

Here's a direct link to download all of the code: master.zip – it may get saved as fourth-edition-master.zip.


Troubleshooting problems with Chapter 1

Did you get an "Index was out of range" error or a "Debugger operation failed" error, or is your timer going slowly? There are usually straightforward fixes for those issues!)

What's on this page

Read the first four chapters today!

Do you want to learn C#? Are you trying to figure out if our book is right for you? We think our book is one of the most effective ways to learn C#. But you don't have to take our word for it! We want you to have the best C# learning experience possible, so to make things easy for you we've provided the first four chapters of our book for free.

Download a free PDF of the first 4 chapters: Head_First_CSharp_4e_chapters_1_to_4.pdf

That PDF includes the complete introduction, chapters 1 through 4, the first two Unity Labs, and the complete Visual Studio for Mac Learner's Guide appendix, as well as the full table of contents and index (so you can see everything that we cover).

Try out our book today and see what you think!

☮️♥️👾 Jenny and Andrew

What will you learn from this book?

Dive into C# and create apps, user interfaces, games, and more using this fun and highly visual introduction to C#, .NET Core, and Visual Studio. With this completely updated guide, which covers C# 8.0 and Visual Studio 2019, beginning programmers like you will build a fully functional game in the opening chapter. Then you'll learn how to use classes and object-oriented programming, create 3D games in Unity, and query data with LINQ. And you'll do it all by solving puzzles, doing hands-on exercises, and building real-world applications. By the time you're done, you'll be a solid C# programmer—and you'll have a great time along the way!

What's so special about this book?

Based on the latest research in cognitive science and learning theory, Head First C# uses a visually rich format to engage your mind rather than a text-heavy approach that puts you to sleep. Why waste your time struggling with new concepts? This multisensory learning experience is designed for the way your brain really works.

How to get Head First C#

There are lots of ways that you can get Head First C#:

Video Walkthroughs

Find the video walkthroughs for Chapter 1 on our YouTube channel.

How to use the code in this repository to follow along with the book

This repository contains all of the code for every project in the book. We created a video walkthrough to help get you started! It starts with a completely clean installation of Windows 10, shows you how to download and install Visual Studio 2019, then walks you through downloading all of the code from the book and running it in Visual Studio.

Video walkthrough: Getting Started with Head First C#: Installing Visual Studio 2019 and downloading code from the book

You can jump directly to the different sections of the video:

  • Installing Visual Studio - 1:20
  • Launch Visual Studio and create a "Hello World" app - 8:30
  • Download the code from the book and run the Animal Matching game project from Chapter 1 - 10:30
  • Run the ASP.NET Blazor WebAssembly Animal Matching game from the Visual Studio for Mac Learner's Guide - 12:45
  • Run the .NET Core Console App Hide and Seek game from Chapter 10 - 14:35

The code for the projects in each chapter is in the Code folder.

  • The Code folder subfolder for each chapter. For example, the code for all of the projects in Chapter 2 are in the Code/Chapter_2 folder.
  • Inside each chapter folder you'll find each of the projects. For example, the PickRandomCards Console App project on page 106 in Chapter 3 is in the Code/Chapter_3/PickRandomCards folder.
  • When there are both WPF and Blazor versions of a project, the chapter folder will contain both of them. For example, on page 118 you create a WPF version of the card picker app called PickACardUI, which you can find in Code/Chapter_3/PickACardUI. The code for the Blazor version on page 714 is in Code/Chapter_3/PickACardBlazor.
  • Code solutions for the Sharpen Your Pencil, Pool Puzzle, Magnets, and other pencil-and-paper exercise can also be found in the chapter folders. For example, Chapter 3 has two Sharpen Your Pencil exercises that have code solutions that run. The first one is on page 135, and the code can be found in Code/Chapter_3/SharpenYourPencil. The second one is on page 153, and the code can be found in Code/Chapter_3/SharpenYourPencil_2.
  • The code for the Unity Lab projects can be found in the Code/Unity_Labs/ folder.

Use the GitHub website to browse the code

The most common way people use the code on this website is to look at our solution. (Remember, it's not cheating to look at our solution while you're solving the problem! That's a valid and often very effective way to learn.) You

  • In a code folder, you'll see a solution file that ends with .sln. Visual Stuido uses this file when you load the code. You can ignore it if you're reading the code on the GitHub page.
  • The code folder contains a project folder with the actual code. Most of the solutions in the book contain one project (in Chapter 9 you'll learn about unit testing, and create solutions with more than one proejct).

Load the chapter projects in Visual Studio

All of the projects for each chapter can be loaded in Visual Studio. The easiest way to run the code from this repository is to download and extract a zip of the entire repository:

  1. Download the zip file of the entire repository. Here's a direct link to download it: master.zip – it may get saved as fourth-edition-master.zip.
  • You can also find that link by going to the top page in the repository, clicking the Code dropdown button just above and to the right of the code listing, and choosing Download zip
  1. Extract master.zip (or fourth-edition-master.zip) – it has all of the files in the repository.
  2. Go to the chapter folder (e.g. Code/Chapter_3) and open the project folder inside it (e.g. PickRandomCards).
  3. Double-click on the solution (.sln) file to open it in Visual Studio. You can also use the Visual Studio menu to open an existing project, navigate to the solution (.sln) file, and open it.

*Note that the Blazor projects can all be loaded in Visual Studio 2019 on Windows. There is currently no macOS support for WPF, so Visual Studio for Mac will not load the Mac projects.)

Load the Unity projects with Unity Hub

You can use Unity Hub to load the Unity projects from this repository.

  1. Download master.zip and extract it.
  2. Follow the instructions in Unity_Lab_1_Explore_CSharp_with_Unity.pdf to make sure Unity Hub is installed, as well as the version of Unity that we used to create the Unity Labs.
  3. Open Unity Hub, click the Add button, and navigate to the folder with a Unity project (e.g. Code/Unity_Labs/Unity_Labs_1_and_2), and click Open to add it to the project list in Unity Hub.
  4. Double-click on the project in Unity Hub to open the proejct.
  5. If the scene appears to be empty once Unity loads the project, load the scene by choosing File >> Open Scene from the menu, navigating to the Scenes folder, and opening Sample Scene.unity.

Downloadable project PDFs

Some of the chapters have downloadable projects. You can download PDFs of those projects here:

NOTE: The downloadable projects for these chapters are early release PDFs! That means that while the code works, the projects are complete, and we've done our initial review of them, we're still working on polishing them up and putting the final touches on them. But you can definitely start using them today!*

Download all of the Unity Labs

Unity Labs from the book

In the Head First C# Unity Labs you'll use Unity, the powerful platform for 2D and 3D game development, to explore C# and practice your C# skills.

Additional Unity Labs

There's more to learn about Unity! We've written additional Unity Labs that go beyond the material in the book to teach you important Unity topics, and give you more practice building 3D games.

Unity Lab code

You can find the code for the Unity Lab projects in the Code/Unity_Labs/ folder. You can load a project into Unity by:

  • Downloading it (or cloning this whole repository)
  • Adding its folder to Unity Hub
  • Opening it in Unity Hub
  • Opening SampleScene from the Scenes folder

Bonus Chapters

Finished the book, but still hungry for more? There are additional bonus chapters so you can keep moving forward with your C# learning.

Additional material that you can download

Here's what you'll find in this repository:

Did you run into trouble with the project in the first chapter?

In the first chaper you jump right into a project to create an animal matching game to help you start learning about C# and Visual Studio. We've had many readers do this project—so don't worry, it definitely works! (In fact, some of our readers got especially creative with the project. You can read more about it on the Visual Studio blog.)

System.ArgumentOutOfRangeException: 'Index was out of range.'

The most common problem people run into is an exception with the message System.ArgumentOutOfRangeException: 'Index was out of range.' Here's a screenshot of what that looks like:

Screenshot of Visual Studio 2019 showing 'index out of range' exception

If you get this error, make sure that your C# code and XAML match the C# code and XAML in the book exactly: you need to have 16 <TextBlock>…</TextBlock> lines in your XAML, and eight matching pairs of animal emoji in the animalEmoji list.

(This exception happens because your foreach loop is pulling an emoji out of the animalEmoji list for each TextBlock and then removing it from the list. If you have an extra TextBlock or if you're missing an emoji, your foreach loop will run out of animals before it runs out of TextBlocks to add them to. It will try to get a random emoji from the empty animalEmoji list, and that's what causes the exception.)

While most readers are able to do this project without any trouble, you could run into problems if your code doesn't match the code in the book exactly. Here's what to do if you run into trouble with the project in the first chapter:

  • Compare the code line by line. It's really easy to miss a comma, semicolon, parentheses, equals sign, etc.
  • If you're following the ASP.NET Blazor version, make sure that your HTML markup matches the markup in the book exactly.

Is your timer going slowly?

At the end of the WPF Animal Matching Game, is your timer acting strainge, counting slowly or only advancing when you click an emoji? If you still have the runtime tools turned on, that could cause your timer issues. Follow the instructions on page 26, or if you're watching the video walkthrough, at 15:30 in the video, to turn off the tools. (Thank you to Daedalus359 for figuring this out!)

Are you getting "Debugger operation failed" when you start your Blazor app?

If you're following the Visual Studio for Mac Learner's Guide, the very first step is creating an ASP.NET Blazor WebAssembly App project and running it. If you run into an "Unable to launch browser" error or an error that mentions certificates, it probably means there's a small setup issue that you need to fix. Open Terminal and run the following commands:

  1. Change Properties/launchSetting.json/ and move the ports from 5000 and 5001 to somthing else (try changing to 5006 and 5007 respectively)
  2. Open Terminal
  3. Type: $ dotnet dev-certs https --clean
  4. Then Type: $ dotnet dev-certs https --trust
  5. Try again

This redeploys the developer certificates, which lets your browser trust Visual Studio to allow debugging.

special thanks to Twitter user Chris Jackson @Sirhc7001 for very quickly finding the solution! You can read more about it here: dotnet quits unexpectedly on mac os #12317

Still having trouble? Check out our video walkthrough!

If you're still having trouble, watch the video walkthrough for the project on our YouTube channel. It shows every step in the project so you can see exactly what you're supposed to do.

Did you run into trouble with pages 77 and 78?

In some early printings of Head First C# (4th edition), pages 77 and 78 were reversed! These are the corrected pages, with the steps in the proper order: Corrected_pages_77_and_78.pdf

Did you have trouble with the "HiLo" game on pages 243 and 244?

In some early printings of Head First C# (4th edition), there was a minor technical issue with this exercise. Here's an updated version: Corrected_pages_243_and_244.pdf

Did you find an error in the book?

We worked really hard to make this book as error-free as possible! But we're only human, and we do occasionally make mistkaes. If you spot an error in the book, please use the O'Reilly errata page to let us know about it. That way it goes into a database so we can keep track of it and fix it in future printings.

Head First C#, 4rd Edition – cover

License and Copyright

All of the source code and graphics used by the source code is licensed under the MIT License.

PDFs, cover, and other written book material © 2021 Andrew Stellman and Jennifer Greene, all rights reserved.

Cover art by Jose Marzan Jr. (@JoseMarzan).

The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. The Head First series designations, Head First C#, and related trade dress are trademarks of O’Reilly Media, Inc.

fourth-edition's People

Contributors

andrewstellman avatar hfcsharpreader avatar jongalloway avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fourth-edition's Issues

p141 Class Diagrams

Hello, Wasn't sure where to leave a comment like this.

I've been looking over the pdf and it's definitely improved over version 3. On page 141 you advise to use Class Diagrams. But I was surprised you didn't mention the VS Class Designer. I find this tool very useful because it generates code as I design the class but still gives me a visual reference how everything comes together.

This is a screenshot of me building TheQuest lab using the VS class diagram. I had reached this lab when my computer died. Because so many lessons reuse code and I didn't want to start over from scratch, I admit to ragequitting but I've slowly worked my way back to this lab again. Reading the instructions in the pdf on Github is a godsend. I don't have to worry about losing my work again. Thank you for that. Now I've got a lab to complete.
Screenshot_1

MainWindow 'no accessible extension method error

Hi, all.

I have this error that is showing up and I can't seem to fix it. I've even copied the code and pasted it in and it still shows up. Any ideas?

'MainWindow' does not contain a definition for the 'timeTextBlock_TextChanged' and no accessible extension method 'timeTextBlock_TextChanged' accepting a first argument of type 'MainWindow' could be found (are you missing a using directive or an assembly reference?)

Help! Thanks!

JTMc

Page 575, addition

If a filename is specified in Project> properties > Debug > Command line arguments that has a space in the path, the program will not run. Including a method to solve this by putting the path to the file in quotations would be appreciated.

Can use namespaces (using System.Windows. Threading) some are greyed out, why cant i just use the namespace so i can move on, i followed the book, i even tried to type out the namespace and still no change.

Capture

`using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MatchGame
{
using System.Windows.Threading;
public partial class MainWindow : Window
{
//Had the system to force to create a class for the dispatcher class
DispatcherTimer timer = new DispatcherTimer();
int tenthsOfSecondsElasped;
int matchesFound;

    public MainWindow()
    {
        InitializeComponent();

        timer.Interval = TimeSpan.FromSeconds(.1);
        timer.Tick += Timer_Tick;
        SetupGame();
    }

    //Not sure why I had to manually create this method
    private void Timer_Tick(object sender, EventArgs e)
    {
        throw new NotImplementedException();
    }

    private void SetupGame()
    {
        List<String> animalEmoji = new List<String>()
        {
            "🚑","🚑",
            "🚓","🚓",
            "🚚","🚚",
            "🚌","🚌",
            "🛴","🛴",
            "🚅","🚅",
            "🚡","🚡",
            "🦽","🦽",
        };

        Random random = new Random();

        foreach (TextBlock textBlock in mainGrid.Children.OfType<TextBlock>())
        {
            int index = random.Next(animalEmoji.Count);
            string nextEmoji = animalEmoji[index];
            textBlock.Text = nextEmoji;
            animalEmoji.RemoveAt(index);
        }
    }

    //Created a variable to compare to the first object which is clicked
    TextBlock lastTextBlockClicked;
    //Create a flag to determine when we have a match which needs to be resetted when there is a match
    bool findingMatch = false;


    private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
    {
        TextBlock textBlock = sender as TextBlock;
        /*
         finding match AKA are we on the first card or not 
         finding match = false, means that we are ready to select the first card
         finding match = true, means that we are ready to select the second card

        when findmatch is false
        we know that we dont have a selected card, 
        we know that this is the first card, so we hide, 
        so we set the flag to true to prepare to check if the next card will match
        to do this we assign the value of this card to the last card to compare against the new card
                    */
        if (findingMatch == false) 
            //which means that we dont have a match yet
        {
            textBlock.Visibility = Visibility.Hidden; //when the card is clicked we hide it via this property

            lastTextBlockClicked = textBlock; //

            findingMatch = true;
        }


        /*
         if the 1st card has been selected and hidden, when the compare the new card with the previous card
         if it matches the previous card then we hide this also
         and set the flag to false to prepare for the next pair of cards to try to match
         */
        else if (textBlock.Text == lastTextBlockClicked.Text)
        {
            textBlock.Visibility = Visibility.Hidden;

            findingMatch = false;
        }

        /*
         if the 2nd card doesnt match we simple dont touch the 2nd card
         instead we just make the first card visible again
         then we set the flag to false again to prepare for the 1st card again
         */

        else
        {
            lastTextBlockClicked.Visibility = Visibility.Visible;

            findingMatch = false;
        }
    }
}

internal class DispatcherTimer
{
    public TimeSpan Interval { get; internal set; }
}

}
`

The Contest – win a free copy of Head First C#, submission form closed before supposed end date

Hi,

I don't know if this is the right place, but, I was following this blog post: https://devblogs.microsoft.com/visualstudio/guest-post-learn-c-with-visual-studio-visual-studio-for-mac-and-unity-and-win-a-free-book/ to try to participate in a contest that should end by 11:59 p.m. PT, December 9, 2020, and right now if I try to follow the link to the form (https://aka.ms/hfcs-book-challenge) I get into a page that says: "This giveaway is now completed. Watch the Visual Studio blog for winners to be announced!" and I believe that this might be wrong and that we are not yet after 11:59 p.m. PT, December 9, 2020.

Regards,
Fernando Nogueira

C#8+ addition

Many features such as default implementations, switch expressions, and others are only available in C#8+, which can lead to confusion since those versions are only available with Visual Studio preview editions. A process on downloading this version would be a helpful addition for until the versions are released outside of preview.

Page 169, 4th Edition typo

Apologies if it's already been discovered, however I've found that on page 169, there's an error in the first paragraph:
"256 cast to a byte will have a value of 0, 25 will be converted to 1, 258 to 2, etc., up to 365, which will end up being 109."

which should be,

"256 cast to a byte will have a value of 0, 257 will be converted to 1, 258 to 2, etc., up to 365, which will end up being 109."

Chapter 3 PickRandomCards

For some reason, I made this code and then tried to run it. I thought, "great its working first try!!!" but then i try to type how many cards to pick, an it crashes. No errors. Odd....

So after going on and on and trying to fix it myself to no avail, I decided to copy and paste from the github... SAME THING HAPPENS... I think somewhere this is broken...

Chapter 6 Page 320 - Typo #2

I also believe there is another typo on page 320:
The ConsumeHoney method is how the bees use honey to do their jobs. It takes a parameter, amount. If it's greater than the honey field it subtracts amount from honey and returns true; otherwise return false.

Should this be if honey is greater or equal to the amount returns true; otherwise return false?
This is can also be seen in the solution on page 322 and code base here

Match Game Error - 'Index was out of range'

I believe I have everything correct (using Kindle version) and when trying to run it's kicking out this error:

System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')'

private void SetUpGame()
{
List animalEmoji = new List()
{
"🐱‍","🐱‍",
"🐴","🐴‍",
"🐯","🐯‍",
"🐔","🐔‍",
"🙉","🙉‍",
"🐼","🐼‍",
"🦄","🦄‍",
"🐍","🐍‍",
};
Random random = new Random();

        foreach (TextBlock textBlock in mainGrid.Children.OfType<TextBlock>())
        {
            int index = random.Next(animalEmoji.Count);
            string nextEmoji = animalEmoji[index];  //This is the line in which the error occurs
            textBlock.Text = nextEmoji;
            animalEmoji.RemoveAt(index);
        }
    }
}

Mistakes in 3rd edition

image
"The book you’re reading has very few errors in it..."

We'll see about that
f615d09440135fd417a285ce68499bb7 1

I read Head First C# Third Edition twice in 2019. I noted all the mistakes I found and problems I had with the book in my notebook. I posted some on the errata site and now I stumbled upon this repository. I'm going to post everything I noted about htis book. I can't tell that all of the mistakes and problems in the book are yours, I could make mistakes myself. But here are the ones I noted:

Pages 4-6:
image
I can't follow pages 4-6 of the main book because I'm not on Windows 8 and I don't have Visual Studio for Windows 8, so I can't create blank XAML app for Windows Store, as it says in the book. And there is no replacement page for pages 4-6 in WPF appendix II. There are only replacement pages in WPF Appendix II for pages 12-47 of the main book.

In appendix ii: Windows Presentation Foundation on page 21 (15 / 165) in PDF format there's an error and it says TextBox. I'm pretty sure it should be "TextBlock" because there was no mentions of TextBox control before it, only TextBlock. And it doesn't mention any TextBox in that chapter after it either. Next mention of TextBox in appendix ii is in Chapter 10, which is completely irrelevant to mention of TextBox in Chapter 1.
Here's a screenshot with the error:
image

Page 24 of the appendix II for WPF, third star "Use the Text section of the Properties window to change the font to Arial, change the size to 100 px, and make it Bold and Italic."
Screenshot of that:
QzBUzTz 1

Page 73(43/165) of WPF Appendix, it says to edit style and set the style to BodyTextStyle:
28OnAvz 1
But I can't find a way to do this in Visual Studio:
YQp9Q5l 1
Even if I choose edit a copy or create empty menus, there's no BodyTextStyle anywhere. Your XML also doesn't contain any kind of BodyTextStyle:
tshaXNZ 1

So I can't find a way to do it in Visual Studio myself, and it doesn't say how it's done in the exercise.

Page 225. You don't tell at all how to make read-only property - read-only:
V9TxGM5 1
The way to do it so it throws an error that the set accessor is inaccessible is to make setter private:
BoWQ9sh 1
But you don't say how to do it in the book.

Page 465(509 / 948)
Typo in "There are too many ways to build this lab for us to you a “right” answer". You missed a verb. It should be something like "There are too many ways to build this lab for us to give you a “right” answer". I added word "give" to that sentence. And you miss a verb in every lab in the book.
FoxitReader_aOpAnKFhyt

Page 476 (520 / 948):
image

Error in the sentence "The player’s constructor sets its hitPoints to 10 and then calls the base class constructor". Base constructor is called before Player's constructor. It first calls base constructor and only then sets HitPoints property in Player constructor to 10. Plus you wrote hitPoints in the comment, and the property is called HitPoints, not hitPoints.

Page 733 (777 / 948):
image
It says that it should write to the console "I don't have a sected ingredient".
It shouldn't print to the console, it should and does show message box because it's in the code on the page(pointed at with a green arrow). In all paragraphs on this page it says it should print to the console. But instead it should show a message box, because that's how you coded it.

Page 229 error in "return value", it should say "return type":
image

Page 251. It isn't clear what it means, if you're able to remove methods defined in base class or not:
image
Are you? Please, clarify in the book.

Page 258. mySandwich.SlicesOfBacon += 5; wasn't initialized:
image

Page 313. Mtehod instead of method:
image

Page 324. No number for second exercise:
image

Page 395. TheAskForAMethod()
image

Page 426. This doesn't work:
image

Page 498. I don't get these in debugger:
image
They changed default behavior in Visual Studio 2015. To get that behavior now so it shows all the inherited properties, we need to change some checkbox in the tools settings. I don't remember which one atm.

Page 502. Problem with stackPanel:
image
image

Page 519. These properties are not read-only:
image
It says that the properties are read only but they are not.

Page 538 82 / 162 in the appendix:
image

Page 588 100 / 165 in the appendix:
image

Page 656. Double word things things:
image

Page 680. bluegray_250x250.jpg repeats twice:
image

Page 680. You didn't say to include purple_250x250.jpg but then you said that Solution Explorer should look like that with purple_250x250.jpg included:
image

Page 729. There is no gridSetsHandled.IsOn property, should be gridSetsHandled.IsChecked:
image

Page 733. The output will not be printed to the IDE's Output window because we're using MessageBox.Show():
image
It will be showed in the message box.

Page 858. 'Later on, you learned how ot use' should be 'Later on, you learned how to use':
image

Page 522. Should be because and not beause:
image

Page 782. Brackets are in wrong places, they're not aligned with code:
image

Page 794 This didn't compile:
image

Page 801 159/165 in the appendix.
These usings are for Windows Store applications and not WPF:
image
And they don't compile in WPF, obviously:
image
You have correct usings in your Source Code solutions for WPF, which compile:
image

You might want to look through them and see if they're still there in the 4th edition.

Well, even though I did find a lot of errors and problems, this is a great book and I think I was able to fix all of my problems with the book by googling, asking people on Stackoverflow and Discord and just debugging myself.

Chapter 6, Page - 320 - Typo

Hi there, I believe there is either a typo on page 320 regarding the honey field, where it should be the nectar field:
"The CollectNectar method is called by the NectarCollector bee each shift. It takes a parameter, amount. If amount is greater than zero, it adds it to the honey field."

Example Code found here and in the solution on page 322 uses the nectar field
public static void CollectNectar(float amount) { if (amount > 0f) { nectar += amount; } }

Something of note for the next edition

Screenshot_2

So my computer died and I decided to just load the code from the resources file. I think my code and yours was pretty much the same. But I get this mess of red and VS won't accept any keywords. I know it was installed right and I could load other files just fine, just not yours for some reason.

I initially came here to post asking how to fix this, but somehow having VS22 active when I went online seemed to have fixed it. The last few days nothing would work, then as I start writing my letter on GitHub, all of the red disappears like magic.

So you might want to make a note if someone in the future complains about this problem, or maybe even note in the next version that if VS doesn't seem to like their program, or your code from the master resources, maybe just going online with the program open in studio might fix it.

Chapter 1 timer issue related to runtime tools

After I finished writing the matching game in chapter 1, my timer was not working properly. It would launch and count up (too slowly) for a second or so, then it would only advance by 0.1s every time I clicked an emoji. I used diff to compare my code with the files in this repo, and they were identical except for cosmetic differences (e.g. choice of emoji, empty lines).

I ended up watching the video walkthrough of Ch1, and I noticed the mention of "runtime tools" around 15:30, so I disabled those. This immediately fixed my problem. I had missed / skipped the instructions to do this on p. 26, and there was nothing to indicate that these tools were anything more than a slight visual nuisance on my screen.

If this makes sense, I think the runtime tools issue should be mentioned on the chapter 1 troubleshooting page, since the connection between these runtime tools and the timer is not obvious to me.

Chapter 1 code p 25 index out of range

Hi,

I am having trouble with the code in the WPF version of the MatchGame in Chapter 1.

The problem is with the code added on page 25 of the print edition. It's line 71 in the code on Github for that chapter.

string nextEmoji = animalEmoji[index] throws an error:
"System.ArgumentOutOfRangeException: 'Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')'"

I've been attempting to debug it. It appears that even though it fills in all the text blocks, it does not stop after completion and attempts to loop through one more time. If I comment on the last line of that block (animalEmoji.RemoveAt(index); it will complete without error, but there are three of one type of emoji and only one of another.

Developing on Windows 10, whatever the latest update is (2020H?) Visual Studio 2019; targeting the latest .NET (5.X), which may mean it is using C# 9.

Probably needs a break condition, e.g. if animalEmoji.Count = 0 then break, but I am not sure how and when this is done in C#.
Anyway, enjoying the book (the Mac Version of the project worked).

Thanks for the book and the help,

Les

Chapter 9 p.526 4th Bullet Point

It reads incorrectly that the "internal keyword" makes classes in one project "accessible" to other projects. This should read that it makes them "inaccessible".

MatchGame.exe

Hi

I have just started reading you book and going through the programs but I have hit a problem. Every time I try to run the program I get a error message from Visual Studio 2022 "To run this application, you must install .NET Core." I have tried downloading and installing .NET Core still getting the same message. Re-installed VS 2022 same issue. The Debug message in VS is "The target process exited without raising a CoreCLR started event."
What can I do to resolved this please?

Thank you
Leon

Ch 8 Two Decks Downloadable exercise problem

Hello,

I've been scratching my head over this and can't seem to figure it out. Basically, something is not happening right with my data bindings. When I debug in local I get leftDeck error cs0103 - Does not exist in this context. But somehow rightDeck seems to work fine. At least it calls the initializer and gets populated with cards. It doesn't get cleared for some reason, but that is the next bug to figure out.

MainWindow - Copy.xaml.txt
MainWindow.xaml - Copy.cs.txt

Deck - Copy.cs.txt
image

As shown in the picture. Resources does populate with key 0- rightDeck and key 1-leftDeck. leftDeck was first in the xaml so I'm not sure why it is the second key and if it might be related to the problem. I tried forcing the leftDeck to populate by adding the statement to main
Deck leftDeck = Resources["leftDeck"] as Deck;

this did populate the field correctly in my watch list and show it full of 52 cards, but the listBox did not populate.

Thank you for any help.

Chapter 9

Hello,

Some minor issues in chapter 9 I was able to figure out for the most part but commenting on them here. Also general commentary.

  1. descending keyword: I like how this keyword was introduced after using the -variable the first two times. I could never remember whether the minus would result in a descending or ascending list. (does it put the next value before this value or this value before the other?) The keyword helps so much.
  2. This entire chapter feels like new content. In 3rd edition, I made it as far as Serialization, but this all seems new.
  3. Failed the magnets as usual, but it made me receptive to the following exercises. I would not have figured out putting modifiers under the select clause.(sparrow-1) I also forgot that the whole LINQ query needed to be assigned to a reference so was left with a few extra "var animal ="
  4. Anatomy of a Query - "Here's the updated LINQ query" > So the directions pretty much state that if the student updates the LINQ query as directed, the code will work. It does not. Foreach gives the error "Cannot convert type string error and, after substituting var for comic, "string does not contain a definition for Issue" errors happened. I ended up making the following fix.
    foreach (Comic comic in ComicDescriptions) Console.WriteLine($"{comic} is worth {Comic.Prices[comic.Issue]:c}");
    to
    foreach(var comic in ComicDescriptions) Console.WriteLine(comic);

An updated foreach or a note "Now you get an error, how should you fix it?" would be good here. Being told updating the query would still work when it did not confused me a bit. There was the redundancy of the old Console.WriteLine and the updated comic query returning the same string as a good hint though.

  1. "Add a unit test project" -> VS2019 does not have a MSTest core template for some reason.

image

While I still haven't figured out how to get the MSTest templates into VS2019, I did figure out if I opened the project in VS 2022 there is a MSTest project there. I added it to the JimmyLinq solution but got a bunch of type or namespace errors. It wasn't accepting the using. In fact, when I tried typing it out. It only gave Microsoft.VisualBasic as an intellisence option. I switched back ot 2019 but it still didn't accept the using. Once I got near land I updated nuget and suddenly it worked. Reiterating the steps didn't reproduce the error so I suppose lack of internet stopped VS2022 from autoadding the dependencies. Now that I've added UnitTest online, I can apparently add it offline too.

I'd really like to find out how to get these missing templates added. There will probably be a future exercise specifying another missing template soon. While I've considered just practicing in 2022, I've been trying to stick to the same version as the book since Version issues caused me so many headaches in 2nd and 3rd edition.

  1. Intentional bug
    image

if (Comic.Prices[comic.Issue] < 100M) return PriceRange.Cheap; else return PriceRange.Expensive; }

So the only thing I had done different before I saw that was mine was reversed ( > 100M return expensive) and I had added the M to the 100 literal (M for money, Thank you for that memnonic). Removing the M and retyping if/else statements still gave the same results, so either this is a potential bug but not a problem in this instance, or I'm missing it.

Thank you.

Chapter 1 - Matchgame

Having added the emoji to the grid with xaml and input the C# code as instructed I get the following error:-

System.Windows.Markup.XamlParseException
HResult=0x80131501
Message='The invocation of the constructor on type 'MatchGame.MainWindow' that matches the specified binding constraints threw an exception.' Line number '6' and line position '9'.
Source=PresentationFramework
StackTrace:
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.DoStartup()
at System.Windows.Application.<.ctor>b__1_0(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at MatchGame.App.Main()

This exception was originally thrown at this call stack:
[External Code]
MatchGame.MainWindow.SetUpGame() in MainWindow.xaml.cs
MatchGame.MainWindow.MainWindow() in MainWindow.xaml.cs

Inner Exception 1:
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Arg_ParamName_Name

*** I am using VS Community 2022 - Has something changed since the 2019 edition that would cause this error?

Order of Xaml code creates NullReferenceExeption

On page 117 the book gives the Xaml code for the Label, TextBox, and TextBlock, but when running the code in that order you'll get a NullReferenceExeption, because when the TextChanged event is being raised when the TextBox is created, and at that point the TextBlock (named "number") is not created yet.
you just have to put the TextBlock (number) before the TextBox (numberTextBox), so when the event handler is created number is not Null.

Chapter 9 Long Exercise.

Hello,

For the Chapter 9 long exercise, one of the steps in the assignment is to type multiple tests in multiple files. The problem is only the first file seems to populate my Test Explorer, so the new tests are not added. I've tried clearing the tests, dragging and dropping the GameStateTests file into the Test Explorer, looking at file properties, double checked the usings statements, but I can't figure out why the other files aren't working. I also tried the open playlist file, but it seems to be looking for .playlist files, not .cs files.

Screenshot_1

Chapter 8 Unity Lab : foreach loop

image

(my PDF viewer has this as page 931, not sure what the actual page number is but it is right before the Chapter 8 Unity Coding Challenge.
image

The code in the book gives the following error. "GameObject does not contain a public instance or extension definition for GetEnumerator." I thought maybe I forgot something so I went back and double-checked, but everything seemed to be as specified in the book. So far the unity lab has been "type this" and "do that". So there aren't a lot of places for me to mess things up. Then I opened up the HFCS Code folder and looked under chapter 8 Unity lab assets. The GameController did not have the foreach loop under StartGame(). Since each chapter builds on the one before, I checked the chapter 9 unity lab too, but there was no foreach loop under StartGame() there either. I looked for Destroy(ball) thinking maybe the code had moved to another method but there were no Destroy(ball) calls in the game controller script.

Unused variable

In Sloppy Joe's Project (Chapter 04) there is an unused variable:

 `string guacamolePrice;`

It's declare at the beginning of the code Behind of the XAML window, then:

  `guacamolePrice = guacamoleMenuItem.Price`

And never get used.

Maybe in the next line your intent was to use guacamolePrice instead of guacamoleMenu.Price for the concatenation?:

 `guacamole.Text = "Add guacamole for " + guacamoleMenuItem.Price` 

Chapter 9 Go Fish Unit Testing

I am having a problem with unit test TestRandomValueFromHand() and I know it must be something wrong I have but my debugging is getting me nowhere and I am getting frustrated. The unit test is failing on the second assertion where random ValueToReturn = 16. It is coming back as "Five" instead of "Four". I added a debug line (code below) to write the card in the hand, referencing index h[16], and that is coming back "Four of Clubs" which seems good. So why is player.RandomValueFromHand().ToString() coming back as "Five"? I have gone as for as directly copying the code for RandomValueFromHand() from the Git repository. My Deck class is nearly identical as well. Any idea where I need to look closer? Thanks.

`public void TestRandomValueFromHand()
{
var player = new Player("Owen", new Deck());

        var h = player.Hand.ToList();
        Debug.WriteLine($"{h[16]}");  //This returns "Four of Clubs"

        Player.Random = new MockRandom() { ValueToReturn = 0 };
        Assert.AreEqual("Ace", player.RandomValueFromHand().ToString());
        
        Player.Random = new MockRandom() { ValueToReturn = 16 };
        Debug.WriteLine(player.RandomValueFromHand().ToString());    // This returns "Five"
        Assert.AreEqual("Four", player.RandomValueFromHand().ToString());
        
        Player.Random = new MockRandom() { ValueToReturn = 51 };
        Assert.AreEqual("King", player.RandomValueFromHand().ToString());
        Debug.WriteLine(player.RandomValueFromHand().ToString());
    }`

Page 376 second paragraph

 abstract class Canine : Animal
    {
        public bool BelongsToPack { get; protected set; } = false;

    }
}

say it has its own abstract property, BelongsToPack, but why abstract modifier didn't appear before BelongsToPack ,Thanks

Events and Delegates, baseball simulator does not print fan and pitcher reactions

In my code I have completed page 14 inside the bonus chapter about Events and Delegates. When I run it, I don't get any console printouts from Fan and Pitcher, almost as if their event handler's did not run. Is this an error on my part?
image

.NET7, Win 11 arm VM inside M1 Macbook Pro, VS2022. I noticed IntelliSense suggesting a question mark on the lines such as private void BallInPlayEventHandler(object? sender, EventArgs e), which differs from your code which does not have the question mark. But the presence of that question mark does not affect the issue.

Unanswered question on p. 324 (main book and Blazor PDF)

In a callout box, there is a good question about unassignedWorkers occasionally not working right because the value is 0.9999999, but this is not answered anywhere, as far as I can see! (Would be nice to know if the answer I'm giving my students is the same as what the authors intended...)

MatchGame Project - Restart does not show the Icons

If you play the game and you are finished selecting the Icons, if you click on restart game the Icons are not displayed again.

Solution:
In the SetUpGame Method you have to add:
textBlock.Visibility = Visibility.Visible;

Full SetUpGame Method:
`private void SetUpGame()
{
List animalEmoji = new List()
{
"😍","😍",
"😪","😪",
"🍔","🍔",
"🍗","🍗",
"🍙","🍙",
"🚄","🚄",
"🌍","🌍",
"❤","❤",
};

        Random random = new Random();

        foreach (TextBlock textBlock in mainGrid.Children.OfType<TextBlock>())
        {
            textBlock.Visibility = Visibility.Visible;

            if (textBlock.Name != "timeTextBlock")
            {
                int index = random.Next(animalEmoji.Count);
                string nextEmoji = animalEmoji[index];
                textBlock.Text = nextEmoji;
                animalEmoji.RemoveAt(index);
            }
        }

        timer.Start();
        tenthsOfSecondsElapsed = 0;
        matchesFound = 0;
    }`

image

where can i buy the Pdf ?

Hello, it seems that the book is not available in Belgium.

Is it possible to buy the PDF version (not Kindle or Epub) ? Where can I find it ?

I started the free chapters, looks great !

Wrong Value Instructions

On the Card Picker Project, section 5 Set the Window Title and Size says:
* Use the Layout section to set the width to 300.
And should have said 800.

Exercise suggestions

I have a proposal that I believe will drastically improve many of the exercises in the book. Of course we all have our different learning styles, however I personally find exercises such as magnets & fill in the blank pools to be a bit of drudgery. There is a book I have read long ago called "Python Crash Course" by Eric Matthes that captured my attention towards how exercises were completely in the hands of the reader. To reinforce learned concepts, the reader was tasked to create a program based on loose guidelines from the very beginning. I think these if they were to replace the two aforementioned exercise types would greatly improve knowledge retention and fun.

Also, at least in my physical copy there are a few pool exercises where some blanks have been printed in such a way that it appears there are two instead of one. Maybe it's just luck of the draw. It appears most notably on page 639.

Chapter 4, 4th edition method deprecation

The method used on page 160 for checking whether or not a float is infinite looks to have been replaced by float.IsInfinity(), at least in .NET version 5.0.300
image

Negating the result of IsInfinity() would fix the example of any errors

Ch 6 Jewer Thief

You might want to put in a warning about auto-generated classes or methods using the lightbulb. The generated methods almost always have the private keyword added, and the classes have the internal keyword added.

I typed the main and used the lightbulb to generate the classes for locksmith jewelThief, safe, etc, and the project would not build. It gave a bunch of errors about Safe and owner being lower visibility than Jewel thief. All my typed characters were correct, so it took me a while to realize that the word internal was added to my classes and messing things up. Just tossing this in for food for thought. Thank you.

--
so the code for this exercise keeps changing from step to step in a way where it works, doesn't work, then works again.

also, the code for ReturnContents that says to add new also adds the word Jewels and replaces the protected keyword with public
``new public void ReturnContents(Jewels safeContents, Owner owner)
Originally both ReturnContents methods were protected too. So Both Methods need to be changed to public or the program will not compile. In the following note

// The JewelThief subclass hides a method in the Locksmith base class,
// so you can get different behavior from the same object based on the
// reference you use to call it!
// Declaring your JewelThief object as a Locksmith reference causes it to
// call the base class ReturnContents() method.
Locksmith calledAsLocksmith = new JewelThief();
calledAsLocksmith.ReturnContents(safeContents, owner);
// Declaring your JewelThief object as a JewelThief reference causes it to
// call JewelThief’s ReturnContents() method instead, because it hides
// the base class’s method of the same name.
JewelThief calledAsJewelThief = new JewelThief();
calledAsJewelThief.ReturnContents(safeContents, owner);

this doesn't work without making both ReturnContents public, then for the next step where they are made virtual and override, the protected status is returned.

Still progressing through the book. I had gotten to the second lab in the 3rd edition before my computer died and I lost all my work. Since every project builds on previous projects, re-using code and such, I didn't feel like starting over and set it aside. Of course, I could have used the code but your code was different from mine and besides, 4th edition was supposed to come out real soon.

Anyway, I'm really liking the new content and the methodology of teaching through the debugger even more than the previous edition. A lot of this might be rehash, but a lot of content was added and I'm seeing it and liking it all.

Missing References and other issues.

Hello,

Attached are a couple explanatory images.

In the Kindle edition, many of the images are clipped. There seems to be nothing I can do to see the entire image. There is no zoom function and right-clicking only gives me a dictionary option. I've also tried switching from dual pane to single pane or changing the margins, but it only makes the entire page bigger or smaller, including the image, but it doesn't un-crop the cropped image. I'm using Windows Kindle viewer, so it might work fine on a tablet, but not on the pc. Not all images have this problem, just the images with explanatory writing on the right side of the images.

The second image points at a reference that is supposed to show in my IDE. It doesn't. Unfortunately, Google isn't much help. There are thousands of false hits connecting reference and Visual Studio. Usually, when you point out something in the IDE you give a tip to reset it if it doesn't show in the students. Could you please let me know what I need to do? I remember it used to show now that you pointed it out, but I can't remember when it vanished.

25eb0f6f-7113-45bf-84a7-610bd5ac832f
61a22297-1b34-404d-b191-43a506e26689

There are no page numbers on Kindle Edition. This makes it hard to apply errata or point out where a problem page might be.

private void Timer_Tick(Object source, ElapsedEventArgs e) { InvokeAsync(() => { tenthsOfSecondsElapsed++; timeDisplay = (tenthsOfS

I don't understand how this goes up in tenths of a second when the ++ operator is used. It says elsewhere that ++ increments by 1. Not .1. I'd expect tenthsOfSecondsELapsed = tenthsOfSecondsElapsed + .1;

The debugger kept tripping Avast antivirus. I ended up having to uninstall it because even with exceptions added, it kept triggering and blocking the debug exercise.

When creating WPF Apps, the instructions say to make WPF .net. But there is not just a WPF .net. There is WPF .net Core, and WPF .net Framework. does it matter which I choose? VS doesn't make clear what the difference is . Core and Framework are a bit too synonomous.

I loved the Debug exercise in Chapter 1. The code that popped the error was already "cleared" and apparently had nothing to do with the new code. Usually, when I see a debug exercise it is something along the lines of. "Ok, now take this working program and we'll delete the period. Now run it." Which is all very good, but the problem is obvious. This was a real head-scratcher, so when the exercise asked how many times did I hit continue before it finally broke, I was also surprised, because it never occurred to me before that I should count such a thing.

Overall, great so far. Pressing into chapter 2 now.

Thank you.

Logic error, page 573

if (i < bytesRead) fails to handle the last byte of those in the buffer. should be changed to if (i <= bytesRead).

also making it a bit clearer that there are 3 spaces in the else for formatting would decrease user error

Chapter 10 Hide and Seek test (HouseTests)

The code below for the test for the House class of the project have the following asserts, for which the the first three seem to be written correctly (they use House.Entry). The ones for kitchen and the rest of the rooms of the house seem to be incorrect as they are defined in the House as "var" within a static constructor and are not field members of the class and thus would not be accessible directly outside it as described in the solution.

Unless I'm missing something let me know.

incorrect (from below):

     var kitchen = hallway.GetExit(Direction.Northwest);
     Assert.AreEqual("Kitchen", kitchen.Name);

correct (what it should be):

     var kitchen = House.Entry.Exits[Direction.NorthWest];
     Assert.AreEqual("Kitchen",kitchen.Name);

(Excerpt from the solution) as written in the addendum project solution online:

    [TestMethod]
    public void TestLayout()
    {
        Assert.AreEqual("Entry", House.Entry.Name);

        var garage = House.Entry.GetExit(Direction.Out);
        Assert.AreEqual("Garage", garage.Name);

        var hallway = House.Entry.GetExit(Direction.East);
        Assert.AreEqual("Hallway", hallway.Name);

        var kitchen = hallway.GetExit(Direction.Northwest);
        Assert.AreEqual("Kitchen", kitchen.Name);

        var bathroom = hallway.GetExit(Direction.North);
        Assert.AreEqual("Bathroom", bathroom.Name);

     ....
    }

.sln files don’t contain code

There is little to no instruction on how to use this repository to follow along with the code in the book. None of the solutions work out of the box and I question why anyone would use this book and severely lacking repository. Zero stars.

Chapter 12, Page 630, qol/logic error

It is said that Console.OpenStandardInput(); allows piped args to be sent via the usage of <<.
On a windows machine, an error occurs when this is attempted however: image

Something more to note is that while the user can technically type as much as they like and it will generate a new line of dumped hex, to exit they must enter Ctrl+C.

I have been using return new MemoryStream( Encoding.UTF8.GetBytes(args[0]) ); in the time being. I have not yet found a way however to pipe to the program without permission denial or error.

Events & Delegates, page 8 typo

That’s why you use the ?. null conditional operator?. null conditional operator – here’s how you’d use it: BallInPlay.?Invoke(this, e)
That’s why you use the ?. null conditional operator?. null conditional operator – here’s how you’d use it: BallInPlay?.Invoke(this, e)

Chapter 8 p.425 Q4 Typo

I believe there is a typo in the answer for Question: Ok, that explains the "collection" part, But what makes it "generic"?

"... items that were packaged in white wrapper with black type..."

Should this be black tape?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.