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).
Apr
15
2014

Reno Hackathon 2014

Congratulations to the winners announced at the Reno Hackathon!

Many of the participants used GameMaker by YoYo Games to create an app.  A testimony to GameMaker Studio is that most who were using it were doing so for the first time – and of that group, some had no development background whatsoever! This was highlighted in the news coverage by KRNV Channel 4 as seen here:

image

Although the participants took the Hackathon seriously, the event was full of energy, prizes, and great networking.  There was a variety among the attendees – students, entrepreneurs, moonlighters, and newbies.  For a glimpse of what the journey was like, check out the news coverage by KTVN Channel 2:

image

The Reno Gazette-Journal also noted the activity corresponding with the Hackathon involving tech for NASA.

The Microsoft licensing team in Reno demonstrated their logistical prowess which resulted in everything running smoothly.  Special thanks to Bruno Terkaly and tech-celebrity Sarah Austin (with PlexiNLP) for contributing their technical mentorship to all!

image

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

Surface RT Review

Surface RT - Why Loved

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