Some time ago I’ve attended a .net developer days 2017 conference. I was quite busy since (traveling, teaching .net, working) that only now I got some time to share some thoughts about it. As a bonus I’m including a short interview I did during the event. I need to state here, just to be clear, I got a free ticket for the conference from the organizers but I’ve paid for workshop by myself. Read More
We developers don’t like documentation. We don’t like to read it, and we even more we don’t like to write it. But sometimes it is worth to read it. Like when you find out that by using datetime in SQL DB you got a milliseconds precision but only if it ends on 0,3,7 (link). That was brought to my attention by Lech Osiński at Programistok 2017. Lech was describing some WTF experience when dealing with datetime if you don’t read the docs. I had a similar experience this time with .NET.
I was asked why this
returns true. My first impression was WTF, it should not return true. Empty string doesn’t have all characters equal to ‘+’. But a quick check in LINQPad confirmed that it does. So what now? Well we could go to read the docs but who would do that? What we did (as this now become a office problem :]) decompiled the All method and check how it is implemented. So All returns false when it predicate returns false but if for any of the chars it will not be false it will return true. So for an empty string, the predicate will never be executed thus All will return true.
A bit counter-intuitive I would say. Counter-intuitive? Yes – but of course documented. If you got to the docs for All it’s clear that for an empty collection (in this case, an empty string) it will return true.
true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
So read the documentation and don’t be surprised when something is not working as expected – at least it’s documented.
Photo by: https://unsplash.com/photos/wk833OrQLJE
If you prefer to watch that to read and you like Cognitive Services and Bot Framework here’s something for you. Read More
Even the best technology is not worth much if there are no applications that uses it. The same goes with Microsoft Cognitive Services.
Here is the list of few websites or apps that uses Cognitive Services. Let’s see if this technology is already getting adoption.
When we started making Little Creeps – the 2D endless runner game on mobile – we were faced with the problem of creating an algorithm that is going to be the core of the game – creating unique path in realtime so we can play as long as we like without the feeling that we are running around in circle.
Continuing on Microsoft Cognitive API. Today lets find out about Knowledge API. In this category we can find services like: Academic Knowledge, Entity Linking, Knowledge Exploration, QnA maker and Recommendation API. Lets have a closer look at each of them.
This API allows you to search through academic papers and retrieve information from Microsoft Academic Graph. MAG is bing based knowledge database. More can be found at: http://aka.ms/academicgraph.
With this API we can identify entities in our text and match them with different one that has the same meaning based on context.
Allows interactive search experience. In this category we can find services like: natural language understanding, query auto-completion, evaluation of structured query and attribute histogram.
With this service you can easily convert existing FAQs into knowledge based that allows your users to query with a natural language.
This API we can use to provide our users with services like product recommendations and frequently bought together option. This might be used as an excellent addition to online shopping experience.
Have you already used Microsoft Cognitive Services in your application? If so I would like to know what are you using it for – share your ideas.