.NET Oxford Meetup VI: Reactive Bots!

18 September 2017 - .NET , dotnetoxford , Meetups

Reactive Bots? What's that all about? Well the title for this month's .NET Oxford actually refers to two different talks ... 'The fuss about Bots?' with Martin Kearn, and 'An Introduction to Reactive Extensions' with James World ...

Both were really fascinating, but also wildly different from each other - making a really nice mix of a high level and very low level talks.

bots

This time, unfortunately we were a man down. Fellow organiser Matt Nield couldn't make it as he was recovering from a bug (not that kind of bug!). He very kindly decided to not risk attending and spreading it. I know he really wanted to be there. It's the first one he's missed, so also the first time I went solo! Although, thanks to the help of both our awesome sponsors and speakers - it wasn't really that solo at all! :-)

Setup and Intro

Normally when we get to the venue, the microphone is already set up and there's a lectern on stage to put laptops on - so we pretty much only have to check our own equipment. This time unfortunately, the PA system wasn't set up, and the lectern was missing. Having not set it up before, there was a bit of fumbling around by myself and Martin (mostly Martin to be fair!) to get it working. Luckily, I arrived early enough that it wasn't really an issue other than me having to leave our sponsors Corriculo Recruitment more to it with welcoming attendees as they came in! Hopefully no-one minded. I had been aiming to get more involved with welcoming attendees in this time too. I'll just have to be even more welcoming next time to make up for it!

The intro talk went well, although it did feel rather strange not having a lectern in front of me with my laptop and notes. We had to use a knee-height table for the laptops instead. Luckily, I could remember most of what I needed to say, so there was only the occasional squint down at my notes when required.

In last month's meetup, I asked people for feedback - whether it be positive or negative; ideas and suggestions; things we're doing well; things we could be doing better. One bit of feedback we got from an attendee (via our sponsors, Corriculo Recruitment), was that for attendees who were new to .NET Oxford, it wasn't that clear what .NET Oxford was all about. This was a good point, as I only really spoke about this in our very first meetup back in January. So this time, I went back to the beginning and focused on what .NET Oxford was all about ...

I started off asking who was new to .NET Oxford - and a surprising number of hands went up. I then spoke about the whys and whats. Obviously, we're a .NET user-group - but we're not just about .NET. Rather, anything that is of interest to a .NET developer. So .NET and surrounding technologies. I spoke about how nowadays, those surrounding technologies actually cover quite a large radius - with .NET now being cross platform; with the Azure Cloud; Xamarin mobile development; Docker, etc, etc.

Oxford already had a great developer community, but there wasn't really anything in the .NET space. This was understandable given that old Microsoft and .NET was very closed source and commercial. Nowadays though, all that has completely changed. Microsoft is a completely different company, and .NET is now developed in the open on GitHub. Being cross platform, this also opens it up to Mac and Linux developers, as well as opening up .NET developers to Linux containers, and the world of container orchestration tools like Kubernetes (a talk hopefully coming up later this year on this!).

Personally, I really wanted a local .NET user-group I could get involved in, and given there wasn't one - I decided to create one! I reached out to Matt to see if he was interested in getting involved, and that's where it all began. I explained this in the intro, re-introduced both Matt and myself, our sponsors Corriculo, and spoke about our typical format for the night. Then moved onto the usual news and prize draws ...

News Items

news

Fiddler Orchestra

Our first news item was about FiddlerCore for .NET Standard and Fiddler Orchestra. The blog post about this can be found here. We all know and love Fiddler, but it's currently Windows only. I certainly know a few Mac users that would love to have this running on the Mac. Because .NET Core is cross platform, this now opens up Fiddler to also move in the same direction. They've taken the guts of Fiddler, put it into the FiddlerCore engine, so they can then start adding different user interfaces on top. They're calling this whole combination of Core and the UIs - the Fiddler Orchestra.

DDD East Anglia

I mentioned this in last month's news section, but given that it's just this coming Saturday, I thought it worth mentioning again. Albeit, anyone without a ticket at this stage will go onto the waiting list. I had my ticket and was really looking forward to going. However at the time of writing this blog post, I'm now unfortunately unable to attend as my wife hasn't been feeling that well (exhaustion from our young kids mainly!), so duty calls at home instead! At least that freed up my place for someone on the waiting list!

.NET Conf

Next week, Microsoft have a full 3 day virtual conference. This is going to be very big, and being virtual - anyone can attend! I'm hoping this'll also provide plenty of fuel for next month's news section! :) For more information, check out www.dotnetconf.net.

Prize Draws

After the news section, I wrapped up the intro talk with the prize draws. As usual, we had our three fantastic prize draw sponsors - Jetbrains, Manning Books, and Oz-Code.

prize sponsors

A massive congratulations to our winners! ...

  • Dennis (surname unknown!) took away a year-long Jetbrains product licence of his choice. We'd obviously recommend Resharper, but if he already has it, they have plenty of other fantastic tools to choose from!
  • Tim Boyle won a Manning eBook of his choice! Again! Tim actually won the same prize last month, and given that there were 40-50 attendees, that's quite good going! Last time he choose Windows Powershell in Action, which I believe was a choice prompted by a PowerShell conversation we all had at the pub after the meetup! And this month, he decided to pick Get Programming with F#!
  • Kurt Hamilton who won the Oz-Code licence! If you haven't used Oz-Code before, it's a Visual Studio extension that puts your debugger on steroids! If you haven't checked it out, definitely download the trial and have a play. Our member get a free 3 month trial licence (see below).

Remember that we have our special Manning coupon code (ug367) which gives all of our members a 36% discount on any of their e-books! They've also asked me to share a link to some of their new courses for their LiveVideo system.

Also, Oz-Code are now offering all our members either a 3-month licence free, or 50% off a full licence! To claim you can visit the this link to pick up your licence!

Sponsors

Corriculo Recruitment

As usual, our amazing sponsors Corriculo Recruitment were on hand helping us out, covering the venue costs, providing everyone with plenty of liquid beverages, and just making everyone feel very welcome. They've also helped us out quite a lot with promotion and speaking to various local developers and companies helping us spread awareness of .NET Oxford. So a massive thank you to them for being so awesome :)

Everstack Ltd

Our secondary sponsor is my own company, Everstack Ltd, providing software development and consultation services. Whilst, we can't take on more work at the moment, I'm always happy to discuss future requirements and to network with both like-minded individuals and other companies.

The Fuss about Bots

martin

The first talk after my intro was by Martin Kearn from Microsoft. Martin has spoken at .NET Oxford before talking about Machine Learning and Azure Cognitive Services. This time he was back speaking about Bots and the Microsoft Bot Framework. And actually, his previous talk on Cognitive Services rolls in quite nicely to this one, as Bots can quite heavily utilise machine learning and cognitive services.

Martin starts off talking about what bots actually are and what kinds of problems they solve. You can interact with them via your usual "chat" applications - eg. Slack, Skype, Facebook messenger, Twitter, email, and many more. You interact using natural language - just as if you were interacting with another human. And now that we have a lot more voice recognition solutions - eg. Cortana, Alexa, Google Now, Siri, etc. - bots have an even bigger role to play.

The Bot platform he focuses on is the Microsoft Bot Framework, which handles most of the more complicated problems for you, so you only have to worry about the problem your bot is actually trying to solve. Which should ideally be small distinct tasks, rather than one bot doing lots of different things.

He uses a Gigseekr bot to demonstrate what a bot is and how it works, also explaining some fundamental concepts and terminology. The sentence that the user inputs is called an utterance, and this gets processed by LUIS, which'll then try to figure out the intent and also extract entities (such as locations, dates, etc.) to determine what the user was requesting.

He ends mentioning that Microsoft are looking for companies that have a 3-5 day proof of concept project requirement that they can help and get involved with to use as a real world case study. They'll do this free of charge. So if this is you, then you can get in touch directly with Martin, and please mention that you heard about it through .NET Oxford.

Bots are one of those things that I keep on hearing more and more about, but still haven't had chance to play around with. I'm definitely going to have to bump this higher up my to learn list!

The slides and more information about Martin's talk can be found here.

An Introduction to Reactive Extensions

james

The second talk of the night was by one of our regulars James World, talking about Reactive Extensions in .NET! James is another repeat .NET Oxford speaker - where he did a Deep Dive into Git at our lightning talk event in July.

I've dipped my toe in the world of Rx in the past, so have touched a bit upon it's awesome power - but I certainly haven't used it very heavily. This is one of those technologies where I find a surprising number of developers have never even heard of it, so it was really great to have a talk on it. I was really looking forward to this talk, and James most certainly did not disappoint!

Out of anyone qualified to do a talk on Rx, James ranks fairly high up as he's the top user in the Rx StackOverflow category - and it's clear he certainly knows his stuff!

He starts off with a few slides, explaining the problems that Rx solves, and some of the fundamental concepts. Then he quickly moves over to live demonstrations with code.

James primarily uses a WPF app he wrote which is literally just a textbox and a listview. All it did was collect input events from the textbox as the user typed on the keyboard and outputted it to the listview. So basically subscribing to an input stream of key presses, and updating the listbox as they came in. The idea being that this will add autocomplete functionality. He then used this concept to demonstrate and explain different Rx concepts, like concurrency, error handling, etc.

One thing that stands out with Rx is how short and elegant code can be with it that solves what would otherwise be really complicated problems. James demonstrated this really well with the above mentioned WPF app by starting off very simple, then building on it and solving more and more complicated issues, whilst not actually adding that much more code!

Finally, he moves over to demoing more of a real world application - showing an example of a typical currency trading user interface, which had a lot more stuff going on - lot of numbers being quickly updated at a very fast frequency. Everything in the UI was stream based coming from the server via SignalR and then handled via Rx. The server was just a local server, but it was still very impressive how fast and responsive everything was when he turned up the update-frequency slider!

He ends by switching to my favourite tool, LINQPad, and showed code that interacted with the same currency trader server. He also taught me something new about LINQPad! I didn't know about the DumpLatest extension method which allows you to Dump observable streams! Another one for the next blog post in my LINQPad Tips and Tricks series!

The code from James' talk can be found on his Github.

I'm going to end by quoting both a LINQ query and paragraph from the bottom of his readme file in that repo ...

Observable.FromEventPattern<TextChangedEventArgs>(Input, "TextChanged")
    .Select(@event => ((TextBox) @event.Sender).Text)
    .Throttle(0.5.Seconds()).ObserveOnDispatcher()
    .Do(_ => ClearMatches())
    .Where(term => term?.Length > 2)
    .Do(_ => SetWaiting())
    .Select(term => Observable.FromAsync(() => _autoCompleteService.Query(term))
        .Timeout(2.Seconds(), Observable.Return(AutoCompleteResult.ErrorResult(term, "timed out")))
        .Retry(3)
        .Catch(Observable.Return(AutoCompleteResult.ErrorResult(term)))
        .ObserveOnDispatcher()
    )
    .Switch()
    .Subscribe(DisplayMatches);

What an amazing throttling, filtering, time-out-aware, error-aware, retrying, latest-results-only query it is. Imaging writing that with imperative code if you dare!

Needless to say, I dread to think of the immense amount of code required to do that without Rx!

Upcoming Meetups

Our October meetup will be on the 24th October, and will be all about Serverless! Christos Matskas will be telling us all about Azure Functions, Azure Logic Apps, AND Azure App Insights!! I first heard Christos speak at one of the DDD conferences, and am really excited to have him down talking at .NET Oxford!

Call for Lightning talk speakers!

We're also planning another lightning talk event for November, as our last lightning talk meetup in July was a big success! If you or anyone you know are interested in doing a short grok talk, then do get in touch!