<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Technoloy Evangelist – Loves New tech, and a his</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/brijrajsingh/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/feed.xml</link>
    <description>Just another Developer Network site</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:20:27 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Multi Column GroupBy Aggregate using R in Azure ML studio</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/multi-column-groupby-aggregate-using-r-in-azure-ml-studio</link>
      <pubDate>Mon, 31 Jul 2017 04:50:52 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=155</guid>
      <description><![CDATA[Azure ML Studio is ...... Well if you don't know what it is then you better go here and get some...]]></description>
      <content:encoded><![CDATA[Azure ML Studio is ...... Well if you don't know what it is then you better go <a href="https://studio.azureml.net/">here</a> and get some basics. Its the most ultimate experience in my knowledge that orchestrates the machine learning process's each level very intuitively.

Quite recently I was working on some data which required GroupBy aggregation at different column levels. Consider the data in this format

&nbsp;
<table width="1093"><colgroup> <col width="78" /> <col width="82" /> <col width="69" /> <col width="120" /> <col width="86" /> <col width="186" span="2" /> <col width="64" span="3" /> <col width="102" /> <col width="142" /> </colgroup>
<tbody>
<tr>
<td width="78" height="19"><b><span style="color: #000000;font-family: Calibri">RegionCode</span></b></td>
<td width="82"><b><span style="color: #000000;font-family: Calibri">RegionName</span></b></td>
<td width="69"><b><span style="color: #000000;font-family: Calibri">StoreCode</span></b></td>
<td width="120"><b><span style="color: #000000;font-family: Calibri">Category</span></b></td>
<td width="86"><b><span style="color: #000000;font-family: Calibri">ProductCode</span></b></td>
<td width="186"><b><span style="color: #000000;font-family: Calibri">ProductName</span></b></td>
<td width="186"><b><span style="color: #000000;font-family: Calibri">Quantity</span></b></td>
<td width="64"><b><span style="color: #000000;font-family: Calibri">Size</span></b></td>
<td width="64"><b><span style="color: #000000;font-family: Calibri">Gender</span></b></td>
<td width="64"><b><span style="color: #000000;font-family: Calibri">Season</span></b></td>
<td width="102"><b><span style="color: #000000;font-family: Calibri">PricePointName</span></b></td>
<td width="142"><b><span style="color: #000000;font-family: Calibri">ProductCategoryName</span></b></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499</span></td>
<td><span style="color: #000000;font-family: Calibri">SHOES</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">487369</span></td>
<td><span style="color: #000000;font-family: Calibri">KWANGO</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">6</span></td>
<td><span style="color: #000000;font-family: Calibri">Men</span></td>
<td><span style="color: #000000;font-family: Calibri">FW 09</span></td>
<td><span style="color: #000000;font-family: Calibri">FTW &lt; 10000</span></td>
<td><span style="color: #000000;font-family: Calibri">FOOTWEAR</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499</span></td>
<td><span style="color: #000000;font-family: Calibri">TOPS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">498510</span></td>
<td><span style="color: #000000;font-family: Calibri">ADIPURE BRA</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td><span style="color: #000000;font-family: Calibri">L</span></td>
<td><span style="color: #000000;font-family: Calibri">Women</span></td>
<td><span style="color: #000000;font-family: Calibri">SS 14</span></td>
<td><span style="color: #000000;font-family: Calibri">FTW 6000-6999</span></td>
<td><span style="color: #000000;font-family: Calibri">APPAREL</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499</span></td>
<td><span style="color: #000000;font-family: Calibri">SANDALS/SLIPPERS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499408</span></td>
<td><span style="color: #000000;font-family: Calibri">ADI SUN</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">8</span></td>
<td><span style="color: #000000;font-family: Calibri">Men</span></td>
<td><span style="color: #000000;font-family: Calibri">FW 15</span></td>
<td><span style="color: #000000;font-family: Calibri">FTW 1000-1999</span></td>
<td><span style="color: #000000;font-family: Calibri">FOOTWEAR</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500</span></td>
<td><span style="color: #000000;font-family: Calibri">SANDALS/SLIPPERS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499429</span></td>
<td><span style="color: #000000;font-family: Calibri">ADI SUN</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">2</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">8</span></td>
<td><span style="color: #000000;font-family: Calibri">Men</span></td>
<td><span style="color: #000000;font-family: Calibri">FW 15</span></td>
<td><span style="color: #000000;font-family: Calibri">APP 2000-2499</span></td>
<td><span style="color: #000000;font-family: Calibri">FOOTWEAR</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500</span></td>
<td><span style="color: #000000;font-family: Calibri">SHOES</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500228</span></td>
<td><span style="color: #000000;font-family: Calibri">DURAMO 6 LEA M</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">11</span></td>
<td><span style="color: #000000;font-family: Calibri">Men</span></td>
<td><span style="color: #000000;font-family: Calibri">SS 15</span></td>
<td><span style="color: #000000;font-family: Calibri">FTW 6000-6999</span></td>
<td><span style="color: #000000;font-family: Calibri">FOOTWEAR</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500</span></td>
<td><span style="color: #000000;font-family: Calibri">SHOES</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500284</span></td>
<td><span style="color: #000000;font-family: Calibri">HOWZAT J V</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Kids-Boys</span></td>
<td><span style="color: #000000;font-family: Calibri">FW 14</span></td>
<td><span style="color: #000000;font-family: Calibri">FTW 3000-3999</span></td>
<td><span style="color: #000000;font-family: Calibri">FOOTWEAR</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">500</span></td>
<td><span style="color: #000000;font-family: Calibri">PANTS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">541832</span></td>
<td><span style="color: #000000;font-family: Calibri">ESS 3S KN PANT</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">M</span></td>
<td><span style="color: #000000;font-family: Calibri">Women</span></td>
<td><span style="color: #000000;font-family: Calibri">SS 14</span></td>
<td><span style="color: #000000;font-family: Calibri">APP 1500-1999</span></td>
<td><span style="color: #000000;font-family: Calibri">APPAREL</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499</span></td>
<td><span style="color: #000000;font-family: Calibri">PANTS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">544313</span></td>
<td><span style="color: #000000;font-family: Calibri">NEW FIREBIRD TP</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">1</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">34</span></td>
<td><span style="color: #000000;font-family: Calibri">Women</span></td>
<td><span style="color: #000000;font-family: Calibri">SS 15</span></td>
<td><span style="color: #000000;font-family: Calibri">APP 1500-1999</span></td>
<td><span style="color: #000000;font-family: Calibri">APPAREL</span></td>
</tr>
<tr>
<td height="19" align="right"><span style="color: #000000;font-family: Calibri">3</span></td>
<td><span style="color: #000000;font-family: Calibri">Michigan</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">499</span></td>
<td><span style="color: #000000;font-family: Calibri">PANTS</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">544314</span></td>
<td><span style="color: #000000;font-family: Calibri">NEW FIREBIRD TP</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">2</span></td>
<td align="right"><span style="color: #000000;font-family: Calibri">40</span></td>
<td><span style="color: #000000;font-family: Calibri">Women</span></td>
<td><span style="color: #000000;font-family: Calibri">SS 15</span></td>
<td><span style="color: #000000;font-family: Calibri">APP 2500-2999</span></td>
<td><span style="color: #000000;font-family: Calibri">APPAREL</span></td>
</tr>
</tbody>
</table>
I wanted to get a group by aggregate SUM on Quantity group by multiple columns like RegionCode, StoreCode, and Category. It would only take a line of code using R, Just drag and drop the Execute R Script component and write this simple statement
<div>
<blockquote>
<div># Map 1-based optional input ports to variables
dataset1 &lt;- maml.mapInputPort(1) # class: data.frame
data.set = aggregate(dataset1$Quantity, by=list(RegionCode=dataset1$RegionCode,StoreCode=dataset1$StoreCode,Category=dataset1$Category), FUN=sum)</div>
<div># Select data.frame to be sent to the output Dataset port
maml.mapOutputPort("data.set");</div></blockquote>
</div>
<div></div>
<div>
<div>Run the experiment, right click the "Execute R Script" component and click on "Result Dataset --&gt; visualize"</div>
</div>
<div></div>
<div>

[caption id="attachment_166" align="aligncenter" width="919"]<a href="https://msdnshared.blob.core.windows.net/media/2017/07/visualize-summary.jpg"><img width="919" height="722" class="size-full wp-image-166" alt="" src="https://msdnshared.blob.core.windows.net/media/2017/07/visualize-summary.jpg" /></a> Visualize Data[/caption]

</div>
<div></div>
<div></div>
&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Downloading an Azure blob storage container - Python</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/downloading-a-azure-blob-storage-container-python</link>
      <pubDate>Sat, 27 May 2017 08:12:55 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=136</guid>
      <description><![CDATA[One of my clients recently faced this issue of downloading an Azure Storage blob container with...]]></description>
      <content:encoded><![CDATA[One of my clients recently faced this issue of downloading an Azure Storage blob container with complex path of folders and sub-folders to his local machine. I stumbled onto this <a href="https://stackoverflow.com/questions/37079951/download-all-blobs-within-an-azure-storage-container/44214423#44214423">stack overflow post</a> . The post however doesn't give a complete resolution but gives a pretty good idea of what needs to be done.

What does your humble next door TE does in this situations?

Well, he rolls up his sleeves (already rolled up in this sweltering <a href="https://timesofindia.indiatimes.com/city/delhi/palam-records-10-year-high-april-temp-at-44-9c/articleshow/58288291.cms">Delhi Heat </a>) and wrote a small script to help you download a blob container with paths and sub-paths to your local machine while preserving the directory structure.

<script src="https://gist.github.com/brijrajsingh/35cd591c2ca90916b27742d52a3cf6ba.js"></script>

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>Installing Azure CLI 2.0 on Windows</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/installing-azure-cli-2-0-on-windows</link>
      <pubDate>Thu, 02 Mar 2017 04:53:25 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=125</guid>
      <description><![CDATA[Azure CLI 2.0 is now in GA !

This release of Azure CLI 2.0 is the first GA release. Azure CLI 2.0...]]></description>
      <content:encoded><![CDATA[Azure CLI 2.0 is now in GA !

This release of Azure CLI 2.0 is the first GA release. Azure CLI 2.0 release has command updates for
<ul>
 	<li>ACS (Azure Container services)</li>
 	<li>Compute</li>
 	<li>Networking</li>
 	<li>Storage</li>
</ul>
The Azure CLI can be used on Linux, MacOS and Windows. While the official documentation <a href="https://docs.microsoft.com/en-us/cli/azure/install-azure-cli">here</a> mentions all the steps required for installation in all supported operating systems, for windows people may face this issue when right after installation when you try to run an az command it says "az : The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program."

The issue is because the azure cli 2.0 is installed in location - C:\Users\&lt;username&gt;\AppData\Local\Programs\Python\Python35\Scripts\  and this path isn't added to the PATH variable. Well! until that happens here is the fix

First make sure you have python installed in your machine. If you don’t have the original CLI (or python) at all, you need that first. Download and install it from here: <a href="https://www.python.org/downloads/release/python-352/" rel="nofollow">https://www.python.org/downloads/release/python-352/</a>
<ul>
 	<li>Uninstall Azure CLI earlier versions with command - <strong>pip uninstall azure-cli</strong></li>
 	<li>Re-install Azure CLI 2.0 - pip install --user azure-cli</li>
 	<li>Add the path C:\Users\&lt;username&gt;\AppData\Local\Programs\Python\Python35\Scripts\ to PATH variable                                                                                                                                                                                                                                    <strong>setx PATH "%PATH%;C:\Users\&lt;username&gt;\AppData\Local\Programs\Python\Python35\Scripts\"</strong></li>
 	<li>check if the az command is working - az --help</li>
</ul>
Ideally the tool must have removed the older cli and made necessary changes in the PATHs. If it still doesn't work just drop me a comment or DM me @brijrajsingh]]></content:encoded>
    </item>
    <item>
      <title>Chat Bots — Designing Intents and Entities for your NLP Models</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/chat-bots%E2%80%8A-%E2%80%8Adesigning-intents-and-entities-for-your-nlp-models</link>
      <pubDate>Sun, 29 Jan 2017 15:52:48 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=115</guid>
      <description><![CDATA[The key for a bot to understand the humans is its ability to understand the intentions of humans and...]]></description>
      <content:encoded><![CDATA[The key for a bot to understand the humans is its ability to understand the intentions of humans and extraction of relevant information from that intention and of course relevant action against that information.
NLP (Natural language processing) is the science of extracting the intention of text and relevant information from text. The reason why you see so many bot platforms popping up like mushrooms is the advent of many NLP as a service platforms. Connecting to channels and developing bots was not a problem, the only missing link was a NLP platform which can scale and is easier to work with because you won’t like to learn NLP to make a silly Bot !
Some popular NLP as a service platforms are
1. LUIS.ai — By Microsoft (BTW I work for MS)
2. Wit.ai — By Facebook
3. Api.ai — By Google
4. Watson — By IBM

An ideal Bot platform offers
1. A NLP service — that you can train yourself.
2. SDK to support and handle conversations and their meta-data.
3. A Platform to host the bot code
4. A Platform to connect the Bot logic with multiple channels

While NLP as a service platforms helps developer in developing the NLP capabilities in as least amount of time as possible, at times the developers find themselves out of wits to understand the basic jargon of NLP and training their NLP as a service platform to the best of its ability.
Each NLP service has its own corpora of Language and domain that it bootstraps with, the corpora gives ability to models to understand language, grammar and terminologies of a certain domain and you must choose the most suitable domain when you are deploying the NLP service.
In this article, I would point out some best practices to train your NLP as a service models.

Intent — Simply put, intents are the intentions of the end-user, these intentions or intents are conveyed by the user to your bot. You can mainly put your intents in 2 categories
1. Casual Intents
2. Business Intents

<strong>1. Casual Intents —</strong> I also call them ‘Small talk’ Intents. These intents are the opener or closer of a conversation. The Greetings like “hi”, “hello”, “Hola”, “Ciao” or “bye” are the opening or closing statements in a conversation. These intents should direct your bot to respond with a small talk reply like “Hello what can I do for you today” or “Bye thanks for talking to me”.
The casual intents also comprise of Affirmative and Negative intents for utterances like “Ok”, “yes please”, “No not this one but the first one”, “Nope”.
Having General affirmative and negative intents help you handle all such intents and rather take them in context with the conversation bot just had with the client.
For ex — if the Bot just asked a question to end-user — you should expect either an affirmative or a negative intent and if its anything else Bot can ask the same question again. Your affirmative and negative intents should be able to handle most such utterances.

<strong>2. Business Intents — </strong>These are the intents that directly map to business of the bot. For eg — if it’s a Movie information Bot then an utterance from client like “When was Schindler’s list released?” is a business intent that intends to find out the Release year of Schindler’s list and you should label it accordingly with an understandable name like “GetReleaseYearByTile”.
Ideally you should think more about business intents because rest of small talk like saying hellos or affirming choices is taken care by general casual intents.

<strong>Entities</strong>
Business intents have metadata about the intent called “Entities”. Let’s take an example for an Intent “GetReleaseYearByTitle” — Sample Utterance “When was Schindler’s list released ?”
Here “Schindler’s list” is the title of the movie for which the user “intends” to find out the release year. The process of finding the entities can be understood at Part of sentence (POS) tagging. However as a user of NLP as a service you don’t need to get into the technicalities of knowing how POS tagging work but if you do want to here is a nice paper on it https://nlp.stanford.edu/software/tagger.shtml

Whenever user is thinking about designing their intents the entities must also be identified and labelled accordingly. Again, in entities you can have general entities labelled for use throughout the intents like metrics (including quantity, count, volume), Dates and most of NLP as service allows you to tag entities of such general types without any big hassle.

Some entities may be labelled as <strong>composite entities</strong> that is having more than one entities (component entity) inside it. As a science, it doesn’t matter if you don’t have this feature with your NLP service as long as you have simple entity labelling. One must define component entities before labelling composite entities.
For ex:- Find me a pair of <strong>Size 8 Red Adidas Sport shoes.</strong>
Intent — SearchProduct
Entities —
Composite Entity — ProductDetail
Component Entity —
<strong>Size</strong> — 8
<strong>Brand</strong> — Adidas
<strong>color</strong> — Red
<strong>Category</strong> — Sport Shoes

<strong>Training for Intents and Entities</strong>

Ideally one should train the NLP as a service with some real corpus, so if you have some chat messages with your clients over Facebook or skype or whatever channel you work with those messages/utterances can help training for intents, otherwise you can think of training for intent with your own “Manufactured” utterances for any intent. For ex — Training for intent of “GetReleaseYearByTitle” can have utterances like

“what was the release year of movie Pulp fiction”
“in which year Pulp fiction was released”
“when did pulp fiction came” — Bad English I know :)
“When was Pulp fiction released”

The training with Manufactured utterances helps in bootstrapping the system but one must re-train the NLP service when it starts getting some real utterances. The process of re-training the system should keep going on until the error rate reduces. The more variance of utterances you receive from real conversations the better you can train your NLP service for intents. Ideally Minimum 5 or optimally 10 utterances per intent are good enough to bootstrap the system.

The NLP services go through a routine of Supervised — Unsupervised — Supervised learning phases. Each supervised learning phase serves as a feedback loop through which the course correction is done for the NLP models.

<strong>User trains the system with utterances —</strong> this is supervised learning, then the NLP service learns on its own on the basis of supervised learning and about 10% of what the NLP Service has learnt during unsupervised learning is asked back from the NLP service to the user if what it has learnt has been correct or not, the user again trains or affirms/negates the unsupervised learning results of NLP service and re-trains the model. This process keeps going on and eventually user will find less and less questions by NLP service with more and more confidence towards the questions its asking the user to affirm.
Key Takeaways -
<ul>
 	<li>Identify Intents in advance — differentiate between general/casual and business intents.</li>
 	<li>Identify Entities — differentiate between metric related and noun related entities.</li>
 	<li>If possible train Intents with original corpus of conversations, otherwise train with manufactured utterances. Minimum 5 utterances, optimum 10 utterances.</li>
 	<li>Train, Converse, re-train — feedback loop must continue in order to train your NLP models.</li>
</ul>
<strong>Interesting reads -</strong>
<ul>
 	<li>https://www.nlpca.com/DCweb/settingintent.html</li>
 	<li>https://research.google.com/pubs/NaturalLanguageProcessing.html</li>
 	<li>https://nlp.stanford.edu/software/tagger.shtml</li>
 	<li>https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/45678.pdf</li>
</ul>
Similar article at Medium - https://medium.com/@brijrajsingh/chat-bots-designing-intents-and-entities-for-your-nlp-models-35c385b7730d#.dj39gyhtl]]></content:encoded>
    </item>
    <item>
      <title>Android Sample - Direct Line API - Microsoft Bot Framework</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/android-sample-direct-line-api-microsoft-bot-framework</link>
      <pubDate>Tue, 10 Jan 2017 05:40:21 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=105</guid>
      <description><![CDATA[Microsoft Bot framework allows you to integrate the bots in your custom applications be it web or...]]></description>
      <content:encoded><![CDATA[Microsoft <a href="https://dev.botframework.com/" target="_blank">Bot framework</a> allows you to integrate the bots in your custom applications be it web or Mobile. While for Web I was able to find some straight forward samples, unfortunately I couldn't find any sample for Integration of an android app. 
Direct Line API allows you to communicate with your bot using the REST API or WSS (Web socket) based calls.

The API documentation is available here <a href="https://docs.botframework.com/en-us/restapi/directline3/" target="_blank">https://docs.botframework.com/en-us/restapi/directline3/</a>

I wrote a very basic Android sample that shows a Chat like interface where you can send the messages to Bot and receive/render the response messages from Bot.
The Android code is available at my <a href="https://github.com/brijrajsingh/DirectLineAndroidSample" target="_blank">Github Repo</a>

The code is written with synchronous REST API (ain't that a bada** way to write a sample code :) ), I must change it to asynchronous and write a WSS based version of the same sometime soon.   ]]></content:encoded>
    </item>
    <item>
      <title>Open source on Azure - CSI Coimbatore Chapter, August 2016</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/open-source-on-azure-csi-coimbatore-chapter-august-2016</link>
      <pubDate>Wed, 10 Aug 2016 11:50:20 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=85</guid>
      <description><![CDATA[CSI (Computer society of India) is one of the oldest communities in India, I was privileged to be...]]></description>
      <content:encoded><![CDATA[CSI (Computer society of India) is one of the oldest communities in India, I was privileged to be part of <a target="_blank" href="https://www.csi-cbe.org">CSI Coimbatore's </a> August <a target="_blank" href="https://www.csi-cbe.org/downloads/opensource_on_azure.pdf">event</a>.

The community comprises of people from Academia, professionals from local tech industry, and students, the mix is quite even; you don't get to mingle so easily with so many PhDs in one room :), they even have their own office!

[caption id="attachment_95" align="aligncenter" width="300"]<a href="https://msdnshared.blob.core.windows.net/media/2016/08/2016-07-18-19.25.00.jpg"><img width="300" height="225" class="size-medium wp-image-95" alt="CSI Coimbatore Office" src="https://msdnshared.blob.core.windows.net/media/2016/08/2016-07-18-19.25.00-300x225.jpg" /></a> CSI Coimbatore Office[/caption]

I was giving a session about Azure on open source, as it turns out there were quite a good chunk of people who were OSS enthusiasts like me, the session was success and Q&amp;A session was pretty good as well.]]></content:encoded>
    </item>
    <item>
      <title>Introduction to Iron Python at - PyDelhi, August 2016</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/introduction-to-iron-python-at-pydelhi-august-2016</link>
      <pubDate>Wed, 10 Aug 2016 11:33:32 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=76</guid>
      <description><![CDATA[Iron Python is a fast Python implementation for the CLI. In our recent meetup of Pydelhi  I gave a...]]></description>
      <content:encoded><![CDATA[Iron Python is a fast Python implementation for the CLI. In our recent meetup of <a href="https://www.meetup.com/pydelhi/" target="_blank">Pydelhi </a> I gave a crisp talk over what is Iron Python and how one can use an Iron python code in .net and vice versa; in fact one can integrate with any one of the CLI language implementations like C#, VB, J# ... 

The code demos I used are in <a href="https://github.com/brijrajsingh/IronPythonTests" target="_blank">Github </a> 

in the repository there are 3 projects built using Iron Python, showcasing the interoperability using IronPython. 

1.netClassLib - A C# class library project, that is referenced by the TestIronPython project
2.TestIronPython - An Iron Python project consuming the class library produced by the netClassLib
3.PytoDotNet - A C# project that references the IronPython libs, loads a given Python program using Python expressions or Python files with classes, and executes the given expression or creates an object for the given class in python and calls methods on it.
]]></content:encoded>
    </item>
    <item>
      <title>ARM template for LAP (Linux + Apache + Php) and Neo4j Deployment</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/arm-template-for-lap-linux-apache-php-and-neo4j-deployment</link>
      <pubDate>Mon, 30 May 2016 09:31:52 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=65</guid>
      <description><![CDATA[Just finished writing my first ARM template that can deploy a set of VMs, where in one VM has an...]]></description>
      <content:encoded><![CDATA[Just finished writing my first ARM template that can deploy a set of VMs, where in one VM has an Apache and php installed with a sample website, and another VM with an installation of <a href="https://neo4j.com/" target="_blank">Neo4j </a>which is accessible only to the first VM on a private port. The Sample website in the Apache node can echo out a message if it could get connected successfully.

The repo is yet to be merged with the Azure repo, but for now one can find it <a href="https://github.com/brijrajsingh/azure-quickstart-templates/tree/master/101-lap-neo4j-ubuntu" target="_blank">here </a> <a href="https://github.com/brijrajsingh/azure-quickstart-templates/tree/master/101-lap-neo4j-ubuntu" target="_blank">https://github.com/brijrajsingh/azure-quickstart-templates/tree/master/101-lap-neo4j-ubuntu</a>.

Lets discuss the construct of our ARM template, This is the folder structure of our ARM template

[caption id="attachment_67" align="alignnone" width="467"]<a href="https://msdnshared.blob.core.windows.net/media/2016/05/177.png"><img class="size-full wp-image-67" src="https://msdnshared.blob.core.windows.net/media/2016/05/177.png" alt="ARM Template folder structure" width="467" height="379" /></a> ARM Template folder structure[/caption]

&nbsp;

azuredeploy.json, azuredeploy.parameters.json, metadata.json and README.md are mandatory file for any template to be a valid ARM template, you can find the rules in the github repo here <a href="https://github.com/Azure/azure-quickstart-templates#readmemd" target="_blank">https://github.com/Azure/azure-quickstart-templates#readmemd</a>.

The installation of Apache, PHP and code to check connectivity as well as installation of Neo4J is done by the custom script extensions.

install-lap.sh - is the script to
<ul>
	<li>Install Apache</li>
	<li>Install php5</li>
	<li>Install Composer - Globally</li>
	<li>Write a Info.php file - to emit phpinfo()</li>
	<li>Write a file neo4jtest.php - which echo out 'connected successfully' if it can connect to the Neo4J VM on a static IP - 10.0.0.10</li>
</ul>
install-neo4j.sh - is the script to
<ul>
	<li>Add Neo4J to the packages source list</li>
	<li>Update apt-get</li>
	<li>Install Java 8 (Silently) - Neo4J needs JDK or JRE - as in Neo4J(J is Java)</li>
	<li>Install Neo4j</li>
	<li>Enable remote connectivity to Neo4J and restart Neo4j</li>
</ul>
&nbsp;

&nbsp;

&nbsp;]]></content:encoded>
    </item>
    <item>
      <title>GIDS 2016 - Azure Data Lakes and Optimizing MEAN Stack</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/gids-2016-azure-data-lakes-and-optimizing-mean-stack</link>
      <pubDate>Mon, 02 May 2016 04:40:27 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=55</guid>
      <description><![CDATA[Last week had a realy good time at GIDS 2016 (Great Indian Developer Summit) at Bangalore, JN Tata...]]></description>
      <content:encoded><![CDATA[Last week had a realy good time at <a href="https://www.developermarch.com/developersummit/">GIDS 2016</a> (Great Indian Developer Summit) at Bangalore, JN Tata Auditorium. I was one of the speakers, but highlight of event was the presence of none other but <a href="https://en.wikipedia.org/wiki/Douglas_Crockford">Douglas crockford</a> himself.

I delivered 2 sessions, the first one was about "Performance optimization of MEAN Stack" , a very dear topic to me as I have spent a lot of time with NodeJS and MongoDB and actually had the issues first hand that I spoke about in my session, Mongo is not a secret sauce that may just help your application perform, its like any other DB when it experiences load and I had some really good tips to share about this. The solution I used is already at the <a href="https://github.com/brijrajsingh/MEAN-demo" target="_blank">Github</a>. Later I had some pretty hearty disucssion with some people from audience about sharding techniques of MongoDB and how to chose the right sharding keys.

The Next session was about "Leveraging Data Lake for your Big Data", Now Azure Data Lake is still in preview and till 2 weeks back I just knew about the product but didn't had access to it, So I shot an email to Saveen Reddy and Alan Tam and finally got access in just a couple of days. Data lake for me is a product that just demoratizes the big data market, it has all the components that make it good enough to work with hadoop, hdfs, sqoop, pig, hive kind of big data products yet it has the capabilities that a person who knows nothing about big data may yet dump in huge amounts of data to the data lake store and yet run easy to understand U-SQL queries. Most from my audience were just thrilled to see how easy could it be to write an agreegate query just like SQL and yet not need to learn what goes in the background and how much more easier is to control the degree of parallelism of the jobs that you are running. The sample I used is also on My <a href="https://github.com/brijrajsingh/SampleUSQL" target="_blank">Github Page</a>.

I am sure the ppt decks will be available in a few days at the GIDS 2016 website, until next year...]]></content:encoded>
    </item>
    <item>
      <title>Hygiener- IOT Hack</title>
      <link>https://docs.microsoft.com/archive/blogs/brijrajsingh/hygiener-iot-hack</link>
      <pubDate>Fri, 22 Apr 2016 05:56:28 GMT</pubDate>
      <dc:creator><![CDATA[brijraj singh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/brijrajsingh/?p=15</guid>
      <description><![CDATA[Last week had the chance to participate in a hack with fellow Microsoft'ians at an internal hack...]]></description>
      <content:encoded><![CDATA[Last week had the chance to participate in a hack with fellow Microsoft'ians at an internal hack event. Our team had four participants - Manish Sharma, Deepthi Anatharaman, Shubham Kumar and yours truly. The hack was around the concepts of  IOT, Azure IOT Hub, Azure Machine learning, Power BI and Azure Data factory.

Our topic was 'Hygiener' - A product that aims at finding the hygiene index of a workplace by placing sensors at Doors and on the Disinfectant bottles, Sensors send information about how many times the door was operated to get inside/outside the workplace/Washrooms/Hospital Wards, and how many times the dis-infectant bottle may have been used by finding if a person's hands were too near the bottle. The data is sent to Azure IOT Hub, where the stream analytics Jobs make sense of data and sends it over to SQL from where the Power BI Reporting could show views over this data. Additionally the raw data is dumped in Azure Data lake for further analytics. A Machine learning implementation on top of the same data can reveal interesting insights like predictive Hygiene Index, or if one can gather the relative attendance in the workplace, Machine learning models can also suggest how attendance will fares against the hygiene index of the workplace.

[caption id="attachment_25" align="alignnone" width="753"]<a href="https://msdnshared.blob.core.windows.net/media/2016/04/Hygiener_arch.png"><img class=" wp-image-25" src="https://msdnshared.blob.core.windows.net/media/2016/04/Hygiener_arch-1024x584.png" alt="Hygiener Architecture" width="753" height="429" /></a> Hygiener Architecture[/caption]

The product consists of an ultrasonic sensor based device and a door toggle device.

The ultrasonic sensor based device is placed on the disinfectant bottles and if someone goes quite near the bottle to get the disinfectant the ultrasonic sensor readings will tell us.

The door toggle device on the other hand provide the information about if the door was opened or closed, a couple of these readings will tell you that approximately how many people entered the area, it may not be too accurate as more than one people can enter a workplace while one person opens the door, but lets say its a corner case for us for now, later on one can use techs like Kinect based sensor to find out exact number of people entering or exiting.

Both sensors are attached to Raspberry Pi's running Raspbian, and registered with an Azure IOT hub.

<a href="https://msdnshared.blob.core.windows.net/media/2016/04/HCS04.jpg"><img class="alignnone  wp-image-35" src="https://msdnshared.blob.core.windows.net/media/2016/04/HCS04-1024x1024.jpg" alt="HCS04" width="511" height="511" /></a>

The Wire diagram for the connecting is as follows

[caption id="attachment_36" align="alignnone" width="797"]<a href="https://msdnshared.blob.core.windows.net/media/2016/04/hc-sr04-tut-2.png"><img class="size-full wp-image-36" src="https://msdnshared.blob.core.windows.net/media/2016/04/hc-sr04-tut-2.png" alt="HC-sr04 wiring with Raspberry PI" width="797" height="813" /></a> HC-sr04 wiring with Raspberry PI[/caption]

&nbsp;

while making toggle switch was easy, its wiring was as follows

[caption id="attachment_45" align="alignnone" width="716"]<a href="https://msdnshared.blob.core.windows.net/media/2016/04/rpi_toggleswitch.png"><img class=" wp-image-45" src="https://msdnshared.blob.core.windows.net/media/2016/04/rpi_toggleswitch-1024x794.png" alt="Raspberry Pi with toggle switch" width="716" height="555" /></a> Raspberry Pi with toggle switch[/caption]

&nbsp;

Code for both sensors to send data to Azure IOT hub is available at <a href="https://github.com/brijrajsingh/Hygiener-IOTHack" target="_blank">GitHub repository</a>.

Once the data is sent to Azure IOT Hub, for both sensors the data is sent to Azure blobs, as well 2 separate stream analytics for both sensors process this data, with cool down periods in mind (sensor may send multiple reading very quickly when someone is near it, or the door toggle happens too quickly). The processed data is -
<ul>
	<li>How many people used the disinfectant - as in how many people got near the bottle enough.</li>
	<li>How many times the door was operated</li>
</ul>
Both processed outputs are connected to PowerBI and a dashboard is prepared to see a nice chart (will share the snapshot soon..) is shown.

DevOPS for IOT - A question that kept bugging me all the time was this - "How do you push code to thousands of IOT devices ?" for now I needed something which is simple, push the code to git and pull it automagically at the raspberry pi for which I wrote a simple shell script that can pull the code by checking for the update at the git repo; essentially there is hardly a way by the git commands to find the update at server, I did some research at SO and nothing substantially came out, I did a simple thing thus, Pull the latest from the git repo to a temp folder, check the git branch -v at the temp and at the deployment folder, if there is a mismatch, you move temp to deployment, and clear the temp folder. Keep checking for the same at periodic interval by scheduling your DevOPS script in the cron scheduler.

The code, diagrams and scripts will be available at <a href="https://github.com/brijrajsingh/Hygiener-IOTHack" target="_blank">GitHub</a>.]]></content:encoded>
    </item>
  </channel>
</rss>