Massive Selection of Microsoft eBooks

There are millions of ebooks available for download on the internet and not all of them are available legally. However, Eric Ligman (Microsoft Senior Sales Excellence Manager) has compiled a massive list of freely, and legally, available Microsoft ebooks on his blog. They cover a large range of topics including, but not limited to

  • Windows 7
  • Windows 8
  • Windows 8.1
  • Office 2010
  • Office 2013
  • Office 365
  • SharePoint 2013
  • Dynamics CRM
  • PowerShell
  • Exchange Server
  • Lync 2013
  • System Center
  • Azure
  • Cloud
  • SQL Server
  • ASP.NET
  • C#

They are all available by permission of the copyright license/owner which may change in the future. Fot this reason I am not linking directly to any but to view the full list go here: largest-collection-of-free-microsoft-ebooks-ever

Click here for other posts relating to free books.

Arrays in VB.NET

I recently wrote a post on declaring arrays in C# and decided to convert it to VB. Below is code for a console app that demonstrates declaring Single Dimension Arrays, Multi Dimension Arrays and Arrays in Arrays, also known as Ragged or Jagged Arrays.

Module Module1

    Sub Main()
        'single dimension
        Dim ages(4) As Integer
        ages(0) = 3
        ages(1) = 6
        ages(2) = 20
        ages(3) = 34
        ages(4) = 67

        Console.WriteLine("Single Dimensional Array")
        For ageLoop = 0 To ages.Length - 1
            Console.WriteLine(String.Format("Item {0}: {1}", ageLoop, ages(ageLoop)))
        Next

        Console.Write(vbCrLf & vbCrLf & "Multi Dimensional Array" & vbCrLf)

        'multi dimensional
        Dim names(1, 1) As String
        names(0, 0) = "Andrew"
        names(0, 1) = "Bobby"
        names(1, 0) = "Susan"
        names(1, 1) = "Peter"

        Console.WriteLine("Row" + vbTab + "Col" + vbTab + "Value")
        For row = 0 To names.GetUpperBound(0)
            For col = 0 To names.GetUpperBound(row)
                Console.WriteLine(String.Format("{0}{1}{2}{3}{4}", row, vbTab, col, vbTab, names(row, col)))
            Next
        Next

        Console.Write(vbCrLf & vbCrLf & "Array of Arrays" & vbCrLf)

        ' Array of arrays
        Dim days()() As String = New String(1)() {}
        days(0) = New String(1) {}
        days(0)(0) = "Monday"
        days(0)(1) = "Wednesday"

        days(1) = New String(3) {}
        days(1)(0) = "Tuesday"
        days(1)(1) = "Friday"
        days(1)(2) = "Saturday"
        days(1)(3) = "Sunday"

        Console.WriteLine("Row" + vbTab + "Col" + vbTab + "Value")
        For row = 0 To days.GetUpperBound(0)
            For col = 0 To days(row).GetUpperBound(0)
                Console.WriteLine(String.Format("{0}{1}{2}{3}{4}", row, vbTab, col, vbTab, days(row)(col)))
            Next
        Next

        If (System.Diagnostics.Debugger.IsAttached) Then
            System.Diagnostics.Debugger.Break()
        End If

    End Sub

End Module

Below is code for another console app that shows how arrays can be initialised inline with declarations and a way to use For Each loops to iterate the array elements.

Module Module2

    Sub Main()
        'single dimension
        Dim ages() As Integer = New Integer(4) {3, 6, 20, 34, 67}

        Console.WriteLine("Single Dimensional Array")
        For Each age As Integer In ages
            Console.WriteLine(age)
        Next

        Console.Write(vbCrLf & vbCrLf & "Multi Dimensional Array" & vbCrLf)

        'multi dimensional
        Dim names(,) As String = New String(1, 1) {{"Andrew", "Bobby"}, {"Susan", "Peter"}}

        Console.WriteLine("Row" + vbTab + "Col" + vbTab + "Value")
        For Each name As String In names
            Console.WriteLine(name)
        Next

        Console.Write(vbCrLf & vbCrLf & "Array of Arrays" & vbCrLf)

        ' Array of arrays
        Dim days()() As String = { _
            New String() {"Monday", "Wednesday"}, _
            New String() {"Tuesday", "Friday", "Saturday", "Sunday"} _
        }

        Console.WriteLine("Row" + vbTab + "Col" + vbTab + "Value")
        For Each d() As String In days
            For Each day As String In d
                Console.WriteLine(day)
            Next
        Next

        If (System.Diagnostics.Debugger.IsAttached) Then
            System.Diagnostics.Debugger.Break()
        End If
    End Sub
End Module

The example application is available from Github here.