Spaces in Paths

A number of readers have recently written me about an error they see when attempting to compile or execute an application or script in books such as, C++ All-In-One for Dummies, 3rd EditionBeginning Programming with Python For Dummies, Python for Data Science for Dummies, and Machine Learning for Dummies. Development environments often handle spaces differently because they’re designed to perform tasks such as compiling applications and running scripts. I had touched on this issue once before in the Source Code Placement post. When you see an error message that tells you that a file or path isn’t found, you need to start looking at the path and determine whether it contains any spaces. The best option is to create a directory to hold your source code and to place that directory off the root directory of your drive if at all possible. Keeping the path small and simple is your best way to avoid potential problems compiling code or running scripts.

The problem for many readers is that the error message is buried inside a whole bunch of nonsensical looking text. The output from your compiler or interpreter can contain all sorts of useful debugging information, such as a complete listing of calls that the compiler, interpreter, or application made. However, unless you know how to read this information, which is often arcane at best, it looks like gobbledygook. Simply keep scanning through the output until you see something that humans can read and understand. More often than not, you see an error message that helps you understand what went wrong, such as not being able to find a file or path. Please let me know if you ever have problems making the code examples in my books work, but also be sure to save yourself some time and effort by reading those error messages. Let me know if you have any thoughts or concerns about spaces in directory paths at John@JohnMuellerBooks.com.

 

Using Java with Windows 10

I’m starting to get more requests for information about using the materials in Java eLearning Kit for Dummies with Windows 10. Java for Dummies eLearning Kit is designed for use with Windows 7, Linux, or Mac OS X, and Java 7. However, as mentioned in the Java 7 Patches and Future post, I’ve tested enough of the code with Java 8 to feel fairly certain that the book will also work fine with Java 8. Unfortunately, using the book with Windows 10 will prove problematic.

The Windows 10 and Java FAQ sheet tells you about the some of the issues in using Java with the new operating system. For example, you can’t use the Edge browser with Java because it doesn’t support plug-ins. You need to install a different browser to even contemplate using Java eLearning Kit for Dummies—I highly recommend Firefox or Chrome, but the only requirement is that the browser support plugins.

Because Java eLearning Kit for Dummies is supposed to provide you with a more intense than usual learning experience, using Windows 10 is counterproductive. For example, none of the procedures in the book will work with Windows 10 because even the act of accessing the Control Panel is different. With this in mind, I truly can’t recommend or support Windows 10 users for this particular book without saying that your learning experience will be less complete than I intended when I wrote the book.

There is still no timeline from the publisher for creating an update of this book. If you really want a Windows 10 version of this book, then you need to contact the publisher directly at http://www.wiley.com/WileyCDA/WileyTitle/productCd-1118098781.html and ask for it. If you have any book-specific questions, please feel free to contact me at John@JohnMuellerBooks.com.

 

Installing Python Packages (Part 2)

In the Installing Python Packages (Part 1) post, you discovered the easiest method of installing new packages when working with Beginning Programming with Python For Dummies, Python for Data Science for Dummies, and Machine Learning for Dummies. Using the pip command is both fast and easy. However, it doesn’t provide much in the way of feedback when things go wrong. To overcome this issue, you can use the conda command in place of pip when you have Anaconda installed on your system. Like pip, conda supports a wide variety of commands. You can find a listing of these commands at http://conda.pydata.org/docs/using/pkgs.html.

You need to know a few things about working with conda. The first is that you need to open an Anaconda prompt to use it. For example, when working with Windows, you use the Start ⇒ All Programs ⇒ Anaconda<Version> ⇒ Anaconda Prompt command to open a window like the one shown here where you can enter commands. (Your Anaconda Prompt may look different than the one shown based on the platform you use and the version of Anaconda you have installed.)

Use the Anaconda Prompt to gain access to the conda command.
The Anaconda Prompt

You can easily discover the features the conda command supports by typing conda -h and pressing Enter. You see a list of command line switches similar to the ones shown here:

Use the conda command line switches to perform various tasks.
A Listing of Conda Switches

As you can see, there are quite a few tasks you can perform. To determine whether you have a package installed, use the Conda search <package name> command.  For example, if you want to determine if you have Pandas installed, you type Conda search Pandas and press Enter.  You see a list of Pandas versions installed, assuming that Pandas is installed, like this:

Use the search switch to locate a particular package installation.
A Listing of Pandas Information

The information you get from conda is far more in depth than pip provides. To determine what you have installed, just go down the list and determine whether you have the version of Pandas that you need.  If you don’t, then type Conda update pandas and press Enter (notice the case used).  On the other hand, let’s say you want to install BeautifulSoup.  Well, the first time through, try typing Conda install BeautifulSoup and pressing Enter.  You see an error message that tells you what to type like this:

The conda command provides you with helpful error information.
Using Error Information

Since you want to install the latest BeautifulSoup, type Conda install beautiful-soup and press Enter.  After searching for the required update information, conda will ask if you want to proceed.  Type y and press Enter.  You’ll see a whole bunch of activity take place, but eventually, you have a new version of BeautifulSoup, plus all the supporting functionality, installed correctly in the correct locations.  Here’s how things looked on my system:

Conda provides detailed information about the installation process.
Viewing the Result of an Installation

At this point, you have BeautifulSoup installed. Installing other packages follows the same path. Using conda does require a little more expertise than using pip, but you also gain additional flexibility and garner more information. When everything goes well, either tool does an equally good job of getting the installation or update task done, but conda excels in helping you past troublesome installations. Let me know your thoughts about using conda to install the packages required by my books at John@JohnMuellerBooks.com.

 

Supporting Creative People

I work really hard to support my readers and so do many other authors. In fact, most creative people are in creative trades because they like to communicate with others using a variety of methods. The simplest goal is to provide something of intangible value to others—be it a painting, sculpture, dance, music, or writing. It’s well known that creative people are often underpaid (hence the cliché, starving artist). Because the starving artist (and most of them truly are starving) makes little money, it’s important that people do support them whenever possible. That’s why the piracy of Intellectual Property (IP) is such a problem. I’ve written about this topic before from a writing perspective (see Piracy and the Reader), but IP theft has become a serious enough problem that we’re beginning to lose many good creative people simply because they no longer have enough money coming in to make a living.

The problem is that many people would support the creative people whose IP they use, but they don’t really understand that they need to pay for this material. For example, there are many sites online now that offer my books free of charge. Just viewing the site doesn’t provide a clue that anyone is stealing anything. These sites have a clean appearance and simply offer IP in the form of downloadable music, books, and so on. In fact, many of these sites are fully searchable. The reasons that someone would do something like this varies, but it pays to employ some critical thinking when you see something free that possibly looks a bit too good to be true. Many people download viruses, spyware, and other sorts of malware along with their free download. In the long run, it’s actually less expensive to buy the IP, than to have a computer compromised by some of the crud that comes with these free downloads.

For the record, my books are never free. You need to pay for your copy of my book in order to support the various things of value that I provide to you as a reader, including this free blog. It isn’t my goal to become rich—if that were my goal, I’d be in some other line of work (believe me when I say authors aren’t paid particularly well), but I do need to make enough to pay my expenses, just as you do. Even though I know many people do download my books free, I still support everyone that I can with good advice on how to get the most from the books I write. To me, coming in each day and working with all of you is one of the benefits of being an author. I truly do want people to use my books to get ahead in life. If you’d like to discuss the effects of piracy on you as a consumer of IP, please write me at John@JohnMuellerBooks.com.

 

Installing Python Packages (Part 1)

My Python-related books, Beginning Programming with Python For Dummies, Python for Data Science for Dummies, and Machine Learning for Dummies use various libraries to perform book-specific tasks. The books do provide instructions as needed, but, based on reader input, sometimes these instructions aren’t as clear as necessary, located in precisely the right location, or possibly as specific as needed. This post will help you get the packages containing the libraries you need installed in order to get more from the books.

It’s essential to remember that Beginning Programming with Python for Dummies relies on the 3.3.4 version of Python. The other two books rely on Python 2.7.x versions. The reason for using the older version of Python in these two books is that these books rely on libraries that Python 3.x doesn’t support. If you try to install these libraries on Python 3.x, you’ll get an error message of somewhat dubious usefulness.

In most cases, the easiest way to install a package is to open a command prompt with Administrator privileges and rely on the pip (for Python 2.x) or pip3 (for Python 3.x) command to perform the installation. For example, to install BeautifulSoup, you can type pip install beautifulsoup4 and press Enter. Installing any other package follows about the same route.

The only problem with the pip utility is that you don’t get it with every version of Python. When using an older version of Python, such as 3.3.4, you actually need to install the pip utility to use it. Fortunately, the installation instructions at https://pip.pypa.io/en/latest/installing/ aren’t difficult to use and you’ll be up and running in a few minutes.

Some readers have also complained that pip doesn’t provide much information when it comes to errors. The lack of information can prove problematic when an installation doesn’t go as planned. Next week I plan to cover the conda utility that comes with Anaconda. This utility isn’t as easy to use in some respects as pip, but it does provide considerably more information. If you have any questions about using the pip utility with my books, please contact me at John@JohnMuellerBooks.com.

 

Mac Gatekeeper Error

A number of my books, such as C++ All-In-One for Dummies, 3rd EditionBeginning Programming with Python For Dummies, Python for Data Science for Dummies, and Machine Learning for Dummies ask readers to download an IDE or other code and install it on their Mac systems. The problem is that the Mac system won’t always cooperate. For example, you might see an error dialog like the one shown for Code::Blocks:

The Gatekeeper error tells you that it won't allow you to install software from unknown publishers.
Your Mac won’t let you install software.

The problem is one of permissions. The default permissions set for newer Mac systems restrict you to getting your apps from the Mac App Store or from vendors who have signed their files. Fortunately, you can overcome this problem either temporarily or permanently, depending on how you want to use your Mac. The Fix the “App can’t be opened because it is from an unidentified developer” Error in Mac OS X blog post provides you with illustrated, step-by-step directions to perform the task using either method. Let me know if you encounter any other problems getting your Mac to install the software required to use my books at John@JohnMuellerBooks.com.

 

Working with Code in e-Books

Most of my technical readers now use e-books instead of paper books. Of course, there is a convenience factor to storing your entire library on a Kindle, even if it’s a software version of the Kindle. Of course, there are all sorts of e-book formats for your desktop system as well. The point is that electronic format makes a lot of sense when dealing with technical books.

However, e-books can cause some interesting problems and I’ve encountered a few with a number of readers now. The most important consideration is that you can’t cut and paste code from an e-book directly into your IDE and expect it to work. There are all sorts of reasons for this exclusion. For example, cutting and pasting may insert special characters into the output stream or the resulting paste may not have white space in the right places. A common problem is that publishers often convert regular single and double quotes into curly quote equivalents. The two kinds of quotes (both single and double) are completely different and the second type definitely won’t compile.

The best option when working with an e-book is to view the code in the e-book, but still get the downloadable source code for the book from the publishers website. I always provide a blog post detailing where to obtain the downloadable source for a book, when you need source code to use the book. If you can’t find the downloadable source, always feel free to contact me at John@JohnMuellerBooks.com. I want to be sure you have a great reading experience, which means having source code that actually runs in your development environment.

Another potential problem with e-books is that you may see unfortunate code breaks (despite the efforts of the publisher and myself). When you need to understand how white space works with a programming language, always review the downloadable source. The fact that the downloadable source compiles and runs tells you that all the of white space is in the right place and of the correct type. Typing the source code directly out of your e-book could result in added carriage returns or other white space errors that will cause the code to fail, even though the commands, variables, and other parts of the code are all correct.

As always, I’m open to your questions about my books. If you don’t understand how things work, please contact me—that’s why I’m here.

 

Using the Correct Product with MATLAB for Dummies

A reader recently wrote in with a problem with the example on pages 311 and 312 of MATLAB for Dummies. In this case, the reader was using the R2015b academic license edition. What the reader saw was this error:

>> A = magic(4)

A =

    16     2     3    13
    5    11    10     8
    9     7     6    12
    4    14    15     1

>> factor(sym(A))
Error using sym/factor (line 50)
The first argument must be a scalar.

It turns out that the newer version of MATLAB doesn’t provide the same support as the R2013b release used for the book. As a result, the example code doesn’t work as expected because the newer version requires different code that looks like this:

A=magic(4)
for i=1:4
    for j=1:4
        B{i,j}=factor(A(i,j));
    end
end

To get all factors double click on B in the workspace window. This workaround is needed because the newer version no longer supports the old method of performing the task.

The point is that the book is written to use a specific version of MATLAB, R2013b, so you must have that version in order to get good results. Fortunately, you can still get the R2013b release. All you need to do is go to the Mathworks site at: http://www.mathworks.com/downloads/select_release. Simply choose the R2013b release from the Download Earlier Release list after you have logged in. Please let me know if you have any questions or concerns at John@JohnMuellerBooks.com.

 

Security Breaches and the Potential Effect on Big Data

There are two interacting forces in big data today that few people are talking about. Perhaps it just hasn’t occurred to anyone that there truly is a serious threat. This particular post is going to talk about big data used for healthcare, but the same issue applies to any use of big data. Organizations, such as Penn Medicine, are using big data to perform real world tasks that really make difference. For example, it’s now possible to predict the potential for diseases well in advance of any critical fallout now—at least for some diseases such as sepsis. The ability to predict an event before it becomes critical is important for all sorts of reasons, but the most important is improving overall health. Of course, it also affects the cost of healthcare and the need to use healthcare in the first place.

However, while writing both Python for Data Science for Dummies and Machine Learning for Dummies, I’ve discovered the fallout of data errors is more critical than anyone can imagine. Ensuring correct data entry is a large part of the solution, but there are other concerns. Yes, algorithms can learn to determine which data is useful and which data isn’t, but the purer the data at the outset, the better.

While writing Security for Web Developers I reviewed many sorts of security breach, some of which involve modifying organizational data. What this means is that an outsider could potentially corrupt the big data used to make assumptions about medical conditions. Do you see where I’m going with this? Having bad data, data that is modified by an outsider and therefore not as likely to gain the attention of someone who can fix it, will cause those algorithms to make some invalid assumptions. Humans help correct the assumptions, but humans aren’t perfect and make assumptions about the behavior of the algorithm. The bottom line is that security breaches of the wrong sort could end up costing lives. It’s something to think about anyway.

The potential for error in big data analysis is just one of a whole bunch of reasons that I’m happy to read that the government is finally looking into ways to bolster the devices used to work with medical data. I’m almost positive that medical practitioners will fight tooth and nail against the new security measures, just like users of every persuasion do, but the security measures really are more important than just protecting individual patient data. As data becomes the centerpiece of all sorts of human endeavors, ensuring it remains as pristine as possible becomes ever more important. Security has to take a bigger role in data management in the future. Let me know your thoughts on securing data that could be used for medical analysis at John@JohnMuellerBooks.com.

 

Robotics and Your Job

Now that word has gotten around that I’ve been working with both data science projects (Python for Data Science for Dummies) and machine learning projects (Machine Learning for Dummies), people have begun asking me hard questions, such as whether a Terminator style robot is possible (it isn’t, Ex Machina and The Terminator notwithstanding) or whether they’ll be without work sometime soon (the topic of this post). (As an aside, deus ex machina is a literary plot device that has been around for a long time before the movie came out.)

Whether your job is secure depends on the kind of job you have, whether robotics will actually save money, what you believe as a person, and how your boss interprets all the hype currently out there. For example, if your claim to fame is flipping burgers, then you’d better be ready to get another job soon. McDonald’s is currently opening a store that uses robots in Phoenix and plans to have 25,000 more moved to robotics by the end of 2016. Some jobs are simply going to go away, no doubt about it.

However, robots aren’t always the answer to the question. Many experts see three scenarios: humans working for robots (as in a doctor collaborating with a robot to perform surgery more accurately and with greater efficiency), humans servicing robots (those McDonald’s jobs may be going away, but someone will have to maintain the robots), and robots working for humans (such as that Roomba that’s currently keeping your house clean). The point is that robots will actually create new jobs, but that means humans will need new skills. Instead of boring jobs that pay little, someone with the proper training can have an interesting job that pays moderately well.

An interesting backlash against automation has occurred in several areas. So, what you believe as a person does matter when it comes to the question of jobs. The story that tells the tale most succinctly appears in ComputerWorld, Taxpayer demand for human help soars, despite IRS automation. Sometimes people want a human to help them. This backlash could actually thwart strategies like the one McDonald’s plans to implement. If McDonald’s finds that the robots cost too much to run or that people are going to the competition to obtain food from other humans, it might need to reevaluate what appears to be a winning strategy. However, the backlash would need to involve a significant part of the population of people who buy food at McDonald’s to induce the company to make the change.

There is also the boss’ perspective to consider. A boss is only a boss as long as there is someone or something to manage. Even though your boss will begrudgingly give up your job to automation, you can be sure that giving up a job personally isn’t on the list of things to do. Some members of the press have resorted to viewing the future as a time when robots do everything and humans don’t work, but really, this viewpoint is a fantasy. However, it’s not a fantasy that companies such as Hitachi are experimenting with robot managers. Some employees actually prefer the consistent interaction of a robot boss. It’s unlikely that managers will take this invasion of their domain sitting down and do something to make using robots untenable.

It really is too soon to tell where robots will go for one simple reason. The algorithms used to make robots functional are still works in progress. In addition, society must decide the place that robots will take. The interaction between business and the people that businesses serve will play a distinct role in how things play out. However, all this said, your job will likely be different in the future due to the influences of robots. For the most part, I feel that life will be better for everyone after the adjustment, but that the adjustment will be quite hard. Let me know your thoughts on robots at John@JohnMuellerBooks.com.