Quantcast
Channel: MSDN Blogs
Viewing all 12366 articles
Browse latest View live

Going deeper with Flat File schema authoring for BizTalk and Azure Logic Apps Flat File encode-decode action

$
0
0

So you’ve gone through the basics at the MSDN Flat File Wizard How-to , Walkthrough and Logic Apps Flat File Encode-Decode action, now what?

Imagine you have a flat file format with a header record followed with repeating line and sub-line. The field delimiter is the “|” and the record terminator is  CR/LF.

HEADER|H1|H2|H3|
 LINE|L1F1|L1F2|L1F3|
 SUBLINE|SL1F1|SL1F2|
 LINE|L2F1|L2F2|L2F3|
 SUBLINE|SL2F1|SL2F2|

You’ve generated a schema using the wizard on the header field and the first occurrence of line and sub-line (marking these as ‘repeat’ records). Your schema looks like this in Visual Studio:

Initial schema

For troubleshooting your new schema, get used to the FFAsm and FFDasm command line utilities from the BizTalk SDK pipeline tools. Don’t worry about the specific 2004 version mentioned in the MSDN article: the tools are present in all versions of BizTalk SDK, including the latest 2016 version. The first time you run the tools you may run into obscure type loading failure exceptions for classes in Microsoft.BizTalk.Pipeline and/or Microsoft.BizTalk.Streaming such as:

Error
 Source:         Flat file disassembler
 Message:        Field not found: 'Microsoft.BizTalk.Streaming.XmlBufferedReaderStream.m_outputStream'.
 HRESULT:        80131511

This is because the pipeline tools assume that both assemblies have been registered in the GAC (Global Assembly Cache). When deploying a BizTalk Server project these are automatically registered; however when you are developing for Azure Logic Apps you are unlikely to build and deploy such project, or you may be keeping your development machine separated from the BizTalk Server instance where you run the integration. You will need to use GacUtil.exe to register the assemblies. Start a command prompt with Administrator privileges then

C:WINDOWSsystem32>cd C:Program Files (x86)Microsoft BizTalk Server 2013 R2

C:Program Files (x86)Microsoft BizTalk Server 2013 R2>"C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX 4.6.1 Toolsx64gacutil.exe" -i Microsoft.BizTalk.Pipeline.dll
 Microsoft (R) .NET Global Assembly Cache Utility.  Version 4.0.30319.0
 Copyright (c) Microsoft Corporation.  All rights reserved.

Assembly successfully added to the cache

And

"C:Program Files (x86)Microsoft SDKsWindowsv10.0AbinNETFX 4.6.1 Toolsx64gacutil.exe" -i "C:Program Files (x86)Microsoft BizTalk Server 2013 R2Microsoft.BizTalk.Streaming.dll"

(Note that I am picking the GAC utility from the Microsoft SDK. Depending on your machine you might find it instead under an older Visual Studio program files folder, or .NET 1 folder in Windows’ system files.)

A normal run of the pipeline tool will look like this:

"C:Program Files (x86)Microsoft BizTalk Server 2013 R2SDKUtilitiesPipelineToolsFFDasm.exe" "C:[..your path..]FlatFileTest.txt" -bs "C:[..your path..]Schema.xsd" -v
 Creating objects.
 Creating message.
 Adding message to a pipeline.
 Executing pipeline.
 Getting processed message(s).
 Doing output for a message 1.

The tool will by default generate a GUID and write a file under that name in the current directory, e.g. {5c27b4f5-e0ed-447f-a73f-f92a789217bb}.xml

You can view either flat file or xml document file with notepad or any text editor.

However if you use the schema generated earlier and the input file with repeating line and sub-line you will get as output:

Creating objects.
Creating message.
Adding message to a pipeline.
Executing pipeline.
Getting processed message(s).
Doing output for a message 1.


Error
        Source:         Flat file disassembler
        Message:        The remaining stream has unrecognizable data.

        HRESULT:        c0c01464

If you inspect the generated xml document, only the first line and sub-line have been decoded. The second line is triggering the unrecognizable data error.

This is a mismatch between the schema and the record. The schema says to expect at the root a complex type sequence with one instance of ‘header’ then repeating ‘line’, then repeating ‘subline’. The parser finds for the sequence the header, a single line, a single sub-line and at this point has completed the sequence. Because the line and sub-line together are not expected to repeat the parsing stops there.

(In a Flat File Decode run in Logic App you will obtain the same XML output of:

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns="http://FlatFile.Schema">
  <HEADER xmlns="">
    <HEADER_Child1>H1</HEADER_Child1>
    <HEADER_Child2>H2</HEADER_Child2>
    <HEADER_Child3>H3</HEADER_Child3>
    <HEADER_Child4></HEADER_Child4>
  </HEADER>
  <LINE xmlns="">
    <LINE_Child1>L1F1</LINE_Child1>
    <LINE_Child2>L1F2</LINE_Child2>
    <LINE_Child3>L1F3</LINE_Child3>
    <LINE_Child4></LINE_Child4>
  </LINE>
  <SUBLINE xmlns="">
    <SUBLINE_Child1>SL1F1</SUBLINE_Child1>
    <SUBLINE_Child2>SL1F2</SUBLINE_Child2>
    <SUBLINE_Child3></SUBLINE_Child3>
  </SUBLINE>
</Root>

)

To declare the root as a sequence we need to declare line and sub-line as a group with order indicator sequence which repeats after the header type.

Updated Schema

Open the schema file in your favorite editor (I used Visual Studio’s XML editor), and after the xs:annotation for the whole schema, insert an element

  <xs:group name="LineAndSubline">
    <xs:sequence>

Then cut-and-paste the definitions for xs:element “LINE” and “SUBLINE”, removing the maxOccurs=”unbounded” attribute on each. Close the xs:sequence and xs:group elements.

Then got after the <xs:element name=”HEADER”> … </xs:element> and insert a repeating reference to the newly declared group as:

<xs:group maxOccurs="unbounded" ref="LineAndSubline"/>

This should be contained in the root element </xs:sequence>.

With this updated schema you should get the updated XML document output with repeating record group (you will find the example below in this post).

Group definition is a generic XML schema capability which can be authored from the initial output of the Flat File Wizard either by hand or any XML schema editor that you like best.

You may find reference XML schema documentation both on MSDN, e.g.

https://msdn.microsoft.com/en-us/library/ms256093(v=vs.110).aspx

and w3schools, e.g.

https://www.w3schools.com/xml/el_group.asp

The selection of the group ‘type’ (XSD indicator) between sequence, all or choice will dependent on your intent. For the example flat file above and expected XML document output we have a repeating sequence of line and sub-line in that specific order – hence the group with order indicator sequence. See more at:

http://www.w3schools.com/XML/schema_complex_indicators.asp

-*-

When you look at the Logic App run history, the text content will look like this (the following is not a screenshot so it can be copy-pasted for the next step):

 

When a file is created 1s

 Flat File Decoding 0s
Inputs See raw inputs
Inputs
{
  "content": "HEADER|H1|H2|H3|rnLINE|L1F1|L1F2|L1F3|rnSUBLINE|SL1F1|SL1F2|rnLINE|L2F1|L2F2|L2F3|rnSUBLINE|SL2F1|SL2F2|rn",
  "integrationAccount": {
    "schema": {
      "name": "Schema2"
    }
  }
}

Outputs See raw outputs
Outputs
{
  "body": {
    "$content-type": "application/xml;charset=utf-8",
    "$content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPFJvb3QgeG1sbnM9Imh0dHA6Ly9GbGF0RmlsZS5TY2hlbWEiPgogIDxIRUFERVIgeG1sbnM9IiI+
CiAgICA8SEVBREVSX0NoaWxkMT5IMTwvSEVBREVSX0NoaWxkMT4KICAgIDxIRUFERVJfQ2hpbGQyPkgyPC9IRUFERVJfQ2hpbGQyPgogICAgPEhFQURFUl9DaGlsZDM+
SDM8L0hFQURFUl9DaGlsZDM+CiAgICA8SEVBREVSX0NoaWxkND48L0hFQURFUl9DaGlsZDQ+CiAgPC9IRUFERVI+CiAgPExJTkUgeG1sbnM9IiI+CiAgICA8TElORV9D
aGlsZDE+TDFGMTwvTElORV9DaGlsZDE+CiAgICA8TElORV9DaGlsZDI+TDFGMjwvTElORV9DaGlsZDI+CiAgICA8TElORV9DaGlsZDM+TDFGMzwvTElORV9DaGlsZDM+
CiAgICA8TElORV9DaGlsZDQ+PC9MSU5FX0NoaWxkND4KICA8L0xJTkU+CiAgPFNVQkxJTkUgeG1sbnM9IiI+CiAgICA8U1VCTElORV9DaGlsZDE+U0wxRjE8L1NVQkxJ
TkVfQ2hpbGQxPgogICAgPFNVQkxJTkVfQ2hpbGQyPlNMMUYyPC9TVUJMSU5FX0NoaWxkMj4KICAgIDxTVUJMSU5FX0NoaWxkMz48L1NVQkxJTkVfQ2hpbGQzPgogIDwv
U1VCTElORT4KICA8TElORSB4bWxucz0iIj4KICAgIDxMSU5FX0NoaWxkMT5MMkYxPC9MSU5FX0NoaWxkMT4KICAgIDxMSU5FX0NoaWxkMj5MMkYyPC9MSU5FX0NoaWxk
Mj4KICAgIDxMSU5FX0NoaWxkMz5MMkYzPC9MSU5FX0NoaWxkMz4KICAgIDxMSU5FX0NoaWxkND48L0xJTkVfQ2hpbGQ0PgogIDwvTElORT4KICA8U1VCTElORSB4bWxu
cz0iIj4KICAgIDxTVUJMSU5FX0NoaWxkMT5TTDJGMTwvU1VCTElORV9DaGlsZDE+CiAgICA8U1VCTElORV9DaGlsZDI+U0wyRjI8L1NVQkxJTkVfQ2hpbGQyPgogICAg
PFNVQkxJTkVfQ2hpbGQzPjwvU1VCTElORV9DaGlsZDM+CiAgPC9TVUJMSU5FPgo8L1Jvb3Q+"
  }
}

 Create file 0s

Flat File decode run history

Notice the unreadable encoded text $content in the output? That’s Base64 encoded so no character interferes with the json syntax. To decode it, go to http://www.bing.com and search for base 64 decode. It will return a built-in Base64 encoder-decoder.

Bing Base 64 Decode utility

Paste the encoded string without the wrapping quotes (“”) and hit decode, you get:

<?xml version="1.0" encoding="utf-8"?>
<Root xmlns="http://FlatFile.Schema">
  <HEADER xmlns="">
    <HEADER_Child1>H1</HEADER_Child1>
    <HEADER_Child2>H2</HEADER_Child2>
    <HEADER_Child3>H3</HEADER_Child3>
    <HEADER_Child4></HEADER_Child4>
  </HEADER>
  <LINE xmlns="">
    <LINE_Child1>L1F1</LINE_Child1>
    <LINE_Child2>L1F2</LINE_Child2>
    <LINE_Child3>L1F3</LINE_Child3>
    <LINE_Child4></LINE_Child4>
  </LINE>
  <SUBLINE xmlns="">
    <SUBLINE_Child1>SL1F1</SUBLINE_Child1>
    <SUBLINE_Child2>SL1F2</SUBLINE_Child2>
    <SUBLINE_Child3></SUBLINE_Child3>
  </SUBLINE>
  <LINE xmlns="">
    <LINE_Child1>L2F1</LINE_Child1>
    <LINE_Child2>L2F2</LINE_Child2>
    <LINE_Child3>L2F3</LINE_Child3>
    <LINE_Child4></LINE_Child4>
  </LINE>
  <SUBLINE xmlns="">
    <SUBLINE_Child1>SL2F1</SUBLINE_Child1>
    <SUBLINE_Child2>SL2F2</SUBLINE_Child2>
    <SUBLINE_Child3></SUBLINE_Child3>
  </SUBLINE>
</Root>

-*-
Beware copy-pasting flat files’ content to Logic App editor. You may loose some characters like the CR/LF and run into errors such as:

Decoding failure on copy-paste

For testing in a Logic App I recommend a simple setup with OneDrive file input-output. This avoid the complications some engineers have with http post tool, getting the right content encoding, etc.
Simple Logic App with Flat File decode

The trigger will be poll-based with a 3 minutes default but you can trigger it from the Azure portal on-demand each time you want to test a file or schema.


InfoPath – State Service Application is required

$
0
0

When using InfoPath in your SharePoint 2013 environment, if you don’t have the State Service configured in the farm you’ll see the error below, “The form cannot be rendered.  This may be due to a misconfiguration of the Microsoft SharePoint Server State Service”.

 

infopathstateserviceerror

 

Resolution:

  1.  See if the state service has been configured by running this PowerShell command:

Get-SPStateServiceApplication

If the State Service is configured you’ll receive the following information back from SharePoint.

stateserviceconfigured

2.  If the State Service has not been configured, execute the following PowerShell command to create and start it.

#Provision the state service
New-SPStateServiceApplication -Name “State Service Application”
Get-SPStateServiceApplication | New-SPStateServiceApplicationProxy -DefaultProxyGroup
Get-SPStateServiceApplication | New-SPStateServiceDatabase -Name “State_Service_DB”
Get-spdatabase | Where-Object {$_.type -eq “Microsoft.Office.Server.Administration.StateDatabase”} | initialize-spstateservicedatabase

Resources:   InfoPath Forms Services not working due to invalid State Service configuration – Event 7898 (SharePoint Server 2010)

[Sample Of Feb. 15] How to using MongoDB with ASP.NET Core

$
0
0
image
Feb.
15
image
image

Sample : https://code.msdn.microsoft.com/How-to-using-MongoDB-with-74f3e1cf

This sample demonstrate how to using MongoDB with ASP.NET Core.

image

You can find more code samples that demonstrate the most typical programming scenarios by using Microsoft All-In-One Code Framework Sample Browser or Sample Browser Visual Studio extension. They give you the flexibility to search samples, download samples on demand, manage the downloaded samples in a centralized place, and automatically be notified about sample updates. If it is the first time that you hear about Microsoft All-In-One Code Framework, please watch the introduction video on Microsoft Showcase, or read the introduction on our homepage http://1code.codeplex.com/.

Power BI Reports in SQL Server Reporting Services 続報

$
0
0

Microsoft Japan Data Platform Tech Sales Team 伊藤

2016年10月に 「SQL Server Reporting Services 内での Power BI レポート のテクニカル プレビュー」の発表があり、このブログでも紹介しました。今回はそのアップデート情報をお届けします。

Power BI Reports in SQL Server Reporting Services を試す

前回のお知らせでは Azure にて提供される Virtual Machine でしかこの機能を試すことができませんでしたが、現在はこちらのダウンロード サイトにて SQL Server Reporting Services (SSRS) の Technical Preview を入手し、Windows 環境にインストールしていただくことが可能になっています。つまり、社内環境で評価できます。

Power BI reports in SQL Server Reporting Services – Technical Preview

こちらにはプレビュー バージョンの Power BI Desktop と SSRSが含まれており、次の機能を試すことができます。

  • SQL Server Analysis Services (SSAS) の表形式および多次元モデルに Live 接続
  • Power BI Desktop で SSAS に Live 接続するインタラクティブなレポートを作成し、Technical Preview のレポート サーバーに保存
    image
  • 保存したレポートをブラウザーで閲覧・操作
    image

現時点では Power BI の以下の機能はサポートしていません。

  • カスタム ビジュアル
  • R ビジュアル

 

このメディアには SSRS のリポジトリ用のデータベースや、Power BI レポートの分析対象となる SSAS は含まれていないので、別途ご用意ください。データベースは SQL Server 2008 以降、SSAS は 2012 SP1 CU4 以降が必要です。

セットアップが面倒な方は、引き続き Azure Marketplace の更新された Virtual Machine をご利用ください。

 

Power BI Reports in SQL Server Reporting Services の今後の予定

※ このセクションは 2016年12月に公開された英語のブログ記事 からの抜粋です。

※ 今後の予定については未定であり、搭載される機能やリリース時期、提供形態等は変更される可能性があります。

SSRS に追加予定の Power BI の機能はどれですか?

  • カスタム ビジュアル
  • (Analysis Services 以外の) 追加のデータ接続、キャッシュ データ、データ更新のスケジュール
  • Power BI モバイル アプリ (SSRS に保存された Power BI レポートの閲覧)

現時点ではその他の Power BI の機能 (ダッシュボード、Q&A、クイックインサイトなど) を追加する予定はありません。

 

製品版はどのようにリリースされますか?

次の SQL Server のリリースで提供する予定です。SSRS 2016 の更新である Service Pack (SP) や Cumulative Update (CU) などの形では提供しません。

 

製品版はいつ入手できますか?

2017 年の中頃を目標としています。

 

なお、Power BI Desktop で作成したレポートを SSRS に保存するだけでなく、SSRS の Web ポータルから直接 Power BI レポートを Power BI Desktop で開いて編集することができます。また SSRS の新機能として、Power BI レポート、モバイル レポート、ページ分割されたレポートのすべてにおいて、コメント機能が追加されていることが確認できます。こちらもご要望の多い機能かと思いますので、ぜひお試しください。

“Unknown network error” on people picker in InfoPath form

$
0
0

You might have issue with people picker in InfoPath form on Sharepoint online site. I would like share an update with you on this issue.

Symptom: You get error “Unknown network error” while resolving the user in people picker control in InfoPath filler form at your SharePoint online site.

Note: The people picker is working as expected in browser based form.

The issue is reported with multiple SharePoint online tenant and reproducible in house.

Our Escalation engineers from Sharepoint Online side are working with Product Group to fix the issue ASAP.

It seems the request makes into SharePoint, SharePoint returns a 200 response (meaning everything is good) then on the way back to the client something blocks the request or causes it to fail.

Please wait for the next update…..

Power BI and the World Bank API

$
0
0

As promised, in this blog, I will create a Power BI visualization based on Hans Rosling’s Ted Talk seen here. While you don’t need any Power BI experience to follow along and recreate this, if you want a basic tutorial I would suggest you watch these short videos here first. It’s not that anything I do is difficult, but the nature of the source data and my desire to add additional data sources over time, led me to the decision to spend a little extra time “modeling”, or organizing and relating my data to provide a foundation for current AND future analysis.

My goals in this demo are simple:

  • Mashup 3 different time-series indicators from the World Bank; Total Population, Fertility Rate, and Life Expectancy At Birth
  • Create a visualization that shows how the third world has changed over the last 50 years, in ways that you may not have expected

The World Bank API

The World Bank has a pretty good open data site at data.worldbank.org.   There are some great datasets and analysis based on global development data.  However, I must admit, when I was searching for specific indicators and how I would access them programmatically, it was a little frustrating to navigate.   To save you some of that frustration, I’ve provided the URLs I use below.

All Countries, By Year 1960-2014

Population, Total:  http://api.worldbank.org/countries/all/indicators/SP.POP.TOTL/?format=json&date=1960:2014&per_page=20000

Life Expectancy At Birth:  http://api.worldbank.org/countries/all/indicators/SP.DYN.LE00.IN/?format=json&date=1960:2014&per_page=20000

Fertility Rate, Births Per Woman:  http://api.worldbank.org/countries/all/indicators/SP.DYN.TFRT.IN/?format=json&date=1960:2014&per_page=20000

World Bank Country Classifications:  This will allow me to slice by various classifications:  http://api.worldbank.org/countries/?format=json&per_page=400

Step 1:  Getting the Data Into Power BI

People often think of Power BI as a data visualization tool.  But it also has really powerful features for getting data, cleansing and transforming data,  and mashing up data from multiple sources.  Our first step is to get data into Power BI from a REST API.  Here we will use 3 separate API calls to get Population, Fertility, and Life Expectancy data from 1960 through 2014.  In this case, the data is returned in JSON format, which we will parse using the query editor.   As you follow the steps below, note the Applied Steps section on the right.  Power BI is keeping track of each transformation/change as you make it, so the next time you refresh this data it will reapply these changes.

  1. On the top ribbon, navigate to Get Data=>Web

getdatafromweb

2. In the From Web dialog box, paste in the url http://api.worldbank.org/countries/all/indicators/SP.POP.TOTL/?format=json&date=1960:2014&per_page=20000

web-url

3. Click On List

 selectlistfromjson

4. Click on To Table

jsonrecordstotable

5. Expand Arrows, uncheck “use original column name”, click OK

expandcolumns

6. Expand the country column, uncheck Use original column name as prefix

 expandcountry

7. Rename columns

id = Country ID
value.1 = Country
value = Population

renamecountrycolumn

8. Select your Population column, select Data Type=>Whole Number

populationdatatype

9.  Select the Date column, select Data Type=>Date

10. Right click on the decimal field and remove it.  Also remove the indicator ID field

11. Rename the query to Population, and click Close & Apply

renametopopulation

12. Repeat this process for http://api.worldbank.org/countries/all/indicators/SP.DYN.LE00.IN/?format=json&date=1960:2014&per_page=20000

a)  When you rename the columns, rename them as follows

id= Country Code

value.1 = Country
value = Life Expectancy

b) Change the Life Expectancy Data Type to Decimal

c) Name the query Life Expectancy and click Close and Apply

12. Repeat this process for  http://api.worldbank.org/countries/all/indicators/SP.DYN.TFRT.IN/?format=json&date=1960:2014&per_page=20000

a)  When you rename the columns, rename them as follows

id = Country Code
value.1 = Country
value = Fertility Rate

b) Change the Fertility Rate Data Type to Decimal

c) Name the query Fertility Rate and click Close and Apply

Step 2:  Merge the Data Sets

We now have three tables; population, life expectancy, and fertility rate.  But logically, each table represents a single “attribute” of a country for a given year, so I thought it would make sense to merge them into a single table.  This will make it easier for end users to understand.

  1. On the top ribbon select Edit Queries
  2. On the top ribbon of the Edit Query screen select Merge Queries=>Merge Queries As New

mergequeriesasnew

3. Each of these tables has Country Code, Country Name, and date in common.  Merge them into one by selecting the Population table from the first dropdown and the Fertility Rate on the second drop down.  Then in each table, while holding Ctrl down, select Country Code, Country Name, and date in each table.  You should see that it has matched 14520 out of 14520 records.

mergepopandle

You can see 14520 out of 14520 fields are matched.

4. Click OK

5. The Fertility Rate table can now be expanded out.  Click on the arrows by New Column, uncheck use original column name as prefix and select the Fertility Rate column

mergeandselectfertilityrate

6. Click on the Merge1 Query on the left Query Pane. Select Merge Queries again.  This time, instead of selecting Merge Queries as New, Select Merge Queries

mergequeries-1png

7. The first table will already be set to Merge1.  Choose the Life Expectancy table for the second drop down. On each table, select County Code, Country Name, and date.

merge1andfertility

8. Click OK and Expand the new column like you did in step 5 of this section.  Uncheck use original column name as prefix and select Life Expectancy

9. Name the new merged table World Development Indicators

nameasworlddevelopmentindicators

10. Select Close and Apply

11.  Since we’ve merged the information from the three other tables into one table, we can hide those three tables.  In the field pane, select Fertility, right click and select Hide.  Repeat for Population and Life Expectancy.

hidetables

We now can see one table, World Development Indicators, containing all the information we need.

Step 3: Create Scatter Plot Visualization

  1. Select the Scatter Chart from the Visualizations Pane

selectscatterplot

2. In the visualizations pane details, drag Country Name to the Legend, Fertility Rate to the X-Axis, Life Expectancy to the Y-Axis, and date to the Play Axis.

addfieldstoscatterchart

3. Press the Play button to watch the neat animation.

Step 4: Add World Bank Classifications table to allow grouping and filtering by country characteristics

The world bank categorizes countries based on region, lending type, and income level.  We want to expand our visualization to let users filter by these additional attributes.  While we could use merge the data set like we did in step 2, I wanted to keep the classification table as a completely separate table…for those of your familiar with dimensional modeling, it is essentially serving as a “dimension” table related to our indicator “fact” table.  For those of you not familiar with dimensional modeling, forget I said that.

1. In the Power BI Ribbon, click Get Data=>Web and paste this URL:   http://api.worldbank.org/countries/?format=json&per_page=400

2. Follow the steps listed in Step 1.   (Click on List, To Table, Expand the columns, uncheck Use original column name as prefix)

classificationexpandcolumns

3. Expand region, only select value

expandregion

4. Right click on the expanded column and rename column to Region

renametoregion

5. Expand adminregion, select value, rename column to Admin Region

6. Expand incomeLevel, select value, rename column to Income Level

7. Expand lendingType, select value, rename column to Lending Type

8. Rename query to Country Classification, click Close and Apply

Step 5: Create a relationship between the tables

One the most powerful features of Power BI is the ability to relate two or more tables together.  Many of you may have done this in Access, or perhaps you are using V-lookups in excel to do something similar.  Stop.  Use Power BI instead. Seriously.

1. On the left hand side, click on the Relationships icon.  You’ll see all the tables we’ve created in this exercise, but the ones we’ve hidden will be grayed out.

relationships

2. The two tables are related by the Country Code column in the World Development Indicators table and the iso2Code in the Country Classification table.  Drag Country Code from the World Development Indicators table to the iso2Code in the Country Classification table.  This allows us to “lookup” additional attributes of a country, like region, income level, and lending type.

 createrelationship

Step 6: Add Classification Filters to your page

1. On the left pane, click back to your visualization.

2. Click anywhere on your page (except on the existing scatter chart visualization), and select Region from the Country Classification table in the fields pane

3. Select the Slicer visualization

classificationfilters

4. On the slicer you just created, click on List, and select Dropdown.  Resize the filter so it takes up less space.

changetodropdown

5.  Repeat steps 2,3, and 4 but this time select the Income Level column

6. Repeat steps 2, 3, and 4 but this time select the Lending Type column

7.  Arrange the filters and resize the scatter chart to taste.

arrangefilters

So that’s it.  You can now impress your friends and family with your Power BI Story Telling abilities.   There are many more World Development Indicators you can get from the World Bank open data site using the same process I showed in this blog.  You can get a list of them here.   Also, just for fun, I made a little Power BI visualization that lets you choose indicators on the left and see the REST APIs on the right.  Enjoy.

Is your Exchange Unified Messaging protected against telecommunication fraud?

$
0
0

What is Telecommunications Fraud?
Telecommunications fraud is the process of exploiting a misconfiguration in telecommunications systems to gain access to your telecommunication platform to make calls on your behalf.

Few things that are really bad about this type of exploit:

  • The exploiter don’t even need an internet to perform such hack.
  • It can be very costly.
  • it can go unnoticed for a long time, or till you get a surprise bill.
  • The exploiter caller ID will be your company number, might pretend to be your company representative.
  • it can even be so bad that they can sell calling cards to use your system for long distance calls.
  • other scenarios are left for imagination…

While Lync/SfB and Exchange UM doesn’t have a DISA feature (direct inward system access ) the below mix of configuration can cause a serious leak in the system to allow telecom fraud.

Lets first have a look on how that could be possible:

When you configure Lync/SfB integration with Exchange UM via the OCSUtil ; two contacts are going to be created in Lync/SfB and assigned automatic Dial Plan and Voice Policy.

  1. The Auto Attendant contact
  2. The Subscriber access contact

Also you in exchange UM an important component will be populated by running the exchUCUtil script which is the “virtual” 1:1 IP gateway.

Now lets go to the configuration:

I’ve seen a lot of companies now avoid the short extension assignment in Lync/SfB and just use E164 format with 10 digit North America DID for the users’ line URI.

so when they start the integration with Exchange UM they will need to assign Exchange UM extensions for the users in Exchange, and to simplify things, they will use that 10 digit DID as an “Extension”.

So far that is not going to cause an issue until they enable “Allow calls to Extension” in the UM dial plan, UM mailbox Policy or the Auto attendant.

Configuration of my lab was the following:

  • 7 and 10 digits North American plan is configured in SfB/Lync at the Default,Pool or Site Dial plan to allow E.164 normalization.; Also if you dont have Default,Pool or Site dial plan normalization defined and created Translation rules on Global trunk normalization to capture 10 digits coming from the Trunk and normalize to E.164 that will also work.
  • SfB Users have 10 digits DID normalized in E.164;  e.g: (lineURI is tel:+1(NPA)XXX-XXXX)
  • Exchange UM dial plan is 10 digits extension and “allow calls to extensions” is enabled on Dial Plan , Auto Attendant and UM mailbox Policy
  • 10-digit policy calls-to-extencalls-to-exten-aa

With this configuration the following scenarios was dialled:

  1. Scenario 1: Caller dials the AA number and as it prompts to dial an extension, I dialled any 10 Digits number (eg.my mobile) and the call was made outside of my SfB server. so for that to happen:
    • A- The Extensions expected are 10 digits based on the UM dialplan
    • B- ExUM send that through the 1:1 IP gateway.
    • C- The 7 or 10 digit Extension will get Normalized to E.164 on the SfB Global, Site or Pool Dialplan which is the default/automatic dialplan for the UMAA object OR on the Trunk Global number translation.
    • D- The UMAA contact object that was created by the OCSUtil has the default Global or Site voice policy that has a route to terminate E164 digits on the PSTN.
  2. Scenario 2: Caller dials the SA number and navigate till it prompts to dial an extension, I dialled any 10 Digits number (eg.my mobile) and the call was made outside of my SfB server.
  • A- The Extensions expected are 10 digits based on the UM dialplan
  • B- ExUM send that through the 1:1 IP gateway.
  • C- The 7 or 10 digit Extension will get Normalized to E.164 on the SfB Global, Site or Pool Dialplan which is the default/automatic dialplan for the UMSA object OR on the Trunk Global number translation.
  • D- The UMSA contact object that was created by the OCSUtil has the default Global or Site voice policy that has a route to terminate E164 digits on the PSTN.

ps

  • 3.   Scenario 3: Caller dials any SfB DID number and timeout to voicemail the caller press **## then it prompts to dial an extension, I dialled any 10 Digits number (eg.my mobile) and again the call was made outside of my SfB server.
    • A- The Extensions expected are 10 digits based on the UM dialplan
    • B- ExUM send that through the 1:1 IP gateway.
    • C- The 7 or 10 digit Extension will get Normalized to E.164 on the SfB Global, Site or Pool Dialplan which is the default/automatic dialplan for the Referred User (In that case the SfB Dialed/Voicemail User ).
    • D- The Referred User has the Global, Site or User voice policy that has a route to terminate E164 digits on the PSTN.

 

Below is a flowchart of my lab findings that I logged and how the call could be routed outside of your system from an anonymous caller.

 

    exum-routing2

     

     

    That was the problem now for the solution:

    For the First and Second Scenario where the Caller Dials the AA and SA you need the Allow Extensions dialling to be enabled in both the UMdial Plan and Auto Attendant, the reason is that you may have a PBX that is behind the SfB server that the legitimate caller might need to call.

    So the solution is to assign both the AA and SA objects a Voice Policy and a Route that ONLY routes to PBXes without PSTN access (if your PBX are 7 or 10 digits) ; if your PBX extensions is less than the UMDial plan, it will not route anyway. Also you can remove the Associated Trunk altogether from that Route so if the number isnt found in SfB Server it doesn’t leave to any where.

    ps2

     

    But for the Third Scenario where the caller dials the voicemail and then press **## you wouldn’t be able to change the voice policy as the Referrer is the SfB user , so in that Case you will have to turn off the “dial by extension” from the UM Mailbox Policy. But at the same time you can enable the caller to dial (0) at the voicemail prompt to transfer only to the operator.

    For a caller to be transferred to an operator, the caller must press 0 on their telephone keypad while the user’s custom voice mail greeting is being played.
    If the user has not created a customized voice mail greeting, the default system greeting will be used and the system will add the operator prompt automatically. For example, “Please leave a message for Tony Smith. To speak to an operator, press 0.” If the caller does not press 0 during the voice mail greeting, they can leave a voice message for the user.
    If you have not configured a personal operator extension for a user, or if you have not correctly configured the dialing rules on the UM dial plan that is associated with the UM-enabled user, the Unified Messaging server will use the operator extension number that is configured for the dial plan. The default digit to reach the dial plan operator is 0.
    For that 0 Operator feature to work you have to configure dialing rule groups for the (UM) dial plan in the Exchange Server.  After you create a dialing rule group, you must add a dialing group entry. After you create the dialing rule group and configure the dialing rule entries, you must add the dialing rule group to the dialing restrictions on the UM mailbox policy associated with the UM dial plan. When you add the dialing rule group to the dialing restrictions on the UM mailbox policy, the settings you use will apply to all UM-enabled users associated with the UM mailbox policy.
    Creating those Dialling groups and rules will allow the following features for the Users:
    1- The ability for callers to press 0 at the voicemail to transfer to an operator
    2- Ability to play on Phone for the applied Users from the OWA voicemail settings
    3- Ability to use follow me settings from the OWA voicemail.
     you’ll probably find it unnecessary to build patterns in the dialing rules or dialing rule groups in Exchange Unified Messaging. SfB Server voice policy will perform call routing and number translation for the corresponding users when the calls are made by Exchange Unified Messaging on behalf of users , so you can use the wildcard * for the Mask number and dialled number to allow any digits from the user OWA voicemail features like play on phone and/or follow me.

    2017 年も DevWire をよろしくお願いします! – DevWire (2017/1/30)

    $
    0
    0
    2017 年 1 月号
    TwitterTwitter でつぶやく  FacebookFacebook でシェアする  LinkedInLinkedIn でシェアする
    Index
    Hot Topics
    今年も見せます! マイクロソフトの流通向けソリューション
    Windows 10 Enterprise E3 ライセンスの Qualifying OS に
    Windows 10 IoT Enterprise が追加!
    組込み製品に付加価値を! 新ビジネスをお手伝いします!
    Azure IoT Gateway SDK を使ってみる
    DevWire のバックナンバーをご紹介
    正規販売代理店情報
    セミナー・トレーニング情報
    Column
    IoT に適したプロトコルの要件を探る (その 5)
    MQ (Message Queue) と MQTT 今岡工学事務所 代表 今岡 通博
    ほっとひと息
    編集後記「お正月は・・・」
    DevWire 編集部 加藤 大輔
    Hot Topics
    今年も見せます! マイクロソフトの流通向けソリューション
    寒さが厳しくなりましたが、いかがお過ごしでしょうか? 春が待ちきれませんが、春の到来を感じさせるイベントと言えばリテールテック Japan 社外サイトへ です。流通情報システムの総合展ですが、昨年のマイクロソフトは、「モノとクラウドの融合で実現する IoT 時代のおもてなしソリューション」をテーマにパートナー企業と展示を行い多くの方にマイクロソフト ブースへお越しいただきました。あまりにたくさんの方にお越しいただいたため、ブースに入れない時間帯もあり、ご迷惑をおかけしたお客様もいらっしゃいました。今年はその教訓を活かして、ブースが少し大きくなります。

    今年のテーマは「流通業のデジタル トランスフォーメーション」。デジタルでどう流通業が変わるのか。今年は AI やコグニティブといった未来を感じさせるテクノロジーを使ったソリューションもご紹介します。今後の動向が知りたい方はマイクロソフト ブースにお越しください!
    毎年、リテールテックと併設で行われる「スマーター リテイリング フォーラム」も同テーマでさまざまな事例や最新情報をご紹介いたします。登録サイトが公開されたら、リテールテック ホームページにバナーが掲載されますので、ぜひ、チェックしてみてくださいね! リテールテックに関しては来月号でもっと詳細にご紹介しますので、お楽しみに!

    昨年のリテールテック マイクロソフト ブース
    昨年のリテールテック マイクロソフト ブース

    Windows 10 Enterprise E3 ライセンスの Qualifying OS に Windows 10 IoT Enterprise が追加!
    この特典変更に伴い、これまで VDA ライセンスの購入が必要だった Windows 10 IoT Enterprise OS をご利用のお客様も Windows 10 Enterprise E3 ライセンスの購入で各種特典をご利用いただくことができます。

    「え!? そもそも Windows 10 Enterprise E3 って何?」という声が聞こえてきそうですが、これまでは、ソフトウェア アシュアランスという呼び名でボリューム ライセンスとして企業のお客様にご購入いただいておりました。マイクロソフトの提供する製品、テクノロジー、サービス、使用権などをセットで特典として提供しており、常に最新バージョンを使えるなどのメリットがありました。Windows 10 Enterprise E3 は、7 月に開催したマイクロソフトのパートナー向けカンファレンスである WPC (Worldwide Partner Conference) で発表されており、Windows 10 Enterprise を 1 ユーザーあたり月額 7 ドルのサブスクリプションで購入することができ、その中にはソフトウェア アシュアランス時代と同様、VDA ライセンスを含むさまざまな管理ツールや機能が特典として含まれています。

    エンドユーザー企業様向けのライセンスにはなりますが、Windows 10 IoT Enterprise 搭載の組込み機器を購入してお使いの企業がこの E3 ライセンスをうまく活用していただくことで、お得になる場合がありますので、ぜひ、チェックしてみてください。

    組込み製品に付加価値を! 新ビジネスをお手伝いします!
    ISV マッチング イベント 2017 冬
    組込み機器に最適なソフトウェアを提供する ISV をマイクロソフトが厳選してご紹介するセミナーと商談会を実施します。注目のソフトを貴社の製品に組み合わせることで、製品単体売りからソリューション売りへの変革が実現できます。今回は、ISV 6 社のソリューションを紹介します。 ぜひご参加ください。

    日時: 2017 年 2 月 24 日 (金) 10:30 – 17:30 (受付 10:00 -)
    場所: 日本マイクロソフト 品川本社 31 階 セミナー ルーム A
    対象: ハードウェア製造企業の BDM、開発者、エンジニア
    費用: 無料

    ISV 参加企業: アジュールパワー株式会社 様 社外サイトへ 株式会社 アロバ 様 社外サイトへ
    株式会社 Empress Software Japan 様 社外サイトへ 株式会社 セラク 様 社外サイトへ
    株式会社 タイプ・アール 様 社外サイトへ 株式会社 フューチャースタンダード 様 社外サイトへ

    詳細情報や参加登録は、お申し込みサイトをご参照ください。

    Azure IoT Gateway SDK を使ってみる
    2 年振りに DevWire に登場!! Windows Embedded MVP “株式会社デバイスドライバーズ 代表取締役社長 日高亜友さん” から Azure IoT Gateway SDK について執筆していただきました。「前編」「後編」、2 号にわたってお送りします。
    昨年の 11 月 GitHub で Microsoft Azure IoT Gateway SDK のリリース版 社外サイトへ が公開されました。Microsoft Azure Blog でのアナウンスはこちら。今回はこの IoT 開発において重要な役割を持つ SDK を実際に使うためのヒントを 2 回にわけて紹介します。 公開の直前に Microsoft MVP Global Summit に参加して、IoT Gateway SDK の興味深い Hands On Training を受講してきました。テキストは英語ですが、GitHub で公開されていたので紹介しようと考えていたところ、SDK の正式リリースにあわせて Hands On Training とほぼ同様のコンテンツが日本語で公開されていたので紹介します。

    (概要)
    Azure IoT Gateway SDK は、センサーやアクチュエータなどのデバイスを Microsoft Azure に接続して双方向通信を実現する IoT Gateway を容易に開発することができるソフトウェア キットで、2016 年 7 月からベータ版が公開されていました。Gateway は IoT を構成するデバイスとクラウドの接続点です。多くの機能と性能、セキュリティが要求される IoT の要とも言えるでしょう。

    私は約 3 年前、Azure IoT 機能の先行実装版とも言える Azure ISS (Intelligent Systems Service) Limited Public Preview の SDK を Windows 8 と Ubuntu Linux 搭載の BeagleBone Black で評価して、どちらでも容易に Azure IoT Gateway を実装できる好感触を得ていたので、IoT Gateway SDK の正式リリースを心待ちしていました。

    Azure IoT Gateway SDK はソース コードで提供されるので、あらゆる環境に移植可能です。現在動作検証されている OS 環境は次のとおりで、基本的にはハードウェアに依存しません。

    ・Ubuntu 14.04
    ・Ubuntu 15.10
    ・Yocto Linux 3.0 on Intel Edison
    ・Windows 10
    ・Wind River 7.0

    SDK に含まれるサンプル プログラムは次のとおりです。

    ・ble  Bluetooth low energy (BLE) デバイスを Gateway に接続します。
    ・hello_world  ”hello world” メッセージを定期的に送信します。
    ・identitymap  MAC アドレスを IoT Hub デバイスの ID と Key にマップします。
    ・iothub  IoT Hub に対してメッセージを送受信します。
    ・logger  受信したメッセージをファイルにログ出力します。
    ・simulated_device  Gateway に接続した BLE デバイスをシミュレーションします。
    ・azure_functions  Azure Function にメッセージを送信します。

    今回は最新の 2016-12-16 版を、Raspberry Pi 3 / Raspbian GNU/Linux 8 (Debian 8.0 相当) でコンパイルして TI 製センサー タグと接続して ble サンプルで評価したところ、データを Azure IoT Hub と送受信できることを確認しました。Raspberry Pi 3 / Raspbian は、後述のドキュメントで動作手順が載っているため、実質的に動作対象と考えてよいでしょう。

    (ドキュメント)
    参考にしたドキュメントを次に示します。これらドキュメントのほとんどが IoT Gateway SDK のベータ版用の古い内容であり、なおかつ最新の Raspbian 8.0 には対応していないため、手順とおりに進めると不具合が発生します。後で手順と注意点を示します。

    1. MVP Summit 2016 IoT Workshop 社外サイトへ
    2. How To Send Device-to-Cloud Messages with the Azure IoT Gateway SDK 社外サイトへ
    3. Azure IoT Gateway SDK – Linux を使用した物理デバイスで D2C メッセージを送信する
    (2. とほぼ同じ内容の日本語版です)

    また特に IoT Hub のページ 社外サイトへ の前半、「作業の開始」節は、コントローラーとして Intel Edison、PC Linux、Windows のアーキテクチャが混在して書かれているため、非常に分かり難くなっています。この節はいずれ修正されることが予想されるので、現時点ではすべて参照しない方がよいでしょう。

    (機器と環境)
    ・Gateway コントローラー ハードウェア
    Raspberry Pi 3 (Bluetooth と WiFi コントローラーを内蔵しています)
    16GB 以上の MicroSD カードに最新の Raspbian をインストールしておきます。
    ルーターを経由して有線 LAN でインターネットの Azure に接続できる環境を構築して使用しました。
    初回起動時に raspi-config を使用して SSH サーバーを有効化するために、HDMI 接続ディスプレイとキーボードとマウスが必要です。

    ・センサー デバイス
    Texas Instruments SimpleLink SensorTag CC2650STK
    小さな赤いパッケージに封止されている 10 個の低消費電力 MEMS センサーと BLE 対応デバイスが内蔵されています。CC2650STK で検索すればネット販売でも秋葉原でも容易に入手できます。BLE (Bluetooth Low Energy) で Raspberry Pi 3 と無線通信します。

    ・開発用 Windows PC
    Windows 10 搭載のデスクトップ PC を使用して、インターネットや Raspberry Pi 3 とは有線 LAN で接続しました。
    開発作業はインストールした Tera Term から Raspberry Pi 3 に SSH 接続して行いました。ブラウザーで表示させたテキストのコマンドを簡単にコピーアンドペーストできるので便利です。また Azure 上のデバイスを管理、モニターするための DeviceExplorer を動作させます。

    ・Azure アカウント
    実際に Azure IoT Hub に接続してテストするため、Azure アカウントが必要です。無料アカウントも利用できます。IoT Hub を作成しておきます。

    ・Raspbian のインストール (ハードウェアの準備)
    NOOBS を使用したインストールを推奨します。2016-11-29 版 (Version 2.1.0) を 32GB の FAT32 でフォーマットした MicroSD カードに展開して使用しました。作業は Windows 10 マシンに USB MicroSD カードリーダー ライターを装着して、エクスプローラーを使用して展開した ZIP ファイルの内容をコピーするだけです。
    MicroSD カードのコピーが終了した後は Raspberry Pi 3 にキーボード、マウス、ディスプレイ、LAN ケーブルを接続して起動します。少し時間がかかりますが、ディスプレイでインストールが進むようすを確認できます。
    Raspbian 起動後はコンソールを開いて次のコマンドを入力してコンフィグレーション ツールを立ち上げます。
    $sudo raspi-config

    メニュー画面が表示されるのでカーソル キーと Enter キーを使用して、
    「7. Advanced Options」
    「A4 SSH」と進み「Would you like the SSH server to be enabled?」
    の画面で<Yes>を選択して確定させます。
    メニューは ESC キーで終了します。

    写真 1:<br />
実験中の Raspberry Pi 3 と SensorTag
    写真 1: 実験中の Raspberry Pi 3 と SensorTag
    写真 2:<br />
raspi-config を<br>起動した画面。
    写真 2: raspi-config を
    起動した画面。
    写真 3:<br />
作成した IoT Hub のプロパティ画面
    写真 3: 作成した IoT Hub のプロパティ画面
    以上で準備ができました。今回はここまでとさせていただきます。次回は実際にサンプル プログラムをビルドしてインストールする手順を示します。次回もお楽しみに!
    DevWire のバックナンバーをご紹介
    DevWire のバックナンバーをご紹介 これを読めば組み込み業界のすべてが網羅できる!

    DevWire バック ナンバー サイトはこちら

    【正規販売代理店情報】
    アドバンテック株式会社 統合 IoT ソリューション 社外サイトへ
    IoT 産業の発展を促進するため、マイクロソフトとの協力のもと WISE-PaaS IoT ソフトウェア プラットフォーム サービスを開発。お客様が迅速に IoT アプリケーションを構築できるオールインワン SRP (ソリューション レディ パッケージ) サービスをワンストップで提供していきます。
    【セミナー・トレーニング情報】
    セミナー・トレーニング情報 多くのセミナー、トレーニングを開催しております。
    ぜひご活用ください。

    ●アヴネット株式会社 トレーニング 社外サイトへ
    ●岡谷エレクトロニクス株式会社 セミナー/トレーニング情報 社外サイトへ
    ●東京エレクトロン デバイス株式会社
    トレーニング 社外サイトへ セミナー・イベント 社外サイトへ
    ●菱洋エレクトロ株式会社 イベント・セミナー情報 社外サイトへ

    Column
     今まで「IoT に適したプロトコルの要件を探る」と題して 5 回にわたって連載をして参りましたが、いよいよ今回が最終回となります。
    8 月号の「MQTT と AMQP の共通の特徴である MQ (Message Queue) についておさえておこう」に関して「MQTT は MQ (Message Queue) ではない」という指摘を受けました。ということで、今回はこの点について考えてみたいと思います。
    MQ (Message Queue) とはネット上のノード間以外にも同一ノード内のプロセス間やスレッド間の通信に使われるソフトウエア コンポーネントです。たいていの場合 FIFO (先入先出) タイプのバッファーに Queue (キュー) いわゆる行列 (数学でいう行列ではなく「行列のできる○○」の行列の意) が構成されます。送信側のメッセージはキューにいったん格納され、キューにあるメッセージは受信側が取り出すまで格納されます。そのため送受信間で同時にメッセージをやり取りする必要がなく、いわゆる非同期のメッセージ交換を実現しています。

    それでは本題の MQTT は MQ であるかという問題ですが、MQTT V3.1 プロトコル仕様には MQTT が MQ であることはどこにも書かれていません。また MQTT を MQ Telemetry Transport と表記しており、以前は MQ のところを Message Queue とは表記していたところを、最近は MQ としかあえて表記していません。なので仕様書では MQTT がメッセージ キューであることを暗に否定していると解する向きもあります。しかし仕様を細かく読んでみると、MQ の実装が適切ではないかと思われる箇所があります。
    そのひとつが Clean Session の扱いです。これはサブスクライバー (メッセージを受信する側) がブローカー (メッセージを仲介するサーバー) に接続するときに設定するフラグです。
    これを 1 に設定して接続に行くとブローカーは以前に保持していたサブスクライバーに関する情報をすべて破棄します。またサブスクライバーが接続を切断した時にブローカーはそのサブスクライバーの情報をすべて破棄します。
    一方このフラグを 0 に設定して接続にすると、ブローカーはサブスクライバーの都合で接続を切断した場合でもサブスクライバーの情報を保持しなければなりません。そしてこれは QoS という通信品質を保証するレベルにもよりますが、ブローカーは同じサブスクライバーが再接続するまで、接続が失われた間のメッセージを保持する必要があります。
    これらのことから MQTT を実装するうえでメッセージを保持するなんらかの機能が必須であることはお解り頂けたかと思います。確かにそれが MQ (Message Queue) である必要はないかとは思いますが、システムを実装するエンジニアにとって最初に頭に浮かぶのが MQ ではないでしょうか。
    今回は MQTT V3.1 のプロトコル仕様に記載されている Clean Session というサブスクライバーがブローカーに接続にする際に設定するフラグをもとに、MQTT が MQ であるかというテーマで考えてみました。MQTT に詳しくないとわかりづらい術語が多々出てきたと思います。たとえばブローカーとかサブスクライバーとか QoS とか、これらについては順次コラムの中でも扱っていきたいと思っています。その後でこのテーマを思い出したらもう一度読み直して頂ければ幸いです。

    このシリーズは今回を持って最終回となりますが、現在新しい企画も検討中です。また読者の皆様とは誌面でお目にかかれることを楽しみにしております。

    ほっとひと息
    編集後記「お正月は・・・」DevWire 編集部 加藤 大輔
    遅ればせながら、明けましておめでとうございます。今年もよろしくお願いします。12 月号で予告したとおり見事に寝正月だった加藤です。寝正月だったにもかかわらず体調を崩したおかげで体重が増えずにすみました。ここは思い切って幸先がよいことにします!
    ここ数年、「年末年始の独特な雰囲気」が無くなっている気がします。個人的には冬のゴールデンウイークみたいだなと思いました。あの独特の雰囲気を感じなくなったのは、年末年始だからこそする特別なことを、あまりしなくなったからかもしれませんね。

    Microsoft Azure Marketplace

    $
    0
    0

    Haben Sie schon vom Microsoft Azure Marketplace gehört?

    Wenn nicht – gar kein Problem! Der Azure Marketplace ist Ihr Onlineshop für Tausende von zertifizierten Open Source- und Community-Softwareanwendungen, Entwicklerdiensten und Daten – allesamt vorkonfiguriert für Microsoft Azure. In dem globalen Online-Store profitieren die Unternehmen mit qualitativen Softwarelösungen in der eigenen Azure Umgebung und haben somit viele verschiedene Auswahlmöglichkeiten das eigene Umfeld bestmöglich zu gestalten und mit Microsoft Partner Lösungen zu verbessern.

    Welche Vorteile bekomme ich dadurch?
    • Kostenersparnis auf Grund der Skalierbarkeit
    • Skalierbarkeit weil eine Lösung jederzeit verwendet und bei Nichtgebrauch wieder abgedreht werden kann
    • Schneller Zugriff zu diversen Software Lösungen von A-Z
    • Cross-Industry Lösungen für jede Branche/für jeden Zweck
    • Einfacher Download in der eigenen Azure Umgebung inkl. Support der Software Anbieter
    • Die gesamte IT wird vereinfacht -> Somit wird weniger Zeit für wiederholende Aufgaben verwendet und mehr Konzentration auf strategische Geschäftsanforderungen gelegt

    JETZT LOSLEGEN mit einer unserer TOP 10 LÖSUNGEN:

    • Barracuda
      Barracuda NextGen Firewalls bieten für Hybrid-Netzwerke, Remote-Standorten sowie in Public und Private Cloud-Umgebungen Sicherheit und Netzwerk-Intelligenz.
    • Bitnami
      Bitnami ist eine Sammlung von Installations Programmen und Software Paketen für Web Anwendungen und virtuelle Machinen. Bitnami Stacks werden dazu verwendet um Software auf Linux, Windows, Mac OS X und Solaris zu installieren.
    • Check Point
      Check Point Produkte bieten End-to-End Security von der Firma in die Cloud bis zu den mobilen Arbeitsgeräten. Mehrere Produkte von Ceck Point stehen am Azure Marketplace zum Download für Sie bereit.
    • Citrix
      Citrix NetScaler ist ein all-in-one Web Application Delivery Controller & Ihr Networking Power Player. Er stellt Business-Anwendungen für jedes Endgerät an jedem Standort bereit – mit unerreichter Sicherheit.
    • Cloudera
      Cloudera bietet eine Plattform mit bester Leistung und geringen Kosten für Big Data Management und Analytics, damit das Firmenergebnis verbessert wird.
    • Hanu Insight
      Hanu Insight ist eine IT Governance und Financial Management Lösung für Microsoft Azure. Sparen Sie dadurch nicht nur Zeit, sondern auch Geld indem Sie vorkonfigurierte Templates einsetzen.
    • Hortonworks
      Hortonworks Data Platform (HDP) dient zur Analyse, Speicherung und Bearbeitung großer Datenmengen -> Big Data Management. Vorteile von Hadoop Cluster können somit genutzt werden.
    • Redhat Enterprise Linux
      Egal ob Sie neue Anwendungen herausbringen, Umgebungen virtualisieren oder eine Open Hybrid-Umgebung erstellen: Red Hat Enterprise Linux Server bildet ein solides Fundament, auf dem Sie Ihr Unternehmen weiterentwickeln können.
    • Tenable
      Tenable Nessus schützt vor Attacken, indem es die Schadenanfälligkeit und Einstellungsoptionen prüft oder nach Malware im eigenen Netzwerk sucht.
    • Veeam
      Veeam Cloud Connect bietet Veeam-Kunden die Möglichkeit, ihre Backup-Infrastruktur ganz einfach in die Cloud zu erweitern.

    Starten Sie jetzt in Ihrer eigenen Azure Subscription!

    【Mobile DevOps】VSTS から Xamarin Test Cloud に繋いで自動 UI テストを実現

    $
    0
    0

    モバイルアプリ開発において、開発からアプリpublish、ユーザのテレメトリ収集まで、一貫して管理できたら素晴らしいですよね。
    それらを、Microsoftのチーム開発管理サービスのVisual Studio Team Servicesと、実機での自動UIテストサービスXamarin Test Cloud(ザマリン・テストクラウド)などを使って実現しましょう!

    目次

    1. 継続的なモバイルアプリ開発 (Mobile DevOps)
    2. Microsoft の提供する、Mobile DevOps を実現する方法
    3. Visual Studio Team Services を使ってコードgit管理 & 自動ビルド
    4. 自動 UI テストを実現する Xamarin Test Cloud サービスについて
    5. Xamarin Test Cloud を VSTS から動かす

    継続的なモバイルアプリ開発

    image860

    モバイルアプリ開発において、やること:

    1. 開発(クライアント側のコード書く)
    2. サーバサイドとの連携
    3. テスト(単体・UIテスト)
    4. テスターたちにベータ版を配布
    5. アプリのユーザの使用メトリックやクラッシュレポートを収集
    6. ユーザからの feedback を収集

    などなど!

    よく「Mobile DevOps(デブオプス (= Development + Operation))」なんて呼ばれます。

    Microsoft の提供する、Mobile DevOps を実現する方法

    それらの一連の流れを実現するためのすべてのツールが、Microsoft によって用意されています!

    1. クライアントはXamarin(ざまりん)を使って開発し、
    2. サーバサイドはMicrosoft Azure(アジュール)というクラウドサービスを使います。
    3. 自動UIテストはXamarin Test Cloudを使います。(ちなみに有名な Slack も Test Cloud を使って開発されています)。
    4. ユーザのテレメトリ収集はHockeyAppを使います。
    5. そしてそれらの一連の流れを管理(タスク管理や自動化など)するのにVisual Studio Team Servicesを使います

    つまり、図にすると以下のようになります。

    blog-graphic-2-2

    このうち、このオレンジ色の部分がVisual Studio Team Servicesで管理できる部分になります。

    blog-graphic

    補足:
    (現在は、これら別々のサービスが全てひとつに統合され、かつモバイルアプリ開発に特化した Visual Studio Mobile Center という新サービスが去年発表されましたが、まだプレビュー版なのです。)

    Visual Studio Team Services を使ってコードgit管理 & 自動ビルド

    image860

    この図示した部分を VSTS (Visual Studio Team Services)を使ってどうやって管理するのかはこちらの記事で書きました。
    Visual Studio Team Services で Xamarin.Android のビルド

    自動 UI テストを実現する Xamarin Test Cloud サービスについて

    続いて、自動UIテストについてです。

    image8

    自動UIテストについては、Xamarin Test Cloudを使います。

    xamarin-test-cloud

    Xamarin Test Cloud は、2,000台以上の実機でUIテストが出来る、クラウド上のテスト環境です。

    screenshot-42x

    Android端末なんて星の数ほど種類があるし、iPhone/iPad については iOS は一度バージョンを上げたら戻せないし、いちいちテスト機として買っていられないですよね。
    そこで Xamarin Test Cloud ですよ!

    しかも、その UIテスト(ボタンをタップするなど)も、すべてコードで書くことができます。

    UITest コードサンプル

    エンジニアの皆さんはまずコードがどんなものか見たいですよね!

    このようにして UIテストを全てコードで書くことができます

    Xamarin Test Cloud 紹介

    Xamarin Test Cloudどんなものか、
    まずは画面のスクリーンショットをいくつか見てみましょう。(だいたいの画像がクリックで拡大)

    管理ポータルの最初のページ。どのアプリのテスト結果見たい?という感じ
    screen-shot-2017-02-15-at-14-50-29

    アプリをひとつ選択した時。テスト結果やピーク時のメモリ使用量が履歴で分かりやすく表示してある。

    screen-shot-2017-02-15-at-14-51-56

    ひとつのテスト履歴を選択した時。その時のテストの詳細が一覧で表示される。
    OSのバージョンやベンダーごとのテスト通過率なども出る。
    左のカラムに、コードで指定したテストが名前付きでリストしてある。

    ↓クリックで拡大
    screen-shot-2017-02-15-at-15-15-15

    「Skip Authentication Test」というテストの中の
    「On Login Page」という名前で保存された各デバイスのスクリーンショット

    screen-shot-2017-02-15-at-14-16-59

    「Change Capacity Units」というテストの中の
    「On Settings Page」という名前で保存された各デバイスのスクリーンショット

    screen-shot-2017-02-15-at-14-21-15

    ひとつのデバイスを選択した時のスクリーンショット。
    このテスト中の瞬間のCPU使用率やメモリ使用量など、このデバイスの詳細データが見られる

    screen-shot-2017-02-15-at-14-21-52

    デバイスログやテストログも見られる。(スクショはデバイスログのもの)

    screen-shot-2017-02-15-at-14-22-12

    Xamarin Test Cloud を VSTS から動かす

    さあ、実際に動かしてみましょう!

    Xamarin Test Cloud を VSTS から動かすためには、

    1. Xamarin Test Cloud側の操作
    2. Visual Studio Team Services側の操作

    の両方が必要です。

    まずは Xamarin Test Cloud 側の操作から始めましょう。

    Xamarin Test Cloud 側の準備

    Test Cloud の管理ページに入ります。
    https://testcloud.xamarin.com

    ↓まずは画面右上の「New Test Run」を押します。

    screen-shot-2017-02-14-at-16-28-31

    今回は Xamarin.Froms 製のアプリの Android のものだけテストしようと思うので、
    「New Android app」を選択して「Next」を押しました

    screen-shot-2017-02-14-at-16-28-44

    たくさん機種が出てきましたね!

    screen-shot-2017-02-14-at-16-29-00

    「★ Short queue times」(「短い待ち時間」)というマークが付いている機種が上に出ていますね。

    screen-shot-2017-02-15-at-15-41-40

    これはどういうことを言っているのかというとですね。

    Xamarin Test Cloud はあくまで実機テストなので、数千のデバイス実機をデバイスファームで保存して動かしています。で、それらのデバイスを多くのユーザが交代交代で使うわけです。なのでひとつのデバイスに多くのユーザがテストを走らせようとすると、当然、待ちになります。待ち行列が発生します。

    なので、XTCは「このデバイスは使う人が少ないからあんまり待たなくて良いよ」というのをマークで出してくれています。

    今回はそれらから3機種ほど選んでみます。

    で、次は言語を選ぶ画面が出てきて、

    screen-shot-2017-02-14-at-16-29-17

    最後にこのような文字列(Xamarin Test Cloud に .apk を投げるためのコマンド)が出て来るので、この文字列をまるっとコピーしてどこかに控えておきましょう。
    screen-shot-2017-02-14-at-16-29-21

    これで Xamarin Test Cloud 側の準備は完了です。

    Visual Studio Team Services 側の操作

    次は Visual Studio Team Services側の準備です。

    VSTSの管理ページに行きます。(webブラウザで https://アカウント名.visualstudio.com です)

    前提:VSTSでビルドが完了しており、.apk や .ipa など成果物が drop されている状態。
    (参考:Visual Studio Team Services で Xamarin.Android のビルドが終わっていれば大丈夫)

    screen-shot-2017-02-15-at-15-55-26
    ↑ビルド定義の最後に「Publish Artifact: drop」で .apk が drop (= リリースプロセスで使えるようにするために、リリースプロセスで参照できるフォルダに .apk を落としている)されている。

    ーー

    で。
    VSTS を開いてください。

    「Build & Release」→「Releases」

    screen-shot-2017-02-15-at-15-59-14

    そうするとリリースの設定画面に行きます。
    これは「テスト環境」「ベータテスター用の環境」「本番環境」など、様々な環境にデプロイorリリースするために、各環境ごとにリリースのプロセスを設定できる画面です。

    まずは最初のリリース定義(Release Definition) を作ってみましょう。
    「+ New definition」をクリックします。

    screen-shot-2017-02-15-at-16-06-53

    たくさんのテンプレートが出てきますが、
    今回はただXamarin Test Cloudに繋ぎたいだけなので、「Empty (=空っぽ)」を選択して「Next」を押します

    screen-shot-2017-02-15-at-16-09-17

    そうするとこのような画面になります!
    もし「自動ビルド→ビルド成功→自動デプロイ」までやりたかったら「Continuous deployment」をチェックすれば良いですが、今回はつけません。
    「Create」を押します

    screen-shot-2017-02-15-at-16-14-53

    そうするとこのような画面になります。
    デフォルトの「Environment(環境)1」という環境だけ作られていますね。
    「+ Add tasks」を押します

    screen-shot-2017-02-15-at-16-25-56

    タスクカタログが開くので、
    左のペインから「Test」を選び、
    「Xamarin Test Cloud」を選択し、「Add」を押し、「Close」です

    screen-shot-2017-02-15-at-16-32-10

    現在このような画面になっているはずです。

    screen-shot-2017-02-15-at-16-35-36

    必須欄(赤くなっている)がほとんど空欄ですね。

    これらのうち、

    • Team API Key *
    • User Email *
    • Devices *

    は、先ほどXamarin Test Cloud側で設定して出てきた文字列を当て込みます。

    screen-shot-2017-02-14-at-16-29-21

    #TheFeedUK – HoloLens in Education

    $
    0
    0

    The following post features in the Jan/Feb 2017 issue of #TheFeed, our online magazine bringing you the best stories from Microsoft Showcase Schools and #MIEExperts, thought leadership, and news from the Microsoft in Education team. This piece is from the HoloLens team here at Microsoft, and looks at how the world of mixed reality is already impacting teaching and learning.

    Head over to SlideShare to browse all the latest stories from this edition of #TheFeed.


    HoloLens in Education

    While technological advances wont necessarily change fact or history, some can certainly change the ways in which many of these subjects and skills are taught. For certain areas of study, the introduction of particular innovations can complement the existing pedagogy, empowering students and teachers to approach topics or exercises from different angles, opening up broader possibilities in terms of accessibility, collaboration, and understanding.

    At Case Western Reserve University, Microsoft HoloLens is already impacting the study of medicine. In the mixed reality world of HoloLens, classes of med students are now able to examine the human body and its multi-layered anatomical structure, seeing systems and events in action in a way that simply has not been possible before through cadavers and textbooks.

    Being able to visualise this information in a 3D manner that is reactive to the students was one of the key reasons behind the adoption of HoloLens into the anatomy curriculum at CWRU:

    Anytime that you change the way you see things; it changes the way you understand them As soon as you can change somebodys understanding, then they can change the way they see the world.

    Confidence is also a key factor in mastering any skill or discipline, and allowing the students to work practically in an environment where mistakes can be made and learned from – without literal life or death consequences – will have a profound impact on learning.

    “In a mixed reality anatomy class, being able to quickly set up or change practical sessions, reset the environment for the next student, or even go back a step after a critical mistake, all significantly improve efficiency and collaboration, meaning more students can acquire skills through practical experience in a much shorter time.” – Mark Griswold, Ph. D – Case Western Reserve University.

    To learn more about the partnership between Microsoft HoloLens and Case Western Reserve University, watch the video below:


    However, it is not just Higher Education and vocational studies where HoloLens can play a meaningful role in student development.

    Chris Barry, Head of Digital Strategy at Harrow School, recently experienced HoloLens, and is confidently optimistic about the impact it can have at all levels of teaching and learning:

    “There is an immediate sense of ‘the future, now’ about the HoloLens experience, and, as an educator, I instantly felt that the device, and the way in which it offers an ‘enhanced’ view of one’s surroundings, has almost limitless potential as a teaching tool, It’s main benefit to teaching is not so much expanding on what we can teach but on how we can teach – that is a much more profound leap forward even before I could think of any specific application! I guess I felt instinctively that its main benefit to teaching is not so much expanding on what we can teach but on how we can teach – that is a much more profound leap forward.”


    Do you want to you to engage with your digital content and interact with holograms in the world around you? Are you ready to start your HoloLens journey? Take your first step into the world of mixed reality here.

    通过libuv使用可重入函数

    $
    0
    0
    [原文发表地址]通过libuv使用可重入函数
    [原文发表时间] 2017/2/7 9:20AM

    在这篇文章之前我们曾经就已经讨论过可重入函数了,甚至最近关于Visual Studio 2017 版本在我们的实现中已经就“yield”关键字在VS2017中被“co_yield”替换进行了更深入的讨论。这种有意义的C++ 标准模块让我非常兴奋, 因此在这篇博客中我很高兴和您分享一些在具体实践中是如何通过libuv 库来使用它。你可以用微软编译器或者其他支持可重入函数的编译器来使用这些代码,在进入这些代码之前,让我们首先认识下问题空间以及为什么你应该考虑它。

    问题空间

    等待磁盘的响应或者从网络上下载数据这本身就比较漫长,而且我们通常被告知写入块崩溃了, 对吗? 对于客户端编程而言,进行I/O 操作或者阻塞UI线程都将会引起诸如像app瘫痪或者挂起的这样糟糕的用户体验。对于服务器端编程而言,新的请求在其他线程都被阻塞的情况下,通常仅仅只需要创建一个新的线程, 然而这样会引起一个线程的资源利用率较低的问题,这些资源却往往并不便宜。

     

    然而, 写一个高效的真正意义上的异步代码的确仍然存在一个普遍的困难。不同的平台提供了不同的机制以及实现异步的API。 许多的API也将不再支持异步的功能。通常,解决方案是通知辅助线程,这将会调用阻塞API, 并且返回结果到主线程。 这同样也是有一定难度的而且需要使用异步机制去避免并发问题。有一些库提供了基于这些不同机制的抽象, 然而,许多例子都包含了Boost ASIO,以及C++ Rest SDK 以及libuv Boost ASIO Rest SDK C++ 库, 而libuv 是一个C 库。 在他们之间有一些重叠的地方, 但是他们都有他们各自的优势。

     

    Libuv 是一个C库,它在Node.js 中提供了支持异步的I/O, 尽管Node.js 显式地为用户设计的这一功能, 但是它也可以独立使用并且提供了一个公共的跨平台API, 不需要顾及到多种特定平台异步的API。 另外,API 即使在Windows 上仍然是UTF8-only 格式, 这也是非常方便的。每一个会阻塞的API 可以接受一个指向回调函数的指针,当所有的请求操作完成后,这些回调函数将被调用。 一个事件循环启动等待多种请求完成以及调用特定的回调函数。对于我而言, 写libuv 代码是简单直观的,但是遵循程序的逻辑却并不是那么容易的。 使用C++ lambdas表达式来调用回调函数或多或少可以有点帮助, 但是在随着一系列回调请求, 传输数据需要许多的样板代码, 关于libuv 你可以在他的官方网站上获取更多信息。

     

    最近对协同程序产生了浓厚兴趣,发现它已经开始支持多种语言了, 而且有一些协同建议已经被提交到了C++ 委员会。尽管目前还没有人来着手处理, 但是有一部分将在某种程度上被协同支持。关于C++ 标准化中就协同建议而言, 有一条就是可重入函数,尽管仍然存在一些新的改变,但是已经被写入了当前版本N4402 中。 他建议用一种新的语言句法来支持不涉及堆栈的协同, 不需要定义实际上的实现 ,但是可以替代一些关于如何绑定到库具体实现句法的详细说明。 这样可以增加灵活性并且可以支持不同的运行时机制。

     

    Libuv 支持可重入函数

    当我开始调查这个的之前从未使用过libuv, 因此一开始我仅仅写了一些简单的libuv 调用, 并且开始思考我希望如何去写这些代码。 随着可重入函数的引入, 你可以写一些看起来非常连续,却是异步执行的代码。 无论在什么时候你在一个可重入函数中看到co_await 这个关键字, 如果await 表达式的结果无效的, 这个函数将被“return”。

    在创建这个库的时候我有以下几个目标。

    1. 非常好的性能
    2. 没有冗余的C++
    3. 被现有用户熟识的模块
    4. 支持简单libuv 和可重入函数的混合

    我在这里展示的所有代码和实际库代码以及下面的例子都在github 是有效的, 可以使用Visual Studio 2015 来编译, 或者在Clang LLVM 分支上,这刚好实现了那些建议, 你也可以用CMake libuv 来替代。 我使用的版本是在基于Linux libuv 1.8 和基于Windows 1.10.1 版本。 如果你想使用Clang/LLVM , 按照这些标准指令来构建它。

     

    我尝试几种不同的方法把libuv 绑定到可重入函数上,在我的库里我考虑到了这两个方面。 首先(例1)使用和std::promise std::future 类似的函数: awaituv::promise_t and awaituv::future_t, 这两个函数指向一个共享状态对象,这个共享状态对象携带从libuv 调用得到的返回值。 我将这个“ return value”放在引用中是因为通过在libuv 中的一次回调异步提供这个“return value. 这种机制要求一个堆分配来保存这个共享状态。 第二个机制是让开发者将这个共享状态放在调用函数的堆栈上, 这也将免去了一个独立的堆分配并且可以关联shared_ptr 机器上, 尽管它没有第一种机制那么明晰,但是在性能方面还是有意义的。

     

    例如:

    让我们看一下这个简单例子: 1000次异步输出“hello world”

     

    future_t<void> start_hello_world()
    {
      for (int i = 0; i < 1000; ++i)
      {
        string_buf_t buf("nhello worldn");
        fs_t req;
        (void) co_await fs_write(uv_default_loop(), &req, 1 /*stdout*/, &buf, 1, -1);
      }
    }
    

    调用co_await的函数需要返回一个awaitable类型,因此这个返回了一个future_t<void>类型, 对一个可重入函数编译器生成代码而言,这种方法将是有效的。这个函数将循环执行1000次并且异步输出“hello world”。 在awaituv 命名空间的函数“fs_write”是libuv uv_fs_write 函数的一个封装,同样它也将返回类型是future_t<int>, 这也是一个awaitable类型。在这种情况下我忽略了实际值但是仍然等待它的完成。 如果await 表达式的结果没有立即生效,那么函数start_hello_world 返回并保存指向重入函数的指针, 也就是说写操作完成,函数被回调。string_buf_t uv_buf_t 类型的一个封装, 尽管uv_buf_t 类型也可以被直接使用。 同样fs_t uv_fs_t类型的一个封装,并且fs_t类型还有一个允许调用uv_fs_cleanup的一个析构函数。虽然这个不是必须要的,但是却可以提升代码质量。

     

    注意: 与std::future 不同,future_t 没有提供get 方法, 因为这种方法总是被阻塞。就libuv 而言, 除非事件循环启动,否则没有一个回调可以被正常执行,程序往往因此而挂起。关于这个的后续工作,敬请期待。

     

     

    现在让我们看一个有点复杂的例子,读取一个文件并且转储到标准输出。

    future_t<void> start_dump_file(const std::string& str)
    {
      // We can use the same request object for all file operations as they don't overlap.
      static_buf_t<1024> buffer;
    
      fs_t openreq;
      uv_file file = co_await fs_open(uv_default_loop(), &openreq, str.c_str(), O_RDONLY, 0);
      if (file > 0)
      {
        while (1)
        {
          fs_t readreq;
          int result = co_await fs_read(uv_default_loop(), &readreq, file, &buffer, 1, -1);
          if (result <= 0)
            break;
          buffer.len = result;
          fs_t req;
          (void) co_await fs_write(uv_default_loop(), &req, 1 /*stdout*/, &buffer, 1, -1);
        }
        fs_t closereq;
        (void) co_await fs_close(uv_default_loop(), &closereq, file);
      }
    }
    

    这个函数浅显易懂,类似于异步写入。static_buf_t uv_buf_t类型的 另一种C++ 封装,并且提供了一个固定大小缓存区。 这个函数打开一个文件, 读取到缓存区, 写入到标准输出,反复执行直到数据读取完成, 最后关闭文件。 在这种情况下,当我们打开文件、读取数据的时候,你可以看到我们使用的await 表达式的结果。

    接下来,让我们来看一个函数, 可以在自动定时改变标准输出中字体的颜色。

    bool run_timer = true;
    uv_timer_t color_timer;
    future_t<void> start_color_changer()
    {
      static string_buf_t normal = "33[40;37m";
      static string_buf_t red = "33[41;37m";
    
      uv_timer_init(uv_default_loop(), &color_timer);
    
      uv_write_t writereq;
      uv_tty_t tty;
      uv_tty_init(uv_default_loop(), &tty, 1, 0);
      uv_tty_set_mode(&tty, UV_TTY_MODE_NORMAL);
    
      int cnt = 0;
      unref(&color_timer);
    
      auto timer = timer_start(&color_timer, 1, 1);
    
      while (run_timer)
      {
        (void) co_await timer.next_future();
    
        if (++cnt % 2 == 0)
          (void) co_await write(&writereq, reinterpret_cast<uv_stream_t*>(&tty), &normal, 1);
        else
          (void) co_await write(&writereq, reinterpret_cast<uv_stream_t*>(&tty), &red, 1);
      }
    
      //reset back to normal
      (void) co_await write(&writereq, reinterpret_cast<uv_stream_t*>(&tty), &normal, 1);
    
      uv_tty_reset_mode();
      co_await close(&tty);
      co_await close(&color_timer); // close handle
    }
    

    这个函数的绝大部分都是简单明了的libuv 代码,它可以支持ANSI 转义序列去设置颜色。 在这个函数中体现出的一个新概念是一个定时器可以循环使用,而不是一次简单的执行。 timer_start 函数(包装于 uv_timer_start) 返回了一个promise_t 类型而不是future_t. 为了获取一个允许等待的对象,在需要定时器的地方调用next_future。 这可以重置内部状态,比如说它可以再等待一次。color_timer是全局变量,所以stop_color_changer 函数可以停止定时器。

     

    最后,这里有一个函数,它可以打开一个socket,并且发送一个http 请求到google.com

    future_t<void> start_http_google()
    {
      uv_tcp_t socket;
      if (uv_tcp_init(uv_default_loop(), &socket) == 0)
      {
        // Use HTTP/1.0 rather than 1.1 so that socket is closed by server when done sending data.
        // Makes it easier than figuring it out on our end...
        const char* httpget =
          "GET / HTTP/1.0rn"
          "Host: www.google.comrn"
          "Cache-Control: max-age=0rn"
          "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8rn"
          "rn";
        const char* host = "www.google.com";
    
        uv_getaddrinfo_t req;
        addrinfo_state addrstate;
        if (co_await getaddrinfo(addrstate, uv_default_loop(), &req, host, "http", nullptr) == 0)
        {
          uv_connect_t connectreq;
          awaitable_state<int> connectstate;
          if (co_await tcp_connect(connectstate, &connectreq, &socket, addrstate._addrinfo->ai_addr) == 0)
          {
            string_buf_t buffer{ httpget };
            ::uv_write_t writereq;
            awaitable_state<int> writestate;
            if (co_await write(writestate, &writereq, connectreq.handle, &buffer, 1) == 0)
            {
              read_request_t reader;
              if (read_start(connectreq.handle, &reader) == 0)
              {
                while (1)
                {
                  auto state = co_await reader.read_next();
                  if (state->_nread <= 0)
                    break;
                  uv_buf_t buf = uv_buf_init(state->_buf.base, state->_nread);
                  fs_t writereq;
                  awaitable_state<int> writestate;
                  (void) co_await fs_write(writestate, uv_default_loop(), &writereq, 1 /*stdout*/, &buf, 1, -1);
                }
              }
            }
          }
        }
        awaitable_state<void> closestate;
        co_await close(closestate, &socket);
      }
    }
    

    另外, 在这个例子中提出了两个新概念。第一,我们不需要完全等待它的携带内容。

    Getaddrinfo 函数返回了一个future_t<addrinfo_state>它包含了两块信息。

    future_t<addrinfo_state>结果包含了一个整型,用来表明结果是成功的还是失败。但是也有一个指向携带信息的指针,在tcp_connect 调用的时候会被使用。第二, 在socket 上读取数据将会在数据到达的时候,潜在地引发多次回调。 这就需要一个不同的机制而不仅仅是单纯地等待读取。 就这点而言, 有read_request_t 类型。在socket 上随着数据到达, 如果有一个非常明显的等待,它将会直接绕过数据。 否则,在下一次等待启动之前它将一直处于等待状态。

     

    最后,让我们看一个结合使用这些函数的例子

    int main(int argc, char* argv[])
    {
      // Process command line
      if (argc == 1)
      {
        printf("testuv [--sequential] <file1> <file2> ...");
        return -1;
      }
    
      bool fRunSequentially = false;
      vector<string> files;
      for (int i = 1; i < argc; ++i)
      {
        string str = argv[i];
        if (str == "--sequential")
          fRunSequentially = true;
        else
          files.push_back(str);
      }
    
      // start async color changer
      start_color_changer();
    
      start_hello_world();
      if (fRunSequentially)
        uv_run(uv_default_loop(), UV_RUN_DEFAULT);
    
      for (auto& file : files)
      {
        start_dump_file(file.c_str());
        if (fRunSequentially)
          uv_run(uv_default_loop(), UV_RUN_DEFAULT);
      }
    
      start_http_google();
      if (fRunSequentially)
        uv_run(uv_default_loop(), UV_RUN_DEFAULT);
    
      if (!fRunSequentially)
        uv_run(uv_default_loop(), UV_RUN_DEFAULT);
    
      // stop the color changer and let it get cleaned up
      stop_color_changer();
      uv_run(uv_default_loop(), UV_RUN_DEFAULT);
    
      uv_loop_close(uv_default_loop());
    
      return 0;
    }
    

    这个函数包含两种模式: 并发模式和顺序模式。在顺序模式下,在一个任务启动之后,我们开始运行libuv 事件循环, 在下一个任务启动之前确保该事件执行完成。 在并发模式下,所有的任务(可重入函数)启动,然后等待所有重入函数执行完成。

    实现:

    这个库当下仅仅还只是头文件,让我们来看其中一个封装函数。

    auto fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, int mode)
    {
      promise_t<uv_file> awaitable;
      auto state = awaitable._state->lock();
      req->data = state;
    
      auto ret = uv_fs_open(loop, req, path, flags, mode,
        [](uv_fs_t* req) -> void
      {
        auto state = static_cast<promise_t<uv_file>::state_type*>(req->data);
        state->set_value(req->result);
        state->unlock();
      });
    
      if (ret != 0)
      {
        state->set_value(ret);
        state->unlock();
      }
      return awaitable.get_future();
    }
    

    这个函数封装了uv_fs_open 函数,并且基本可以被识别。 它没有启动回调,只是返回了future<int> 而不是int 。 就自身而言promise_t<int> 保存了一个用来统计状态对象的引用,而且它包含了一个int 还有其他的附加信息。Libuv提供了一个数据成员去保存这些特定的数据信息,这对我们而言是一个指向状态对象的一个裸指针。真正的转到uv_fs_open 函数的回调是一个lambda 表达式,它会强制转化数据为状态对象并且调用他的set_value 方法。 如果uv_fs_open 返回失败(这也将意味着不再引入回调),我们直接设置promise 的值, 最后。我们返回一个失败,当然这个失败也将有一个指向状态的引用计数指针。 返回失败将进一步说明对于co_await 而言需要有一些必要的方法和它一起工作。

     

    当前我们已经封装了下面的libuv 函数:

    • uv_ref/uv_unref
    • uv_fs_open
    • uv_fs_close
    • uv_fs_read
    • uv_fs_write
    • uv_write
    • uv_close
    • uv_timer_start
    • uv_tcp_connect
    • uv_getaddrinfo
    • uv_read_start

    当下的库还是远远不够的,封装其他的libuv 函数仍然需要进一步完成。 目前我还没有探索到撤销操作或者错误信息的传送。 我坚信一定有一个更好的方法来处理这种多次回调uv_read_start uv_timer_start 函数, 但是我还没有发现任何让我可以很愉快完成的东西。 或许就循环而言仍然需要基于回调来实现。

     

    总结

    就我而言, 协同程序提供了一个较为简单的方法来使用libuv 实现异步编程的模式,你可以下载库和在Github可重现的样例。 请让我了解到你对这种方法的想法以及它给你带来的方便。

    How to send a email to the subscription’s admin in Logic Apps

    $
    0
    0

     

    Logic Apps provide a way to simplify and implement scalable integrations and workflows in the cloud. Using Logic Apps and Azure Service Management REST API (https://msdn.microsoft.com/en-us/library/azure/ee460799.aspx), you can create an application to manage your service’s resources programmatically. In this article, we will demonstrate how to get the email address of Azure subscription and send an email in Logic Apps dynamically.

    Pre works:

    1. Create a management certificate

    Please follow the steps in this document to create your management certificate:

    https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-certs-create

    2. Upload your management certificate through Azure classic portal

    Then you need to upload your management certificate to your subscription (public certificate .cer file) so that it is authorized to perform management operations on your behalf. Please follow this documentation for step-by-step details:

    https://docs.microsoft.com/en-us/azure/azure-api-management-certs

    3. Find the API you needed.

    In this sample, we will call an REST API to get the User Accounts information:

    GET https://management.core.windows.net/<subscription-id>/principals

    https://msdn.microsoft.com/en-us/library/azure/dn469420.aspx

    Logic Apps:

    Part A: Create a Logic App to get the email of Admin (Parent Logic App).

    1. Create a request trigger.

    We created a request trigger here to start our workflow. But you can use any other triggers.

    More information you can find here: https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-http-endpoint

    2. Create an HTTP action.

    In this action, we will call Azure REST API using client certificate (pfx + password).

    Note: You need to base64 encode the pfx file content and embed in the pfx textbox.

    clip_image002

    3. The format of the response body is a xml file as follows:

    <?xml version=”1.0″ encoding=”utf-8″?>

    <Principal xmlns=”http://schemas.microsoft.com/windowsazure”>

    <Role>role-names-for-user-account</Role>

    <Email>email-address-for-user-account</Email>

    </Principal>

    In Logic Apps, it is more convenient to pass the data as a JSON file between different actions or apps.

    You can use @JSON() function to convert the XML content easily in Logic Apps as below:

    clip_image004

    In real word, you can define any actions after you got the response message.

    Here we defined a child logic apps to parse the response and send email — sendEmail.

    Part B: Create a Logic App to parse the response and send email to Admin (Child Logic Apps).

    The sendEmail app takes an array of subscription admins and uses Send email action inside a ForEach loop

    1. Create a request trigger to accept the response.

    Here is a sample of the JSON format playload:

    {

    “Principals”: {

    “Principal”: [

    {

    “Role”: “ServiceAdministrator;AccountAdministrator”,

    “Email”: “user1@microsoft.com”

    },

    {

    “Role”: “CoAdministrator”,

    “Email”: “user2@microsoft.com”

    }

    ]

    }

    }

    Put the above JSON data to http://jsonschema.net to get the its JSON schema.

    Paste the schema definition in request trigger. With the help of JSON schema, Logic App could automatically tokenize all properties e.g. Principals, EmailId etc.

    clip_image006

    2. Create a ForEach action – Loop over all principals

    a. Send Email action – Send email using Office 365 send email action.

    clip_image008

    3. Response action – Child workflows should have response action to be callable from another logic app use native child workflow action.

     

    Special thanks to Vinay Singh, Xiaodong Zhu.

     

    Ray Wang from DSI team.

    “Transfer-encoding: chunked” is not in the response header when using ARR

    $
    0
    0

     

    One of my customer is using ARR (Application Request Routing) in IIS8.5 as a reverse proxy to route the incoming requests to an application which does its own chunked transfer encoding. However, they find the “transfer-encoding: chunked” is not in the response header when using ARR, which causes the failure of the application connection.

    Root Cause

    =============

    In IIS 7 and above, it automatically buffers responses data going back to the client, up to 4MB by default. If any application sends a response less than 4MB, IIS will buffer it in its entirety and send the response with a Content-Length header. If buffering is enabled and the application sends a response without a Content-Length header – and the response exceeds the buffer size or is explicitly flushed by the app before its complete – the buffering code will automatically chunk transfer encode the response if appropriate. If the application manually does its own chunked transfer encoding, it may strip the chunked transfer encoding and send the buffered response with a content-length.

    Solution

    =============

    We can try to disable buffering by changing the Response Buffer Threshold (KB) to 0 in ARR Server Farm Proxy setting.

    image

    Here is a test of the solution by using ARR to route the request to a public chunkedimage page https://www.httpwatch.com/httpgallery/chunked/chunkedimage.aspx .

    By default, when accessing this page through ARR, it will buffer the response and send the response with a Content-Length header.

    image

    When we change the Response Buffer Threshold (KB) to 0 in ARR Proxy setting. We can see the Transfer-Encoding: chunked in response header this time.

    image

    -Yingjie Shi from APAC DSI team

    IIS 8.5 binds to all IP addresses on a server

    $
    0
    0

     

    If you have multiple IPs in one windows server 2008 and above, when you add a website in IIS, you might found that 0.0.0.0 is listening on 80 or 443, rather than the IP address you just added. In this article, I will talk about the root cause and workarounds for this kind of scenario.

    Backgrounds:

    1) I have a windows server 2012R2 with two IP address A and B.

    2) add a new website 1, bind it to IP A with 80 port, add another website 2, bind IP B and 80 port.

    3) run “netstat -ano”, would find below result:

    Active connections:

    Proto local address state PID

    TCP 0.0.0.0:80 LISTENING 4

    The 80 port on all IP addresses are listening.

    4) stop website 2, IP B:80 should be released and stop listening, If I try to telnet IP address B which is not occupied by any websites now:

    telnet B 80

    it would be successful.

    5) The scenario is not expected, as I have already stopped website 2.

    Root cause:

    It is due to a feature designed in IIS, Socket Pooling. Socket pooling causes Internet Information Services (IIS) to listen to all IP addresses.

    disable Socket pooling?

    I did try to disable socket pooling following https://support.microsoft.com/en-us/help/238131/how-to-disable-socket-pooling, however failed.

    Here is the reason: Because DisableSocketPooling is defined as a valid property in the IIS 6.0 metabase schema (MBSchema.xml), you can still set this property by using Adsutil.vbs, but this has no effect.

    Workaround:

    Fortunately, In this situation, if we want to delete the port 80 bound with 0.0.0.0, we can manually delete the HTTP listening rule.

    1) When stopping website 2 in IIS console, if want IP B stop listening on port 80, please run below command:

    netsh http delete iplisten ipadd=IPB:80

    2) Now, we can find that we cannot telnet IPB:80 anymore.

    3) In the same way, if you need to start the website again, not only to start it on the IIS manager, run below command to add HTTP listening as well.

    netsh http add iplisten ipadd=IPB:80

    More references:

    https://support.microsoft.com/en-us/help/813368/setting-metabase-property-disablesocketpooling-has-no-effect

    https://support.microsoft.com/en-us/help/238131/how-to-disable-socket-pooling

    https://support.microsoft.com/en-hk/help/954874/iis-binds-to-all-ip-addresses-on-a-server-when-you-install-iis-7.0-on-windows-server-2008

    https://msdn.microsoft.com/en-us/library/cc307219(VS.85).aspx

    https://msdn.microsoft.com/en-us/library/cc307227(v=vs.85).aspx

    Thanks,

    Cynthia Jiang from DSI team


    ARCHITECTURE & SECURITY DAYS 2017

    $
    0
    0

    archsec

    Zveme vás na konferenci ARCHITECTURE & SECURITY DAYS 2017, která se koná 28. a 29. března 2017 v pražském Microsoftu.

    Budeme se zabývat architekturou software, dependency injection, testováním a návrhem infrastruktury informačních systémů v návaznosti na příchod .NET Core, a také návrhem systémů z pohledu bezpečnosti – správné nastavení HTTPS, použití kryptografie a nejčastější bezpečnostní chyby.

    Více informací a registraci na akci najdete na: https://www.archsec.cz/

    SharePoint 2016 : Modern OneDrive User Experience results in blank page

    $
    0
    0

    As part of the November 2016 public update for SharePoint Server 2016 (Feature Pack 1), a new modern user experience for OneDrive for Business is included. This modern user experience is turned on automatically when you install the public update

    Classic OneDrive Page:

    version1

     

     

     

     

     

     

     

     

     

    The classic OneDrive page reflects URL /PersonalSite/Documents/Forms/All.aspx.

     

    Modern User Experience:

    version2

     

     

     

     

     

     

    Once switched to modern OneDrive experience, you are redirected to /PersonalSite/_layouts/15/onedrive.aspx.

     

    This modern experience can be toggled by the following SharePoint PowerShell script:

    To enable:

    $Farm = Get-SPFarm
    
    $Farm.OneDriveUserExperienceVersion = [Microsoft.SharePoint.Administration.OneDriveUserExperienceVersion]::Version2
    
    $Farm.Update()

    To disable:

    $Farm = Get-SPFarm
    
    $Farm.OneDriveUserExperienceVersion = [Microsoft.SharePoint.Administration.OneDriveUserExperienceVersion]::Version1
    
    $Farm.Update()

     

    The OneDrive.aspx page appears blank if you have installed only Cumulative Updates for SharePoint Server 2016 (KB 3127940) . In order for OneDrive modern experience to work correctly, you also need to install the OneDrive hotfix documented in the KB article KB 3127942. This hotfix updates the SharePoint 2016 version to 16.0.4456.1002. However, you can install this hotfix even on top of January 2017 Cumulative Update for SharePoint since it contains linguistic resources necessary to render modern OneDrive experience.

     

    POST BY : Tapan Maniar[MSFT]

    Une nouvelle expérience utilisateur pour l’installation de Visual Studio 2017

    $
    0
    0

    Visual Studio 2017 inaugure une toute nouvelle expérience utilisateur pour son installation. Vous êtes désormais invité à sélectionner les thématiques technologiques qui vous intéressent et le programme d’installation sélectionne automatiquement les composants techniques à installer.

    Vous pouvez récupérer le programme d’installation de la version Release Candidate de Visual Studio 2017 ici

    Les différentes thématiques sont regroupées en 4 catégories principales :

    • Windows
    • Web & Cloud
    • Mobile & Gaming
    • Other Toolsets

    03

    A la date d’écriture de cet article les thématiques sont les suivantes :

    • Universal Windows Platform development
    • .NET desktop development
    • Desktop development with C++
    • ASP.NET and Web development
    • Node.js development
    • Azure development
    • Data storage and processing (avec les outils pour SQL Server mais aussi Azure Data lake, Hadoop et Azure ML)
    • Office/SharePoint development
    • Mobile development with .NET (qui regroupe les outils pour développer avec Xamarin)
    • Mobile development with Javascript (qui regroupe les outils pour développer avec Apache Cordova)
    • Mobile development with C++
    • Game development with Unity
    • Game development with C++
    • .NET Core cross-platform development (qui regroupe les outils nécessaires pour développer avec la nouvelle mouture cross-platform de .NET)
    • Linux development with C++ (qui regroupe les outils pour développer des applications Linux avec Visual Studio – oui, oui, vous ne revez pas Winking smile )
    • Visual Studio extension development (qui regroupe les outils pour développer des extensions pour Visual Studio)

    De nouvelles thématiques pourront apparaitre lors des prochaines mises à jour.

    Une fois que vous avez choisi les thématiques qui vous intéressent, un résumé de la liste des composants techniques qui vont être installés est affiché à droite de la fenêtre. Certains composants optionnels ne sont pas cochés par défaut. Vous pouvez les cochez vous-mêmes comme par exemple PowerShell tools et Azure Storage AzCopy lorsque vous choisissez la thématique Azure development

    06-highlighting

    Il ne vous reste plus qu’à cliquer sur le bouton Install et c’est parti !

    07

    Bon à savoir : le programme d’installation de Visual Studio 2017 nommé Visual Studio Installer reste installé sur votre PC après l’installation et vous pouvez le relancer pour installer de nouvelle thématique, des composants techniques supplémentaires ou les mises à jour.

     

    How I improved my chatbot

    $
    0
    0

    I think a common attribute of a hardcore coder is procrastination.  Up to now I have brainstormed my LadyBug but have not done much coding to support the backend.  Nonetheless, this is probably my last blog on the design of my #chatbot and will start coding it pretty soon.  If you haven’t seen my other articles on this topic, then have a look. #chatbots

    As a review, I have discussed:

    • How I created the chatbot
    • Most common English questions and how to answer them with LIUS and C#
    • How to Publish the chatbot
    • How to Test and Debug it (hardcore)
    • Some LUIS enhancements like:
      • Phrase Lists
      • Utterance upload
      • Entities
    • Designing theBrain(LuieResult result) method (discussed in this article)

    Here is what I am going to do:

    • Answer questions that match only a single Intent and no entity
    • Answer questions that match multiple (2) Intents and no entity
    • Answer questions that match only a single Intent and only a single entity (multiple Intent (2) to a single Entity)
    • Answer questions that match multiple (2) Intents and multiple entities (2)
    • Answer questions that match multiple (2) Intents, multiple entities (2) and consider the previous Intents and Entities
    • Infinity…

    Let’s walk through it.

    Answer questions that match only a single Intent and no entity

    As you can see in this article, I have already done that.  As shown in Figure 1, based on the single intent returned from LUIS I have an answer to the question.  This is limited, I know.

    image

    Figure 1, answer questions that match only a single Intent and no entity #chatbot

    Answer questions that match multiple (2) Intents and no entity

    As you may have learned by setting up the debugging platform discussed here, That it’s a good place to get information about how to reference the attributes of the JSON file returned from LUIS.  What I am thinking is that in the methods shown in Figure 1, will update them to check and see if the Score attribute of the second Intent within the LuisResult class is > .50-.60.   If yes, then I will use both to answer a question specific to those 2 Intents.  Within the single Intent method, I could add this statement and call theBrain() method if it matches.

    if (result?.Intents[0]?.Intent != null && result?.Intents[1]?.Score > .60 )
    {
      theResponse = theBrain(result);
    }
    

    Since I have 11 Intents, there can be 100 combinations.  Using Excel I simply took each of the Intents and mapped them to each of the other Intents, it worked out looking something like that in Figure 2.

    image

    Figure 2, multiple LUIS intent mapping for a #chatbot

    So, what needs to happen is to add some logic into theBrain() method to look at the 2 intents, see what they are and answer the question appropriately.

    if (firstIntent == "Location" && secondIntent == "Time")
    {
     theResponse = "That is a really nice place to visit, but I do not have the time.";
    }
    

    Answer questions that match only a single Intent and only a single Entity

    Using Excel again, I mapped all my Entities to an Intent, which resulted in the following, shown in Figure 3.  This give us another 100 possible answers to questions, now we are up to 200 total unique responses to questions asked of the #chatbot.

    image

    Figure 3, LUIS Intent to Entity mappings for a #chatbot

    Since there should always be at least one Intent, that is the place where the code needs to be added to look for the other Intents and Entities.  What can be done here is to add this check to see if the there is an Intent and an Entity.  You could also check to see if there is a second Intent.

    if (result?.Intents[0]?.Intent != null && result?.Entities[0]?.Type != null )
    {
      theResponse = theBrain(result);
    }
    

    Then, in theBrain() method look for all the possible scenarios and respond appropriately.

    if (firstIntent == "Location" && firstEntitiy == "Bad")
    {
     theResponse = "I have never been there, but consider someplace else.  I'm just saying.";
    }
    

    Answer questions that match multiple (2) Intents and multiple entities (2)

    Now it really starts rocking hardcore.  First, I mapped the Entities (2), see Figure 4 like I did with the Intents in Figure 2.

    image

    Figure 4, multiple LUIS entity mapping for a #chatbot

    A single Entity mapping (remember there are 10) to a single Intent mapping (remember we have 11) results in about 90 more unique responses that can be sent from the #chatbot.  Up to 290 total now.  See Figure 5.

    image

    Figure 5, LUIS entity mapping to a LUIS Intent for a #chatbot

    For each Location/Time Intent pair there will be a total of 10 relationship models like in Figure 5.  That would mean a total of 900 unique responses per Intent pair, getting us to 1190 possible unique responses.  That is for 1 Intent pair, there are 10 intent pairs, as shown in Figure 2.  Which would mean (10 x 900) + 290 = 9290 possible responses from my #chatbot.

    The code from the default LUIS method could be something like this.

    if (result?.Intents[0]?.Intent != null && result?.Intents[1]?.Score > .60 && 
        result?.Entities[0]?.Type != null result?.Entities[1]?.Score > .60)
    {
      theResponse = theBrain(result);
    }
    

    And theBrain() method would respond like.

    if (firstIntent == "Location" && secondIntent == "Time" && firstEntitiy == "Bad" && secondEntity == "Interesting")
    {
     theResponse = "I have never been there.  You are keeping my very busy.  But what I hear is it's attociously absorbing ";
    }
    

    Infinity…

    It is actually a mind-blowing pattern and there is really no end, I mean with only a few mappings and relationship we can respond with almost 10000 unique responses, with many, many more options.

    Just for fun I created Figure 6 that illustrates how the mapping of multiple (2) Intents to multiple Entities (2) would look like.  Note that it is only partially complete as I ran out of colors and time.  The point is that there are a lot of combinations and a lot of responses that can be sent back from the #chatbot.  I wonder if there are existing libraries or algorithms that already have these sentences…well, most likely not for the Intents and Entities I have chosen.

    image

    Figure 6, LUIS multiple (2) intent and multiple (2) entity mapping to a LUIS Intent for a #chatbot

    I was hoping to find some cool hidden pattern in my map like is discussed in this TED video “Math is the hidden secret to understanding the world” or maybe a Fibonacci number or pattern, but no such luck, but I didn’t finish the mapping so maybe…  This was fun and I hope I get the chance to finish this project and actually code it.

    How to Apply Transaction Logs to Secondary When it is Far Behind

    Viewing all 12366 articles
    Browse latest View live