# Sunday, 09 September 2018

I may be the last person in America to see Billy Joel in concert. Despite not releasing an album in over two decades, Joel tours almost constantly, routinely filling stadiums and arenas. Recently, he performed a record 100th time at Madison Square Garden alone.

And Friday night, he performed for the seventh time at Wrigley Field in Chicago - also a concert record for this venue.

And I was there.

IMG_2164I bought my first Billy Joel album ("The Stranger") in 1977 and played it until the grooves ran out. It was one of the first albums I bout and I memorized every song. Joel must have known I was coming because he played six songs ("Movin' Out (Anthony's Song)", "Scenes from an Italian Restaurant", "Vienna", "Only the Good Die Young", and "She's Always a Woman") from "The Stranger". Interestingly, he did not play "Just the Way You Are", one of the biggest hits of the year.

In fact, he drew from nearly every one of his 12 studio albums. With 33 Top 40 hits and 23 Grammy nominations, he could not play all his hits; but he did play for two and a half hours, delighting a full crowd at the baseball stadium. He combined big hits like

and a surprising aria written by Puccini and sung by his guitarist Mike DelGuidice. Joel also brought background singer Crystal Taliefero to the front to sing "RESPECT" an Otis Redding composition made famous by the late Aretha Franklin.

He left the audience feeling appreciated by not only mentioning Chicago, but by playing parts of Sinatra's "Chicago (My Kind of Town)" twice during his set. His drummer wore a Cubs jersey and shouted "Good luck in the playoffs!" as he left the stage.

For me, the highlights were a moving rendition of "New York State of Mind", a song I've always believed that Joel never got enough credit for; and "River of Dreams" featuring its complex rhythms - a song Joel surprised us with after a series of pop songs in the 1980s.

Everyone sang along and rocked back and forth as the piano man sang his classic "Piano Man" before bowing and waving Good Night. But, of course he returned to the stage and delivered 4(!) upbeat songs for his encore.

Two and a half hours is a long time for anyone to play, particular for a singer in his 60's; but Billy Joel's voice sounds as strong as ever. And his piano playing is still outstanding. And with a solid group of musicians behind him, the crowd left satisfied.

And now that I've seen Billy Joel, I suppose that everyone has.

Sunday, 09 September 2018 07:01:00 (GMT Daylight Time, UTC+01:00)
# Saturday, 08 September 2018

The Microsoft Bot Framework provides a template that creates a simple bot: The "Bot Builder Echo Bot". It is named this because it echoes back any text you send it, along with the length of that text.

The bot is simply an ASP.NET Web API application that exposes web services to Channel clients. As such, it uses the default routing for Web API applications of "api/controllername"

where controllername is the name of the Controller class with the word “Controller” removed.

A channel will submit an HTTP POST to a URL containing "api/message", which will call the Post method in the MessagesController class. Let's take a look at this class.

    [BotAuthentication]
    public class MessagesController : ApiController
    {
        /// <summary>
        /// POST: api/Messages
        /// Receive a message from a user and reply to it
        /// </summary>
        public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
        {
            if (activity.GetActivityType() == ActivityTypes.Message)
            {
                await Conversation.SendAsync(activity, () => new Dialogs.RootDialog());
            }
            else
            {
                HandleSystemMessage(activity);
            }
            var response = Request.CreateResponse(HttpStatusCode.OK);
            return response;
        }

        private Activity HandleSystemMessage(Activity message)
        {
            string messageType = message.GetActivityType();
            if (messageType == ActivityTypes.DeleteUserData)
            {
                // Implement user deletion here
                // If we handle user deletion, return a real message
            }
            else if (messageType == ActivityTypes.ConversationUpdate)
            {
                // Handle conversation state changes, like members being added and removed
                // Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
                // Not available in all channels
            }
            else if (messageType == ActivityTypes.ContactRelationUpdate)
            {
                // Handle add/remove from contact lists
                // Activity.From + Activity.Action represent what happened
            }
            else if (messageType == ActivityTypes.Typing)
            {
                // Handle knowing that the user is typing
            }
            else if (messageType == ActivityTypes.Ping)
            {
            }

            return null;
        }
  

Listing 1

A channel posts an activity to the service. If the activity type is anything other than "Message", it calls the HandleSystemMessage method. Notice that nothing is actually implemented in this method. You will have to write this yourself.

However, if the activity type is "Message", the Post method asynchronously calls the Dialogs.RootDialog class. Here is that class:

    [Serializable]
    public class RootDialog : IDialog<object>
    {
        public Task StartAsync(IDialogContext context)
        {
            context.Wait(MessageReceivedAsync);

            return Task.CompletedTask;
        }

        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
        {
            var activity = await result as Activity;

            // Calculate something for us to return
            int length = (activity.Text ?? string.Empty).Length;

            // Return our reply to the user
            await context.PostAsync($"You sent {activity.Text} which was {length} characters");

            context.Wait(MessageReceivedAsync);
        }
    }
  

Listing 2

The StartAsync method is called first, which waits for a message to be completely received; then, calls the MessageReceivedAsync method.

This method reads the text of the activity and forms a string that contains the original message text and the length of that text. It then Posts this back to the channel with the line below:

await context.PostAsync($"You sent {activity.Text} which was {length} characters");

Finally, it waits for the next message to come in via the following line

context.Wait(MessageReceivedAsync);

The rest of this project is Web API plumbing, setting up things like routing and where to store state information.

As you can see, this is a fairly simple architecture built on an established framework (Web API). This makes it easier to understand and to modify.

This simple bot is a good starting place that demonstrates the structure of a bot. You can modify this dialog, add new dialogs, or modify the logic as suits your purposes.

Saturday, 08 September 2018 09:15:00 (GMT Daylight Time, UTC+01:00)
# Friday, 07 September 2018

Microsoft Visual Studio makes it very simple to create a new bot with the Microsoft Bot Framework.

Launch Visual Studio 2017 (You can download a free version here)

From the menu, select File | New | Project.

The "New Project" dialog displays, as shown in Fig. 1.

Fig01-NewProjectDialog
Fig. 1

Create a new "Bot Builder Echo Bot" project. From this dialog, you find this template by either expanding Visual C# | Bot Framework in the navigation tree on the left; or by entering "Bot Builder" in the search box at the top right.

Enter a name and location for your project and click the [OK] button.

When the project loads, select Build | Rebuild Solution from the menu to compile the solution and validate all references.

This simple bot receives a message and echoes back the same message, along with the length of that message. The relevant code is in the MessageReceivedAsync method of the RootDialog class, which is shown in Listing 1.

private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
{
  var activity = await result as Activity;

  // Calculate something for us to return
  int length = (activity.Text ?? string.Empty).Length;

  // Return our reply to the user
  await context.PostAsync($"You sent {activity.Text} which was {length} characters");

  context.Wait(MessageReceivedAsync);
}
  

Listing 1

After the solution is rebuilt, select Debug | Start Debugging from the menu to launch the bot. This will host a web service and a web page on your local machine. The web page will display in your browser, as shown in Fig. 2.

Fig02-BotRunning
Fig. 2

Note the URL of this page, which will look something like

http://localhost:nnnn/

where nnnn is the port number on which this web application is running.

You can call the bot's web service from many sources; but the easiest way to test it is with the Bot Framework emulator. You can find detailed information on this emulator here. You can download the latest version of the emulator from here, as shown in Fig. 3.

Fig03-DownloadBotFramework
Fig. 3

Download and run the most recent EXE file from this site to install the emulator on your local PC.

Launch the emulator to view the form shown in Fig. 4.

Fig04-BotFrameworkEmulator
Fig. 4

Click the [Open Bot] button on the "Welcome" tab of the emulator. A JSON file containing configuration about your bot was created for you and saved in the Visual Studio project folder. Its root name will be the same as the project, but it will have a ".bot" extension. Select this file and click the [Choose file] button, as shown in Fig. 5.

Fig05-OpenBotConfiguration
Fig. 5

The format of this file looks like the sample in Listing 1.

{
  "name": "MyBot",
  "secretKey": "",
  "services": [
    {
      "appId": "",
      "id": "http://localhost:3978/api/messages",
      "type": "endpoint",
      "appPassword": "",
      "endpoint": "http://localhost:3978/api/messages",
      "name": "MyBot"
    }
  ]
}
  

Listing 2

NOTE: When you return to the emulator, you can click the [Open Bot] button or click a shortcut link below the button to re-load the configuration.

After you save (or open) a configuration file, a "Live Chat" tab displays in the emulator, as shown in Fig. 6

Fig06-BotEmulatorRunning
Fig. 6

To test the bot, type a message into the "Type your message" textbox and press [ENTER]. Your message will display. A short time later, a response will display with your message, followed by the number of characters.

You can find this code in the SimpleBotDemo project of the Bot-Framework-Demos on my GitHub page.

In future articles, I will show you how to enhance your bot, deploy it to a public site, such as Azure, and call it from a variety of clients. But this is the simplest way to create, run, and test a bot.

Friday, 07 September 2018 09:05:00 (GMT Daylight Time, UTC+01:00)
# Thursday, 06 September 2018

GCast 12:

Azure Media Services: Live Streaming

Learn how to Upload, Encode, and Share a Video using Azure Media Services.

Thursday, 06 September 2018 09:22:00 (GMT Daylight Time, UTC+01:00)
# Wednesday, 05 September 2018

The Bots are taking over.

A chatbot is an automated process that can respond to questions or commands via voice or text. They are useful for simulating a conversation and handling some of the tasks that would ordinarily require a call center staffed with people. Uses include processing orders, checking status, and answering questions. If you can understand the question and figure out the answer, you can probably write a chatbot to handle it.

Advantages of Chatbots

Chatbots have some advantages over human interactions.

Operating Cost. Labor costs tend to be among the highest cost of any business and operators in a call center can be expensive. Once deployed, a chatbot's cost tends to be a fraction of the cost of paying a person.

Availability. Chatbots can scale up to increase demand, so that users, customers, and potential customers do not need to wait for the next available operator. If activity rises unexpectedly, it is far easier and faster to deploy new resources to support a chatbot than it is to bring in more people to answer calls.

Speed. A computer can often look up information much faster than a human can.

Flexibility. A chatbot can be wired up to a variety of communication channels, allowing you to use the same code base to connect to different clients in different ways. For example, you can write a chatbot and connect to users via Facebook, SMS, a web page, or any number of other platforms.

Disadvantages of Chatbots

Of course, chatbots will not solve all your problems. Here are some disadvantages.

Startup cost. There tends to be a larger startup costs for chatbots. They must be programmed, tested, and deployed. This cost is only justified if they will yield sufficient savings over the lifetime the chatbot is deployed. Tools like the Microsoft Bot Framework can reduce development time; but that early cost still exists.

Impersonal. Chatbots are not people and some customers prefer talking to a human being over talking to a machine. The cost of human interaction is worth it when you wish to cultivate a personal relationship with your customer or partner. 

Too human. With advances in natural language processing, it can be difficult for people to determine whether they are interacting with a person or a computer. Some people are turned off by this ambiguity. They feel cheated when a computer represents itself as a person.

Real-time flexibility. For many interactions, it is impossible to anticipate every potential question or command from your customers. Humans can react to these very well. Generally, you need to program a chatbot to anticipate each question or command.

Finally

There is no question that chatbots are becoming more and more important as companies interact with their customers. But how your company uses them can determine how successful your chatbot strategy is.

Some scenarios call for starting an interaction with a chatbot; then bringing in a person only if the chatbot cannot adequately help the customer.

Understanding the needs of your customer and the problem you are trying to solve is a key to effective use of chatbots.

Wednesday, 05 September 2018 09:02:00 (GMT Daylight Time, UTC+01:00)
# Tuesday, 04 September 2018

BraveNewWorldThroughout history, many societies have enforced a caste system, kept in place by either top-down authority or socialization that convinces people it is the proper order.

In Aldous Huxley's dystopian future, the caste system is maintained by defining each individual's level prior to his or her birth and conditioning that person to accept that level. The conditioning begins immediately after birth with repeated messages and chemicals to influence what environmental conditions they will like or detest. Some conditioning even occurs before birth. Embryos destined to perform menial labor are poisoned enough to stunt their mental capacities, so they will not aspire to more.

The casts are labeled with the first 5 letters of the Greek alphabet: Alpha, Beta, Gamma, Delta, and Epsilon. At the top of the system are the Alphas, who enjoy a relatively large amount freedom. At the bottom are the Epsilons, who perform the most menial tasks.

All the people are kept distracted by mindless entertainment; by the encouragement of promiscuity; and by the consumption of euphoria-inducing drugs.

Everyone in this Brave New World accepts their level, because they have been conditioned since birth to do so. Well, almost everyone.

Alpha citizen Bernard Marx recognizes that humans have sacrificed elements of their humanity for a general feeling of contentment. He resents the shallowness of everyone around him. Of course, he is shunned by his peers for this.

When Bernard travels to an Indian reservation (now called a "Savage Reservation"), he finds a society outside the drug-numbed control of the government. He also finds Linda - a former Beta woman trapped in the reservation years ago when she was separated from her Alpha companion. Linda now has a son John, the offspring of her and her Alpha. John who knows he is different from the other reservation children, but he has nothing to which he can compare his life. Linda and John are ostracized by the people of the reservation. Linda's promiscuity is at odds with the beliefs of the locals. The women hate her for sleeping with their husbands and the men ridicule her, but still have sex with her.

Bernard brings Linda and John back to his world, where conflict results almost immediately. Linda retreats into the escapism of the freely-available drugs; John falls in love with a woman but is repulsed by her aggressive sexual advances.

For such a short novel, Huxley packs a great deal.

Religion and God have been abolished; yet, people revere Henry Ford as a god-like figure. He is given credit for the technological advances that brought society to its current state. People have common expressions like "Our Ford" and "His Fordship", and they long ago converted all crosses into T's in honor of Ford's famous Model T car. They have even convinced themselves that Sigmund Freud was a pseudonym for Henry Ford, giving him credit for all of Freud's psychology writings.

Henry Ford's influence is obvious in this world. The ultra-efficient in-vitro birthing center resemble the assembly lines of Ford's automobile factories.

It's not surprising the government has encouraged the worship of science over worship of God. All science is controlled by the government and released or manipulated to maintain contentment among the populace.

And that is what Brave New World is about. The people have chosen contentment and happiness over liberty, freedom, individualism, free will - anything that would make them human and allow them control over their own lives. Those in power support this to maintain their power. Authority is maintained by distraction, rather than by force.

In this world, people and entertainment are mass-produced. People seek contentment, but never challenge themselves and the government likes it that way. Citizens question nothing because they are distracted by sex and drugs and mindless media.

There is no love; No marriage; No families; No commitment. There is only a seeking of pleasure and most have accepted that. Art, literature, and philosophy, and religion are gone. Even science is stunted by the goals of those in power. Labor saving devices are suppressed if they would provide too much leisure to the working class.

We see some of this today. People ignore abuses of the government if the stock market rises.
Mind-numbing reality shows and situation comedies and other recreations fill our free time and distract us from thinking about the real problems of the world.

It is this idea of the struggle between individual liberty and acceptance of society and its rules that form the focus of this book. It is about how the state can influence us without our knowledge.

The characters and the story are simply a mechanism for driving home this concept. The reader expects that Bernard will be the story's hero, because he questions the morality of the order of this world early in the book. But eventually, Bernard embraces society's mores when his fellow Alphas finally praise him for bringing John the savage for them to ogle. In the end, it is John who provides an outside perspective on the dominant society of Brave New World.

Brave New World is often compared with 1984, written by Huxley's contemporary George Orwell, who also predicted a dystopian society controlled by the state. But Orwell's government ruled through fear, while Huxley's overlords ruled by keeping the people happy and distracted.

I found Brave New World a chilling parable of society that could exist - a world that in many ways we are heading toward now.

"And that," put in the Director sententiously, "that is the secret of happiness and virtue–liking what you've got to do. All conditioning aims at that: making people like their unescapable social destiny."

Tuesday, 04 September 2018 20:54:00 (GMT Daylight Time, UTC+01:00)
# Monday, 03 September 2018
# Sunday, 02 September 2018

9/2
Today I am grateful to John for loaning me a necktie when I forgot to bring one.

9/1
Today I am grateful I was able to celebrate Kara and Christian's wedding with them  yesterday.

8/31
Today I am grateful to the bank employee, who unlocked the door when she saw me walking up yesterday, even though it was a minute after closing time.


8/30
Today I am grateful to have Nick visit for a few days.

8/29
Today I am grateful for lunch with Donovan yesterday.

8/28
Today I am grateful to visit the Adler Planetarium for the first time yesterday.

8/27
Today I am grateful my coffee machine is fixed after a weeklong nightmare.

8/26
Today I am grateful for:
-Lunch with Dan and his friends yesterday
-My first visit to the Irish American Heritage Center last night

8/25
Today I am grateful for 24 hours in southwest Michigan.

8/24
Today I am grateful for a walk around North Lake Park in Stevensville yesterday.

8/23
Today I am grateful for a long bike ride yesterday.

8/22
Today I am grateful my son saw me speak at a user group for the first time.

8/21
Today I am grateful for dinner and drinks last night with Suzanna and Paul.

8/20
Today I am grateful for lunch with Tim yesterday.

8/19
Today I am grateful to attend the Evanston Art & Fork Festival last night.

8/18
Today I am grateful for breakfast yesterday with Debbie and Diane.

8/17
Today I am grateful to see Electric Light Orchestra in concert last night and to reconnect with old friends.

8/16
Today I am grateful to present at a user group last night for the first time in 5 months.

8/15
Today I am grateful to see Stacy Keach at the Goodman Theatre last night.

8/14
Today I am grateful that a bunch of people responded yesterday to the emails I sent last week.

8/13
Today I am grateful for a walk along Loyola Beach yesterday.

8/12
Today I am grateful for a visit from Doug and Sherree and Sterling and Dylan this weekend.

8/11
Today I am grateful to attend an exciting Cubs-Nationals game yesterday.

8/10
Today I am grateful for late-night beers with Ondrej

8/9
Today I am grateful to attend Sarah's Going-Away party last night.

8/8
Today I am grateful for an annual physical exam yesterday.

8/7
Today I am grateful to attend a celebration last night for Girl Develop It - Chicago.

8/6
Today I am grateful for my new Echo Dot.

Sunday, 02 September 2018 16:33:59 (GMT Daylight Time, UTC+01:00)
# Friday, 31 August 2018

FoundationThe Galactic Empire has existed for thousands of years and seems to be powerful with a bright future. But not to psychohistorian Hari Seldon.

Using advanced mathematics and his newly-created science of "psychohistory", Seldon predicts that the Empire will soon collapse and be followed by a dark period lasting 30,000 years, until a new Empire will finally rise again to restore technology and culture to the galaxy. The collapse is inevitable, but Seldon has a plan to reduce the dark period to 1,000 years. That plan involves the Foundation - a colony of scientists placed on a remote planet at the edge of the galaxy and a set of crises that must be overcome over the next centuries.

This is the universe of Foundation by Isaac Asimov.

Long after Seldon's death, he continues to influence the society he founded. He periodically appears in a recorded holovision to announce the arrival and resolution of a "crisis" - crises that he predicted would occur and for which he accurately predicted the resolution.

Foundation is told in a collection of short stories, set many thousands of years in the future. Each story takes place a few decades after the one before it, so we have little time to get to know the characters - only how they influence their society. The characters are less interesting than Seldon's master plan and his application of psychohistory to each crisis. The forces that motivate society, such as politics, military force, religion, and commerce take center stage in these stories. Seldon knew he could not predict the behaviors of individuals not yet born, so he combined sociology, mathematics, and statistics to look at the behaviors of populations in aggregate and predict what how entire societies would react to the forces around them. Of course, this idea is applied today - both in the real world and in speculative fiction.

Three quarters of a century after its publication, Foundation remains a strong novel. It was published as part of a trilogy in the early 1950s, and Asimov later released many sequels and prequels. Eventually, he tied together these stories with his popular Robot novels, setting the Foundation, Empire, and Robot series all in the same universe.

Science fiction has been heavily influenced by Asimov and his Foundation series. Other writers have written about mankind's colonization of space and a galactic empire. Certainly, George Lucas was aware of this series when he created the Star Wars universe. And in 1966, the prestigious Hugo Award declared the Foundation trilogy to be the Best All-Time Science Fiction Series.

And it all began in the 1940s, when a 22-year-old Asimov published a short story that would later be compiled into a book that would be volume 1 of a trilogy that would launch a universe that would influence the world.

Friday, 31 August 2018 12:48:14 (GMT Daylight Time, UTC+01:00)
# Thursday, 30 August 2018

GCast 11:

Azure Media Services - Uploading, Encoding, and Sharing a Video

Learn how to Upload, Encode, and Share a Video using Azure Media Services.

Azure | GCast | Screencast | Video
Thursday, 30 August 2018 09:29:00 (GMT Daylight Time, UTC+01:00)