Microsoft Band Released – New Fitness Tracker

image

Microsoft has released a new fitness band product called Microsoft Band.  Like other fitness bands on the market, it tracks your activity including heart rate tracking and sleep tracking.  It also tracks GPS so that you can track where you have run, walked or biked.  It also has a UV sensor to track sun exposure and a galvanic skin response measurement to track stress. 

Microsoft Health

Microsoft Band will work with Android, iOS and Windows phones.  Microsoft Band also provides email and calendar preview and built in Cortana based voice activation.  Cortana will only be available though if you have a Windows phone.

Microsoft Health

Data is stored in Microsoft’s Health platform (what used to be called Health Vault) and Microsoft is promising machine learning algorithms that will provide you with recommendations on work outs, anticipate your needs and keep you motivated throughout the day.

Read More

Integrating Excel and Google Maps to Geo-code Your Addresses

My sister was looking for an easy way to calculate distances so I wrote her a couple macros that that she could use in Excel.  The code is below for anyone who wants to borrow it and extend it further.

Using Google MAP APIs

Google provides a very well documented and easy to use API that is accessible through basic HTTP requests.  The response it returns can be either JSON or XML format – in our case we’re using the XML format because the MSXML parser can easily parse it within an Excel Macro.

In order to use the XML parser, you need to have a reference to the Microsoft XML v6.0 COM object.  In the macro editor, go under Tools –> References and make sure this component is checked.  If the component isn’t in the list, you can browse to it – it should be located in the C:\Windows\System32 directory and the DLL is msxml6.dll.

image

Looking Up Longitude and Latitude

The objective in this scenario is pretty simple – take a list of addresses and geo-code them with longitude and latitude values.image

Google Maps API provides the ability to look up longitude and latitude:

https://maps.googleapis.com/maps/api/geocode/xml?address=New+York

Looking Up Distance

The objective in this scenario is to take a list of source and destination addresses and calculate the distance based on the shortest route that Google Maps calculates.  The advantage of this approach is this factors in the specific routing through streets instead of calculating it “as the crow flies” (e.g. directly from one point to another).

image

Google Maps API provides the ability to look up directions and routes and provides a total distance in meters for each route.

https://maps.googleapis.com/maps/api/directions/xml?origin=Chicago&destination=Toronto

VBA Macro Code

Option Explicit

' Subroutine to plug in Longitude and Latitude for a range of locations.
Public Sub LookupLongitudeAndLatitude()
    
    ' Declare variables
    Dim CurrentSheet As Worksheet
    Dim CurrentRange As Range
    Dim row As Range
    Dim Address As String
    Dim Longitude As Double
    Dim Latitude As Double
    Dim Success As Boolean
    Dim BlankValues As Boolean
    Dim Status As String
    
    ' Get the current selected cells
    Set CurrentSheet = ActiveSheet
    Set CurrentRange = Selection
    
    
    ' check for current range size to see if three columns are available.
    If CurrentRange.Columns.Count <> 3 Then
        MsgBox ("Please select 3 columns, one with addresses in it and two blank to put the long and lat values")
    Else
            
        For Each row In CurrentRange.Rows
          BlankValues = True
          Address = row.Cells(1, 1)
          
          ' Check for existing values.  We're expecting blank for columns 2 and 3 so if they have any content,
          ' we'll error out and send a warning isntead of writing over existing cells.
          If IsEmpty(row.Cells(1, 2)) <> True Then
            MsgBox ("Expected longitude column to be blank for cell " & row.Cells(1, 2).Address(False, False))
            BlankValues = False
          End If
          If IsEmpty(row.Cells(1, 3)) <> True Then
            MsgBox ("Expected latitude column to be blank for cell " & row.Cells(1, 3).Address(False, False))
            BlankValues = False
          End If
          
          If BlankValues = True Then
            Success = GetLongitudeAndLatitude(Address, Longitude, Latitude, Status)
            If Success = True Then
                row.Cells(1, 2) = Longitude
                row.Cells(1, 3) = Latitude
            Else
                row.Cells(1, 2) = Status
                row.Cells(1, 3) = Status
            End If
            
          End If
        Next row
    End If
    
    ' reset selection to original range
    CurrentSheet.Select
    CurrentRange.Select
    
End Sub

Private Function GetLongitudeAndLatitude(Address As String, Longitude As Double, Latitude As Double, Status As String) As Boolean

    ' Declare variables and set return value to false by default
    GetLongitudeAndLatitude = False
    Dim response As DOMDocument60
    Dim http As XMLHTTP60
    Dim node As IXMLDOMNode
    Dim nodes As IXMLDOMNodeList
    Set http = New XMLHTTP60
        
    ' Read the data from the website
    On Error Resume Next
    ' Open an XML request from Google using their GeoCode API
    http.Open "GET", "https://maps.googleapis.com/maps/api/geocode/xml?address=" & URLEncode(Address), False
    http.send
    Set response = http.responseXML
        
    ' get the status node.  This node tells you whether your search succeeded - OK means success.  Any other status means some kind of error or address not found.
    Set node = response.SelectSingleNode("/GeocodeResponse/status")
    If node.nodeTypedValue <> "OK" Then
        Status = node.nodeTypeString
    Else
        Set nodes = response.SelectNodes("/GeocodeResponse/result")
        ' check for multiple addresses if we found more than 1 result then error out.
        If nodes.Length > 1 Then
            MsgBox ("Found Multiple Matches for Address: " & Address)
        Else
            ' grab the latitude and longitude from the XML response
            Set node = response.SelectSingleNode("/GeocodeResponse/result/geometry/location/lat")
            Latitude = node.nodeTypedValue
            Set node = response.SelectSingleNode("/GeocodeResponse/result/geometry/location/lng")
            Longitude = node.nodeTypedValue
            GetLongitudeAndLatitude = True
        End If
        
    End If
    
    Set http = Nothing
    Set response = Nothing
    
End Function

' URL Encoding function courtesy of http://stackoverflow.com/questions/218181/how-can-i-url-encode-a-string-in-excel-vba
Private Function URLEncode( _
   StringVal As String, _
   Optional SpaceAsPlus As Boolean = False _
) As String

  Dim StringLen As Long: StringLen = Len(StringVal)

  If StringLen > 0 Then
    ReDim result(StringLen) As String
    Dim i As Long, CharCode As Integer
    Dim Char As String, Space As String

    If SpaceAsPlus Then Space = "+" Else Space = "%20"

    For i = 1 To StringLen
      Char = Mid$(StringVal, i, 1)
      CharCode = Asc(Char)
      Select Case CharCode
        Case 97 To 122, 65 To 90, 48 To 57, 45, 46, 95, 126
          result(i) = Char
        Case 32
          result(i) = Space
        Case 0 To 15
          result(i) = "%0" & Hex(CharCode)
        Case Else
          result(i) = "%" & Hex(CharCode)
      End Select
    Next i
    URLEncode = Join(result, "")
  End If
End Function

' Subroutine to plug in Distance between two addresses.
Public Sub LookupDistance()
    
    ' Declare variables
    Dim CurrentSheet As Worksheet
    Dim CurrentRange As Range
    Dim row As Range
    Dim SourceAddress As String
    Dim DestinationAddress As String
    Dim Distance As Double
    
    Dim Success As Boolean
    Dim BlankValues As Boolean
    Dim Status As String
    
    ' select the currently selected range
    Set CurrentSheet = ActiveSheet
    Set CurrentRange = Selection
    
    ' check for current range size to see if three columns are available.
    If CurrentRange.Columns.Count <> 3 Then
        MsgBox ("Please select 3 columns, one with source address, one with destination address and one for distance.")
    Else
        
        For Each row In CurrentRange.Rows
          BlankValues = True
          SourceAddress = row.Cells(1, 1)
          DestinationAddress = row.Cells(1, 2)
          ' Check for existing values.  We're expecting blank for column 3 so if it contains any content,
          ' we'll error out and send a warning isntead of writing over existing cells.
          If IsEmpty(row.Cells(1, 3)) <> True Then
            MsgBox ("Expected distance column to be blank for cell " & row.Cells(1, 3).Address(False, False))
            BlankValues = False
          End If
         
          If BlankValues = True Then
            Success = GetDistance(SourceAddress, DestinationAddress, Distance, Status)
            If Success = True Then
                row.Cells(1, 3) = Distance
            Else
                row.Cells(1, 3) = Status
            End If
            
          End If
        Next row
    End If
    
    ' reset selection to original range
    CurrentSheet.Select
    CurrentRange.Select
    
End Sub

Private Function GetDistance(SourceAddress As String, DestinationAddress As String, Distance As Double, Status As String) As Boolean
    
    ' Declare variables and set return value to false by default
    GetDistance = False
    Dim response As DOMDocument60
    Dim http As XMLHTTP60
    Dim node As IXMLDOMNode
    Dim nodes As IXMLDOMNodeList
    Set http = New XMLHTTP60
        
    ' Read the data from the website
    On Error Resume Next
    
    ' Open an XML request from Google using their Directions API
    http.Open "GET", "https://maps.googleapis.com/maps/api/directions/xml?origin=" & URLEncode(SourceAddress) & "&destination=" & URLEncode(DestinationAddress), False
    http.send
    Set response = http.responseXML
        
    ' get the status node.  If it isn't OK then we have either an error or no address found.
    Set node = response.SelectSingleNode("/DirectionsResponse/status")
    If node.nodeTypedValue <> "OK" Then
        Distance = 0
        Status = node.nodeTypedValue
    Else
        Set nodes = response.SelectNodes("/DirectionsResponse/route")
        If nodes.Length > 1 Then
            ' this should never happen unless alternatives=true is added on to the URL above.
            MsgBox ("Found Multiple Routes for Source Address " & SourceAddress & " and Destination Address " & DestinationAddress & ".")
        Else
            ' Grab the distance value from the XML - it's in meters so we'll divide by 1000 to convert to KM
            Set node = response.SelectSingleNode("/DirectionsResponse/route/leg/distance/value")
            If node Is Not Null Then
                Distance = node.nodeTypedValue
                Distance = Distance / 1000
                GetDistance = True
            End If
            
        End If
        
    End If
    
    Set http = Nothing
    Set response = Nothing
    
End Function

Read More

Faster Azure VM and Storage Options Just Announced

Microsoft has announced a new series of VM sizes called G-Series which provides higher performance, faster I/O and more RAM than current VM sizes.

VM Size Cores RAM (in GB) Local SSD Storage (in GB)
Standard_G1 2 28 406
Standard_G2 4 56 812
Standard_G3 8 112 1630
Standard_G4 16 224 3250
Standard_G5 32 448 6500

 

These VM sizes will be available later this year.

In addition, Microsoft is providing a new high performance storage called Azure Premium Storage which offers SSD based storage designed for intensive I/O workloads.  For those looking at shifting their SQL Server workloads to the cloud, this will be welcome news.

Pricing has not yet been announced.

Read More

Performance and Pricing Comparison of new Azure SQL Tiers

My colleague has performed some performance benchmarking of the new Azure SQL tiers with Dedicated Throughput Units.

Here are the results of his test:

clip_image001 

Based on these tests, you can see that indeed buying a premium service delivers premium results.  In addition to the performance improvement in premium, we also noticed that premium is also more consistent – the other tiers have a 5-10% variation in performance.

From a “DTU” perspective, these numbers also bring into question the reliability of the DTU measure in that S2 is supposed to be 250% faster than S1 (50 DTUs vs. 20 DTUs) but we’re not seeing 250% increase in transaction volume.  Similarly, P3 is supposed to be 400% faster than P2 (800 DTUs vs. 200 DTUs) but we’re not seeing 400% more transactions per second.

Based on this model, we can also calculate the price per 100K transactions for each tier:

Tier Transactions per Second Transactions per Hour Price per Hour Cost per 100K Transactions
P3 1300 4680000.00

$ 5.27250

$ 0.113
P2 555 1998000.00

$ 1.31820

$ 0.066
P1 276 993600.00

$ 0.65910

$ 0.066
S2 221 795600.00

$ 0.10630

$ 0.013
S1 164 590400.00

$ 0.04250

$ 0.007
S0 103 370800.00

$ 0.02140

$ 0.006
Basic 51 183600.00

$ 0.00710

$ 0.004

 

As you can see by the results, there is a MASSIVE price premium for performance commitment – the price per transaction for the top P3 service is a whopping 28X the price of Basic for the same transaction! 

You are buying a performance boost by going with a higher tier of service, but the costs escalate even faster and the boost isn’t as significant as promised at least with this basic performance test.

Choose the lowest possible tier to service your workload at all times to pay the cheapest rate per transaction.  You can dynamically scale up or down your service at any time and with a good monitoring and auto-scaling approach that dynamically moves up your service tier only when you need it, you will pay significantly less based on these performance numbers and the current pricing model.

Read More

Microsoft’s New App Launcher will Provide an Improved Office 365 Navigation Experience

As Microsoft has launched new services as part of the Office 365 subscription, the current global navigation is running out of runway to house all of them…

The current global navigation is what you see here:

image

As Microsoft adds new services this approach is becoming cumbersome.  In addition, as users add new applications, sites, content, links, etc. within each of these services there is no easy way to personalized and unified navigation across all of them.

The New App Launcher

 

The new App Launcher will provide a more Windows 8 start screen experience by allowing you to pin your list of apps to your Office 365 menu using a tile based experience instead of a simple menu.  You will have a My Apps page that has the exhaustive list of your applications (e.g. sites, feeds, documents, links, services, etc.) and you can then pin/un-pin them to your Office 365 App Launcher.

app launcher 2

app launcher 1

The update is expected to launch in November.

Read More

Microsoft Adds Real Time Stream Analysis and Hybrid Cluster Support to HDInsight

Apache Storm is a free and open source real time analytics processing system that processes large volumes of analytics data (e.g. web logs, streaming sensor readings, activity feeds, ecommerce transactions) in real time.  This is a departure from traditional Big Data tools such as Map Reduce which do similar analysis but through a batch processing approach.

Microsoft has announced that Apache Storm will be available as part of the latest version of the HDInsight Service. 

Hortonworks has also added hybrid data connectors to enable hybrid scenarios where on-premise Hadoop deployments are backed up to the cloud on Azure or where additional on-demand bursting is needed beyond what is available on premise.

Read More

Microsoft Continues to Grow Support for Open Source

There are now significant pieces of the Microsoft code eco-system that are now open source including:

Microsoft has a web site that describe its open source contributions and activities here.

image

Read More

New Microsoft Office Sway Provides a Responsive and Multi-Device Presentation Canvas

Microsoft has just announced the release of a brand new Office application – Microsoft Sway

Sway is a new presentation design canvas specifically designed for a multi-device, HTML driven world.  You can think of it as a replacement for PowerPoint that dynamically presents content through a responsive layout engine.  In addition, the “slide” metaphor transitions to a continual canvas that can flow left, right, up or down and resize and re-layout based on the capabilities of the device.

Sway Vision Video

 

There are some neat sample presentations available on the Sway.com site and you can sign up for the preview.

07A. Demo Sway tile - Red Panda

07B. Demo Sway tile - Northwest Aquarium

07D. Demo Sway tile - Pyrography

Read More

Great New Example of Microsoft Office Mix

Bill Gates has used the new Microsoft Office Mix technology to create a neat interactive presentation that includes high definition video, slides, annotations and narration.  Check it out as a great example of what can be produced using standard Power Point 2013 combined with the Office Mix technology to deliver as an online teaching tool.

Read More