Jan
3
2015

Install Visual Studio 2015

This blog post is part of a series covering ASP.NET 5

The following is a step-by-step guide to installing Visual Studio 2015 (currently in Preview).

  1. Download Visual Studio 2015 Preview
  2. Execute the file when the download is complete.  You will be prompted with a screen similar to what is shown next:image
  3. Select the options relevant to your development needs.  Although all options are checked in the screen capture below, the highlighted items below are essential for web development:image
  4. After clicking the Install button, the application will start to acquire files and perform the install:
    image
  5. If you previously selected Visual C++ Cross Platform Mobile Development or Tools for Apache Cordova, you will see the following:
    image
    This enables features as seen below:
    image
    After clicking Install, you will see a secondary installer to enable the desirable third-party features:
    image
    The secondary installer will confirm selected features:
    image
    The installation will continue with acquiring needed files and applying:
    image
  6. Once Visual Studio 2015 is installed, you will need to sign in with your Microsoft account:image

Visual Studio 2015 is now installed and ready!

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Jan
2
2015

ASP.NET 5

aspnetA hand-picked collection of posts, articles, videos, and resources related to ASP.NET 5. All posts featured on Palermo4.com will be "living content" - that is it will be updated to be in sync with current releases. If you happen to know of any resource that should be here, please leave a comment below!

Overview, Concepts, & Resources

ASP.NET 5 on Palermo4.com

Videos

scott hunter asp.net 5
Scott Hunter on ASP.NET 5
mva asp.net 5 scott hanselman scott hunter
MVA ASP.NET 5
asp.net 5 community standup
Community Standup
    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Oct
27
2014

Sharing a TouchDevelop App

Making an app has never been easier.  Just visit TouchDevelop and try yourself!  After creating an app, you will likely want to get feedback and share it with others.  Although the publishing process offers a way to share the app, here is what to do if you want to share it later.

1) Sign in to TouchDevelop

2) Locate the app you created under “my scripts” and select it

image

3) Select the “share” option

image

4) Use the URL provided however you wish Smile

image

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Oct
12
2014

Universal Windows Apps with Angular

Starting with Visual Studio 2013 (with update 2), developers can create an app with a single solution to target multiple devices such as PCs, tablets, or phones.  This type of solution can generate universal Windows apps.  These can be written with C#, C++, or JavaScript. For video training on the topic, please check out the free course at the Microsoft Virtual Academy.

If written with JavaScript, web developers who use Angular will be happy to know you can continue to do so while making apps.

For a jumpstart on the development process, I have created a starter solution with a bare-bones shell that properly sets up Angular for use in the project.  The starter solution is named AngularVS (Angular for Visual Studio) and is available publicly at github.

A key factor for Angular to work properly in these types of apps is the use of the the ng-csp directive as seen below.  Not only will this enable Angular to work smoothly, if declared before other popular libraries|frameworks such as jQuery, it helps enable them safely too!

ngcsp

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Sep
26
2014

IsPrime Function in JavaScript

The following code sample illustrates how to use JavaScript to determine if a number provided is a prime number or not. In this example, the number is hardcoded in the JavaScript. You can edit this and experiment with other values at the isPrime at CodePen

var theNumber = 22;
var primeResult = isPrime(theNumber);
document.write("<hr />" + primeResult);

function isPrime(n) {

  var s = [2,3,5,7];
  var ld = [1,3,7,9]; 
  var divs = [];

  if (n==1) {return false;}
  if (s.indexOf(n) > -1) {return true;}
  
  if (ld.indexOf(n%10) > -1) {
     divs = getDivisibles(n);
     document.writeln(divs);
  } else {
    return false;
  }
  
  return (divs.length == 0);
  
}// isPrime

function getDivisibles(n) {
  var i = 2;
  var divs = [];
  while (i*i<=n) {
      if (n%i==0) {
        var upper = n/i;
        divs.push(i);
        if (upper>i) {divs.push(upper);}
      }
      i++;
  }// while
  divs.sort(function(x,y){return x-y;});
  return divs;
}// getDivisibles

See the Pen isPrime by J Michael Palermo IV (@palermo4) on CodePen.

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Sep
26
2014

Demo jQuery Selectors

The demo below shows how to find a count of elements using different jQuery selectors. To modify the expressions yourself, feel free to make edits at the jQuery selectors demo at CodePen


$(document).ready(function () {
  // start the results of methods below with this:
  writeLine("Selectors<hr />");

  // count of all elements
  writeSelectorLength("*");

  // count of elements in body
  writeSelectorLength("body *");

  // count of all divs and p tags
  writeSelectorLength("div,p");

  // count of all p tags direct children of divs
  writeSelectorLength("div > p"); 

  // count of all li tags
  writeSelectorLength("li"); 
});

// helper method to write content at specific location in page
function writeLine(anyHtml) {    
    var output = $("#output");
    var currentOutputContent = output.html();
    output.html(currentOutputContent += anyHtml + "<br />");
}
// helper method to write results of getSelectorLength
function writeSelectorLength(anySelector) {
    writeLine(getSelectorLength(anySelector));
}
// helper methos wrapping results of query in a span
function getSelectorLength(anySelector) {
    return anySelector + 
        "<span class='smaller'> has </span>" + 
        $(anySelector).length + 
        " <span class='smaller'>matches</span>";
}

See the Pen MVA140826-jQuery by J Michael Palermo IV (@palermo4) on CodePen.

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).
Jul
28
2014

GameMaker Tips: Resources

A significant aspect to making games with GameMaker is the management of graphics, sounds, and other game related resources.  Inside GameMaker, resources are managed in the Resource Tree, which provides a file-explorer type view to all the gaming assets.

gamemaker resource tree  

The Resources menu option also provides a quick way to add resources to a game project.  Each respective resource menu-item has a corresponding keyboard shortcut.

gamemaker resources and keyboard shortcuts

    Copyright © Microsoft Corporation. All rights reserved.
    The code provided in this post is licensed under the Microsoft Public License (Ms-PL).

Resources

Archives