# Monday, December 22, 2014
PipeDreams Team
The Pipe Dreams team

I didn't know what to expect when I was invited to the Hack10 Hackathon in Miami last week. I heard we would be working with Windows 10, so I installed the preview. I heard we would be working with Visual Studio 2015, so I installed that preview. I heard we would be using Azure, which was good because I love Azure and I wanted to learn more. I heard we would be doing something with the "Internet of Things" (IoT) and I wondered what was meant by that. I heard we would be using Git, so I did a bit of reading because I am very much a Git noobie.

But I didn't know what we would be working on or what the format would be.

As it turned out, we were asked to split into teams of 4 or less and come up with an idea involving IoT, Azure, Windows 10 and Git. Many people arrived with ideas and teams already formed. I did not. I looked around and saw a team of 3 with an idea and I asked if I could join them team. It was Dave Voyles, David Crook and Jennifer Marsman and they were kind enough to let me in. I had worked with Jennifer in the past and I knew Dave and David by reputation, so I believed we had a very strong technical team.

David Crook had come to the Hackathon an idea - a hardware device to monitor temperature, pressure, light, and wind flow and report that data (along with time and location information) to a database in Azure that could be queried and displayed in a portal. The hardware device would simulate the readings inside an oil pipeline because this was a real-world problem that Crook had studied before coming to the hackathon. We called our project "Pipe Dreams".

Jennifer worked to program 2 hardware devices - one to monitor the environment and one to send collected data to Azure;
Dave Voyles created a portal to displayed the data on a map, updating each collection point and popping up a message if data fell outside an acceptable range. He completed a web front-end and started a Windows 10 client;
David Crook wrote most of the business logic and analysis, including some fairly complex formulas that he acquired from his research of the oil and gas industry.
and I created an Azure SQL database and a mobile service to write and query the data.

We shared our code in a Git repository, integrated with Visual Studio Online.

When it was done, we had data flowing end-to-end, measuring the environment and collecting data via an IoT device; stored and analyzed in Azure; and reported via a web portal.

We presented our findings to the group. I opened with a video showing a pipeline explosion (of course) and promised that our solution would solve this problem. The other team members showed off the technical aspects of the solution.

It was a competition among the dozen or so teams and first place went to... Pipe Dreams! That's right, we won!

We also had a chance to see what the other teams built, which was  a lot of fun. One of the more clever (and sadistic) ideas was a device allowed audience members to rate a speaker during a presentation and give the speaker a shock if his ratings fell too low.

Two other teams placed in this competition: A team from Brazil created a game that became more difficult as more players connected over the Internet and played against you; and Paul DeCarlo, Jared Bienz, and Sertac Ozercan created a device to play music that could be controlled via a range of other devices, including Windows 8, Windows Phone, XBOX One and the Microsoft Band.

Overall, it was an excellent weekend. I learned a lot about the technologies we worked with and I was able to partner with some really bright technologists. Microsoft had invested quite a bit into the event to help keep us Evangelists up to speed on the technical side of our jobs - we stayed in a nice hotel, ate excellent food, and there were a number of experts on hand to answer questions or help us when we got stuck.

I hope these types of events continue and I hope that I can be a part of one in the future.

Azure | Tech
Monday, December 22, 2014 12:26:48 AM (GMT Standard Time, UTC+00:00)
# Monday, December 15, 2014
Monday, December 15, 2014 2:14:00 PM (GMT Standard Time, UTC+00:00)
# Wednesday, December 10, 2014

"Small Gods" is the thirteenth book in Terry Pratchett's Discworld series.

Pratchett's Discworld universe contains a plethora of gods. The vast majority of these gods are tiny, swarming invisibly and unnoticed in the desert. But a few gain a following of worshippers, which increases both the size and the power of these fortunate gods.  One such god was Om, who was so powerful in the country of Omnia that the priests who ruled the country would tolerate the worship (or even mention) of any other god. Om would typically manifest himself as a giant bull; but, when the story opens, he has somehow been transformed into a small tortoise. Om is preoccupied with his reduction in status - from powerful being to to tiny reptile - and with avoiding the talons of hungry eagles circling overhead.

One of Om's problems is that the people of Omnia don't really believe in him - they only go through the motions of their religion out of fear of the priests and the mysterious Quisition, who capture, judge, and torture accused heretics. Another of Om's problems is that he cares very little for the lives and fates of those who worship him - he only desires their faith because it brings him greater power, but he cannot even remember the names of his own prophets.

While struggling in his tortoise form, Om encounter Brutha, an illiterate student/servant with a good heart. Brutha is the only one in Discworld who can see or hear Om because he is the only one who believes in him without the threats from the Omnian church. Brutha is troubled to discover his god is not omnipresent or omniscient or caring or even polite. But he agrees to help him return to his former glory.

Small Gods is filled with quirky characters and witty prose. Like all the Discworld novels, every scene overflows with silliness. Pratchett describes a philosopher with the following:

His philosophy was a mixture of three famous schools -- the Cynics, the Stoics and the Epicureans -- and summed up all three of them in his famous phrase, "You can't trust any bugger further than you can throw him, and there's nothing you can do about it, so let's have a drink."

Or this witty exchange between the leaders of two countries:

"Slave is an Ephebian word. In Om we have no word for slave," said Vorbis.
"So I understand," said the Tyrant. "I imagine that fish have no word for water."

But Small Gods also biting satire about the dangers of religious zealotry and the emptiness of blindly following tradition. With Small Gods, Pratchett reaches beyond making us laugh and makes us think.

Wednesday, December 10, 2014 2:49:00 PM (GMT Standard Time, UTC+00:00)
# Tuesday, December 9, 2014

I spend a lot of time learning new skills and new technologies. After learning something new, my first reactions are to apply it that knowledge and to share that knowledge. When I was a consultant, I spent more time applying knowledge; generally, I was learning things that I needed to do my job, such as a technology that fit my current project.

Today, I am a Technical Evangelist and I spend more time passing on that knowledge to others.

I have found the following to be the most useful ways to pass on the knowledge I've learned: blog posts; technical presentations at user groups and conferences; screen casts; and hands-on labs.

Each of these media tend to appeal to different groups. There are a number of software developers, for example, who read blogs every day but never attend a code camp or user group. There are also different learning styles: some people learn more by reading; others by seeing it done; still others by doing it for themselves. (For me, a combination of all three works best).

Knowing that these different audiences exist has given me permission to package the same information into a variety of formats.

For example, for the past few months, I've developed and delivered a presentation on Azure Mobile Services. The presentation lasts about 90 minutes, which is perfect for a user group. I can cut it down to 60 or 75 minutes for a conference time slot.

Many people who saw this presentation told me they like the content because it covers all the basic features of Mobile Services and explains why they are important.

A few weeks ago, I had some extra time so I decided to commit to a adding more technical content to my blog. I was struggling to come up with ideas when I thought of the Mobile Services presentation. As often as I gave this presentation, only a few hundred people had seen it due to the fact that people had to travel to a user group or conference on a specific date and time to catch it.

I decided to transcribe the contents of my presentation into a series of blog posts. So far, I've written 9 different blog posts and I still haven't covered all the material in the 90-minute presentation.  Writing blog posts makes the content available to people who prefer written material over in-person delivery; and it also makes it available to a much larger audience - you don't need to travel to where I'm speaking in order to learn what I am teaching. (I’ve linked to the posts at the end of the article)

After a couple weeks of blog posts, I scheduled a hands-on workshop at a large university in order to show students how to use Mobile Services. I decided to start the workshop by delivering my presentation. Afterwards, I wanted the students to try the technology themselves, so I wrote a set of Hands-On labs with step-by-step instructions for creating and configuring Azure Mobile Services. The labs were similar to some of the blog posts I had already written but I re-wrote them with a different audience and a different goal in mind - The blog posts could simply be read; but with the labs, I was expecting the reader to follow along, so I had to make each step as explicit as possible. You can download the current version of these labs at https://github.com/DavidGiard/Azure-Mobile-Services-Labs.

I haven't yet decided if I'll record a set of screencasts showing developers how to manage Azure Mobile Services, but doing so would not involve a huge amount of time, since I already have most of the script written (from either the blog posts or the labs).

I'm not sure what is my next step - expanding the labs, continuing the blog post series, or creating screencasts. Of course, there are other demands on my time that will keep me from doing all of the above.

My point is that I don't see any problem repackaging the same content in multiple formats. Different people learn in different ways, so it's a great way to scale your knowledge transfer. If you are in the business of educating people, I'd love to hear your opinion. Is it cheating to repackage the same content? Or is it effective use of time and good scaling of delivery?


Azure Mobile Services Blog Posts (so far)

Tuesday, December 9, 2014 11:50:00 AM (GMT Standard Time, UTC+00:00)
# Monday, December 8, 2014
# Sunday, December 7, 2014

12/5
Today I am grateful to all the Purdue students who came out to my Azure Mobile Services workshop last night.

12/4
Today I am grateful for lunch with Adina yesterday. in Wicker Park.

12/3
Today I am grateful for the audience at my final Cloud Dev Camp yesterday in Indianapolis.

12/2
Today I am grateful for my final 2014 trip to Indianapolis.

12/1
Today I am grateful I spent most of the past 24 hours with my son Tim.

11/30
Today I am grateful for another Michigan State football season with double-digit wins! #GoGreen

11/29
Today I am grateful for a home-cooked meal last night and leftovers for lunch today.

11/28
Today I am grateful for Thanksgiving dinner with my family yesterday.

11/27
Today I am grateful for my family - both near and far.

11/26
Today I am grateful that I have heat restored to my house on this chilly morning.

11/25
Today I am grateful I made it back to Michigan in time to take care of a couple emergencies with my house.

11/24
Today I am grateful to Jason Farrell, who loaned me his laptop power cord for over a week, making it possible for me to get some actual work done.

11/23
Today I am grateful for all the energy at the Northwestern University WildHacks hackathon this weekend.

11/22
Today I am grateful to be heading back home for the first time in over 10 days.

11/21
Today I am grateful to attend and speak at M3Conf for the first time yesterday and today http://m3conf.com .

11/20
Today I am grateful to those who came to the Cloud Dev Camp yesterday and to George, who helped me out by delivering an excellent Azure SQL Database presentation.

11/19
Today I am grateful for lunch yesterday with Kent in Franklin, TN.

11/18
Today I am grateful for a network of smart people I can call on for technical assistance.

11/17
Today I am grateful for: 1. The hospitality of Darlene and Kevin. 2. Getting to see an exciting Rams-Broncos game in St. Louis yesterday. 3. Fitz's root beer.

11/16
Today I am grateful for: 1. My first visit to St. Louis Day of .NET, and all the organizers, speakers, and attendees, who made it a great experience. 2. An exciting basketball game at St. Louis University last night.

11/15
Today I am grateful for all the great people I am meeting my first time at St. Louis Days of .NET.

11/14
Today I am grateful for; * Making it onto the last flight to St. Louis via standby. * My first-ever visit to Houston, TX * A great turnout at the Cloud Dev Camp yesterday * Finding my phone

11/13
Today I am grateful to spend yesterday hanging out with Sarah, driving around the state of Illinois.

11/12
Today I am grateful for the opportunity to teach my first college class last night.

11/11
Today I am grateful to all the veterans who have served our country, especially my Dad - Lt. Cmdr. E Normand Giard, USN, ret. His photo is my profile picture today in his honor.

11/10
Today I am grateful to Susan Anspaugh, who loaned me her carpet cleaner to shampoo my carpets and wasn't mad that I kept it so long.

11/9
Today I am grateful for a ticket to the MSU game last night, even though the good guys lost.

11/8
Today I am grateful I had a chance to watch the local premiere of "Teenage Ghost Punk" last night.

11/7
Today I am grateful for my first Office Hours at Chicago Innovation Exchange yesterday and to all those who showed up.

11/6
Today I am grateful that the sharp stomach cramps I took to bed last night were gone this morning.

11/5
Today I am grateful to return to Chicago and get back to what I do.

11/4
Today I am grateful I was able to stay in one place for a week, where I had a chance to catch my breath.

11/3
Today I am grateful for a walk along the river on an Autumn afternoon.

Sunday, December 7, 2014 12:05:50 PM (GMT Standard Time, UTC+00:00)
# Wednesday, December 3, 2014

Stephen R. Donaldson introduced Thomas Covenant in his 1977 novel Lord Foul's Bane. He continued the story in The Ilearth War and concluded the Trilogy with The Power That Preserves. Donaldson went on to write a second Trilogy about this character, followed by a 4-part series titled "The Last Chronicles of Thomas Covenant". This review covers only the first Trilogy.

Thomas Covenant was a bestselling author with a good home and a loving wife and infant son, when he was suddenly struck ill with leprosy. The disease cost him 2 fingers on his right hand and his wife, who left Thomas for fear their son would catch his disease. His neighbors rejected him out of fear and ignorance, but he defied them by walking into town each week to collect his mail.

On one such trip, Thomas was crossing the street and nearly run down by a police car. When he awoke, he found himself in a strange world, known only as The Land, facing the horrific villain Lord Foul, who commanded him to deliver a message to the people of The Land.

The Lords and commoners of The Land noticed Covenant's missing fingers and his white gold wedding ring and assumed he was the reincarnation of Berek Halfhand, a heroic figure from The Land's past, who lost his fingers battling the evil Lord Foul with the powerful force of white gold. They believed that Covenant was sent to The Land to protect them and to defeat Lord Foul.

Their faith in Covenant and their non-violent code caused them to forgive Covenant's every sin and shortcoming. And he has many.

When he enters the Land, Covenant's leprosy is magically cured, restoring feelings to his nerve endings. The rush of long-unfelt sensation is so overwhelming that he rapes Lena, a young woman who had shown kindness to him. Even this betrayal does not shatter the faith of either the people of The Land or of Lena herself.

Time and again throughout the trilogy, the Land's inhabitants sacrifice themselves for Covenant, hoping he will use his power and defeat Lord Foul; but, Covenant repeatedly defers, making no effort to learn how to harness the power of his white gold ring and often pushing his responsibility onto others.

Covenant is magically transported back to his own world; but is drawn back to The Land two more times with the expectation that he will rescue its inhabitants. Most of the time, the inhabitants are disappointed. Each time, he returns to The Land years have passed in this magical world, even though only a few weeks have passed in his own.

In the world of high fantasy, there are many unlikely heroes, but few as unlikeable as Thomas Covenant.

Covenant is reluctant to take on the responsibility of battling Lord Foul. During his years as a leper, he has learned to be extremely cautious because he no longer has nerve endings to warn him of impending danger. He carries this caution into The Land, despite no longer needing it. Worse, Covenant seems incompetent as The Land's heroes and does not even recognize the powers he has such as the magic that white gold holds in The Land. He leaves disappointment and betrayal almost everywhere he goes, until his final encounter with Lord Foul at the end of the third book.

Overall, I enjoyed this trilogy. The Land suffered under Lord Foul and their chosen hero could not help them; but ultimately Covenant found his strength and did what he needed to do.  The characters were interesting enough to hold my attention for three books; but I don't know if or when I'll return to The Land and read the remaining seven.

Wednesday, December 3, 2014 9:49:00 AM (GMT Standard Time, UTC+00:00)
# Tuesday, December 2, 2014

Writer/Director Michael Cramer describes Teenage Ghost Punk as a "supernatural punk rock romantic comedy" - a string of adjectives and nouns that make it tough to categorize.

The movie debuted in October at the Spooky Movie International Horror Film Festival in Washington, DC. I saw it a month later at its Chicagoland premiere at the School of Rock in Oak Park, IL.

Teenage Ghost Punk tells the story of a family moving into a haunted house. Amanda is a popular high school cheerleader from Spring Lake, MI, whose newly-divorced mother moves the family to suburban Chicago, hoping for a fresh start. Amanda feels out of place in her new home and she is stressed because she misses her cheerleader friends and tall-but-rockhead boyfriend. Things get worse when she begins to hear bumps in the night and family items turn up missing. It turns out that the house is inhabited by the ghost of Brian - a teenager who was struck by lightning while playing guitar on the house's roof during a thunderstorm in the early 1980s. Brian is convinced this is still his house and that Amanda and family are intruding. Only Amanda can see and hear Brian and his ghostly pals. They talk and become close and Amanda decides to invite Brian to the school dance, where she hopes to introduce her friends to her new boyfriend. And then it gets weird.

WP_20141107_20_48_06_Pro
Cramer, along with some of the cast and crew answer audience
questions after the Chicagoland debut viewing November 7

In 2009, Michael Cramer released his first movie - Dear Mr. Fidrych - about a kid who idolized Detroit Tigers Pitcher Mark "The Bird" Fidrych, then grew up to address his midlife crisis by taking his son across country to meet his boyhood idol Fidrych.

I liked Dear Mr. Fidrych. It reminded me of my own childhood - and not just because Cramer and I grew up together in a Detroit suburb during the 1970's when The Bird had his burst of fame. However, Dear Mr. Fidrych was an independent film created on a shoestring budget and there was no hiding these facts.  Technical aspects of the movie were lacking - in particular the sound was inconsistent throughout the film and nearly all the actors were amateurs, with the leading roles going to the director and his immediate family. The story, the energy, and the charm of Dear Mr. Fidrych were enough to more than make up for any technical weaknesses.

Teenage Ghost Punk is far more polished. One could easily believe it was produced and created by a Hollywood studio. The sound is better, the cinematography is better and the acting is better. But the script retains the humor and the humanness of Dear Mr. Fidrych. Even Jack Cramer (son of the director), who plays the title character, has grown into a solid actor. He has an engaging smile that resonates on screen as he charms both Amanda and the audience. I can't think of any aspect of moviemaking that did not improve between Cramer's first movie and this one.

Teenage Ghost Punk is filled with memorable characters. A bumbling Ghostbusters-like team fails to defeat any ghosts but end up being right about their supernatural presence; the neighborhood ghosts spend their days recreating moments from their lives and spend their evenings playing cards; The over-the-top gay neighbors bicker and cuddle shamelessly; Amanda's little brother Adam includes 4-syllable words in nearly every sentences; and Madame Lidnar has little success at her own séances, but relates as well as anyone to the ghosts when she encounters them.

The silliness of the characters adds to the story, rather than distracting from it. The theme of TGP comes together very well at the end. Ultimately, the movie is about letting go of the past and moving on. Most of the characters - living and dead - are unable to do so until the end of the movie. They grew and matured as time passed.

And so did Michael Cramer and his crew.

Tuesday, December 2, 2014 10:45:00 AM (GMT Standard Time, UTC+00:00)
# Monday, December 1, 2014
Monday, December 1, 2014 11:24:00 AM (GMT Standard Time, UTC+00:00)
# Sunday, November 30, 2014

In my last article, I described how to use Visual Studio to create and deploy an Azure Mobile Service with server-side code written in a .NET language. I chose C# for that example. In this article, we will walk through the boilerplate C# code generated when you create a new Azure Mobile Services project.

Figure 1 shows the newly-created Azure Mobile Services project in Visual Studio’s Solution Explorer

Zumo9-Figure 01 - ZuMo Project
Figure 1

Let’s go through the key parts of the code.

Global.asax.cs

The Application_Start code runs at the very beginning of the application so any startup code goes here. In this case, we call the static method WebApiConfig.Register (Listing 1).

protected void Application_Start()
{
    WebApiConfig.Register();
}

Listing 1

WebApiConfig.cs

Let's take a look at the Register method in the WebApiConfig class.  WebApiConfig.cs is in App_Start folder.

This project uses the Entity Framework to interact read and write data. The most important line of the Register method (Listing 2) is

Database.SetInitializer(new MobileServiceInitializer());

which initializes Entity Framework settings. The new MobileServiceInitializer is found in the same file and it has the ability to seed the sample TodoItem table with a couple records (Listing 3)

public static void Register()
{
    // Use this class to set configuration options for your mobile service
    ConfigOptions options = new ConfigOptions(); 
 
    // Use this class to set WebAPI configuration options
    HttpConfiguration config = ServiceConfig.Initialize(new ConfigBuilder(options)); 
 
    // To display errors in the browser during development, uncomment the following
    // line. Comment it out again when you deploy your service for production use.
    // config.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always; 
 
    Database.SetInitializer(new MobileServiceInitializer());
} 
 


Listing 2

public class MobileServiceInitializer : DropCreateDatabaseIfModelChanges<MobileServiceContext>
{
    protected override void Seed(MobileServiceContext context)
    {
        List<TodoItem> todoItems = new List<TodoItem>
        {
            new TodoItem { Id = "1", Text = "First item", Complete = false },
            new TodoItem { Id = "2", Text = "Second item", Complete = false },
        }; 
 
        foreach (TodoItem todoItem in todoItems)
        {
            context.Set<TodoItem>().Add(todoItem);
        } 
 
        base.Seed(context);
    }
}

Listing 3

TodoItem.cs

Next, we'll look at the TodoItem class (Listing 4), which can be found in DataObjects folder. This is the data model and will. It has 2 explicit properties - Text: the text of a Task that we need to complete; and Complete: a flag indicated whether or not we have completed this task. This object will will map to columns in the TodoItem table.
We don't need to explicitly provide an ID property because the class inherits this property from the EntityData class.

public class TodoItem : EntityData
{
    public string Text { get; set; } 
 
    public bool Complete { get; set; }
}
 

Listing 4

MobileServiceContext.cs

This is a Context used to manage database updates and retrievals via Entity Framework. It knows where to connect to the database and what model to send to the database. The Controller class will instantiate this to interact with the database table.

TodoItemController.cs

TodoItemController is the main controller class that maps HTTP Verbs (POST, PATCH, GET, and DELETE) to specific actions. It inherits from the TableController class, which has an IDomainManager named DomainManager that is used to retrieve and update data using Entity Framework. All the controller methods need to do is to call TableController methods, such as Lookup, UpdateAsync, InsertAsync, and DeleteAsync.

For example, if a client sends a request to our mobile service’s HTTP endpoint with the POST verb, the routing engine will run the PostTodItem method in TodoItemController (Listing 5).

public async Task<IHttpActionResult> PostTodoItem(TodoItem item)
{
    TodoItem current = await InsertAsync(item);
    return CreatedAtRoute("Tables", new { id = current.Id }, current);
}

To add business logic to your service, you will add code to the Controller methods (GetAllTodoItems, GetTodoItem, PatchTodoItem, PostTodoItem, and DeleteTodoItem.)

In this article, we covered the code that is automatically generated in a C# Azure Mobile Service.

Sunday, November 30, 2014 2:19:16 PM (GMT Standard Time, UTC+00:00)