# Saturday, October 6, 2018

TheReturnOfTheKingThe Return of the King concludes J.R.R. Tolkien's epic trilogy - The Lord of the Rings.

Lord of the Rings is the story of Good versus Evil; of perseverance in the face adversity; of loyalty in the face of temptation; and of friendship. They battle because they must

Frodo and Sam and Gandalf are motivated by what is right and by a chance to save their friends Sauron and his allies are motivated by a desire to rule the world. They battle because of their greed and power lust. Spoiler alert: The good guys win.

Good triumphs because the good people are motivated to protect their lands and help one another.
Sauron motivates his allies through fear and intimidation. As a result, there is no loyalty and constant infighting among his forces.

Of course, the good guys suffer infighting and doubt in the outcome, but they know their cause is just and they know they can depend on their friends and allies. And ultimately, they win because they assist one another voluntarily, despite great risks to themselves.

Return brings the 3-volume story to its climax. Gandalf, Aragorn, and the others remaining from the Fellowship of volume 1 wage war against Sauron's forces, which distracts the evil sorcerer enough to allow Frodo and Sam a chance to sneak into Mordor and destroy the powerful One Ring at the Cracks of Doom, where it was created.

One should only read The Return of the King as part of the trilogy - not only to understand how the story progressed and how we got to where we are; but to appreciate the evolution that so many of the main characters go through. Gandalf is transformed from gray to white surpassing the power of his master Saruman, who was seduced by Sauron. Merry and Pippin begin book 1 as irresponsible children and end volume 3 as heroes. They literally grow up as they both mature and gain height by drinking Ent Water; Aragorn, known only as a wandering woodsman when we first met him, claims the throne through both his heredity and his heroic actions; Frodo, of course, accomplishes his goal of carrying the ring, though it drags on his mind and his body. But it is Samwise Gamgee ("Sam"), whose loyalty and courage makes Frodo's quest happen. He came to us as a gardener and ended up saving the world, doing so with startling humility.

There are so many more characters in this book that captured my imagination: Faramir, who resisted the temptation that doomed his brother Boromir; and his father Denethor, driven mad by the loss of his son and the seeming hopelessness of the War of the Ring; and Eowyn, who disguised herself as a man to join the battle and fulfills a prophecy by defeating a great enemy.

One even finds great characters among the villains, most especially the pathetic Gollom who literally battles with himself over whether to betray Frodo and seize back the precious ring that he once owned.

I could go on and on. There are so many characters and so much texture to the world Tolkien creates, that this series bears reading multiple times. This was my second time, although my first was decades ago.

If there is any weakness of Return, it is that the story continues for so long after the war has settled. After dealing with the one ring and ending the war, the Hobbits return to the Shire to discover it has been ravaged by orcs and bad hobbits under the influence of the evil wizard Saruman.  It's an interesting story, but a bit of an anti-climax after the long quest to save the world. Still, it does show the strength gained by which our heroic hobbits, who are able to save the Shire without the help of Gandalf or the elves.

But this does not diminish the book or the series, which stands as a classic of high fantasy.  If Tolkien did not create this genre, he certainly defined it. You can see his influence in many who came after him. Terry Brooks's popular Shannara series borrows many characters and storylines from The Lord of the Rings.

Tolkien's story is epic, his writing is poetic, and his characters are memorable.

I am left with the image of Frodo expressing his affection and appreciation for the extreme loyalty shown by his friend Sam, when their demise seems almost certain:

"I'm glad to be with you, Samwise Gamgee, here at the end of all things."

And I am glad this world had Tolkien to give us the world of Middle Earth.

Saturday, October 6, 2018 1:53:00 PM (GMT Daylight Time, UTC+01:00)
# Friday, October 5, 2018

I began publishing this blog in January 2008 - over 10 years ago. I've been pretty consistent in adding content. I've never gone a calendar month without at least one post and I've averaged about 11 posts per month during that span. But I had never had more than 21 posts in a given month. Until June of this year. In the past 4 months, I've averaged 23.5 posts per month.

Why I write

I'm making more time to write down my thoughts these days because I see value in this. Here are some of the reasons I maintain this blog.

Understand what I'm learning

I spend a lot of time learning new technologies. I read books and articles, I attend sessions, I watch videos, and I ask questions. But the two things that solidify this knowledge are building something with the technology and explaining that technology to others. This blog helps me achieve the latter. Blogging or explaining, forces me to learn areas of the topic I might otherwise miss. I am smarter on a subject after I have blogged about it.

Share knowledge with others

I love to learn, and I love to teach. When I learn something new, I believe there is someone out there who could benefit from learning the same thing. I have received emails from people thanking me for explaining or making them aware of a technology.

Share knowledge with myself

I also use my blog to teach my future self about a technology. Often, I will work with a tool and not return to it for months or years. When I need to remember how to do something, I find it useful to have documented my experiences previously. Many times, I return to this post about how to use GitHub commands, because I don’t use these enough to remember them.

Build credibility

Technical blogging creates the perception that I know what I'm talking about. This was important when I was a consultant, as customers sometimes found me through my blog. This was important when I was seeking employment, as employers knew about my experience and my passion by reading my blog. And this is important as a public speaker, as conference organizers can see that I'm able to explain a topic on which I propose to speak.


As a public speaker, I often give a high-level overview on a technical topic. Often, I will post a slide at the end of my presentation with links to relevant blog posts for those who want to dive deeper.

Practice writing

No matter your profession, effective writing is a valuable skill. But writing is a muscle that needs to be exercised. Blogging provides me an opportunity to write (hopefully) coherent paragraphs and stories. The more I do this and think about it, the better I get at it, which helps me at my day job.

What I write

I write on a variety of topics. Here are a few broad categories into which they fall

Technical overviews

Describe a given technology and why it is important

How-To instructions

These are step-by-step instructions on a technical topic, such as a programming language feature or a software tool.

What I'm doing

If I have a lot of speaking coming up, I will publish a list of upcoming presentations. Of course, you can always find out my speaking schedule at http://www.davidgiard.com/Schedule.aspx.

What I did

Sometimes I will experience something amazing, like a trip to Europe or South America and I'll share my impressions and experiences.

Conference overviews

After attending a conference that particularly inspired me or taught me, I'll share my thoughts and learnings.


Personal thoughts

Things I believe and why. Sometimes, these are very personal, such as my memories of a friend or family member who passed. Sometimes, I write about philosophical things like the importance of forgiveness. At the beginning of each month, I publish a list of all my daily gratitudes from the previous month.

Career Coaching

I’ve spent much of the last few years of my career coaching others. I’ve learned some important soft skills and I use my blog as a way to share those learnings.


I have 2 ongoing TV shows: Technology and Friends features interviews with technologists about a variety of topics that are of interest  to other technologists. GCast features screencasts showing how to use software tools. I have been a guest host for DevRadio and other shows and I will post links to those videos on my blog.

Podcasts and articles

When I'm a guest on a podcast or interviewed for an article, I link to it from my blog.


I read a lot and attend a lot of concerts and theater. I share my impressions of the art I experience.
Book review
Concert review

As you can see, my blog is both a personal and a professional one. Years ago, popular blogger Scott Hanselman gave me some advice - Have a single presence on the web. So, you can discover a lot about me - What I'm thinking, what I'm doing, and what I'm doing, and what I'm learning - here at davidgiard.com.

Thinking of writing a blog?

If you are thinking of writing a blog, I encourage you to do so. It has benefited me, and it could benefit you. Here are some things to think about as you begin.

Write about what you know and what you learn. Don't worry if it's too basic. I write many introductory posts on basic topics. If something is new to me, it's likely also new to someone else.

Don't worry if it's been said before. You may have a way of explaining that is just right for someone.

Identify your audience and your goals. Are you a technical blogger, a patron of the arts, a philosopher, a political pundit? All of the above? A targeted blog can help you focus on what your next article should be. It's worth noting that I don't actually follow this bit of advice. I post enough content that there is something for just about everyone. But it's useful advice when you are starting out and don’t yet have a lot of content.

Always check your spelling and grammar. Your blog engine will probably help with this. If it is insufficient, paste your post into Microsoft Word and press [F7] to check it. Poor spelling and sloppy grammar reflect poorly on the writer.

Find a host and a blog engine. There are many free ones out there. I use DasBlog as my engine and I host on Microsoft Azure. If I were starting today, I might choose a more popular blog engine like WordPress or Drupal.

Maintain discipline. Commit to writing at least one post a month. Set a calendar reminder. Take notes during the month that you can later assemble into a post. Infrequently updated blogs are less interesting. And abandoned blogs are depressing.

Always date your posts. This is especially true for posts about technology, because software changes very fast.

Final thoughts

I really enjoy keeping this blog. I like the fact that others have learned from what I've written, even if "others" means "future me".

Friday, October 5, 2018 5:51:01 PM (GMT Daylight Time, UTC+01:00)
# Thursday, October 4, 2018
Thursday, October 4, 2018 4:08:28 PM (GMT Daylight Time, UTC+01:00)
# Monday, October 1, 2018
Monday, October 1, 2018 6:55:44 AM (GMT Daylight Time, UTC+01:00)
# Thursday, September 27, 2018

GCast 15:

Creating an Azure Web App

Azure Web Apps allow you to host your web sites and applications in the cloud. I walk through the steps of setting up an Azure Web App.

Azure | GCast | Screencast | Video | Web
Thursday, September 27, 2018 9:42:00 AM (GMT Daylight Time, UTC+01:00)
# Monday, September 24, 2018
Monday, September 24, 2018 9:38:00 AM (GMT Daylight Time, UTC+01:00)
# Sunday, September 23, 2018

The Microsoft Bot Framework makes it easier to create a chatbot. But a chatbot is only good if your users have a way of calling it. Microsoft bots can be accessed via a number of channels, including Facebook Messenger, Microsoft Teams, Skype, Slack, and Twilio.

Bot Settings

Once you have deployed a bot to Azure, you can view its properties in the Azure Portal, as shown in Fig. 1.

Fig. 1

Click "Settings" to display the "Settings" blade, as shown in Fig. 2.

Fig. 2

You will need the "Microsoft App ID" value (Fig. 3)

Fig. 3

Copy this value and save it somewhere, such as in a text file. You will need it later.

Bot Channel

Next, create a Channel for your bot. To do this, do the following:

Click "Channels" to display the "Connect to Channels" blade, as shown in Fig. 4.

Fig. 4

Click the "Configure Direct Line Channel" icon (Fig. 5) to display the "Configure Direct Line" dialog (Fig. 6)

Fig. 5

Fig. 6

The Secret Keys are hidden by default. Click the "Show" link next to one of them to display this key, as shown in Fig. 7

Fig. 7

Copy this value and save it somewhere, such as in a text file. You will need it later.

Click the [Done] button to close the "Configure Direct Line Channel" dialog.

Create Web Page

Now, you are ready to create a web page to allow users to use your chatbot.

The chat functionality is exposed through web services; but you can simplify calling these by using the Web Chat control. The source code for this open source project is here; but you don't need the source code unless you plan to modify or extend it.

Instead, you can link to the JavaScript file from your HTML with the following tag:

<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>

Add a div to your web page with the id "mybot", as shown below

<div id="mybot"></div>

Then, add the following JavaScript to configure the WebChat client:

		'directLine': { 'secret': 'DirectLineSecretKey' },
		'user': { id: 'UserId' },
		'bot': { id: 'MicrosoftAppId' },
		'resize': 'detect'
	}, document.getElementById("mybot"));


  • DirectLineSecretKey is from one of the 'Secret Keys' fields of the Bot's Direct Line channel blade, that you copied earlier.
  • MicrosoftAppId is from the 'Microsoft App Id' field of the bot's 'Settings' blade, that you copied earlier.
  • UserId can be any string you like. These will display in the UI next to text submitted by the user.

The WebChat project also provides a stylesheet that you can use by adding the following tag within the <HEAD> tag:

<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />

Below is the full HTML and JavaScript with some dummy values for DirectLineSecretKey, user, and MicrosoftAppId.

<!DOCTYPE html>
    <title>Cubic Chatbot</title>
    <link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
    <div id="mybot"></div>
    <script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
            'directLine': { 'secret': 'pdWb0xfE48M.wcA.dQI.YQgum240I2x9dVGc6S28u5Xik2Xt3A_TakzR24uGgjs' },
            'user': { id: 'Customer01' },
            'bot': { id: 'ac0438dc-a820-40fb-ae87-6448403ed1ad' },
            'resize': 'detect'
        }, document.getElementById("mybot"));

In a browser, this page renders as shown in Fig. 8.

Fig. 8

Fig. 9 shows how it looks when you connect to a bot that echoes back what the user sends.

Fig. 9

If you want this control to be displayed within another web page, you can add an iframe to that other page, as below.

<iframe src="botclientpage.html"></iframe>

In this article, I showed you how to create a web page that communicates with a Microsoft Bot.

Sunday, September 23, 2018 6:25:43 PM (GMT Daylight Time, UTC+01:00)
# Saturday, September 22, 2018

TheTwoTowersI wonder if we shall ever be put into songs or tales. We’re in one, of course; but I mean: put into words, you know, told by the fireside, or read out of a great big book with red and black letters, years and years afterwards. And people will say: "Let’s hear about Frodo and the Ring!" And they’ll say: "Yes, that’s one of my favourite stories."
-Samwise Gamgee

The Fellowship formed in the first book has broken. Frodo and Sam are on their way to Mordor to destroy the evil ring, so that the evil Sauron cannot use its power to conquer Middle Earth; Gandalf is presumed dead after falling into an abyss while battling the Balrog; Merry and Pippin have been kidnapped by Orcs - the same Orcs who killed Boromir; and Legolas, Gimli, and Aragorn traverse the land, seeking allies and battling Sauron's forces.

The first half of The Two Towers follows Legolas, Gimli, Aragorn, Merry, and Pippin until they are united. It is filled with epic battles between mighty armies. The second half of the volume chronicles the journey of Frodo and Sam, as they travel across perilous country to Mordor, guided by the twisted Gollom. The dangers they encounter are smaller, but no less perilous. They are attacked by Gollom and by Orcs and by a giant spider.

The theme of this middle volume of The Lord of the Rings trilogy seems to largely deal with decisions in the face of adversity. Boromir wrestles with his loyalty to the Fellowship and his desire to use the powerful ring to defend his country. Gollom literally argues with himself when debating whether to keep promises he made to Frodo or betray him and seize the ring for himself.

The leaders of Middle Earth know that a war is coming, but many of them need to be convinced to take sides. They delay because they wish to remain neutral, which gives an advantage to the aggressor Sauron and his minion Saruman. Since Tolkien lived through World War II, it's hard to imagine he wasn't thinking of all the countries who hesitated to take on Hitler during his pre-war efforts to expand his power.

The Two Towers is a classic adventure story that keeps the reader in suspense throughout. But, like its predecessors The Fellowship of the Ring, it is best read as part of the trilogy. It is parts 3 and 4 of a 6-part series and each of these parts ends with much unresolved. The characters are wonderful, the world is amazing, and the storytelling is epic.

I am enjoying this journey.

Saturday, September 22, 2018 9:24:00 AM (GMT Daylight Time, UTC+01:00)
# Friday, September 21, 2018

FellowshipOfTheRingOn his eleventy-first birthday, hobbit Bilbo Baggins decided to leave Hobbiton. He did so in dramatic fashion, literally disappearing while giving a speech at his birthday party. Bilbo left most of his belongings to his nephew Frodo, including a magic ring he discovered on a journey years earlier.

Neither Bilbo nor Frodo nor the wizard Gandalf knew that the magic ring was cursed. It was created by the evil Sauron, who has returned to take over all of Middle Earth and who desires the ring's power, which will virtually guarantee his success. When Sauron's minions The Ring Wraiths arrive in the Shire seeking the ring, Frodo and his friends flee, traveling across Middle Earth to Rivendell - a city of elves, where Bilbo has been living. At Rivendell, the wise elves decide that the only way to prevent the ring from falling into Sauron's hands is to destroy it. Sadly, the only way to do this is to throw it into the fiery pits of Mount Doom, located far away in the Mordor - home to Sauron.

So, Frodo sets out for Mordor with his 3 hobbit friends, Gandalf, Gimli the Dwarf, Legolas the elf, and two men: Aragorn and Boromir. Along the way, this "fellowship" is beset by treacherous terrain, fierce monsters, and the betrayal of a friend.

The Fellowship of the Ring begins J.R.R. Tolkien's classic Lord of the Rings trilogy.

It takes place a few years after The Hobbit, in the same world with many of the same characters. But it is much darker in tone.

Tolkien is at his best when he is building a world. By the end of the story, we know the beings who populate Middle Earth, the lands in which they live, the languages they speak, and much of their history. Fellowship is an adventure story, but the action is often interrupted by detailed descriptions of the environment. Those who know the story only through Peter Jackson's excellent movie may be disappointed that the book does not advance as fast.

But the depth of detail provided by Tolkien more than makes up for any pacing issues. The reader feels that he knows this world and these characters and why the ring is so important.

I love Tolkien's writing style, which can be at turns ominous and humorous. At his birthday party speech, Bilbo announces: "I don’t know half of you half as well as I should like; and I like less than half of you half as well as you deserve.", which leaves his guests trying to figure out if this was a compliment.

He mixes in much poetry or songs with his work, some of which is quite good. The prophecy of the Ring is told with the following poem:

"All that is gold does not glitter,
Not all those who wander are lost;
The old that is strong does not wither,
Deep roots are not reached by the frost.
From the ashes a fire shall be woken,
A light from the shadows shall spring;
Renewed shall be blade that was broken,
The crownless again shall be king."

And some of Tolkien's writing just sounds epic in its prose: "One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them."

Although listed as volume 1, this is not as much a first book in a trilogy as it is the first chapters in a very long novel, published in 3 volumes to make it easier to consume and market. You should read this volume knowing full well that it is not a complete story: You are committing to the entire series.

And a wonderful story it is.

Friday, September 21, 2018 1:54:00 PM (GMT Daylight Time, UTC+01:00)
# Thursday, September 20, 2018

GCast 14:

Creating an Azure Storage Account

Learn how to create a new Azure Storage account.

Azure | GCast | Screencast | Video
Thursday, September 20, 2018 9:58:00 AM (GMT Daylight Time, UTC+01:00)