Happy new 2016!

How to Convert an IP Address to IP Number in SQL

The process of converting an IP Address to an IP Number is relatively simple. For example take the IP Address - To convert it to an IP Number you would do the following.

Number = (256*256*256*192) + (256*256*168) + (256*1) + (0)

Unfortunately MS SQL doesn't provide any native Split functionality to split the decimal separated ip address into the small pieces of data that we could easily work with. We thought we were going to have to do some nasty string dissection using Substring and CharIndex and then we stumbled upon the beautiful Parsename function. Apparently this function was originally designed to help developers navigate through the MS SQL naming structure (ie databasename.dbo.tablename). For our purposes it worked great to pull apart our decimal separated string so we could perform calculations on each piece of data.

update IPTable set IPNumber = 
      256 * 256 * 256 * CAST(PARSENAME(@ipaddress, 4) AS float) + 
      256 * 256 * CAST(PARSENAME(@ipaddress, 3) AS float) + 
      256 * CAST(PARSENAME(@ipaddress, 2) AS float) + 
      CAST(PARSENAME(@ipaddress, 1) AS float)

Happy coding!

How Microsoft deployed Windows 10 inside the company

Unsurprisingly, Microsoft has learned a thing or two about deploying new versions of Windows inside the company over the years.


By doing an in-place upgrade, Microsoft's IT department deployed Windows 10 to 85 percent of the company's employees within four weeks of its release, and by 95 percent within 10 weeks -- a week ahead of IT's goal.

"The Windows 10 deployment was the fastest company-wide operating system deployment Microsoft IT has ever seen. In-place upgrade deployment using OSD was the key technology that enabled this successful deployment." (OSD. or Operating System Deployment, is a feature of System Center 2012 R2 Configuration Manager SP1.)

Those stats are according to a technical case study published by the company's IT department earlier this month.

As this is a Microsoft-blessed document, this isn't the place to come for a list of gotchas or things that went wrong. However, there are some interesting "lessons learned" and best practices in the case study -- even for smaller (and possibly larger) IT shops that are planning to deploy Windows 10 at some point in the future.

By doing an in-place upgrade, Microsoft avoided having to manage OS images, like the company did when it deployed Windows 7."Microsoft users really didn't have to do anything. Click, click, install and they were up and running," the case study claims, as applications, data and settings were carried over through the migration.

Because Microsoft scheduled mandatory updates to happen during times that most computers at the company would be connected to the corporate network (such as Tuesdays at noon lunch), there was less impact on the help desk, reducing support costs by roughly 50 percent, the case study claims.

As Windows Insider testers know, Microsoft has been flighting Windows 10 builds inside the company, too, as part of its Windows 10 development/deployment process. The case study notes that Microsoft IT created an early adopter community to test these early builds.


Inside the company, there are currently a select number of employees on the Canary ring, getting daily builds; the Operating System Group ring (running builds validated by the Canary Ring) and then the broader Microsoft ring (running builds validated by the Operating System Group ring). Prior to Windows 10's initial release in July, there were already 38,000 users, or 40 percent of the company's employees running Windows 10, the case study notes.

"Most" of the computers at Microsoft were running Windows 8.1 before the early adoption phase of Windows 10, though as a result of "a recent Microsoft acquisition" (I believe, after watching this Windows 10 deployment video, a reference to the Nokia handset business), there were hundreds of line-of-business apps that were developed to run on Windows 7 as part of the mix, too.

Microsoft Builds Android App Store For Its Own Android Apps Inside Of The Android App Store


Microsoft has a new app out called ‘Microsoft Apps‘ on Android that contains a list of its Android apps that you can download on the Android app store.

There are two parts to this development. The first is that Microsoft’s cross-platform work continues, and that the company has yet to let up an inch on its work to bring its software and services to users on every rival operating system. And, the second point is that Microsoft has created an effective Android app store — catalog? — inside of the actual Android app store.

An early comment noted that fact. From the app’s page on Google Play:


That comment is almost correct. At the same time, it can be difficult to sort through tens, and hundreds of thousands of apps to find the precise one that you are perhaps looking for. Microsoft wants to make sure that if you want to use its stack on Android, you can do so without unnecessary sleuthing.

The app has racked up four review so far, giving it an average score of 4 stars.

The new app might not make sense until you realize just how many apps Microsoft has on Android — you can take a spin through the full list here. It’s extensive. It’s almost odd to recall how big a splash bringing Office to Android and iOS once was.

Microsoft fans have a new toy, and the company has a potential conduit for its apps on the Android platform. Not too bad a turn of events for the Redmond-based software company.

Automatic Table of Contents

Any long page of content with distinct and well marked up content can benefit from a table to contents. A table of contents provides a quick way to jump down the page to the desired section. Of course you can create a table of contents manually, but it may be smart to build it dynamically on-the-fly with JavaScript. This is true for several reasons:

  • It's easier - write the JavaScript once and it can create the Table on Contents on every page you need it.
  • It's more reliable - the JavaScript isn't subject to authoring errors.
  • It's still accessible - A table of contents is good for the general concept of accessibility, but it is a bonus (not having it doesn't ruin the page) and nearly all screen readers run JavaScript.

This kind of thing has been done many times and many ways. But this time is ours! Plus it makes for a good tutorial.

HTML: Headers and IDs

A long page of different parts you wish to link to could be marked up a bunch of ways. Perhaps a FAQ page could be a <dl>. It could literally be <section> after <section>. In our case, we'll assume this structure:

   <h3 id="question-one">Title of Question</h3>
   <!-- whatever other content, probably some paragraphs and stuff. -->

   <h3 id="question-two">Another Question</h3>
   <!-- whatever other content, probably some paragraphs and stuff. -->

   <!-- etc -->

A perfectly legit page full of headers with IDs and the content between them. Note the ID's. They are unique, as any good ID ought to be. This is required because it gives us a link target.

A link like this:

<a href="#question-one">Link to Question One</a>

Will jump down the page when clicked until the element with the ID "question-one" is in view.

Building the Table of Contents with jQuery

Our goal is to inject HTML on the page in the form of a table of contents. Like this:

<nav role="navigation" class="table-of-contents">
  <h2>On this page:</h2>
    <li><a href="#question-one">Question One</a></li>

Step 1: A string of HTML

We'll build this entirely dynamically. Perhaps it would be smart to use some kind of JavaScript templating for this. But hey, this is so simple, let's just build a big string and append that.

var ToC =
  "<nav role='navigation' class='table-of-contents'>" +
    "<h2>On this page:</h2>" +

Step 2: Loop through the headers

The <h3>'s on our page indicate each section we wish to link to, so we'll find them all with a jQuery selector, then loop through each of them.

$("article h3").each(function() {
  // loop

Step 3: Get the bits of data we need

We need 1) the text of each header, which we will turn into a link and 2) the ID of each header which we can turn into a href attribute for that link.

var el, title, link;

$("article h3").each(function() {
  el = $(this);
  title = el.text();
  link = "#" + el.attr("id");

Inside of that loop, "this" refers to the header element currently targeted, so to speak. we set "el" to a jQuery version of it, so we can use jQuery methods on it to extract that text and ID.

Step 4: Create a new list item and append to string

var newLine, el, title, link;

$("article h3").each(function() {
  el = $(this);
  title = el.text();
  link = "#" + el.attr("id");

  newLine =
    "<li>" +
      "<a href='" + link + "'>" +
        title +
      "</a>" +

  ToC += newLine;

The "+=" there means "append this new string to the already existing string stored in this variable.

Step 5: Close the "template"

ToC +=
   "</ul>" +

Step 6: Inject HTML onto page

Now you'll need to decide just exactly where you want this newly formed table to contents to be injected onto the page. Putting at the top of the page is probably smart.

Our example uses <article> to wrap everything, so to inject at the top of that, we would do:


In "real life", perhaps you'd target a header and use insertAfter or another of jQuery's fancy DOM insertion methods.

See the Pen Automatic Table of Contents by Enrico (@erossini) on CodePen.

MOBI Mime Type

How to setting IIS for .mobi extensions?

  1. Open IIS and click on its name


  2. Double click on MIME


  3. Then right click and in the menu click on Add.


  4. Then add as file name extension .mobi and as MIME type application/x-mobipocket-ebook

How to reinstall Office 2010 without the installation DVD

If you need to reinstall your Microsoft Office 2010 software but do not have the installation discs, you can download the software or order a backup DVD from the Microsoft Office 2010 website.

To download a backup copy of Office 2010

  1. Locate your 25-character Microsoft Office Product Key. You will find the product key on the original product package, on a Product Key Card sent with your computer or in your Order Confirmation email.
  2. Go to the Get a backup of Office 2010 web page and click the Download button.
  3. Enter your Office 2010 product key. You will be given the choice to download the software or order a DVD copy for a fee.
  4. Once the software is downloaded, double-click the downloaded file and follow the on-screen instructions to install and activate your software.

Ballmer to Microsoft: Universal apps won't work, Android on Windows Phone will


Former Microsoft CEO Steve Ballmer reckons Microsoft's universal Windows app strategy will fail to fill its app gap. Instead, the company needs to ensure Windows Phone handsets can run Android apps.

It's no secret that Microsoft still has a problem on the mobile front two years on from its acquisition of Nokia's handset business, a deal which was led by Ballmer. Windows Phone continues to hold single-digit market share, offering little incentive for developers to invest in building apps for the platform.

To address this issue, Microsoft earlier this year announced software bridges to make it easier for iOS and Android developers to port their apps to Windows 10 and Windows 10 Mobile.

However, earlier this month, it seemed that Microsoft would abandon its Android bridge, dubbed Project Astoria.

That decision was a mistake, according to comments made by Ballmer at Microsoft's annual general meeting on Wednesday.

An audience member questioned Microsoft CEO Satya Nadella about the continued absence of key apps for Windows Phone, to which Nadella responded that it was appealing to Windows developers through its universal apps program, which lets them build apps that work across PCs and mobile devices.

"That won't work," Ballmer is quoted by Bloomberg as saying as Nadella spoke. Microsoft instead needs to allow Android apps to run on Windows Phone.

What’s New in Visual Studio Update 1 for .NET Managed Languages


Hold on to your hats, cowboys and cowgirls! A lot of exciting things are coming out of the .NET Managed Languages team for Visual Studio 2015 Update 1. Read on to learn more about new IDE features, interactive C#, new code analysis management, Visual F# improvements, and the new F5 experience for Roslyn open source development.


New Editor Features

Now that we have Roslyn in Visual Studio 2015, we can leverage its power to create the smartest IDE out there. The improvements we’ve made to the IDE experience in Update 1 relate chiefly to navigation and refactoring:

  • Go To Implementation. The most notable change we made with regards to navigation is the introduction of “Go To Implementation.” You can now navigate from a base class or type to its various implementations. This saves a lot of time when searching in large solutions—when using Find All References returns a long list.
  • Convert Method to Property. We added the refactoring that now allows you to press “Ctrl+.” inside a method with no arguments and convert it into a property. We’ll even notice if you have a pair of Get/Set methods and convert them into a single property. This refactoring cascades throughout your solution so you don’t have to manually fix this change elsewhere.
  • VB Go to Definition and Object Browser. After hearing feedback from many of you, we added an option to make it easy to restore the behavior where VB Go to Definition would navigate to the Object Browser. You can find this option under "Tools->Options->Text Editor->Basic->Advanced->Navigate to Object Browser for symbols defined in metadata".
  • VB Commands for Next/Previous Member Fix. Many VB customers noticed that we forgot to implement support for navigate to the next and previous method. Oops. We brought that back, and added support for C# as well. Look for it on the Edit menu.
  • Go To/Peek Definition Bug Fix. We fixed this issue where you had to change your tabs to spaces in order to Peek Definition or Go To Definition. Huzzah! (Could you tell that Roslyn’s coding style is to use spaces instead of tabs? ;))

Microsoft's new service makes app developers out of everyday employees


Work is growing increasingly mobile thanks to smartphones, but companies can have a hard time coping with demand for apps that let their workers take corporate data on the go. Mobile developers are expensive, and getting new applications tested and then pushed out to users can be a time-consuming process.

Microsoft just unveiled a new beta service on Monday that's supposed to help ease that tension by allowing anyone to build an app - no software development experience required. PowerApps combines a cloud application backend with easy-to-use tools that make creating a mobile app a drag-and-drop affair.


PowerApps applications can pull in information from a variety of data sources including Office 365, Dynamics, Google Drive, Workday and other services. Developers can also build connections for PowerApps in their own services if there isn’t a connector already available.

Once the data connection is set up, users can then start building an application interface from one of Microsoft’s pre-built templates, or plug key data into PowerApps and let the service suggest the right designs for their purposes. Those people who have a strong idea for what they want their app to look like can create it from scratch.


Once users have built the apps they want, they can then use Microsoft's service to share their newly created tools with coworkers who have the PowerApps application installed on their smartphones.

The system is currently limited to building software that runs inside the PowerApps app on mobile devices, however, so employees won’t be able to push their creations to the iOS App Store or Google Play Store. Microsoft Corporate Vice President Bill Staples said during a press briefing that Microsoft will consider feedback from its customers when determining if the company should make it possible to create standalone applications using PowerApps.



Planet Xamarin

Planet Xamarin