Posts

Showing posts from 2016
Image
Give your Form Flow based chat bot new smarts with LUIS FormFlow  is an attractive API offering for building chat bots in the  Microsoft BOT Framework  in that it greatly simplifies the conversation data management you otherwise need to deal with yourself, to have a useful dialogue with a human. With FormFlow, you set up predefined processes (or  guided conversations ) that you would like your human to navigate through, e.g. Bot: Hello and welcome to Customer Support! Bot: I'm Botty. What is your name? Human: Susan. Botty: Great to meet you, Susan! How can I help you today?   You can ask me to 1.  Get me a Sandwich , 2.  Book an appointment  or 3.  Rant incessantly . Susan: Please get me a sandwich Botty: Are you sure you can handle the  heat ? Susan: Yes Your Hot sandwich is coming right up! The above is accomplished by creating a serializable poco with your  Field s, accompanied by two helper methods to turn the poco into a  Form : [Seriali

Chat bots with the Microsoft Bot Framework

Image
Chat bots are all the rage these days. As someone who wrote one or two bots back in the day of  IRC  ( mIRC  scripts to be specific), this is a welcome renaissance. I'm planning to write a series on these bots (particularly because I haven't found a way to cover everything I feel you need to understand to be productive - and have fun! - in one post). Bot framework In Microsoft land, a chat bot is an  ASP.NET Web API  Controller which receives a JSON payload, acts on it and returns a JSON payload. The payloads in question are received from - and sent back to -  Microsoft Bot Connector . The connector is responsible for talking to the  channels  where your bot will live. Example channels include Slack ,  Skype ,  Facebook Messenger , the Web (as a embeddable control). An example chat bot API controller, might look something like this: namespace Chatbot { [BotAuthentication] public class MessagesController : ApiController { /// /// POST

Combine an ion-tabs with an ion-nav in Ionic 2

If you'd like to present a tabular login flow during the user's sign up and log in phase and a tabbed application flow for the day-to-day use of your app, you can use Angular 2's templating functionality to provide multiple view layouts in your root component (app.html): In the above code snippet, we have a menu and tabs layout if the user is logged in and a navigation controller if a user is not. For the above to work, we need to   import { User, Auth } from '@ionic/cloud-angular'; ... and make instances of these providers available to our template, e.g. through our constructor:   constructor(     public user: User,     public auth: Auth   ) Controlling the tabs In the app I'm currently working on, some menu options activates a certain tabs, whereas other menu options open a page in a modal view. To control the tabs, I    import { Component, ViewChild } from '@angular/core';   import { Platform, MenuController,

Error: No component factory found for ... Angular 2 / Ionic 2

The error EXCEPTION: Uncaught (in promise): Error: No component factory found for YourPageHere   in Ionic 2 RC1 most likely mean that you have forgotten to declare your newly created page inside your app.module:     ...     import { LoggedInPage } from '../pages/logged-in/logged-in';     ...     @NgModule({         ...         declarations: [             ...             LoggedInPage         ],         ...         entryComponents: [             ...             LoggedInPage         ],         ...     })

Missing ionicons in Ionic 2 RC1

If your Ionicons are not showing up in your Ionic 2 app (after you've recently upgraded the ionic runtime, for example), it might be because they are no longer linked with your distribution. Here's how you can go ahead and fix that: Pre-requisite: npm install ionicons In your copy.config.js , ensure that you copy the ionicon fonts from your node modules:     ...     {       src: 'node_modules/ionicons/dist/fonts/',       dest: '{{WWW}}/fonts/'     }     ... In your src/app/app.core.scss , make sure that you include ionicon's sass:     @import "../../node_modules/ionicons/dist/scss/ionicons"; With those two changes, you should be back in the game!

Node.js and the Internet of Things by @codefoster through @pluralsight #SmarterThanYesterday

Image
I just finished watching a remarkable Pluralsight course by Jeremy Foster , in which he succeeds not only to get you psyched start your own IoT projects, but also does a great job showing up the immense power of modern JavaScript! For long-time .NET developers, seeing just how long the JavaScript and Node community has come can be an awe-inspiring experience. The grass just seems ... greener on that other side. As a side note, I'm currently looking into Microsoft's Bot Framework . There, again, the Node.js side of the fence just gets more done quicker. Less ceremony, more ... stuff done! Whether you want an orientation of what this IoT thing is all about, a look at available hardware starter kits, some insight in what kind of libraries are available or how to concretely make an end-to-end solution, Jeremy Foster has you covered! Once he's run you through all of the basics, Jeremy wraps up by showing you an end-to-end solution, in which he talks to his Microsoft

Binding to Blobs, Queues and Tables with Azure WebJobs

Image
Azure WebJobs are awesome and you should start using them right now!  I've been using them for a while and thought I'd share some knowledge: Naming is important Looking in the Azure WebJobs Dashboard, you'll have much better experience if your class and method names describe what their intention is: Rename your Functions.ProcessQueueMessage to something legible (especially if your web job has many triggers): If you, in your dashboard, get a notice of a missing connection string, you'll want to add that in your site's Application settings: Async Task is your friend My job classes are static and my methods are too. Further, my methods are async Task so that I can use other async APIs with minimal friction: You can bind your method parameters to everything storage (and some Service Bus too!) As you could see in the example above (and also in Troy's article linked in the beginning), running a web job method in response to a blob being wri

Microsoft Azure Resource Management (ARM) Templates, Service Bus, Topics and Subscriptions

Image
If you've logged into the Azure Management Portal recently, you might've noticed that we are now able to export templates from our resource groups! That's absolutely amazing and is something that surely will save us a lot of time throughout our Azure careers. If you have any Service Bus resources, you might've also noticed, however, that those are not included in the template! Furthermore, the Service Bus templates are not available in Visual Studio's Add Resources  ARM tooling. Bummer! Here's how you add the necessary nodes into your JSON deployment template: Ok, so what's with all the parameters and variables? Let's go through them together: sbVersion is set to the first available API version within the service bus namespace: "sbVersion": "[providers('Microsoft.ServiceBus', 'namespaces').apiVersions[0]]" sbNamespace depends on the deployEnvironment parameter. In our case, that is either 'te

Polymer in Azure

Image
Having one of my teams looking closer into Polymer, I am looking through the Polymer tutorial today , looking for stumbling blocks ahead of time so that they can be resolved by the time they get there. First off, if you're behind a corporate firewall, you'll want to make sure that bower can traverse any proxy you might have. You'll need a .bowerrc in your project folder, looking similar to this: Second off, you cannot test Polymer from your file system - you'll need to serve your resources from a web server. Provided that you have managed to get things started locally, let's get real - we want to use these components as UI facades to whatever services we might host in the cloud. Fire up Visual Studio and create a Web project. I started a ASP.NET Core project, 'cause that was the shiniest that I had available to me. In my VS solution, I created an elements directory in my wwwroot , pasted in my .bowerrc file in there and opened a console, which I used t

Note taking and scalability

I enjoy taking notes. It frees up my short- and long time memory so that I only have to remember bits and pieces and know that I can search to find everything else. As such, I've tried various noting solutions over the years, being a staunch user of Evernote for many years before it got slow and starting to fail (weird synchronization issues, slow client ... ). Wanting to start over, I exported all of my notes (and misc. other files that I could just throw in there, since it mostly worked) to Google Drive where I could search for the data inside them (although the results weren't always pretty). I then tried Microsoft OneNote . After having used that extensively for the past two years, the client is getting slow and I'm starting to get more and more synchronization issues, tempting me to "just use notepad and a folder system!" But ... that is not as convenient to format and search as a noting app... Not counting text nodes, I have other things in my OneNot

Event Sourcing with Svein Arne Ackenhausen

Yesterday, one of my teams and I participated in an Event Sourcing workshop with Svein Arne Ackenhausen , sharing his experiences going from traditional RDBMS state store architectures to event sourcing ones. This is my interpreted summary of the event. :-) Event Sourcing fits well within a a bounded context. Within this context, UIs can HTTP Post specific command DTOs to an endpoint which - Constructs a Command - Asks the Command to structurally validate itself (e.g. check a number range 1-10) - Send it to a Command Handler The Command Handler will - Invoke business rules to validate the Command (e.g. check if this user is allowed to invoke said command) - Load an Aggregate from an Event Source Repository (which in turn will construct the aggregate and might read an Event Store and replay all events onto it) - Send the Command to the Aggregate which, again, will validate the command against its state. If the Command is valid, the aggregate will send an event that describes