The robots are coming with cheese!!

Last month saw us meeting once again at Auto Trader for May’s DotNetNorth. We welcomed our old friend Rob Miles over from Hull to talk about his latest passion, dinky robots! Rob has been working on these things for a while and opened with a description of how he designed a little robot using stepper motors, Arduino boards and various sensors (after, of course, a couple of corny opening gags).

Rob has conceived these robots – called Hull PixelBots officially – to be easy to build with off-the-shelf (cheap) electrical components and even a 3d-printable chassis (although you can just use perspex or balsa wood). He has also written the operating system that powers the beasts called HullOS (are you detecting a theme here?); but is adamant that that sounds much harder than it actually is.

Rob then showed us a few demos and explained that using a few of the features in Azure, he could control the beasts remotely. If you want to see the presentation, it was recorded by our friends from Pusher – you can find it here

Global Azure Bootcamp in Manchester

Last Saturday a group of community group leaders and helpers in Manchester joined forces with hundreds of other people for the 2018 Global Azure Bootcamp run in association with Microsoft. At the event we had four sessions covering various parts of the Azure ecosystem, some with hands-on labs so people could get a good feel how Azure solutions come together.

So huge thanks to our session leaders who came together and devise an agenda in just a couple of weeks:
Luce Carter, organiser of the Xamarin user group who did our Intro to Azure and using the portal session.
Aden Earnshaw, who did a great job on his user group presenting debut and covered Web Apps.
Martin Boam, who recently was awarded a Microsoft MVP award and runs the Cloud User Group gave a session on Serverless computing.
Jim Bennett – a Cloud Developer Advocate at Microsoft – came all the way from Reading and delivered a great demo about using Azure AI to augment mobile apps, despite the curse of the demo gods striking!
(And I did one on CosmosDB / DocumentDb too)

We also thank Auto Trader for providing the venue for us and providing coffee and tea for the whole day – especially Helen, the venue event co-ordinator who is always helpful.

This was our first go at running the Bootcamp, it was hectic but very rewarding to work with some new people in the run up and to see everyone learning something new on the day – hopefully we will be doing another one next year too! But I won’t be thinking about it too hard for a couple of months.

Using Table Valued Parameters in Dapper

Today I discovered a neat way of passing values into a SQL Server stored procedure with Dapper using a Table Valued Parameter. Up to now, I’d been using a DataTable, adding the columns programatically and then populating it row-by-row. Whilst re-reading Erland Sommarskog’s detailed post about dynamic SQL, I noticed something I hadn’t picked up on before – that there was another way of doing this. Some more research via Leonard Lobel’s site lead me to this solution, which is much neater that the DataTable shenanigans.

Firstly we need to create a table-valued parameter in SQL Server: In your database, open a new query and type:

CREATE TYPE dbo.SimpleKeyList AS TABLE( [KeyId] INT NULL)

Next we create a procedure that will accept the TVP as a parameter:


CREATE PROC dbo.EchoKey
@KeyList dbo.SimpleKeyList READONLY
AS
SELECT KeyId FROM dbo.SimpleKeyList ORDER BY KeyId DESC

This procedure will just return all the keys sent in but in reverse numerical order, so we can see that some processing has occurred.

Now we need to do a bit with Dapper;

This is our basic method:


        public List<int> EchoSomeKeys(KeyList inputData)
        {
            using (var db = new SqlConnection(_connString))
            {
                var data = db.Query<int>("EXEC Core.EchoKey @KeysIn", 
                    new {KeysIn = inputData.AsTableValuedParameter("dbo.SimpleKeyList") }
                );
                return data.ToList();
            }
            
        }

Looks simple doesn’t it? Now all we need is our input class KeyList:


public class KeyDto
{
    public int KeyId { get; set; }
}
public class KeyList : List<KeyDto>, IEnumerable<SqlDataRecord>
{
  IEnumerator<SqlDataRecord> IEnumerable<SqlDataRecord>.GetEnumerator()
  {
    var sdr = new SqlDataRecord(new SqlMetaData("KeyId", SqlDbType.Int));

    foreach (KeyDto item in this)
    {
      sdr.SetInt32(0, item.KeyId);
      yield return sdr;
    }
  }
}

You can see that a little bit of magic is injected via the implementation of

IEnumerable<SqlDataRecord>

Dapper provides the AsTableValuedParameter method which iterates over the enumerator provided by the interface and populates the parameter TVP.

I knocked up a quick NUnit test to check it all works:


[TestFixture]
public class TestTableValuedParam
{
  [Test]
  public void TVP1()
  {
    var a = new Tvps();
    KeyList keysIn = new KeyList();
    keysIn.Add(new KeyDto { KeyId = 68});
    keysIn.Add(new KeyDto { KeyId = 12 });
    keysIn.Add(new KeyDto { KeyId = 42 });

    var m= a.EchoSomeKeys(keysIn);
    Assert.That(m.Count, Is.EqualTo(3));
    foreach (var i in m)
    {
      Console.WriteLine(i);
    }
  }
}

Which verifies that we get the values returned in reverse order.

DotNetNorth review of 2017

I thought I’d do a quick look back at the events of the year for DotNetNorth as it’s been a pretty amazing year all told.

Spring

The beginning of the year saw our meetup membership exceeding 700. Our attendances had been growing slowly in 2016 and we were beginning to see the effects of the simple marketing tactics that our main sponsors Evolution Recruitment had been doing – a number of their consultants had been adding a short link to the group into their email signatures.

We had also nicely settled into using our latest venue; we made the switch to take advantage of a few things, such as a huge video wall for presentations, microphones and much easier access in the evenings. There were a few disadvantages – the space has a coffee shop alongside and the sound can carry quite far but in general it was a great fit for us with space to sit about 60 comfortably and a few dozen more at a stretch.

We also began a relationship with the guys at Pusher, who offered to come and video our talks to put on their website.

Summer

We started to see significant growth in our audience numbers in the summer with numbers reaching 60-70 for each session. The down-side of this, of course, is the cost of pizzas so we were pleased when we re-confirmed our sponsorship agreement with Evolution Recruitment.

We were also contacted by the events team at AutoTrader, a big employer in the city, who were looking at ways to raise their profile within the Tech community in Manchester.

After Oli and I took a visit to see the space we decided to run a trial event in June; this went well with the AT catering team excelling themselves in putting on a great buffet with drinks.

The opportunity to use AutoTrader came just in time as around this time the events organisers at Rise were let go and they declined to take bookings more than a month in advance.

Autumn

In September we started a run of events at AutoTrader; being able to plan dates in advance with them meant we could schedule some great speakers and our audiences grew to around 60-70 each evening. We also ran a Windows Fall Creators Update launch event with a huge box of t-shirts being shipped from Redmond.

In October we ran our second Xamarin Dev Day which was kindly hosted by UKFast; they have a great theatre space with a stage and huge screen and a breakout area alongside. That event attracted people from as far away as Reading and London, just showing there’s an appetite for these kind of full day events.

We also joined the .Net Foundation Meetup Group, which means we’re now listed alongside 100 other .Net related user groups across the globe.

End of the year

At the close of the year we’re looking in great shape – we have over 1300 members on meetup and it’s growing daily.

Due to some changes in the community outreach programme at AutoTrader, they won’t be able to support us quite as comprehensively as they have in 2017, so we’re pleased to have just signed up another sponsor Dunnhumby; we’re also looking at some alternative venues to mix things up a bit, so we’re not dependent on a single host company and not demanding too much of them either.

We’re also pleased that two DotNetNorth attendees have set up their own user groups – Luce Carter has set up a Xamarin group and Michael Dickens a F# group.

All in all, this has been the best year yet for DotNetNorth; we still have problems cropping up every so often, but I still get a great thrill when the message pops up to say ‘new .Net fans have joined your meetup group’. I especially want to thank the four people who help run the group – this really is a team effort and we could not have got where we are without the work put in by Pete Vickers, Oli Newsham, Mike Irving and Jason Holloway.

Looking forward to 2018 now, deep breath….

 

A bit about Dot Net North

As you may know, I am one of the co-organisers of a Microsoft oriented community ‘user’ group in Manchester called DotNetNorth. We run a monthly meeting in Manchester city centre with one or two speakers plus pizza (that’s Manchester in the United Kingdom).

When the group started it was run by myself, Pete Vickers and Chris Hardy and was aimed at building a community of Windows Phone developers; we didn’t see many people at the meetings but we built a small core of regular attendees many of whom have become friends.

In 2014 we decided to pivot into a less specialised group and we’ve grown since then to have almost 1000 fans on our meetup group.

Chris has since gone off to work for Xamarin in the USA so Pete and I now have the help of Oli Newsham, Jason Holloway and Mike Irving to keep the group running. Having a team certainly makes the events easier to host and run – we’ve all got different strengths and we use that to our advantage each meeting and it means people can find an ‘organiser’ when they need one.

This last year has been a pretty incredible one for us – we secured a year long sponsorship with Evolution Recruitment which allowed us to stop worrying about how to pay for the pizza each month and they also promoted the meetup site by adding a link to the email signature of all their consultants working with Microsoft related technologies. The company has been commendably ‘hands-off’ about the arrangement with one of their guys, Scott Barker, coming along each month (sometimes with a colleague too) just to chat to anyone who is looking to move jobs.

The group continues to grow at pace and we will soon be looking for a bigger venue to host the meetings and more sponsors to cover the costs.

If you’re interested in coming along or speaking at one of our meetings then you can see the event diary and/or send us a message at http://www.meetup.com/DotNetNorth

HoloLens talk at DotNetNorth Manchester

Last night was the December meeting of DotNetNorth in Manchester at which the excellent Mike Taulty gave us a developers’ first look at the HoloLens. It was an eagerly anticipated meeting and we had just over 50 people in the room.

There’s some seriously powerful stuff going on inside the headgear and it was great to see people getting really excited about what HoloLens can deliver.

The group has been running in this format for just over a year and this was one of the best attended ones we’ve had – thanks to our sponsors and the team of fellow organisers.

DotNetNorth is a community group for techies in Manchester who are interested in Microsoft products. I’ll post more about the group over the next months, but if you’re local to the area and want to join us then head over to https://www.meetup.com/DotNetNorth/ and join the group.

 

 

Data science certificate – take care if linking to a Microsoft account

One tip  – when you have to sign up to edX to do the courses you will be presented with an option to ‘connect with Microsoft account’ along with options to connect with Facebook and Google too. I normally shy away from explicitly connecting accounts like this but decided, this once, to use the MS connect facility to connect to my hotmail account. This does NOT work (well not for hotmail accounts). Worse, it appeared to work for 24 hours before it stopped and causing much confusion and gnashing of teeth. Apparently, it will work for Office365 type accounts but not ‘consumer’ grade Microsoft ones.

Wish I’d followed my usual advice when faced with another new web registration – a deep breath to calm the rising frustration, open Enpass and add another login.

Beginning a journey to “data scientist”

For a long time I’ve been interested in data. My first development job was building a production tracking and reporting application in Microsoft Access (version 2.0 if you’re asking) and I’ve been in love with the idea and practice of storing data ever since. Many of my subsequent jobs were building applications to collect and show data, after my experience with Access (which was then, and still is, an incredible piece of software) I worked with VB4 through to VB6 and the transition to Windows Forms and C# and eventually to HTML and the web.  But all that time, it was the *data* that interested and excited me. I did a few assignments building business intelligence solutions using the SQL Server BI stack and that was really good fun and challenging but I always seemed to end up back as a C# coder.

Having finished a recent contract building web apps in C# and Angular and all that webby stuff I found myself thinking that I’d change my focus and go back to the data. I had heard about the Microsoft Professional Program for Data Science, so I’ve enrolled in that with the aim of transitioning away from being a pure code monkey to something more deeply attached to the data.

I’ve finished a couple of the modules already, but I plan to blog a bit about my experience in making this change. At the end of the journey I hope to be able to call myself a Data Scientist, and more importantly get paid to be one.

 

Conversation id’s are not carried between service broker instances

Digging around today I have found something that, at first seemed odd, but probably isn’t. When a message gets transmitted between service broker instances, it has an associated conversation ID. One might expect that the ID would travel with the message(s) to the destination instance. After all, it’s the conversation ID that ties together all the messages that need to be treated as one dialogue.

At the destination, however, the conversation ID that the messages have is different to the one they are associated with at the sending end.

This seems odd.

All the messages in a conversation at the receiving end have the same conversation ID, it’s just a different GUID to the one that they have in the source database.

Apply a bit of brain juice and I surmise that what is going on here is either (or both) of (a) the system just not trusting the sender GUID, so causing a new one to be used, (b) an incrementing GUID is being used for the conversation ID, so that the destination has to assign a fresh value so as to maintain the sequence order of the ID.

I need to do a bit of testing to see if (b) is in fact what’s going on here.

 

P.S. I shall be presenting a talk on Service Broker of the SQL Server User Group in Manchester in June.