C++ All-in-One for Dummies 3rd Edition Extras

A number of you have pointed out that the extras for C++ All-In-One for Dummies, 3rd Edition on the Dummies site are a bit confused at the moment. Thank you, as always, for your input. I always appreciate getting your e-mails on any topic that affects the usability of my books. The publisher has assured me that the links will be cleaned up. Of course, eventually getting the links fixed won’t help you today. With this in mind, here is a list of the actual extras for this book—the elements that I’ll support and that provide support for the book:

To access a particular extra, just click its link in the list. Of the items you can download, the items that I most strongly suggest you download are the code examples. Downloading the code examples will save you considerable time, reduce potential errors, and make your experience with the book a lot better. If you want to type the examples in by hand, try them first using the downloaded code and then type them in. Using this two-step process makes it possible for you to easily see typos that you make as you work with the code on your own.

Remember that this edition of the book uses a newer IDE, Code::Blocks 13.12. Even though some examples will work with the older versions of Code::Blocks used in the second edition, other examples won’t. Upgrading your copy of Code::Blocks to version 13.12 ensures that you see the examples as they are meant to work. A few readers have asked about the requirements for using the extras and you really do need Code::Blocks 13.12 to use them correctly. You can also get by with a compiler that provides C++ 14 support, but you’ll need to modify the procedures to use that compiler, rather than Code::Blocks. I don’t provide support for other compilers because I don’t have them installed on my system.

Please let me know if you have any other questions about the extras for this book. It’s important to me that you get the maximum value from your purchase. Report any problems to me at John@JohnMuellerBooks.com. Of course, I always want to hear your book-related queries as well.

 

Getting Your Beginning Programming with Python for Dummies Extras

On Monday I announced my latest book, Beginning Programming with Python For Dummies. This truly is the book you must have if you need to learn Python quickly and you don’t have a lot of experience. If you have already received your copy of the book or you’re simply curious, you want to check out the extras that come with this book. You can find them on the Dummies site at http://www.dummies.com/extras/beginningprogrammingwithpython. So, just what sorts of things can you get? Here is a list of the online content:

  • Cheat sheet: You remember using crib notes in school to make a better mark on a test, don’t you? You do? Well, a cheat sheet is sort of like that. It provides you with some special notes about tasks that you can do with Python that not every other developer knows. You can find the cheat sheet for this book at http://www.dummies.com/cheatsheet/beginningprogrammingwithpython. It contains really neat information like the top ten mistakes developers make when working with Python and some of the Python syntax that gives most developers problems.
  • Dummies.com online articles: A lot of readers were skipping past the part pages in the book, so I decided to remedy that. You now have a really good reason to read the part pages, and that’s online content. Every parts page has an article associated with it that provides additional interesting information that wouldn’t fit in the book. You can find the articles for this book at http://www.dummies.com/extras/beginningprogrammingwithpython. Here is a quick overview of the articles you find on the extras site:

  • Updates: Sometimes changes happen. For example, I might not have seen an upcoming change when I looked into my crystal ball during the writing of this book. In the past, that simply meant the book would become outdated and less useful, but you can now find updates to the book at http://www.dummies.com/extras/beginningprogrammingwithpython.
  • Companion files: Hey! Who really wants to type all the code in the book? Most readers would prefer to spend their time actually working through coding examples, rather  than typing. Fortunately for you, the source code is available for download, so all you need to do is read the book to learn Python coding techniques. Each of the book examples even tells you precisely which example project to use. You can find these files at http://www.dummies.com/extras/beginningprogrammingwithpython.

As always, I highly recommend that you download the book’s source code. Doing so will save you considerable time and frustration. In fact, when you write to me at John@JohnMuellerBooks.com, the first thing I’ll ask is whether you downloaded the source code.

Of course, you’ll also continue seeing extra content for the book on my blog. Always check out the Beginning Programming with Python for Dummies category to see new posts for this book. You’ll find all sorts of useful information in this category including: book fixes, source code fixes, answers to reader queries, and general Python news.

 

Fixed C++ Book Link

Last week I announced the release of C++ All-In-One for Dummies, 3rd Edition and told you about a link for the book extras at http://www.dummies.com/extras/cplusplusaio/. Unfortunately, the link didn’t work for a while. Clicking the link produced an error message, rather than a page full of useful content. The publisher has fixed the link and you can now gain access to a lot of really cool book extras:

All these extras will make your reading experience even better. Make sure you check them all out. Of course, I always want to hear your book concerns, especially when it’s something major like not being able to find needed content. Please feel free to contact me at John@JohnMuellerBooks.com with your book-specific question.

 

Choosing a C++ Editor

A lot of people have asked why I chose Code::Blocks as the editor for C++ All-In-One for Dummies, 3rd Edition. There are a number of reason that I chose this particular editor including:

  • Ease of use
  • Free download
  • Runs on all the platforms the book supports

However, the fact that Code::Blocks works well for the book and for most beginning projects doesn’t mean it’s the best solution for your particular needs. There are many different C++ Integrated Development Environments (IDEs) out there and I’m constantly trying new products. When the new version of Visual Studio comes out, you can be sure I’ll obtain a copy and check it out because some of my readers use Visual Studio. The problem with Visual Studio is that it tends to use Microsoft additions to the C++ language and it also doesn’t run on all the platforms that the book must support. However, if you’re working with Microsoft systems and need to create a relatively large project, Visual Studio might be a good choice for you—only you can make that determination.

The Eclipse IDE is another good selection. In fact, I used Eclipse when writing Java eLearning Kit for Dummies because it runs on every platform I needed to test. When I wrote this book, I chose to focus on the language though and not really mention the IDE at all. I didn’t want readers to have preconceived ideas of how Java should look inside an editor. I had thought about using Eclipse for C++ All-in-One for Dummies, 3rd Edition, but after reviewing the IDE and comparing it to Code::Blocks, I felt Code::Blocks was a lot simpler. Even so, if you need great multiplatform support for your C++ projects, Eclipse is a great choice.

I recently tried another IDE, Intel Composer. This is most definitely not a IDE for the faint of heart or the light of pocketbook (the asking price is $1,199.00). Of course, many of you are going to question my sanity for even downloading such a product when there are so many less expensive solutions out there. The main reason to obtain a product like this one is that it provides phenomenal parallelism support for multiprocessor applications. In other words, you use this sort of IDE for high end projects. You can read all the other features this product offers on the vendor site. One of the other items that grabbed my attention is that it provides both multiplatform (Windows, Mac, Linux, and Android) and multiformat (Phone, Tablet, PC, Ultrabook, and Server) support. Whether this particular IDE makes sense for your needs depends on the kind of applications you create.

Although the information in Wikipedia is often suspect, you can find a comparison of various IDEs at http://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments. The best way to choose a C++ IDE is to look for a product that meets your needs and then try it out on a subset of the problem you’re trying to solve. Researching the IDE you use is essential because a mistake can cost you a lot of time later. Not every IDE support every C++ feature, every platform, or every team need. Tell me why you think I should move to something other than Code::Blocks for the next edition of the book at John@JohnMuellerBooks.com.

 

TVF Example in Chapter 10

At least one reader has encountered a problem with the Table-Valued Function (TVF) example in Chapter 10 of Microsoft ADO.NET Entity Framework Step by Step when working with Visual Studio 2013. Before you begin this example, make absolutely certain that you have setup and configured SQL Server for use with the book. You can find the required instructions in these posts:

In addition, you must start the SQL Server Browser. Otherwise, the example will never work.

First, the good news—the example does in fact run. If you use the downloadable source code, rather than trying to type the example in by hand, you can see it function and work through the example using any technique you like (such as the debugger). However, as I pointed out in Entity Framework Examples – Visual Studio 2013 Update, this book really is designed to work best with Visual Studio 2012, so it’s not unexpected that you may encounter problems if you don’t follow the guidelines in the System Requirements section of the Introduction (page xxii).

The bad news really isn’t that bad. You may see an error, “Error 3027: No mapping specified for the following EntitySet/AssociationSet – ObtainClientsEntities” when you compile the example.  The example will still work, but the error message is disconcerting. Unfortunately, I haven’t been able to reproduce it on my system using Visual Studio 2012. You may be able to rid yourself of this error message by erasing the .suo files in the example file and doing a complete rebuild of the example.

In addition, when you open the Rewards2Model.edmx file in the XML editor, you may see “Error 11007: Entity type ‘ObtainClientsEntity’ is not mapped.” Again, I haven’t been able to reproduce this error. There is some discussion that you really must create the table before creating the example application in order to avoid this error. However, taking that step would reduce the usefulness of the technique. Again, the example works just fine even with this error in place.

What is need to know is whether these two errors are common and what I need to do to reproduce them. It may be that there is a quick fix that has so far eluded notice. In the meantime, it’s safe to ignore the two errors because the example does run, even when you’re working with Visual Studio 2013. Please contact me with your findings at John@JohnMuellerBooks.com.

 

Entity Framework Examples – Visual Studio 2013 Update

Microsoft has a habit of making updates between versions of Visual Studio applications difficult. For example, the simple act of opening a solution (.SLN) file using a different version of Visual Studio than the one used to create it can be difficult or impossible. Most technology updates contain breaking changes that mean older code requires tweaks in order to continue working. Even the Visual Studio IDE interface changes, which means step-by-step instructions no longer work properly. Unfortunately, all of these sorts of changes have affected the examples in Microsoft ADO.NET Entity Framework Step by Step. This book is written to support:

 

  • Visual Studio 2012 Professional (or above)
  • Entity Framework 5.x

It doesn’t surprise me that Visual Studio 2013 developers are encountering problems with the book. Changes to the IDE mean that the step-by-step instructions won’t work as stated and there isn’t an easy method of fixing this problem short of rewriting the book. Likewise, changes to the Entity Framework mean that some assemblies such as System.Data.Entity don’t even exist any longer, so some book explanations won’t make sense.

However, it’s still possible to open the examples and see how they work. Instead of opening the .SLN file associated with an example, open the C# Project (.CSProj) file. For example, when looking at the example in Chapter 1, you open the SimpleEF.csproj file found in the \Microsoft Press\Entity Framework Development Step by Step\Chapter 01\SimpleEF\SimpleEF folder instead of the SimpleEF.sln file found in the \Microsoft Press\Entity Framework Development Step by Step\Chapter 01\SimpleEF folder when using Visual Studio 2013.

Much of the theoretical, usage, and general functionality information in the book (about half of the book) is still useful to the Visual Studio 2013 developer as well. So, there is still a lot of value to obtain by reading my book, but readers are right to point out that not every feature will work as written. Please accept my apologies in advance if you purchased the book and were disappointed with it. I did provide clear instructions about the products to use with the book in the book’s Introduction, but such information can be easy to miss.

As always, I try to provide every reader with a great reading experience. Should the publisher decide to update this book, you’ll learn about the update here when I start looking for beta readers. Please let me know about your other book-specific questions at John@JohnMuellerBooks.com.

 

Choosing an Example Type

It can be difficult to choose just the right kind of source code examples to include in my books. In fact, readers often write to ask why I didn’t choose a different kind of example for a book. For example, a lot of readers tend to prefer console applications because they’re:

 

  • Straightforward
  • Easy to understand
  • Easy to write
  • Demonstrate the code clearly
  • Don’t rely on any automation


Given these reasons, it would seem as if I’d use console applications for all of my examples in all of my books. In fact, these benefits (and others) are the reason I used console applications in C++ All-In-One Desk Reference For Dummies. In fact, to this list, you can add the benefit of the same example code running on multiple platforms to the list. The same example code runs on Mac, Linux, and Windows platforms with the GCC compiler. Even with this book, however, I’ve had readers write to ask why I didn’t use a different compiler or IDE and why I didn’t include examples that demonstrate the ability to use C++ to create user interfaces in anything but Visual Studio (the new edition of the book won’t include the Visual Studio examples).

Some books don’t lend themselves to console applications. For example, one of the purposes of Microsoft ADO.NET Entity Framework Step by Step is to show how you can use the automation provided by Visual Studio to write your applications with less code and in significantly less time. Not everyone likes the automation and I’ve actually had a few readers ask why I couldn’t write the examples using a console application format. The problem is that few people use the Entity Framework with console applications and the automation is there to simplify things. I understand that other books may provide console application examples, but I chose to provide the examples in a form that the majority of my readers would use in a real world setting.

Trying to come up with a book that pleases everyone is simply impossible because everyone has different needs. It all comes down to people wanting the best deal possible in a book, which means seeing an example that uses their environment on their platform and demonstrating precisely the kind of code they need to write. It’s an unrealistic expectation for any book. My Getting the Most from Your Technical Reading Experience post explains how you can optimize the purchasing experience to obtain the best book for your needs. The caveat is that no matter how good the purchase is, the book will never answer all of your questions and most definitely won’t answer them in precisely the way you need them answered for fulfill an application development requirement.

Of course, I’m always open to your input. It’s the reason I run this blog and ask for your input in nearly every post. My purpose in writing is to answer as many questions as I can for as many readers as I can in the best way possible. Sometimes that means I need to take a step back and rethink a particular process I’m using, technique I’m applying, or perspective I’m pursuing. I encourage you to continue contacting me at John@JohnMuellerBooks.com with your book-related queries. I always use your input to help create better books in the future.

 

Antivirus and Application Compilation

Sometimes applications don’t get along, especially when one application is designed to create new content at a low level and the other is designed to prevent low level access to a system. Such is the case with compilers and antivirus applications in some cases. I haven’t been able to reproduce this behavior myself, but enough readers have told me about it that I feel I really do need to address it in a post. There are situations where you’re working with source code from one of my books, compile it, and then have your antivirus application complain that the code is infected with something (even though you know it isn’t). Sometimes the antivirus program will go so far as to simply delete the application you just compiled (or place it in a virus vault).

The solution to the problem can take a number of forms. If your antivirus application provides some means of creating exceptions for specific applications, the easiest way to overcome the problem is to create such an exception. You’ll need to read the documentation for your antivirus application to determine whether such a feature exists.

In some cases, the compiler or its associated Integrated Development Environment (IDE) simply don’t follow all the rules required to work safely in protected directories, such as the C:\Program Files directory on a Windows system. This particular issue has caused readers enough woe that my newer books suggest installing the compiler and its IDE in a directory the reader owns. For example, I now ask readers to install Code::Blocks in the C:\CodeBlocks directory on Windows systems because installing it elsewhere has caused some people problems.

Unfortunately, creating exceptions and installing the application in a friendly directory only go so far in fixing the problem. A few antivirus applications are so intent on protecting you from yourself that nothing you do will prevent the behavior. When this happens, you still have a few options. The easiest solution is to turn the antivirus program off just long enough to compile and test the application. Of course, this is also the most dangerous solution because it could leave your system open to attack.

A safer, albeit less palatable solution, is to try a different IDE and compiler. Antivirus programs seem a little picky about which applications they view as a threat. Code::Blocks may cause the antivirus program to react, but Eclipse or Visual Studio might not. Unfortunately, using this solution means that steps in the book may not work precisely as written.

For some developers, the only logical solution is to get a different antivirus application. I’ve personally had really good success with AVG Antivirus. However, you might find that this product doesn’t work for you for whatever reason. Perhaps it interacts badly with some other application on your system or simply doesn’t offer all the features you want.

My goal is to ensure you can use the examples in my books without jumping through a lot of hoops. When you encounter problems that are beyond my control, such as an ornery antivirus application, I’ll still try to offer some suggestions. In this case, the solution truly is out of my control but you can try the techniques offered in this post. Let me know if you find other solutions to the problem at John@JohnMuellerBooks.com.

 

Finding the Source Code for Microsoft ADO.NET Entity Framework Step by Step

Sometimes a bit of information isn’t known by an author at the time of writing, so the book will contain placeholder text to remind everyone to add the information later. Normally, the process works great and the replacement is made without problem. I was recently informed of a problem in Microsoft ADO.NET Entity Framework Step by Step. It turns out that there is placeholder text in some places that reads, “Provide URL Here.” I added the placeholder because I didn’t know where the publisher would store the book’s source code at the time of writing. Of course, the placeholder is hardly helpful to anyone who really would like to find the book’s source.

If you encounter such a placeholder in this book, please go to the O’Reilly download site at http://aka.ms/ADONETEFSbS/files or http://examples.oreilly.com/9780735664166-files/ to obtain the files. I really do consider it important that you download the book’s source code and use it as you work through the text. This particular book has a lot of complex examples that will be tough to get right if you type them in by hand. A single typo can make the examples completely unusable, or at least cause damage to your sample database.

In addition to reading about potential problems and obtaining useful bits of additional information by reading my blog, make sure you also check the book’s errata page at http://www.oreilly.com/catalog/errata.csp?isbn=0790145339164 (see my Errors in Writing post as well). This page provides you with succinct summaries of potential problems and the fixes I suggest for them. Always feel free to write me about my books as well at John@JohnMuellerBooks.com. It’s important to me that you always have a great experience when using my books.

 

Using Code::Blocks 13.12 with C++ All-in-One for Dummies

As stated in my Beta Readers Needed for a C Book Update post, I’m currently working on an updated version of C++ All-In-One Desk Reference For Dummies. The 2nd Edition book that is currently available relies on Code::Blocks 8.02 (the version I still recommend you use with this particular edition), which is really long in the tooth at this point. I’ve provided a number of update posts since the book was released to help you use Code::Blocks versions 10.05 and 12.11. However, as the example code has gotten older, more and more problems have surfaced with the example code because C++ itself has changed. The new book will use Code::Blocks 13.12, so the example code problems will disappear.

Most of the book examples for the 2nd edition will still compile with Code::Blocks 13.12, but not all of them will (the series of Code::Blocks 10.05 update messages should give you some idea of the problems you’ll encounter using a newer version). However, there are issues with one of the Code::Blocks 13.12 releases that will cause you serious problems in using the book. If you insist on using the latest version of Code::Blocks, make sure you download the codeblocks-13.12mingw-setup.exe file and not the codeblocks-13.12mingw-setup-TDM-GCC-481.exe file. According to the site, this second file has some issues with Code::Blocks. A note on the site page at http://www.codeblocks.org/downloads/26 explains the problem. Essentially, the GCC 4.8.1 release has problems with Code::Blocks, so you’ll see behavior that has nothing to do with the example code if you use it.

One of the beta readers for the new edition actually pointed out this problem. He inadvertently installed the buggy version of GCC 4.8.1 and I was able to see first hand that it really does cause some serious issues. (Actually, we couldn’t figure out what was going on at first.) This is one of many reasons I love to use beta readers when working on my books. In finding just this one problem (and he has found others), this beta reader prevented a whole lot of other readers from having issues with my new book .

I always want to hear about issues you have with my books. If you find that you have problems with the examples after reading through the posts on my blog, please contact me at John@JohnMuellerBooks.com and tell me about them. In many cases, the only way that I know a problem exists is when you make me aware of it. Thanks again for all your helpful support over the years!