Saturday, November 11, 2017

Intro to Natural Language Processing with LUIS

Here's the slides for the presentation I'm doing 11/16/2017 at the Granite State Windows Platform Developers (@WPDevNH) meeting in Salem, NH (at the Microsoft Store)

The group is primarily about Windows 10 app development (implying Universal Windows Platform, UWP).  That said, the group's been begging for sessions on AI and related services for some time.

Since I've been helping a client navigate LUIS lately, I figured an into to the LUIS service would be a nice way to break into this very useful service.

I reserve the right to tweak these slides up until I present them on Thursday, November 16th, 2017.


Please Join Us! 
RSVP HERE:

https://www.meetup.com/Granite-State-NH-WPDev/events/243099117/

UWP Equivalent for HttpUtility.ParseQueryString

Getting ready for my LUIS presentation at the Granite State Windows 10 Platform Devs Users Group (@WPDevNH), it made sense to demo LUIS using UWP rather than .NET classic.  (Join us, 11/16 at the Microsoft Store in Salem, NH...  https://www.meetup.com/Granite-State-NH-WPDev/events/243099117/ )

For a demo related to LUIS querying, I needed an alternative to System.Web.HttpUtility.ParseQueryString.  (based on this demo:  https://docs.microsoft.com/en-us/azure/cognitive-services/LUIS/luis-get-started-cs-get-intent )

I did a simple decorator of a Dictionary, adding a constructor to parse using WwwFormUrlDecoder, and overriding the ToString() to put it back together...

I whipped one up relatively quickly, but decided this would be a decent quick post.  Here's my alt code:

using System.Collections;
using System.Collections.Generic;
using System.Net;
using System.Text;
using Windows.Foundation;

namespace LUIS_Examples
{
    public class ParseQueryString : IDictionary<string, string>
    {
        private IDictionary<string, string> _internalDictionary = new Dictionary<string, string>();
        public ParseQueryString(string queryString) :
            base()
        {
            var decoder = new WwwFormUrlDecoder(queryString);

            foreach (var item in decoder)
            {
                _internalDictionary.Add(item.Name, item.Value);
            }
        }

        public override string ToString()
        {
            var sb = new StringBuilder();
            foreach (var aPair in _internalDictionary)
            {
                sb.AppendFormat("{0}={1}", WebUtility.UrlEncode(aPair.Key), WebUtility.UrlEncode(aPair.Value));

            }
            return sb.ToString();
        }

        public string this[string key] { get => _internalDictionary[key]; set { _internalDictionary[key] = value; } }

        public ICollection<string> Keys => _internalDictionary.Keys;

        public ICollection<string> Values => _internalDictionary.Values;

        public int Count => _internalDictionary.Count;

        public bool IsReadOnly => _internalDictionary.IsReadOnly;

        public void Add(string key, string value)
        {
            _internalDictionary.Add(key, value);
        }

        public void Add(KeyValuePair<string, string> item)
        {
            _internalDictionary.Add(item);
        }

        public void Clear()
        {
            _internalDictionary.Clear();
        }

        public bool Contains(KeyValuePair<string, string> item)
        {
            return _internalDictionary.Contains(item);
        }

        public bool ContainsKey(string key)
        {
            return _internalDictionary.ContainsKey(key);
        }

        public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
        {
            _internalDictionary.CopyTo(array, arrayIndex);
        }

        public IEnumeratorstring, string>> GetEnumerator()
        {
            return _internalDictionary.GetEnumerator();
        }

        public bool Remove(string key)
        {
            return _internalDictionary.Remove(key);
        }

        public bool Remove(KeyValuePair<string, string> item)
        {
            return _internalDictionary.Remove(item);
        }

        public bool TryGetValue(string key, out string value)
        {
            return _internalDictionary.TryGetValue(key, out value);
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return ((IEnumerable)_internalDictionary).GetEnumerator();
        }
    }
}


Tuesday, October 3, 2017

UWP App Samples

I realized as I was presenting a guided tour of UWP App Samples that I'd come full circle on a set of presentations around my experience building Windows 10 UWP apps.   The overall process was kicked off in three decisions. 

1)  pick a framework (we settled on Prism + Unity),   

2) pick a control library (we went with the UWP Community Toolkit (which is since released 2.0 by the way, updated for 1710, Fall Creators Update... there may be another presentation in the works here)).

Finally,
3) we consulted the UWP App Samples.   ( https://github.com/Microsoft/Windows-universal-samples )

When it comes down to it, our goal was very ambitious, and we couldn't have accomplished what we did without these three key pieces.   I've presented each of them over the past several months at the Granite State Windows Platform App Devs meetup. ( https://www.meetup.com/Granite-State-NH-WPDev/ )

At the time of the presentation, the categories in the Open Sourced UWP App Samples project were these:

  • App Settings,
  • Audio/Video/Camera,
  • Communications,
  • Contacts and Calendar,
  • Controls/Layout/Text,
  • Custom User Interactions,
  • Data,
  • Deep links and app-to-app Communication,
  • Devices and Sensors,
  • Files/Folders/Libraries,
  • Gaming, Globalization and Localization,
  • Graphics and Animation,
  • Holographic,
  • Identity/Security/Encryption,
  • Launching/background tasks,
  • Maps/Location, Navigation,
  • Networking/Web Services,
  • Platform Architecture,
  • Speech/Cortana,
  • Threading,
  • Tiles/Toasts/Notifications
If your app will do anything remotely associated with any of the above functionality, you need to consult the related sample projects before beginning.  They aren't production-ready samples, but they are good samples, nonetheless.

These slides don't do any justice at all to the UWP Sample Apps project, it was really just something to throw on the big screen while folks gathered.

Monday, September 4, 2017

UWP Community Toolkit in the Wild

On August 17th, I reviewed use of the UWP Community Toolkit in practical application, used in several privately published apps. These apps were commissioned by Hewlett Packard to illustrate commercial uses of the HP Elite X3 Windows 10 Mobile phone. We checked out the code behind these apps with permission from HP.

The apps themselves focus on three core verticals:
1) Public Safety - apps to support officers in the field
2) Field Service - supporting a cable field service technician
3) Home Health - supporting a visiting care provider.

All show off Windows 10 UWP as a versatile platform, capable of easily adapting to phone, tablet, or desktop, as well as the HP Elite X3's additional ability to support various hardware expansion jackets and docking options.

The UWP Community Toolkit is an open source project designed to make Windows 10 the easiest platform to build great apps for. More information can be found here:

http://www.uwpcommunitytoolkit.com/

The official UWP CTK demo app is here:
http://aka.ms/uwptoolkitapp

The presentation itself was all demos, digging in on the CTK toolkit sample app, looking at it in a locally cloned git repo, and showing how we used the same controls in the X3 demo apps.

The UWP CTK is a great set of tools to jumpstart Windows 10 Dev with.  

Our next meeting on September 21st, (2017) we'll take a look at another great "Hit the ground running" UWP resource, the App Samples.

Prism and Unity, an MVVM and DI Knockout Combo

I recently had the opportunity to do UWP work for Hewlett Packard.  It was a really cool experience, building UWP apps for the HP Elite X3 Windows 10 based phone.

I'd also just rolled off a project prior-to that used Unity under the hood for Dependency Injection, so Unity felt like a natural extension. Prism as an MVVM presentation framework on UWP also felt like a natural extension of the MVVM framework we'd build on WPF in that same previous project.

Here's the slides from the June 22nd, 2017 presentation to the WPDevNH group in Salem, NH.

What's New in C# 7

Overdue, but better late than never... here's my slides for my WPDevNH presentation back in April 2017....

Microsoft Build 2017 Recap

[Edit:  I wrote this originally back in May, 2017, but realized I never published it.  Anyway, very belated, here's a rundown on Build 2017 with some light analysis at the end.]

You know an event is "Epic" when, at its conclusion, leaves you feeling like the climax was forever in the making and then suddenly complete...  done...  over.   Even post-event celebrations feel like the long drawn out ending from the Lord of the Rings trilogy.

Build 2017 is an interesting twist on that for me.   I spent most of the beginning of 2017 looking forward to it.  Then it finally came, and the world was in its midst. 

The twist is that Build, for me, is not the end, but a refreshed beginning.  It's the kickoff of new ideas, new development stories, and new opportunities, rather than an end.   Build came and went, and left me feeling like I'm alive at the best time in the history of the world to be a developer, and especially a full Microsoft stack developer.

I've already presented my recap a couple of times.   Here's the slides.




The slides are not as well organized however, so I'll run through a recap with a bit more organization.

Platform:   Azure
  • Azure IoT Edge
I liken Asure IoT Edge to the autonomic reflexive system of the cloud.
  • Cloud Shell Management
  • Azure Management Mobile App for iOS & Android
  • Appsource
  • Azure Stack
Platform:  3rd Party
  • Visual Studio for Mac


Platform:  Mixed Reality
  • AI-enabled Workplace monitoring
  • New motion controllers
  • Acer & HP MR Dev kits available

Platform:  Windows 10 client
  • Fall Creators Update
  • Remix
  • Fluent Design System
  • Project Rome & Graph
  • Legacy App Bridging
  • Continuous Delivery
  • Windows Identity & FIDO
  • Ubuntu Linux updated
  • SUSE & Fedora Linux added



Platform:   .NET
  • .NET Standard 2.0 & XAML Standard 1.0
  • Embeddinator-4000
  • Live Player for iOS & Android

Technology: Cognitive
  • Twice as many services available under Azure Cognitive Services banner
Technology:  Database
  • PostgreSQL as a service
  • MySQL as a service
  • Cosmos DB
Technology:  BOT FX
  • Adaptive Cards

Technology:  Cortana 
  • Hardware units from Harmon Kardon, HP, Intel

Concluding Observations


Microsoft has fully given up on Windows 10 Mobile as an OS, and redefined "Mobile" to mean that the computing experience roams across all devices.  This is now what they mean when they say "Mobile First / Cloud First". This roaming experience even cuts into iOS, OS X, and Android.  The big celebration of Build 2017 is "Microsoft is no longer a monopoly" which means that they are on top of "innovation hill" again.  Expect amazing things from Microsoft, and expect them to be on their game once things like Augmented Reality to really dig in on the consumer market.