Friday, February 26, 2016

Pluto-Charon and the New Worlds

New Horizons
Now that New Horizons has blazed by the Pluto-Charon system and sent back so many remarkable pictures of ice mountains, frozen nitrogen seas, globe-spanning chasms, misty valleys and glacial flows I feel it's time to rethink what to call them. I say "them" because the two astronomical bodies in question orbit each other as a pair. And around them orbits a system of smaller bodies known as Nix, Styx, Hydra, and Kerberos. These are not a cluster of random objects wandering around the sun, but an organized system not unlike those of Jupiter and Saturn.

Ice Mountains and Hazy Valleys
Dwarves
The IAU and Neil DeGrasse Tyson have chosen to rename Pluto to be a "Dwarf Planet". That's a nice moniker, but I really don't imagine two of the most geologically dynamic bodies in our solar system to carry a pick-axe while whistling a working tune on their way to the mines. A tag more significant must be applied to these objects.

What is a Planet Anyway?

Artist Rendering of Saturn
The English word "planet" derives from the greek word "planētai" which means "wanderer". It was used specifically as a term to define five celestial objects that didn't follow the stars and weren't the already-named "Sun", "Earth", and "Moon". I suggest we go back to that definition of planet and leave that term to Mercury, Venus, Mars, Jupiter, and Saturn. Nothing else should be called a planet. The Sun, Moon, and Earth would get the unique definition of their own names befitting their very special places in our lives.

Names New and Old
So where does that leave the remaining celestial bodies, discovered and undiscovered, in our solar system? I suggest four groups for the remaining objects: these groups would be known as "comets", "asteroids", "moons", and "worlds".

Comets
Comets are easy. They would still remain the celestial objects that exhibit both a parabolic orbit around the Sun and at least some point in their travels vent a tail.

Moons
Moons aren't too difficult either. They would be all of the bodies that orbit a "planet" or "world". Charon doesn't count as a moon because the center of orbit is between it and Pluto. Titan - a much larger body is still a moon because it's center of orbit is within the diameter of Saturn, which is one of our familiar planets. But what is a "world"?

Asteroids or Worlds?
Ceres
Now we get to the more challenging objects. What is the difference between a "world" and an "asteroid"? Traditionally, every body that orbits the Sun between Mars and Jupiter has been called an Asteroid. That might be acceptable, but there are many other objects already discovered outside of that band that we also call "asteroids". I suggest every object in an elliptical orbit around the Sun that doesn't meet any other criteria be called an asteroid.



Worlds
There are, however, still quite a few objects that orbit the Sun in an elliptical orbit that I would not call an asteroid. In my opinion, the decision is easy. For me, any object that is large enough and dense enough to form a nearly spherical shape and orbits the Sun in an ellipse should be called a "World". This would include, but not be limited to, Ceres, Uranus, Neptune, Pluto, Charon, and Eris.

Pluto-Charon Rise Again
Artist Rendering of Pluto-Charon
If we follow this logic then our solar system would be composed of the Sun, Earth, Moon, the Planets, the Worlds, the Moons, the Asteroids, and the Comets. The planets would be as they originally were defined: Mercury, Venus, Mars, Jupiter, and Saturn. The worlds of Ceres, Uranus, Neptune, Pluto, Charon, and Eris (there are other unnamed and undiscovered Kuiper Belt Objects that would also be "worlds" once named) would round out the remaining larger objects. And the rest of the solar system would be made up of countless named and unnamed moons, comets, and asteroids.

New Language
This proposed nomenclature would allow us to use phrases such as "tomorrow morning all of the planets will be visible at the same time", "we've discovered a new world", and "Ceres is the only world in the asteroid belt" without the need to apply validations and exceptions. This grouping would make understanding the organization of our solar system simple and any new discovery would be easily cataloged with no argument or disagreement. Pluto and Charon are no more "dwarves" or "objects" than Mars and Earth. They deserve to be called "worlds".

Thursday, December 17, 2015

Teddy Ruxpin and the Uncanny Valley

In 1970, Masahiro Mori proposed a concept in the Japanese journal, "Energy" called the "Uncanny Valley". Read his essay at (http://ieeexplore.ieee.org/xpls/icp.jsp?arnumber=6213238). In short, when a humanoid figure approaches the likeness of a living healthy person, our affinity toward this object increases. But once that likeness gets nearly, but not entirely human we become repulsed towards it.

His concept was specific to robotics, but raised questions about our own psychology. What is it that makes us uncomfortable about a situation? In the case of humanoid figures, Mori implies corpses and zombies make us most uncomfortable. Both are very close in appearance and in the case of zombies, behavior, to a healthy real living person. I would personally put celebrity impersonators in the deepest part of the uncanny valley as well.

But what about other situations? Do uncanny valleys exist for environmental experiences? Imagine your feelings about your surroundings based on how similar to nature they might be. Architects often incorporate plants and trees into large interior spaces. Does this plant life really encourage the feeling of the great outdoors or does it feel artificial?

What about other interactions? Recently I needed customer support for a product. I opened a chat window on the manufacturer's site and started up a conversation with the customer service agent. After a bit of back and forth, I realized that I was interacting with a chatbot.

You might remember the first chatbot, Eliza. She is still around, and you too can have a very frustrating conversation with her at (http://psych.fullerton.edu/mbirnbaum/psych101/Eliza.htm).
Today we all regularly interact on a daily basis with chatbots known by names like Siri, Galaxy, Google, and Cortana. We also interact with chatbots without our immediate knowledge just like the one I desperately needed for customer service.

Once I realized that I was dealing with a chatbot I immediately knew I was not going to get what I needed. I proceeded to write down the phone number of the offshore support line and asked the chatbot one more question before signing off, "Tell me about the man eating chicken". After a long processor-intensive pause, my bot-friend could only respond that it didn't know anything about the man eating chicken. Feel free to ask this question any time you are suspicious that you aren't conversing with a human. You can sometimes get very interesting results.

How did I know that I was talking to a machine and not a human being? This bot was following the exact form of question-and-answer interaction that a real human tier-one support agent would follow. In fact, it was surprisingly similar to a real human, but not quite. I knew because I felt like something wasn't right. This chatbot might not have been quite as creepy as a zombie, but it wasn't quite human - and I could tell.

It might be more comfortable to make it clearly obvious that a user's interaction is with a chatbot than to try to get close to a true conversation simulation only to fall into the uncanny valley and turn that user away. I know I was certainly turned away from this chatbot. Had I been using a wizard-style form I would have been more likely to at least get to the end of the interaction. In that case I would know up front that I wasn't dealing with a person, and wouldn't be put-off mid-way through.

Consider what made HAL, from the movie "2001:A Space Odyssey", so unsettling. Besides "his" rampant paranoia and homicidal rampage, HAL was just slightly off. Uncomfortable delays in response, questions asked at peculiar times, and an always-pleasant voice all gave away that HAL might seem human, but missed by just a little. HAL dropped right into the uncanny valley and every audience member knew it from the start. No explanation or set-up was required - we all felt immediately uncomfortable with that pleasant, unceasing, red light.

When designing a customer experience, pay attention to the risk of falling into the uncanny valley. If your interaction can't be completely believable, you might want to go for the unbelievable. Most Teddy Ruxpin dolls (https://www.youtube.com/watch?v=8EshrR-xk2E) either ended up in the closet behind other toys with its batteries removed or in the trash heap. But my niece still has her grandmother's Gunde bear and she will likely pass it on. A Gunde bear is hardly realistic, but it lasts, in part, because it isn't trying to fake it.

Teddy Ruxpin dolls are just creepy. Maybe they belong with corpses, zombies, and celebrity impersonators.

Don't try to fake your customer experience either and everyone will be more comfortable in the end. Avoid the uncanny valley. Make it real or blatantly unreal.

Monday, June 1, 2015

Mr. Turtle, how old are you?

.pendown()

If you’re as old as me then you may remember the term “Turtle Graphics.” You may not. The term is actually even older than me. Turtle graphics was a concept of imagining a turtle walking around on a piece of paper with a pen taped to its back. As it walks around, it drags the pen. Periodically it might walk on tiptoe so the pen doesn’t draw (penup). Eventually the concepts of “MoveTo” and “LineTo” evolved from the idea.

I can recall that Turtle Graphics was a library available to Pascal programmers as long ago as 1980. The developers of Windows API and Mac API adopted the concept and conveniently dropped the turtle reference, pretending (perhaps) that they came up with the idea all on their own. Fast-forward to this day and you’ll find the exact same concept embedded in the “Canvas” tag in HTML5. The turtle lives on!

HTML5 offers two somewhat competing methods for drawing graphics. The “Canvas,” with turtles walking all over it, and scalable vector graphics (SVG). Each has its place and purpose. Interestingly, even SVG has a long history. You’ll see it in nearly identical form within other architectures including Windows Presentation Foundation, but it too is much older than both.

Why should you care?

For the same reasons that you should be sure to read the great novels and the newspaper: Reference. By knowing the history of the tools you use, you will begin to see the relationships between them. Ultimately new concepts will look very familiar, and become much easier to learn. Understanding how everything fits together will also help you innovate and create your own new ideas that may one day outlive the Turtle itself.

For more about how the turtle lives on in Python, see https://docs.python.org/2/library/turtle.html

.penup()

Tuesday, May 26, 2015

Click, Wait...What?

I was recently flabbergasted by an ATM. I tried to get my money, but had a terrible time and finally gave up. I really should check my balance to be sure I didn't accidentally leave $300 in the dispenser.

This particular ATM had both a broken speaker and what must have been a TI-99/4 computer inside (check out http://oldcomputers.net/ti994.html if you're younger than 40). All of the user interaction was on the screen, and only on the screen. There were no physical buttons of any kind. With the ATM having a dead speaker, I received no audible feedback that it ever received my input. To make matters worse, not only was there no visual response to my finger banging desperately on the screen, but the ATM took a solid second to actually do what I pointed out. So I would hit a number, wait for something to happen and then hit it again. I never was able to get my PIN in the right way. Eventually I just quit trying and walked away.

What happened? I had a bad user experience.

While most ATM's provide a very simple click-a-button-and-beep level of feedback, most of the time that's enough when you're trying to get your money. But sometimes, especially when the interfaces are non-physical, we need a little more.

A while back, Google published a working document entitled, "Material Design". Since they've been burning up the versions with one Android release after another, and most Android devices offer a dearth of physical interactions, it seems that Google has learned a little wants to talk about it. While this document is definitely in its early stages it is well worth a read. A little too much of "Material Design" is dedicated specifically to how Google applied the concepts to Android, but the rest of the document is right on the money.

Devices (and web sites) should be ready to inform the user, not just throw down a bunch of color and fancy animations. The concepts in this document reflect the idea that an interface that is not physical must provide feedback to a user that helps them feel like it is physical.

Consider a remote control. You can feel the buttons, they don't move, often they are color-coded, and sometimes they are textured or shaped in a way that implies their function. Touch-screen devices can't do that. Sure, the buttons can be shaped or colored and in a good design they won't move. But you can't feel them. "Material Design" goes to great lengths to explain how you can design user interfaces that encourage the visitor to experience Zen-like connections that leave them feeling like they really did feel the interface.

Feeling like you really felt the interface will leave you with, well...a good feeling and that's a good thing. I really wish that ATM had left me with a good feeling...or at least my money. Maybe the next one I use will have been designed by someone who read and really understood "Material Design". I can only hope.

Take a look at "Material Design" and feel the digital world change before your very eyes...or at least beneath your finger.

Friday, March 13, 2015

Feeling Empty

Yesterday I did something terrible. I worked very hard to categorize, organize, and then empty my email inbox. This morning I booted up my computer and opened my email to see...nothing. I'm not certain how to handle it. I haven't seen an empty inbox since 1994.

What do I do? I know my tasks and am certain of my strategic direction. I have work to complete. But at this very moment I am faced with a blank, white panel full of emptiness. I feel alone; all alone.

And I am afraid.

When will something arrive and nudge me with that oh, so familiar "ba-bong"? What will it contain? Will it be a virus, a newsletter, a Nigerian Prince asking me for money, or something actually important - like work?

If I still owned a clock it would be ticking away like the telltale heart. Ratcheting up my anxiety like that clack-clack-clack of a roller coaster as I approach the top of the first hill, strapped in with no hope of escape. Panic begins to set in as I ponder what will either feel like love's first kiss or a kick in the groin.

I click "refresh" ... still nothing.

Have I lost my connection? Have I been forgotten? What if the weekend hits and my inbox is still empty? I'm not sure I can handle that.

Ba-bong!

Hello Nigerian Prince, thank you for thinking of me. It has truly been too long.

Tuesday, February 24, 2015

...Finally


One of the most powerful, but misused logical constructs in programming is the exception. Exceptions provide the programmer with an exit strategy in the event of a runtime error. Any section of code that could fail should be wrapped in a "try" block. If an error occurs within that "try" block then an exception is thrown and any code in the subsequent "catch" block will get executed. Conveniently, in most languages that support exception handling, the reason for the failure is also passed into the "catch" block. This allows the programmer to check why the failure occurred and handle it appropriately.
Unfortunately, more often than not, programmers either simply ignore the exception and move on or pass the exception on to the user and exit the program. You will see this on far too many websites. No user should ever be exposed to an exception. In my mind, displaying an exception to a user is the programming equivalent of dropping one's pants.
Most programming languages that support exception handling offer a third optional code block known as "finally". The "finally" code block is always executed after the completion of the "try" or "catch" blocks. I have seen far too much code in my career that contains no "finally" block, but does contain duplicate code in both the "try" and "catch". In extreme cases I have seen complex code within the "catch" block that is highly likely to throw its own exceptions under certain circumstances. Any code within the "catch" block should be as simple as possible.
Consider the following ASP.Net C# console application. This application accepts commmand-line arguments and displays them back to the user. A common command-line structure accepts arguments that begin with a dash character ("-") as options with parameters immediately following. For example, "hello -name Brad" would tell the "hello" application to accept a "name" parameter with the value of "Brad". For web developers this is similar to the querystring.
A console program consumes the arguments in a globally scoped array called "args":


 static void Main(string[] args)


In this intentionally buggy example, we echo back the arguments to the user. If the user passes "-name Brad LiveResponse -color Red" then the program will echo:

 Total number of command line argument values: 5
 Arguments...
  name=Brad
  LiveResponse
  color=Red


But if the user passes "-name Brad LiveResponse -color" then the program will fail with the following output:

 Total number of command line argument values: 4
 Arguments...
  name=Brad
  LiveResponse
 Exception: Index was outside the bounds of the array.


The exception occurs due to the following bad logic:

 for (int i = 0; i < args.Length; i++)
 {
  if (args[i][0] == '-')
  {
   Console.WriteLine("\t" + args[i].Substring(1) + "=" + args[++i]);
  }
  else
  {
   Console.WriteLine("\t" + args[i]);
  }
 }


In this logic we assume that when an argument that begins with a dash character is provided then the user will always be kind and provide a value after it. But if the user passes "-name Brad LiveResponse -color" the line "Console.WriteLine("\t" + args[i].Substring(1) + "=" + args[++i]);" will cause a runtime error as it will be incrementing the loop counter "i" beyond the end of the "args" array expecting a value for the color parameter.
So now we have a program with a runtime error that is easy to produce. Why did I choose to demonstrate this with a console application? Any time you run a console application from the debugger it will simply exit when it is done. A program like this runs so quickly that you may never see it execute. In order to see the program execute you will need to insert logic that causes the program to wait before closing. In this example I added:

 Console.ReadLine();


This forces the program to wait until the user hits the enter key, allowing us to see the output. In this example we will always want to run this line before the program exits whether an exception occurs or not. This is where the "finally" block comes into play. If you were to put that line within the "try" block it will get executed only if there is no error:

 for (int i = 0; i < args.Length; i++)
 {
  if (args[i][0] == '-')
  {
   Console.WriteLine("\t" + args[i].Substring(1) + "=" + args[++i]);
  }
  else
  {
   Console.WriteLine("\t" + args[i]);
  }
 }
 Console.ReadLine();


You could put it inside both the "try" and "catch" blocks:

 Console.WriteLine("Exception: " + ex.Message);
 Console.ReadLine();


But if you do that then you've added the same line of code in two different places. This introduces additional maintenance and quality risk if you ever want to change the "end of program" wait action to something else. Instead, add a "finally" block after the catch. This block of code will get executed whether an exception occurs or not:

 finally
 {
  Console.ReadLine();
 }


Note that the "finally" block will still get executed even if the code in the "try" or "catch" block returns to the calling operation before completion.
Consider another example of an application that opens connections to a database. These connections must be closed. By placing the close methods within your "finally" block you can ensure that the connections don't remain open in the event of an error.
The "finally" block allows you to simplify your program by placing any actions together that must get executed every time, whether there is an error or not.

The whole example program follows. If you would like to see it in action, create a C# console application in Visual Studio and replace the program code with this. I intentionally wrote this program with an error in it. Try it out.
  • Run it with a variety of command-line options and see how many ways you can break it.
  • Move the "Console.Readline();" statement into the "try" or "catch" block to see what happens.
  • Add a "throw" statement into your "try" or "catch" to see what happens (hint: a "throw" in the "catch" block produces very interesting results).
  • And, for fun, see if you can write a more robust and terse command-line parser and post it in the comments below.
  • 
     using System;
    
     class Program
     {
      static void Main(string[] args)
      {
       try
       {
        Console.WriteLine("Count: {0}\r\nArguments...", args.Length);
        for (int i = 0; i < args.Length; i++)
        {
         if (args[i][0] == '-')
         {
          //If the argument begins with a dash, include its parameter
          // in the output.
          //If the last argument begins with a dash this line will
          // throw an exception.
          Console.WriteLine("\t"+args[i].Substring(1)+"="+args[++i]);
         }
         else
         {
          //Otherwise just write the argument
          Console.WriteLine("\t" + args[i]);
         }
        }
       }
       catch (Exception ex)
       {
        //The above code with throw an exception
        // if the last argument begins with a dash.
        Console.WriteLine("Exception: " + ex.Message);
       }
       finally
       {
        //Whether an exception is thrown or not this line is
        // always executed.
        Console.ReadLine();
       }
      }
     }
    
    
    

Saturday, October 11, 2014

A Scout is Prepared

Six Weeks

In June of 2013, I dropped my son off at the Spanish Peaks Scout Reservation. He'd signed up to be a counselor in training and would be spending six weeks on the side of a Colorado Mountain. I was nervous. He was only 14 at the time and had never been away from home for more than 10 days before. Not only would he be away from home, he would be a 12 hour drive from home. I had planned for this and was ready to catch a flight to nearby Pueblo and get to him if there happened to be an emergency.

Ready for This

I was confident in his ability to handle an emergency. He'd been trained in all of the scouting basics, and had earned a variety of readiness merit badges. But he'd never faced a real emergency before, and I hated the idea that he might have to face one without my help.

Fires

This particular summer had been a dry one in Colorado and there had already been a dozen or more
major forest fires in the state. Near Colorado Springs, the Black Forest Fire was still burning. But there hadn't been any fires in southern Colorado - yet.

Fire!

Then my fears were realized. On the evening of June 19th I received a call from an unknown number. Normally I let those go to voicemail, but I decided I'd answer this one. Unfortunately I was too late and the call went to voicemail anyway. Once I got to the voicemail I heard my son say "I'm alright, but please, please call me back as soon as you can." While listening to the voicemail I received a text from my wife, "Please call me as soon as you can." Obviously something very wrong was happening. I still hadn't connected the dots to the forest fires. They were all so far away. I was wrong.

Relief

I was able to connect with my son within a few minutes and was so incredibly relieved to hear his voice on the other end. He and the rest of the occupants of his camp had evacuated to a nearby high school where the red cross had set up an aid station. His camp and the mountain it occupied were burning.

Getting There

When I received the call I was out of town on business with a return flight through Denver early the next morning. We made a number of possible plans that depended on where he might be by morning. The fire was out of control and they didn't even know if the town they had evacuated to would be there by the time I could get to him. The next morning I arrived at the Denver airport. We had planned for me to complete my flight home and get him onto a flight home from Pueblo when my son reminded my wife that there were others from our home town that we needed to help. After a very brief discussion with my wife over the phone and the flight attendant at the door I was off the plane and headed for the rental car counters.

No Luck

Not a single rental car was available. I was stuck a four hour drive from my son and had no way to get to him. Then I remembered that a friend lived in Colorado Springs. "What are you doing for lunch?", I asked him. After a little explanation on my part my friend was in the car, heading for Denver. He was able to get me to Colorado Springs where I was able to rent a car. Two hours later I was in Pueblo on the phone with my son, and one hour after that I met him at the high school he had slept in the night before.

45 Minutes

I picked up my son and three others from our area. Thanks to my son's selflessness I was able to get them all lunch and then get them clothes at a nearby department store. They had nothing but what they had been wearing when smoke was first seen. Under normal circumstances it takes 45 minutes to drive from the camp to the nearest town. These had not been normal circumstances. Nearly 200 adults and scouts, some as young as ten years old only had 45 minutes to gather, get into cars, and get off of the mountain before the camp was engulfed. There was no time to go get anything. Some of the tents, my son's included, were already burning by the time everyone gathered to evacuate.

Prepared

But the campers and staff were prepared. They had planned for this and practiced. Every camper and staff member was accounted for and evacuated with only very minor injuries. Those responsible for others, including my son, stepped up an did their jobs to get everyone out safely. The Boy Scout motto is "Be Prepared." Every scout says that. Every scout learns the skills required to handle emergencies. Most never have to use those skills or live that motto. Some do. My son and the rest of the campers and staff at Spanish Peaks Scout Reservation relied on their training and he lived up to the motto.

Next Summer

Only days after picking up my son and the others, those that he selflessly reminded me needed to be helped as well, my son told me that he wanted to go back for the next summer. I wasn't too sure about it, but he was. When I dropped him off for the 2014 session we stood at the spot where his tent had been. It was sobering to see the ashes, but I knew as we stood there that he had gone to camp the summer before a boy and came home a young man. I've never had to directly face the challenges that he had in 2013 and hope I never will. My son faced them and handled them with a maturity that most of us will never have. He was prepared. I know now that he is prepared for the life he has ahead of him and I'm ready to see him face it head on.

References

Our Personal Story of the East Peak Fire
Wikipedia Article About the East Peak Fire