Showing posts with label python. Show all posts
Showing posts with label python. Show all posts

Sunday, August 4, 2013

Canning Tomatoes Through Google Glass

This post is a bit of an excuse to use my Google Glass while cooking because, I like technology . . . all of it! In some cases it is the state-of-the-art Google Glass or Leap Motion and in others it is the technical details and optimized process of home canning. But it is also an attempt at seeing home canning as a technological process that has benefitted from an systematic architectural plan. It is also an excuse to see the everyday process in light of the Zachman Framework . . . and show you how I like to spend some of my time.

The canning process and the technology behind it provides some clues as to how to successfully design a process and a supporting system. It also illustrates the need for solution evangelization, too. When my mother was making jams and sauces in her 1960s kitchen, she used the inferior technology of paraffin wax to seal the jars. While no one got ill from this technology, throughout the years, the study of home food preservation systems has informed and changed the way the process is carried out. Not using wax today is well-known, but I still find it on the shelf in the store right next to the new, safer lids and bands.

Our relation to technology is mostly dependant on how we learned. We still find people today who prefer paper checks to move money, envelopes and stamps to communicate, and margarine for baking. In the latter case, we have gone from butter to margarine and now back to butter based on lobbying and the desire for a better solution. The definition of "better", of course, varies. About canning, recently Stephen Colbert cast aspersions while talking with Emily Matchar about her book Homeward Bound.

The Ball Blue Book Guide to Preserving is the architectural blueprint for home canning. Why is it more than a cookbook? It has recipes, but more importantly, it covers all 6 columns of the Zachman Framework:
  • What - This is the recipies and the equipment.
  • How - This is explored in-depth as canning has a very specific process model.
  • Who - You, of course, but also the roles of the boiling water, the lids, the acid, the sugar, etc.
  • Where - How you layout your tools and raw materials, including final storage is the "where" element.
  • When - Timing is critical  in canning and there are pages of timing models for each type of food.
  • Why - There are many motivations like saving money, getting back to basics, or giving a gift.
One of the processes documented is "boiling water bath canning". How does it work? A site on Exploratorium called Science of Cooking explains:
"As heating begins, the contents of each jar expand, and changes in internal pressure take place. Initially, gases are vented from the jar. When the processing period is finished, the atmospheric pressure outside the jar is greater than the pressure inside. This difference in pressure pulls the lid down onto the jar and forms a vacuum seal."
The process is the critical element here and it has been refined and documented so that anyone can have success. From not tightening the bands too much, the the water temperature, to your altitude, the "what", "how", and "when" are the focus columns in this system.

Enough of the justification . . . on to the fun! Read and view on to see how I turned 15 pounds of ripe tomatoes into 7 pints of crushed tomatoes in juice. These jars of summer will be great in December or March of next year flavoring pasta or caramelizing in a beef braise. The process begins as you pick the tomatoes, wash them and sort out the best ones.


I picked 27 pounds of tomatoes from a single plant (I'll get about 45 pounds total over the season) but in these videos I can about 15 pounds into just 7 pints.

You only need a very large pot, a knife, and the canning jars, but I have a few nice-to-have tools. But all in all they are not expensive. Check out my setup below!


You have to make sure to not re-use the canning lids as they need to be in pristine condition.

Once I have all of the stuff in place I can begin to peel, core, chop, mash and cook the tomatoes. For crushed tomatoes, you only really have to crush a few of them to get the juice going and then the heat does the rest of the job.

One of the processes you need to accomplish is peeling the tomatoes and the blanch / shock method is the best. To do this, you rapidly alter the temperature of the whole tomato so the skin splits and separates from the fruit. You cannot effectively peel a tomato like a pear, so this is one of the most import processes. Check it out here with the beginning and ending Glass button fumbling:


Finally, there is filling the jars, sealing them, and boiling them. I shot a few more videos and have toyed with mixing them together in a comprehensive video, but time is short and with all those ripening fruits, Glass and Leap to play with and Python to learn.




Tuesday, July 23, 2013

Glass Development - Bootstrap UX/UI Framework, a Beginner's Discovery!

If you have read my last two posts, you know I have not developed for a good decade and a half.

<old name voice>Back in HTML 3.2 we had to code walking uphill in the snow BOTH DIRECTIONS! Dern kids today</old man voice>

Well, as I begin to learn anew and develop for Google Glass, I find that the Python Quickstart project has a nice clean set of HTML and CSS. Now, I know (knew?!) how to write that stuff and I noted in the index.html file this reference in the <head> tag

<link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"  media="screen">


What is this "bootstrap" thingy?? I asked myself and poking around I find a wonderful world of UI goodness courtesy of some nice geeks from Twitter, @mdo and @fat

My Glass Quickstart Site Using Bootstrap
Yep, the Google Glass Quickstart project uses a set of web tools that bring in a responsive design from Twitter Bootstrap or just Bootstrap that is going on two years old. Who knew?

Anyway, this is a really nice way to make a clean website and on digging into the details, it is flexible, responsive and helpful. So, I wanted to point this out and that you'd do well to check out the Bootstrap site and by extension, the Bootstrap blog.

You do not have to use Bootstrap for Glass site development at all, but if you are modifying the Quickstart it certainly gives you a platform to look good!

Tuesday, July 16, 2013

Google Glass Development For Windows - Beginner Tips

As an update to my last post, I am happy tonight because I have finally had success in getting the the Glass Quickstart for Python running on my instance of the Google App Engine for Windows 7. If you have read my previous post you know I was not doing well. My plea netting several kind messages that gave me hints at what I might be doing wrong, but I thought I'd start over, armed with new knowledge from failure and the kindness of the community.

Yay! The Glass Quickstart is finally running!
After much reading, I confirmed that the Python path was best for me and what I really needed to do is to have my environment setup correctly and carefully follow the steps outlined on the quickstart pages. So, I began fresh and took my time. Here is what I learned about setting up the development environment for Glass with Python and Google App Engine on Windows.

  1. Install Python 2.7.x (not 3.x) before GAE. If you do this, GAE will know Python is there and set itself up to use it.
  2. You have to install and then configure, so the best resource (at the time of this writing) to install Python on Windows 7 is this video from Michael Herman.
  3. Do not use the 64 bit install, even if your machine is 64 bit. Some Python modules do not install or work correctly on Win64. Use the file on this page that is called:
    "Python 2.7.5 Windows Installer (Windows binary -- does not include source)" for best results.
  4. The best educational instruction for configuration is the Google Python Course. Make sure you use 
  5. To make Python easier to use from any location on your system, you have to set your PATH. Use this string in Windows PowerShell to set your PATH, which has all of the directories in it. The instructions at Google or Python.org or python-guide.org are OK, but this PATH from the video from Michael Herman is the best: [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\;C:\PYTHON27\DLLs;C:\PYTHON27\LIB;", "User")
  6. After you have tested Python by itself, then follow these instructions from Google to install the GAE.
  7. In that set of instructions, there is a step-by-step tutorial which, if you are careful, will get you a running application called 'Guestbook'. It was helpful to do this before the Glass Quickstart to ensure my environment was working fine.
  8. As Google recommends, to edit the example files and your own code, install and the free text editor Notepad++ (not the Notepad app that comes with Windows). I had issues with incorrectly encoded characters from the cut&paste code using plain old Notepad.
  9. After that is all installed, I went through the Python Tutorial for GAE and built the app. Here is my running example
  10. Because the Glass Quickstart code is downloaded from the code versioning website, GitHub, I signed up for and installed GitHub for Windows. I can see how it will be useful but it is not needed to just get the Quickstart up and running. You could just download the ZIP file and extract it.
  11. While working with the GAE, make use of the Google App Engine Launcher. Yes, yes, I know you can type command lines, but for we who like a GUI this tool is helpful in getting your environment and application code running on local and then deployed on your instance of GAE.
  12. My main advice: pay close attention to setting up Python and your development tools properly, use the installers and GUIs, and you will be successful.
The elusive 'deployment successful' message in the GAE Launcher deployment log window!



Sunday, July 14, 2013

Google Glass Development Follies

By occupation, I am not a developer, coder, or programmer . . . nor do I play one on TV. Yet I have developed applications, web sites and client applications in the past. I have to say that was the distant past (chronologically: FORTRAN 77, BASIC, HyperCard / HyperTalk, Visual BasicSQL in Access, FileMaker ProRegEx, HTML 3.2, LotusScript and JavaScript) and so for well over a decade I have not done any programming. In fact, many would see my previous list of "languages" and declare that I was simply scripting, not really programming at all! Which is fine and I am inclined to agree. However, my point is that while I am not a skilled developer I do know what development is and generally how it is accomplished.

Further, as an IT Enterprise Architect, I "develop" applications for a living. Just not down to the level of code, just like a building architect or shopping mall developer rarely grabs a pneumatic nail gun or diamond-tipped tile saw to complete the project. Yet all architects need to know the materials available and how the tools operate to properly execute a well-designed building. Thus, when I was selected for the Google Glass Explorers program, since it was a new UX and platform, I thought I'd try my hand at designing a native application for Glass.

My app, I mused, would be something simple: a location-aware service for botanic gardens and parks that would provide geographically appropriate information cards that could give the wearer rich information about their surroundings. For example, at Rancho Santa Ana Botanic Garden near where I live the cards would appear when you are in the riparian zone on the mesa or in the palm oasis or in the wildflower meadow. A virtual reality tour of sorts.

A week after I got my Glass, I enthusiastically began. After a bit of research and reading the materials provided by Google, I began to setup my development environment. Mainstream Glass development involves hosting your service on the Google App Engine (GAE) and I set about to register for GAE, activate the API, and publish a sample application. I needed to select a language (FORTRAN 77 was not supported!) and at first I decided to go for the future and I selected Go, the new language for web applications invented by Google. The Go "Getting Started" tutorial provides a sample application and a step-by-step instruction and for the most part, I was able to follow and successfully deploy the application. The step-by-step lesson builds upon itself and when it got more complicated, my application in Go would not compile, but I had a working app up on the big bad internet, so I was feeling pretty good.

The next step was to try to get the Glass Quickstart application compiled and working on my GAE instance. This did not happen. The instructions left out some parts and did not clearly state where files or libraries should be located. After tinkering for several multi-hour sessions of the course of 3 days, I thought that possibly Go was too new of a language for me to tackle, with two few experts hanging out on the forums to help a newbie like myself. In looking at the activity on the various forums like GitHub and Stackoverflow (both new to me, sonny!), it seems that people were much more involved in Python. There was already another new Python Glass app on GitHub about counters, so this was encouraging.

So I plunged into Python. And like its reptilian namesake, my time, confidence and self-esteem were slowly squeezed to death. Not that Python, the language, itself had anything to do with it, but the development environment is not standardized all that well and the nature of the open source path is fraught with peril for the uninitiated. That said, there are a lot of tutorials, blogs, and books out there, but many times these resources begin with assumptions which lead to deployment errors. I tried again and again to get the Glass Quickstart for Python deployed, but error after error stopped me in my tracks. I was missing libraries, had the session.secret file in the wrong directory, etc. My being on Windows did not help matter either because developers today just don't do Windows (unless you're in .NET).

So, at this point I have posted a plea on StackOverflow, the Glass Explorers Community (private link) and directly to the Google developer via G+ that put the Quickstart up in GitHub. I have had no takers yet and might resort to getting (and reading) a Python book.

But hey, if you can help a harmless old script kiddie like me with Python, please, slither on by!