Beta Readers Needed for Beginning Programming with Python For Dummies

I’m starting a new book project entitled, Beginning Programming with Python For Dummies. Python is a really neat language and it’s used for all sorts of commercial tasks. The main benefits of using Python are that the code is succinct, it’s easy to read, and it’s easy to learn.

This book is intended for someone who has never written any code before. The focus of the book is to make things simple and easy to understand, so if you’re already a Python developer, you probably won’t find too much in the way of new information. Here is a list of the topics you’ll find in my book as you read:

 

  • Part I: Getting Started
    • Chapter 1: Talking to Your Computer
    • Chapter 2: Getting Your Own Copy of Python
    • Chapter 3: Interacting with Python
    • Chapter 4: Writing Your First Application
  • Part II: Talking the Talk
    • Chapter 5: Storing and Modifying Information
    • Chapter 6: Managing Information
    • Chapter 7: Making Decisions
    • Chapter 8: Performing Tasks Repetitively
    • Chapter 9: Dealing with Errors
  • Part III: Performing Common Tasks
    • Chapter 10: Interacting with Modules
    • Chapter 11: Working with Strings
    • Chapter 12: Managing Lists
    • Chapter 13: Collecting All Sorts of Data
    • Chapter 14: Creating and Using Classes
  • Part IV: Performing Advanced Tasks
    • Chapter 15: Storing Data in Files
    • Chapter 16: Sending an Email
  • Part V: Part of Tens
    • Chapter 17: Ten Amazing Programming Resources
    • Chapter 18: Ten Ways to Make a Living with Python
    • Chapter 19: Ten Interesting Tools
    • Chapter 20: Ten Libraries You Need to Know About


As you can see, this is a really useful book for the novice. By the time you complete this book, you’ll be able to perform some useful tasks with Python and you’ll be able to read other books without the usual head shaking and complete frustration. The goal isn’t to turn you into an expert, but to reduce the learning curve so that you can actually follow other texts that you might want to use.

This isn’t a platform specific book. It doesn’t matter whether you work with a Mac, Linux, or Windows. I’m looking for people from all walks of life and my only expectation is that you know how to perform essential tasks with your platform of choice, such as install applications and work as an administrator on that system.

Of course, I still want to avoid making any errors in the book if at all possible. That’s where you come into play. The biggest complaint people have about computer books is that they’re obviously written by an expert and not the people reading them. I take all of the input from the beta readers to avoid that sort of problem. In addition, beta readers often find errors that other people miss. In short, you’re an incredibly important part of the writing process.

As part of being a beta
reader, your name will appear in the book Acknowledgements (unless you
specially ask that I don’t provide it). However, one of the bigger
benefits to you is that you get to read the book free of charge and gain
the skills that it can provide for you. Imagine what learning a new
programming language can do for your career. Even if you don’t need Python
for work, you can use what you gain to create applications for your own
needs and to obtain a better understanding of how computers work. Just contact me at John@JohnMuellerBooks.com if you’d like to work with me on this project.

 

Winter Egg Production

Chickens are affected by the amount of daylight available. In fact, layers typically need 12 to 14 hours of light each day to lay eggs consistently. Commercial egg laying operations will provide this amount of light artificially, if necessary, to ensure the chickens keep laying eggs. Of course, commercial egg laying operations also heat their coops and keep chickens in conditions that reduce the quality of the egg that you get in the store. Part of the benefit of raising chickens in natural conditions is that you obtain a high quality egg that actually contains more good elements and fewer bad elements (such as cholesterol and fat). However, there is a cost involved with getting this higher quality egg and that’s a reduced winter production.

A number of sources online mistakenly say that egg production stops completely during the winter months. However, my own experience says otherwise. Yes, the production is greatly reduced, but we still obtained 63 eggs from our ten hens during the month of December. This is contrasted with 248 during August, which is a typical summer month. So, you probably won’t have enough eggs to sell in December if you bake and eat eggs regularly. However, you also won’t have to go completely without eggs.

Of course, the question is why you wouldn’t provide a light in the coop if it will induce the chickens to lay more eggs. The problem with using a light is that it robs the chickens of important nutrients they need during the winter months. The chickens need these nutrients to stay warm during the winter, especially if your coop is unheated. Heating and lighting a coop is also expensive, so you’d need to consider the tradeoff in additional costs. When all is said and done, most small operations will be better off letting the chickens have a bit of a rest during the winter.

You can improve egg production by ensuring your coop has south facing windows so that the chickens do get the maximum light available. This strategy will also keep the chickens warmer because the sunlight will heat the coop during the day. Given the experience we’re having with the chickens, I credit the south facing window for getting any eggs at all.

One of the things you can do if you really must have more eggs during the winter months is to freeze your eggs. That’s right, you can freeze eggs during the late fall (as production is going down) for use during the winter months. You can whip the eggs up and freeze them for up to 12 months.  It’s also possible to freeze just the whites.  Unfortunately yolks don’t freeze well, so you need to choose how you plan to use your eggs as part of your strategy.

There are tradeoffs for nearly any self-sufficiency strategy you use. We’ve chosen to follow a natural path when it comes to egg production by giving our chickens a bit of a vacation during the winter months to ensure that we continue to get quality eggs when they do lay and also to extend the life of our layers by not overtaxing their systems. What is your experience with winter egg laying? Let me know at John@JohnMuellerBooks.com.

 

Extending the Horizons of Computer Technology

OK, I’ll admit it—at one time I was a hardware guy. I still enjoy working with hardware from time-to-time and it’s my love of hardware that helps me see the almost infinite possibilities for extending computer technology to do all sorts of things that we can’t even envision right now. The fact that computers are simply devices for performing calculations really, really fast doesn’t actually matter. The sources of data input do matter, however. As computer technology has progressed, the number of sensor sources available to perform data input have soared. It’s the reason I recently wrote an article entitled, Tools to Help You Write Apps That Use Sensors.

The sensors you can connect to a computer today can do just about any task imaginable. You can detect everything from solar flares to microscopic animals. Sensors can hear specific sounds (such as breaking glass) and detect ranges of light that humans can’t even see. You can rely on sensors to monitor temperature extremes or the amount of liquid flowing in a pipe. In short, if you need to determine when a particular real world event has occurred, there is probably a sensor to do the job for you.

Unfortunately, working with sensors can also be difficult. You don’t just simply plug a sensor into your computer and see it work. The computer needs drivers and other software to interact with the sensor and interpret the data they provide. Given that most developer have better things to do with their time than write arcane driver code, obtaining the right tool for the job is absolutely essential. My article points out some tricks of the trade for making sensors a lot easier to deal with so that you can focus on writing applications that dazzle users, rather than write drivers they’ll never see.

As computer technology advances, the inputs and outputs that computers can handle will continue to increase. Sensors provide inputs, but the outputs will become quite interesting in the future as well. For example, sensors in your smartphone could detect that you’re having a heart attack and automatically call for help. For that matter, the smartphone might even be programmed to help in some significant way. It’s hard to know precisely how technology will change in the future because it has changed so much in just the last few years.

What sorts of sensors have you seen at work in today’s world? Do you commonly write applications that use uncommon sensor capabilities? Let me know about your user of sensors at John@JohnMuellerBooks.com. I’d really be interested to know how many people are interested in these sorts of technologies so that I know whether you’d like to see future blog posts on the topic.

 

Considering Perception in User Interface Design

I read a couple of articles recently that reminded me of a user interface design discussion I once had with a friend of mine. First, let’s discuss the articles. The first, New Record for Human Brain: Fastest Time to See an Image, says that humans can actually see something in as little as 13 ms. That short time frame provides the information the brain needs to target a point of visual focus. This article leads into the second, ‘Sixth Sense’ Can Be Explained by Science. In this case, the author explains how the sixth sense that many people relate as being supernatural in origin is actually explainable through scientific means. The brain detects a change—probably as a result of that 13 ms view—and informs the rest of the mind about it. However, the change hasn’t been targeted for closer inspection, so the viewer can’t articulate the change. In short, you know the change is there, but you can’t say what has actually changed.

So, you might wonder what this has to do with site design. It turns out that you can use these facts to help focus user attention on specific locations on your site. Now, I’m not talking here about the use of subliminal perception, which is clearly illegal in many locations. Rather, it’s possible to do as a friend suggested in designing a site and change a small, but noticeable, element each time a page is reloaded. Of course, you need not reload the entire page. Technologies such as Asynchronous JavaScript And XML (AJAX) make it possible to reload just a single element as needed. (Of course, changing a single element in a desktop application is incredibly easy because nothing special is needed to do it.) The point of making this change is to cause the viewer to look harder at the element you most want them to focus on. It’s just another method for ensuring that the right area of a page or other user interface element gets viewed.

However, the articles also make for interesting thoughts about the whole issue of user interface design. Presentation is an important part of design. Your application must use good design principles to attract attention. However, these articles also present the idea of time as a factor in designing the user interface. For example, the order in which application elements load is important because the brain can perceive the difference. You might not consciously register that element A loaded some number of milliseconds sooner than element B, but subconsciously, element A attracts more attention because it registered first and your brain targeted it first.

As science continues to probe the depths of perception, it helps developers come up with more effective ways in which to present information in a way that enhances the user experience and the benefit of any given application to the user. However, in order to make any user interface change effective, you must apply it consistently across the entire application and ensure that the technique isn’t used to an extreme. Choosing just one element per display (whether a page, window, or dialog box) to change is important. Otherwise, the effectiveness of the technique is diluted and the user might not notice it at all.

What is your take on the use of perception as a means of controlling the user interface? Do you feel that subtle techniques like the ones described in this post are helpful? Let me know your thoughts at John@JohnMuellerBooks.com.

 

Your Security is an Illusion

I receive a number of queries about security from administrators and users every month, and many of these questions have links to all sorts of security issues that have occurred recently—everything from National Security Agency (NSA) spying to the Target security breach (incidentally, a number of other businesses have been attacked in the same manner). The fact of the matter is that books such as Administering Windows Server 2008 Server Core, Microsoft Windows Command Line Administration Instant Reference, and Windows 8 for Dummies Quick Reference have been telling you all along that security is a matter of vigilance—that software will never do the job alone. Even so, readers keep sending requests for some sort of magic bullet that will allay all their fears and make the task of security automatic.

Maintaining a reasonably secure system is a matter of observing personal, data, and system-wide best practices. Many other authors have listed these best practices in the past, but here are some of the techniques that people fail to use most often:

 

  • Use complex passwords that are easy to remember so you don’t need to write them down—consider using a passphrase whenever possible.
  • Change your password reasonably often and don’t rely on the same set of passwords all the time.
  • Keep your passwords secret so that no one else can abuse them.
  • Encrypt your data.
  • Perform local data backups regularly.
  • Ensure your applications remain updated with the latest security fixes.
  • Update your system as needed to ensure it provides a full set of modern security features.
  • Install security applications that check the incoming and outgoing flow of data, and block anything that looks remotely dangerous.
  • Check your system regularly for any files, folders, software, or other items that look out of place.


This list doesn’t even include some of the common user foibles, such as opening e-mail from parties they don’t know. In addition, none of these techniques are automated. You have to perform the manually in order to get the benefits they provide. Yes, it’s true that some of the techniques are automated once you start them, but you still have to start them. For example, installing security software will automatically monitor the data flow on your system, but you still have to install the security software manually.

Even with all of these security measures in place, someone who is truly determined can break into your system. You should simply count on it happening at some point, even if you’re incredibly careful. When a security breach does occur, you need to have a contingency plan in place.

Any good contingency plan will include a method of evaluating the damage caused by the security breach. You need to know just what was compromised and what the fallout of the compromise will be. Even individuals experience fallout from security breaches, such as identity theft. Once the damage is evaluated, you need a method for fixing the problems it has caused. In some cases, you may actually have to format the drive and start from scratch, which is where that data backup is going to become critical.

There is no magic bullet when it comes to security. Over the years I’ve searched, in vain, for a magic bullet and it isn’t even possible to conceive of one. Therefore, it’s the user and administrator who are best prepared for the eventuality of spying and security breaches that are in the best position to handle it later. Let me know your thoughts on security at John@JohnMuellerBooks.com.

 

It’s All in the Engineering

A considerable amount of my time in fulfilling the self-sufficiency dreams Rebecca and I have is spent building new items and repairing existing items. Existing equipment of all types requires constant maintenance as well. If you leave a cage exposed to the elements long enough, it’ll simply rot away. Everything has a tendency to fail without some sort of maintenance. All of these efforts—everything from building to maintaining to tearing down when an item is no longer useful—relies on some sort of engineering principle. If you want to get water to your garden, but the hose diameter is too small, the resulting trickle will only serve to frustrate you. Building shelves that don’t rely on proper engineering principles are downright dangerous. Installing electrical elements without regard to the amount of current the circuit needs to handle will almost certainly result in a fire. In short, in order to know in advance just how well something will work and what you need to do to maintain it, you need to know the engineering behind it.

In the Building Larder Shelving post, you learned about the engineering behind building shelves that will hold up to the weight of canning jars, which is considerable. This is just one of many posts that I’ve created that define the math behind self-sufficiency. If you ever find an error in my calculations, please let me know so that I can provide an update with the correct information. It’s also important to realize that my calculations are for a specific project type and you need to use them with your project in mind (making any required changes).

Fortunately, there are other places where you can find interesting information about engineering principles. One of the best places I’ve found recently (as passed on by a friend) is Engineering Toolbox. This site provides all sorts of useful information about various engineering disciplines, including how to create the proper sort of concrete for a project that you have in mind. If you were to mix the concrete without using a recipe, you’d either end up spending way too much money for your project or you’d end up with a project that won’t hold up to any kind of abuse.

It’s incredibly dangerous to take on a building or maintenance tasks for which you lack the proper equipment or training. Always make sure you understand not only the engineering behind the task, but that you also adhere to any required building codes and obtain the proper permits and inspections, as required. More than a few people have gotten hurt by not taking the proper precautions, so always verify that every step of a process you perform is done correctly before you proceed to the next step. The care you take in performing self-sufficiency tasks will always pay dividends in your personal safety and the longevity of the project.

Finding the right site to discover just how to create, maintain, and tear down the equipment needed to be self-sufficient can be an adventure akin to the mysteries solved by Holmes. You need to exercise care in using the information you find and verify that information across several different sites to ensure it’s accurate. Of course, there always comes a time when you’re simply in deep water and need the help of a professional. Some professionals will mentor you in building your project (for a fee in most cases); others will let you help them perform the task so that you gain needed knowledge and experience.

Building and maintaining your equipment can be a lot of fun. However, doing it the wrong way can be a disaster. Let me know your thoughts about building and maintaining equipment at John@JohnMuellerBooks.com.

 

Choosing Variable Names

It often surprises me that developers seem to choose completely useless variable names like MyVariable when creating an application. Although MyVariable could be an interesting variable name for an example in a book, it never has a place in any sort of production code. Even then, I try to create book examples with meaningful variable names, especially when getting past the initial “Hello World” example. Variable names are important because they tell others:

 

  • What sort of information the variable stores
  • When the variable is commonly used
  • Where the variable is used
  • How to use the variable correctly
  • Why the variable is important


In some cases, the variable name could even indicate who created the variable; although, this sort of information is extremely rare. If you never thought a variable name should contain all that information, then perhaps you haven’t been choosing the best variable names for your application.

Even with these restrictions in place, choosing a variable name can be uncommonly hard if you want to maximize the name’s value to both yourself and other developers. Some organizations make the selection process easier by following certain conventions. For example, a form of Hungarian Notation, where certain type prefixes, suffixes, and other naming conventions are used, is a common way to reduce the complexity of creating a variable name. In fact, Hungarian Notation (or some form of it) is often used to name objects, methods, functions, classes, and other programming elements as well. For example, NamArCustomers could be an array of customer names (Nam for names, Ar for array). The use of these two prefixes would make it instantly apparent when the variable is being used incorrectly, such as assigning a list of numbers to the array. The point is that an organizational variable naming policy can reduce complexity, make the names easy to read for anyone, and reduces the time the developer spends choosing a name.

 

Before I get a ton of e-mail on the topic, yes, I know that many people view Hungarian notation as the worst possible way to name variables. They point out that it only really works with statically typed languages and that it doesn’t work at all for languages such as JavaScript. All that I’m really pointing out is that some sort of naming convention is helpful—whether you use something specific like Hungarian Notation is up to you.


Any variable name you create should convey the meaning of that variable to anyone. If you aren’t using some sort of pattern or policy to name the variables, then create a convention that helps you create the names in a consistent manner and document it. When you create a variable name, you need to consider these kinds of questions:

 

  1. What information does the variable contain (such as a list of names)?
  2. How is the variable used (such as locally or globally, or to contain coordinates, or a special kind of object)?
  3. When appropriate, what kind of information does the variable contain (such as a string or the coordinate of a pixel on screen)?
  4. Is the variable used for a special task (such as data conversion)?
  5. What case should prefixes, suffixes, and other naming elements appear in when a language is case sensitive?

The point is that you need to choose variable names with care so that you know what they mean later. Carefully chosen variable names make it possible for you to read your code with greater ease and locate bugs a lot faster. They also make it easier for others to understand your code and for you to remember what the code does months after you’ve written it. However, most important of all, useful variable names help you see immediately that a variable is being using the wrong way, such as assigning the length of a name string to a coordinate position on screen (even though both variables are integer values). Let me know your thoughts about variable naming at John@JohnMuellerBooks.com.

 

Improving Your Technical Writing

I receive a number of e-mails each month from people who want to improve their technical writing skills. Most of the people who write are in a technical trade, but not writers by profession. For example, I might get an e-mail from a software engineer or an IT manager who needs to write better reports. Of course, the primary way to improve your writing is to practice. A good friend of mine expresses this idea in Make Writing a Habit. It’s good advice. No matter how much talent you might possess, you can’t become good at something until you practice (often, quite a lot).

Practicing applies to any sort of writing, but technical writing has a few special requirements that you need to consider. The first rule of good technical writing is to ensure you know what you want to say. This means creating an outline, even if you’re working on an article length project. In some cases, you won’t even use the headings you create as part of the resulting piece—the headings are there to keep you on track and focused. The more detailed you can make your outline, the better your writing will go.

Creating an outline doesn’t guarantee any sort of success, unfortunately. People often see a heading and can’t quite remember what they planned to put there. It’s a common problem, so you shouldn’t worry about it. What you should do instead is provide notes to yourself on what you plan to put into a heading. I often include URLs for sites that I want to review in depth or provide as part of my piece right there with the notes. If you got an idea for something you’d like to do by reading some resource, make sure you include a specific reference to that resource as well (never plagiarize though—always create your own text from the sources you use).

In depth research is also a huge part of writing technical documents. Keep thinking about what you want to write and verify every fact by researching it in some way. In some cases, research includes creating an experimental setup on your own system. This may sound like a lot of work, but it’s often the best part of technical writing. Experimenting to find out whether some idea will actually work is fun and interesting. It’s also time consuming, so make sure you plan ahead if you want to perform some experiments as part of creating your piece.

All of these approaches will help improve your technical writing. However, the biggest mistake that many technical writers make is writing for themselves, rather than for their target audience. You have to put yourself in your reader’s shoes and answer the sorts of questions your readers will have. Role-playing may not seem like part of technical writing, but it is. You have to put on your reader hat to be successful. In some cases, getting the reader hat on right is nearly impossible, which is why I also rely on beta readers to read my material. These people ask questions I’d never think of even if I spend weeks trying to do so.

Technical writing is about organized and succinct content. It’s about creating a flow of ideas from your mind to the reader’s mind through the medium of the written word. You’re a teacher of sorts, but your classroom is vast and you’re not able to speak with your pupils. To write good technical documentation you have to think about the sorts of questions your reader will ask or find someone who will ask them for you. The outline, research, and roll playing all come together to help you create a document that conveys information to your target audience in a unique manner that reflects your particular philosophy of solving technical issues.

Creating good technical documentation is something that most people can do with enough practice, thought, and research. Knowing your audience is an essential part of any kind of writing, but with technical writing it’s an absolute necessity. Let me know your thoughts about technical writing at John@JohnMuellerBooks.com.

 

Where is the Global Warming?

If you’ve read this blog long enough, you know that I take a moderate view of global warming. In fact, I’ve even written a post by that title, The Moderate View of Global Warming. It doesn’t surprise me that a number of readers have recently written to ask if I still believe in global warming given the recent cold wave that hit the United States. Yes, I do. Of course, a belief must be based on something, so I went looking for some statistics. My own blog provides some. For example, the harvest was earlier this year than any other year for which I’ve recorded statistics (17 of them). In fact, I’ve made quite a few observations about the effects of global warming on me personally because global warming seems like this really big issue that affects everyone else.

For most people, my personal observations are nice, but unless they happen to live in the same area of the world in which I live, the observations aren’t really relevant. At first I thought I was going to have to painstakingly research the statistics myself, but then I found an article entitled, Scientists: Americans are becoming weather wimps. It turns out that the US regularly experiences freezes of the sort that we’ve recently had, but that the interval has been 17 years this time. It turns out that in the past 115 years, there have been 27 distinct cold snaps where the average temperature across the country have dropped below 18 degrees. That’s an average of one cold snap every 4 years—so waiting 17 years is an unprecedented interval.

The recent cold snap isn’t even very high on the list of cold snaps—it ranks 55th in the list of cold snaps since 1900 when the statistics were first collected. So, the recent cold snap wasn’t only long overdue, it wasn’t particularly cold. Our predecessors faced much colder weather than we do today.

The statistics that made things clearest for me is that there have only been two days that rank in the list of the top 100 coldest days since 2000. However, there have been 13 days that rank in the list of the top 100 warmest days in the same time period. Although these statistics aren’t much comfort to anyone who has suffered broken pipes due to the cold, they all point to one thing—even though it has been cold, the earth is generally getting warmer.

Reducing pollution is an essential part of bringing global warming (defined as a general warming trend with more frequent extremes in weather conditions) under control. Personalizing global warming is an important part of understanding it. Create a list of changes that you’ve noted over the past ten or so years, such as the additional costs for cooling your home and the number of days you have to use the air conditioner each year. Once you start looking around and seeing how global warming is affecting both finances and health, you begin seeing why it’s personally important for you to control it. Let me know your thoughts about global warming and controlling pollution at John@JohnMuellerBooks.com.

 

Verifying Your Hand Typed Code

I maintain statistics for each of my books that are based on reviews and reader e-mails (so those e-mails you send really are important). These statistics help me write better books in the future and also help me determine the sorts of topics I need to address in my blog. It turns out that one of the most commonly asked questions is why a reader’s hand typed code doesn’t work. Some readers simply ask the question without giving me any details at all, which makes the question impossible to answer. In some cases, the reader sends the hand typed code, expecting that I’ll take time to troubleshoot it. However, this isn’t a realistic request because it defeats the very purpose behind typing the code by hand. If I take the time to diagnose the problems in the code you typed, I’ll be the one to learn an interesting lesson, not you. If you learn better by doing—that is, by typing the code by hand and then running it, then you need to be the one to troubleshoot any problems with the resulting code.

My advice to readers is to use the downloadable source code when working through the book text. If you want to type the code by hand after that as part of your learning experience, at least you’ll know that the example works on your system and you’ll also understand how the example works well enough to troubleshoot any errors in your own code. However, you need to be the one to diagnose the errors. If nothing else, perform a character-by-character comparison of your code to the example code that you downloaded from the publisher’s site. Often, a reader will write back after I suggest this approach and mention that they had no idea that a particular special symbol or method of formatting content was important. These are the sorts of lessons that this kind of exercise provide.

Now, it has happened that the downloadable source code doesn’t always work on a particular user’s system. When the error is in the code or something I can determine about the coding environment, you can be certain that I’ll post information about it on my blog. This should be the first place you look for such information. Simply click on the book title in question under the Technical category. You’ll find a list of posts for that book. Always feel free to contact me about a book-specific question. I want to be sure you have a good learning experience.

There are some situations where a reader tries to run application code that won’t work on a particular system. My books provide information on the kind of system you should use, but I can’t always determine exceptions to the rule in advance. When I post system requirements, your system must meet those requirements because the examples are guaranteed to fail on lesser systems. If you encounter a situation where the downloadable code won’t run on your system, but none of the fixes I post for that code work and your system does meet the requirements, then please feel free to contact me. There are times where an example simply won’t run because you can’t use the required software or the system won’t support it for whatever reason.

The point of this post is that you need to work with the downloadable source code whenever possible. The downloadable source code has been tested by a number of people, usually on a range of systems, to ensure it will work on your system too. I understand that typing the code by hand is an important and viable way to learn, but you should reserve this method as the second learning tier—used after you have tried the downloadable source code. Please let me know if you have any questions or concerns at John@JohnMuellerBooks.com.