markjprice / cs7dotnetcore

Repository for the Packt Publishing book titled "C# 7 and .NET Core" by Mark J. Price
http://cs7dotnetcore.azurewebsites.net/
28 stars 21 forks source link

MainWindows.xaml.cs missing #3

Closed DFerri916 closed 7 years ago

DFerri916 commented 7 years ago

Page 402, also referenced on page 398. There's no "MainWindows.xaml.cs" file. I have no idea where to program this event.

markjprice commented 7 years ago

That's a typo in the book. The file is not named MainWindows.xaml.cs, it is named MainPage.xaml.cs. Thanks for spotting it! I will fix that in the 3rd edition.

DFerri916 commented 7 years ago

Thank you! I imagined so, though I’m still not certain where to place that syntax. Checking now.

Also, I wasn’t counting, but I bookmarked a couple items worth mentioning.

Lastly, while I have your ear, I figure it’s worthwhile mentioning my free opinion on the book, thus far. I’m a Senior Access / Excel (VBA / SQL) Developer in my field, with a scholastic background in SQL and various programming courses from 2005-2009. I studied C# 3 briefly in school, years back. I know C# is the right language to study next, since I at least have an expertise in VBA, so VB will be a simple transition. Also, while multi-platform development isn’t in VB, it’s all the more reason to focus entirely on C#, to bring myself up-to-speed.

Since being a master in Access has its natural progression towards Visual Studio and C# is a future-proof, I chose this book because it explains 2 technologies I’m new to.

My mention is that from a completely blank canvas, built on already having the programmers mindset, I found a particular dichotomy in the pace of the book. Chapters 1-6 or so were great. They explained the fundamentals and lessons went swimmingly well. Around that, the book seemed to divert and suddenly elevate in its difficulty, or more precisely, chose to explain less and assume the user knew more, as if there were several sub-chapters in between that went into the consideration the first half of the book went into, with the exercises becoming more vague and not able to be entirely completed, when I was so excited to have completed all of them from the first half.

I just wanted to mention that, since this is something others who feel less comfortable or familiar in the thousand ways C# doesn’t explain things can be connected might encounter and find themselves not completing the book. I know for certain my very next book will again focus on more C#, so I can understand why it is C# took all the shortcuts to accomplishing things that I in VBA felt proud I had to invent and engineer, not having some randomly named function already be able to accomplish a task.

In any event, the fundamentals that were authored within the chapters are so far fantastic, from the low-level explanations of variables to the high-level access to them, as well as the classes, methods, Linq and alternative database connections, multi-threaded processing, and connections from .NET core, that I am now eagerly awaiting .NET core 2.0, as I now have a broad understanding of what a C# program requires and feel more comfortable experimenting on building the architecture to create prototypes. I am eagerly awaiting what I don’t know I’ll learn in the next 3 chapters!

Thank you very much for your immediate reply and time

Sincerely,

Douglas Ferri

From: Mark J Price [mailto:notifications@github.com] Sent: Friday, August 11, 2017 11:38 AM To: markjprice/cs7dotnetcore cs7dotnetcore@noreply.github.com Cc: DFerri916 DFerri916@Hotmail.com; Author author@noreply.github.com Subject: Re: [markjprice/cs7dotnetcore] MainWindows.xaml.cs missing (#3)

That's a typo in the book. The file is not named MainWindows.xaml.cs, it is named MainPage.xaml.cs. Thanks for spotting it! I will fix that in the 3rd edition.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/markjprice/cs7dotnetcore/issues/3#issuecomment-321846431, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AdIJSOG7faPLUzq4XfzUEBKvH8hFHuVNks5sXHU6gaJpZM4O0zXN.

DFerri916 commented 7 years ago

Hello,

Just another add. Immediately following that update on page 402, the “Shared resources” section starts by having me add syntax to an element that doesn’t exist. I’m not at all certain where this code is, as I don’t see it in anything I’ve built so far. I’ll have to re-create the Chapter’s solution to see if it was something inadvertently deleted during any experimenting of functionality.

Many thanks again

Douglas Ferri

From: Douglas Ferri Sent: Friday, August 11, 2017 12:03 PM To: 'markjprice/cs7dotnetcore' reply@reply.github.com; markjprice/cs7dotnetcore cs7dotnetcore@noreply.github.com Cc: Author author@noreply.github.com Subject: RE: [markjprice/cs7dotnetcore] MainWindows.xaml.cs missing (#3)

Thank you! I imagined so, though I’m still not certain where to place that syntax. Checking now.

Also, I wasn’t counting, but I bookmarked a couple items worth mentioning.

Lastly, while I have your ear, I figure it’s worthwhile mentioning my free opinion on the book, thus far. I’m a Senior Access / Excel (VBA / SQL) Developer in my field, with a scholastic background in SQL and various programming courses from 2005-2009. I studied C# 3 briefly in school, years back. I know C# is the right language to study next, since I at least have an expertise in VBA, so VB will be a simple transition. Also, while multi-platform development isn’t in VB, it’s all the more reason to focus entirely on C#, to bring myself up-to-speed.

Since being a master in Access has its natural progression towards Visual Studio and C# is a future-proof, I chose this book because it explains 2 technologies I’m new to.

My mention is that from a completely blank canvas, built on already having the programmers mindset, I found a particular dichotomy in the pace of the book. Chapters 1-6 or so were great. They explained the fundamentals and lessons went swimmingly well. Around that, the book seemed to divert and suddenly elevate in its difficulty, or more precisely, chose to explain less and assume the user knew more, as if there were several sub-chapters in between that went into the consideration the first half of the book went into, with the exercises becoming more vague and not able to be entirely completed, when I was so excited to have completed all of them from the first half.

I just wanted to mention that, since this is something others who feel less comfortable or familiar in the thousand ways C# doesn’t explain things can be connected might encounter and find themselves not completing the book. I know for certain my very next book will again focus on more C#, so I can understand why it is C# took all the shortcuts to accomplishing things that I in VBA felt proud I had to invent and engineer, not having some randomly named function already be able to accomplish a task.

In any event, the fundamentals that were authored within the chapters are so far fantastic, from the low-level explanations of variables to the high-level access to them, as well as the classes, methods, Linq and alternative database connections, multi-threaded processing, and connections from .NET core, that I am now eagerly awaiting .NET core 2.0, as I now have a broad understanding of what a C# program requires and feel more comfortable experimenting on building the architecture to create prototypes. I am eagerly awaiting what I don’t know I’ll learn in the next 3 chapters!

Thank you very much for your immediate reply and time

Sincerely,

Douglas Ferri

From: Mark J Price [mailto:notifications@github.com] Sent: Friday, August 11, 2017 11:38 AM To: markjprice/cs7dotnetcore cs7dotnetcore@noreply.github.com<mailto:cs7dotnetcore@noreply.github.com> Cc: DFerri916 DFerri916@Hotmail.com<mailto:DFerri916@Hotmail.com>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [markjprice/cs7dotnetcore] MainWindows.xaml.cs missing (#3)

That's a typo in the book. The file is not named MainWindows.xaml.cs, it is named MainPage.xaml.cs. Thanks for spotting it! I will fix that in the 3rd edition.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/markjprice/cs7dotnetcore/issues/3#issuecomment-321846431, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AdIJSOG7faPLUzq4XfzUEBKvH8hFHuVNks5sXHU6gaJpZM4O0zXN.

markjprice commented 7 years ago

Hi Douglas,

Thanks for mentioning the typos on pages 222 and 250. Others have raised them as errata too, so they will be fixed in the 3rd edition.

Apparently Visual Basic will be supported in .NET Core 2.0, although I still think you're doing the right thing by learning C#. VB is definitely legacy at this point. I'm disappointed in Microsoft for not replacing VBA with a C#-based scripting language, like PowerShell, in the Office products for automation.

I agree that the latter half of the book ramps up what is expected of the reader, and you're right that it was a conscious choice. It's a tricky balance, because I wanted to include at least an introduction to the major app models (web, Windows, and mobile), but there are limits to space in a book like this, and I didn't want to annoy readers with too much hand-holding after they've mastered the basics.

I think it is especially noticeable for readers who attempt to go through the whole book in a single sitting. It might be less of a shock if the learning can be spread over several weeks or months, with time in-between to practice on some projects.

I do plan to fill out more explanations in the later chapters in the 3rd edition, because I agree that on balance the book would benefit most from effort in that area.

Thanks for your detailed feedback: it all helps in the continuous improvement of the book. :)

--Mark

DFerri916 commented 7 years ago

Hi Mark,

Thank you again and of course

Awesome. Yes, I’ve been researching as much as I can to place myself into the best subset of Visual Studio technologies, at least first, to build a solid technical ground-game, then to add on other affiliated skills. The difficulty is that I’ve achieved being at the apex in Access & VBA development, basing the success of my career on it, where I can build literally anything. Now, Visual Studio has that same ability, I’m assuming, but without inherent connectivity to tables / workbooks and requires much more explicit programming.

Just the same, C# requires much more programming than VBA, or everything is vastly different (TBD), so I have to re-learn the functions or techniques to accomplish something to stay parallel in qualified skills (E.g. Redim preserve arrays in VBA and most importantly, the inherent connectivity to tables / workbooks with the VBA Office Object Model). Simultaneously, I’m reading I should focus on .NET classes over C#, over VB, from VBA. Quite a few hops I have to make to land well, and if I suddenly say I’m competent in VS, I need to make sure I’m not bringing a void of a technology, being inline functions.

As a seasoned contractor, I can say for sure that most organizations still often see developers the same as IT, as infrastructure support for the organization, but not to make a direct profit. That’s why VBA will still be around – in its simplest existence, it can be learned by power-users to expedite or enhance their workflow, then where realized, requested as an intermediate or full-fledged solution within a department, to enable users to master their jobs where they already are, harnessing data, instead of being burdened by it. And it’s free, since they probably already have Microsoft Office for Excel, Word, PowerPoint, and Outlook, and if fortunate, Access.

Definitely, the two plateaus were interesting. It’s better than most books, where Chapter 1 is nothing like Chapter 2-10. I did find purpose in not being given the answer, but because it was authored, I had the assurance the answer was there. I wasn’t left without direction, so I benefited from knowing I should eventually stumble on what went wrong. Most of the ambiguities were capitalization errors that VBA got me used to not having to worry about, so I could focus on what the sophisticated tool was going to be used for, instead of building the actual tool.

I generally power through books, but this is a new one, so I knew I needed all the lessons to forge the synapses. This one was read in 17 days. I made sure to type everything requested and work on the practice examples until they were right or I gave up. 6.2, 10.2, 11.2, and 14.2 were at least half built. 6.2 was the most fun, puzzle-wise. The closest build was this. After a revised version, I gave up, then built it in 30 seconds in Access with a cartesian join – my dilemma, being so fluent in Access SQL and having to relearn it with objects. Any way. I don’t think I applied the right lessons for the request – tips to know I was on the right path would definitely be helpful, since everything was new and I didn’t apply concepts to examples, already having forged solutions, like automatically knowing I could have used cartesian joins on a table 3x to find the answer, but just the same, nobody else would think of it that way, unless they were fluent in dismantling data by SQL and recordsets, the way I have. I couldn’t find any on the internet, so I planned/plan to re-invest time into this puzzle after knowing more technical C#.

//Original////////////////////////////////////////////////////////////////////////////////////////////////////////////////// var lstMultipliers = new List(); int r = 0; for (r = 0; r <= lstPrimeNumbers.Count - 1; r++) { if (numVal > lstPrimeNumbers[r]) { lstMultipliers.Add(lstPrimeNumbers[r]); WriteLine(lstPrimeNumbers[r]); } } for (r2 = 0; r2 <= lstMultipliers.Count - 1; r2++) { WriteLine($"R2 = {lstMultipliers[r2]}"); for (r3 = 0; r3 <= lstMultipliers.Count - 1; r3++) { WriteLine($" R3 = {lstMultipliers[r3]} = {lstMultipliers[r2] lstMultipliers[r3]}"); if (lstMultipliers[r2] lstMultipliers[r3] == numVal) { lstSolution.Add(lstMultipliers[r2]); lstSolution.Add(lstMultipliers[r3]); //return; successful = true; goto Next_Section; } }

}

Next_Section:

WriteLine(successful);
if (successful == false)
{
    WriteLine("Solve later. Convert usable proven 2D loops into dynamic backwards method. What just learned tool should be used to suffice for VBA RS?");
    //WriteLine(lstSolution[0]);
    //WriteLine(lstSolution[1]);
}

//Original//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

//Most Recent////////////////////////////////////////////////////////////////////////////////////////////////////////////////// private static void PrimeFactors(int numVal) {

        bool prime;
        var lstPrimeNumbers = new List<int>();

        for (int i = 2; i <= 100; i++)
        {
            prime = true;

            for(int i2 = 2; i2 < i; i2++)
            {
                if ((i % i2) == 0)
                {
                    prime = false;
                    break;
                }
            }

                    if (prime == true && i <= numVal)
            {
                        lstPrimeNumbers.Add(i);
                    }

        }

        int x = 0;
        int y = 1;

        while (y <= numVal)
        {
            y = y * lstPrimeNumbers[0];
            x++;
        }

        //Creates Array and defaults all values to 1
        int[] placeholder = new int[x-1];
        for(int i = 0; i <= placeholder.Length-1; i++)
        {
            placeholder[i] = 1;
        }

            //Defaults total to 1
            long total = 1;
            int i3 = 0;

        WriteLine($"a0 \t a \t ara \t b \t PN[b] \t total");

        //add another for loop?
        for (int a0 = 0; a0 <= placeholder.Length-1; a0++)
        {
            //For each array placeholder
            for (int a = 0; a <= placeholder.Length - 1; a++)
            {
                for (int b = 0; b < lstPrimeNumbers.Count - 1; b++)
                {

                    placeholder[a] = lstPrimeNumbers[b];

                    total = 1;
                    for (i3 = 0; i3 <= placeholder.Length-1; i3++)
                    {
                        //WriteLine($"before \t i3 = {i3}; total = {total}");
                        total = total * placeholder[i3];
                        //WriteLine($"after \t i3 = {i3}; total = {total}");
                    }

                    WriteLine($"{a0} \t {a} \t {placeholder[a]} \t {b} \t {lstPrimeNumbers[b]} \t {total}");

                }
                placeholder[a] = lstPrimeNumbers[0];

            }
        }

//Most Recent//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Anyway, that’s some of the partial code to try casting a wider 100% dynamic net that created gaps in numbers where prime multiplication didn’t exist, needing an iteration to both store the existing and new variables. The original was more solidly built, but had a limit to finding factorials after a fixed maximum. Since I couldn’t re-dim arrays, where I’m fluent, and can’t use tmp tables to store data, where I’m also fluent, I’ll have to re-invest time to it, which is invaluable in experience to be able to comfortably try to solve and solve. That original one needs fixing up to be re-used, but you’ll see the pattern in my thought processes.

Enjoy and thank you again for the reply and solid foundation for my C# re-development!

Sincerely,

Douglas Ferri

From: Mark J Price [mailto:notifications@github.com] Sent: Saturday, August 12, 2017 2:49 AM To: markjprice/cs7dotnetcore cs7dotnetcore@noreply.github.com Cc: DFerri916 DFerri916@Hotmail.com; Author author@noreply.github.com Subject: Re: [markjprice/cs7dotnetcore] MainWindows.xaml.cs missing (#3)

Hi Douglas,

Thanks for mentioning the typos on pages 222 and 250. Others have raised them as errata too, so they will be fixed in the 3rd edition.

Apparently Visual Basic will be supported in .NET Core 2.0, although I still think you're doing the right thing by learning C#. VB is definitely legacy at this point. I'm disappointed in Microsoft for not replacing VBA with a C#-based scripting language, like PowerShell, in the Office products for automation.

I agree that the latter half of the book ramps up what is expected of the reader, and you're right that it was a conscious choice. It's a tricky balance, because I wanted to include at least an introduction to the major app models (web, Windows, and mobile), but there are limits to space in a book like this, and I didn't want to annoy readers with too much hand-holding after they've mastered the basics.

I think it is especially noticeable for readers who attempt to go through the whole book in a single sitting. It might be less of a shock if the learning can be spread over several weeks or months, with time in-between to practice on some projects.

I do plan to fill out more explanations in the later chapters in the 3rd edition, because I agree that on balance the book would benefit most from effort in that area.

Thanks for your detailed feedback: it all helps in the continuous improvement of the book. :)

--Mark

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/markjprice/cs7dotnetcore/issues/3#issuecomment-321961975, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AdIJSO1V_q3sfEfwMicITqo-jeuLXOkVks5sXUrOgaJpZM4O0zXN.