# Monday, February 3, 2014
Monday, February 3, 2014 8:35:00 PM (GMT Standard Time, UTC+00:00)
# Sunday, February 2, 2014

Today I am grateful to those who went out of their way to connect with me personally while I was in Seattle last week.

Today I am grateful for a week at TechReady filling my brain and my belly.

Today I am grateful I was invited to a private party at a frickin' pro football stadium!

Today I am grateful for a seafood dinner in Seattle last night with my teammates, that I met this week.

Today I am grateful to the honest person who found and returned my laptop yesterday.

Today I am grateful for the opportunity to learn so much.

Today I am grateful for the hospitality and generosity of my friend Ted Neward and his family.

Today I am grateful for a good night sleep after a long day of travel.

Today I am grateful that my team is patient and willing to answer all my dumb questions.

Today I am grateful that so many universities are willing to allow me to come in and teach their students.

Today I am grateful I was able to stay inside yesterday and avoid the extreme cold.

Today I am grateful for lunch yesterday with my friend Dan, who I don't see often enough.

Today I am grateful that the folks at Indiana University were able to organize a game development event on short notice and that people attended on a day the University is closed.

Today I am grateful that my job takes me to Bloomington, IN, so I get to spend bonus time with Tim Giard.

Today I am grateful for a successful game development hackathon at Rose-Hulman yesterday in Terrre Haute, IN.

In 2012, I bought a new car. Although it's not fancy, I am grateful today that it has navigated safely through the many miles of bad weather and rough road conditions I've driven these past 2 weeks.

Today I am grateful I was upgraded to a 2-bedroom suite last night.

Today I am grateful that I've found a job I love.

Today I am grateful to start another year of the Great Lakes Area .NET User Group. #MIGANG

Today I am grateful to all the amazing people who appeared on #TechnologyAndFriends, helping me to make it to show 300.

Today I am grateful I could spend yesterday walking around downtown Chicago with my son.

Today I am grateful for an amazing day yesterday - watching a Spartan overtime victory with my goddaughter Amanda and my son Tim; followed by the Microsoft mid-winter party at the Chicago Field Museum.

Today I am grateful that no damage was done to my house while I was out of town 4 days during a severe cold, snow, and rain.

Today I am grateful to Jim Holmes and the amazing job he and his minions have done producing the #CodeMash conference the past 8 years!

Today I am grateful that 2 full days of precompiler workshops at #CodeMash are now behind me.

Today I am grateful to reconnect with so many old friends this week at #CodeMash

Today I am grateful we made it safely driving 130 miles in arctic conditions last night.

Today I am grateful for the young men who helped push my car out of a snow bank last night.

Today I am grateful for lunch yesterday with my son, who took me to his favourite cheesesteak restaurant.

Today I am grateful for my Aunt Ida, who passed away earlier this week. After 90+ years being kind to others, she has gone to heaven to be with her husband. RIP Aunt Ida.

Today I am grateful for the Michigan State Spartan football team and their exciting Rose Bowl victory over an excellent Stanford Cardinal team. #GoGreen

Today I am grateful for an amazing 2013. I grew more these past 12 months than I have in many years.

Today I am grateful I was able to keep down my breakfast. I'm feeling much better than I did yesterday.

Today I am grateful my son Nick was able to make it home for Christmas.

Sunday, February 2, 2014 5:29:24 PM (GMT Standard Time, UTC+00:00)

TechReady is an internal conference for Microsoft field employees. As far as I can tell, field employees are those who do not work for a product team in Redmond, which is still a lot of people.

Well, I am now a Microsoft employee and my group (Developer Platform Evangelism, aka DPE) does not build products, so I was able to attend TechReady for the first time this week.

What an experience! I attend a lot of conferences and my habit at these conferences is to only attend a few sessions, electing instead to find smart people in the hallways or speaker room or lunch room and pick their brains to learn as much as I can about real world software experiences. This conference was different - in part because I didn't know a lot of attendees and in part because so much of the content was not available anywhere else.  I attended as many sessions as I could and even watched recordings of a few sessions on the flight home.

Before attending, I promised I would not share the content of any sessions (much of it focused on features that may or may not be in a future product release); so I'll share my impressions and experiences here.

First, this conference was a great opportunity to meet others inside Microsoft. A number of evangelists from the west region attended and I got to know them. One night, my team had dinner with Sanket Akerkar, the Vice President in charge of US DPE. I was impressed with his openness and the frank exchange about the future of evangelism within Microsoft.

At most meals, I sat with strangers and got to know people from all over the world in many different roles at Microsoft. Microsoft is a very diverse company with all kinds of people doing all kinds of things and this week really underscored that fact to me. I also had a chance to meet up with some old friends, such as Josh Holmes, Kevin Pilch-Bisson, Dani Diaz, Chet Kloss, Mark Grimes, Jeff Wilcox, and Ted Neward. Ted doesn't work for Microsoft but he invited me to dinner with his family when he heard I was in town. I had a long conversation with consultant David Chappell, a Microsoft consulting partner who has written extensively on the impact of the cloud on businesses. Part of that conversation was recorded and I'll share it in a few weeks.

I heard a lot of talk about technologies that I want to explore later - in particular Project Siena and Unity.

I listened to many people smarter than me discussing product feature decisions. I was impressed by how much of Microsoft product features are driven by customer requests. A frequent exchange I heard was: "Why did you decide to implement Feature A and not Feature B?" "Because many of our customers have requested Feature A and we hear very little demand for Feature B, so we deferred B for a later release." Microsoft is sometimes perceived as a walled tower that unilaterally pushes products on customers but this week showed me emphatically that is not the case.

Overall TechReady gave me a greater appreciation for my new company. The conference is bi-annual, so I hope to get back to it shortly.

Sunday, February 2, 2014 1:34:00 AM (GMT Standard Time, UTC+00:00)
# Thursday, January 30, 2014
# Wednesday, January 29, 2014

Ajax refers to the pattern of calling server-side methods from client-side JavaScript. jQuery provides a simple, straightforward method for making Ajax calls. The syntax is

            url: ServiceEndpoint,
            dataType: ReturnDataType,
            type: HttpVerb,
            data: Data,
            error: function (err) {
                // Code to run when error returned
            success: function (data) {
                // Code to run when successfully returned


  • ServiceEndpoint is the URL of the method to call on the server
  • ReturnDataType is the data format we expect the server method to return (“xml”, “html”, “script”, “json”, “jsonp”, or “text”). You can specify multiple values and the server will return the first matching format type that is supported by this method.
  • HttpVerb is the HTTP verb (“GET”, “POST”, “PUT”, or “DELETE”) to use to send data to the server.
  • Data is the data (if any) that is sent from the client to the server.

By default the Ajax method executes asynchronously. When a call returns from the server, jQuery will run the function specified in the success parameter (if the call returned successfully); or the function in the error parameter if an exception occurred. These functions accept return data or error information returned from the server as parameters, so that your client-side code can handle return values effectively.

Ajax can provide a much more responsive experience to your web page and jQuery can make ease the process of making Ajax calls.

Wednesday, January 29, 2014 5:03:00 PM (GMT Standard Time, UTC+00:00)
# Tuesday, January 28, 2014
Tuesday, January 28, 2014 3:14:00 AM (GMT Standard Time, UTC+00:00)
# Sunday, January 26, 2014

In the last article, I showed how to use jQuery to select elements in the Document Object Model (DOM) of a web page. In this article, I will show things you can do with those selections.

Calling Methods on Selections

We can call methods on the list of objects returned by a selection simply by appending a dot, followed by the method call and any arguments to the selection syntax. For example, the following jQuery will hide all the anchor tags on a page:


Binding Functions to Selections

One of the powers of jQuery is the ease with which we can bind a function to the events of an object, so that this function executes whenever the event fires. To do so, simply append a selection with a dot followed by the name of the event; then, pass the function as an argument to the event, as shown below:


For example, the click event fires when a user clicks on a page element. The following sample binds a function to the click event of an element with the ID “Div1”:


The (document).ready event

The document variable is defined within the jQuery script. Selecting this variable with $(document) will return the document as a whole. The most common use for this selector is to bind a function to the document’s ready event. The syntax for this is


I have omitted the body of the function in this case, but notice the anonymous function declaration. In JavaScript, we don’t need to assign a name to a function if we are binding it to an event – we only need to pass that function to the method name. This is common syntax in JavaScript.

In fact, binding a function to the document ready event is so common, that its syntax can be shortened to simply surrounding a function with parentheses preceded by “$”, as shown in the following snippet, which does the same thing as the previous snippet


Putting it All Together

We can nest functions in jQuery and we often do so by binding code to events when the document.ready event fires, as in the following example:
<script type="text/javascript" src="jquery-1.10.2.min.js"></script>
<script type="text/javascript">

In this article, I showed how to manipulate selected elements and bind events to those elements. This can be done when a page loads by adding code to the document.ready event.

Sunday, January 26, 2014 5:00:00 PM (GMT Standard Time, UTC+00:00)
# Saturday, January 25, 2014

How JavaScript Interacts with a Web Page

When a web page loads in a web browser, the browser loads all elements into memory. Each element on a page exists in a containership hierarchy – that is, each element is contained within another element with the document itself at the top of this containership hierarchy. Containership is defined by tags that are opened and closed between the opening and closing tags of another element. For example, the simple page in the listing below is loaded into memory in an object graph similar to that shown in Figure 1.

    <title>My Page</title>
       src="http://code.jquery.com/jquery-1.7.1.min.js ">
          This a <a href="Page2.htm">link</a>

Fig. 1

jQuery keyword

Because jQuery is JavaScript, it can be mixed with native JavaScript in your script files. The jQuery object is defined in the jQuery file and you can use it via the “jQuery” keyword. This keyword tells the parser that what follows is jQuery syntax. This keyword is so common that it can be shortened to the simpler “$”.

“$” is used to define selectors and to call methods defined in the jQuery scripts.


Most of what you will do with jQuery involves selecting a set of objects and performing some action on those objects, such as

· Changing the properties of each object in the set

· Binding code to an event of the objects

· Calling a method on each object

You can return a set of objects with the following jQuery syntax:


where selector is a snippet identifying which objects to select. The syntax of a jQuery selector is similar to the syntax for a CSS selector. The most common selectors are for a tag, and ID, and a Class Name, as shown in the list below.


Select by…






Class Name



Element Type



Variable Name


A selector preceded by “#” will be interpreted as an ID selector. jQuery will search the page for any element that matches the ID that follows “#” in the selector.

A selector preceded by “.” will be interpreted as a Class selector. jQuery will search the page for any element assigned the name of the Class that follows “.” in the selector.

A selector with no preceding characters will be interpreted as a Tag selector. jQuery will search the page for any element with the tag name identified in the selector.

Advanced Selectors

Combining Selectors

It is possible to combine selectors to either narrow your selection or establish containership.

Two selectors separated by a space indicate that jQuery should select the second selector only if it is found within the first selector. For example, $(“div a”) selects every anchor tag that is contained within a div tag.

Two selectors concatenated without a space indicate that jQuery should select only objects that match both selection criteria. For example, $(“div.BodyText”) selects any div tag that contains the attribute class=”BodyText”.

Set-based Selectors

By default, jQuery selectors always select a set of elements, even if that set may contain zero, one, or more than one element. However, we can refine a selection further by appending filters to a selection, such as “:first”, to select only the first element in the selected list of elements; “:last”, to select the last element in the selected list; “:even”, to select only the even-numbered elements; and “:odd”, to select only the odd-numbered elements. When even and odd selectors, it is important to note that the sets start with index number 1.

For example, $(“div:first”) selects the first div on the page, while $(“a:even”) selects every other anchor on the page, beginning with the second.

In this article, I described how to select objects on a web page with jQuery. In the next article, I will show things that we can do with those selections.

Saturday, January 25, 2014 5:56:00 PM (GMT Standard Time, UTC+00:00)
# Friday, January 24, 2014

Accessing jQuery From Your Site

To start using jQuery, simply add a reference to the jQuery library as in the following example:


Of course, you will need to download jQuery from http://jQuery.com and save it in your site’s scripts folder for the location above to work. Also, the currently downloaded version may have a slightly different name as the version number is included in the file name.

Using a Content Delivery Network

Alternatively, you can connect to jQuery on a Content Delivery Network (CDN), such as one provided by jQuery, Microsoft, or Google, in the following manner:





  src="http://code.jquery.com/jquery-1.10.2.min.js ">

A CDN offers the following advantages:

  1. A CDN has servers around the world, so it can serve up files closer to the client that requested them, so they download faster.
  2. Most web clients cache files by default, so the client may already have a cached copy of the jQuery script file and may not need to download it again.

Adding jQuery to your site or page is simple and fast. In my next article, I will talk about the syntax of jQuery and how to use it to select objects on a web page.

Friday, January 24, 2014 5:42:00 PM (GMT Standard Time, UTC+00:00)
# Thursday, January 23, 2014

I began to write web applications in the 1990s and, from the beginning, I understood that client-side scripting would enhance my applications. If I wanted to update part of a web page, client-side scripting could do so quickly and elegantly and without sending a new request to the server or refreshing the entire page and I knew it.

JavaScript quickly became the de facto language of the web and, unfortunately, I was never very good at JavaScript. One reason I struggled with JavaScript was because each browsers implemented JavaScript in its own way and sometimes the language diverged from one browser to the next. For example, the following JavaScript code is necessary to perform the simple task of retrieving an element from a web page:

var id = "Div1";
var elm = null;
  if (document.getElementById)
    elm = document.getElementById(id);
  else if (document.all)
    elm = document.all[id];
  else if (document.layers)
    elm = document.layers[id];

Notice there are several different JavaScript commands that retrieve an element by its ID. Some commands work in some browsers, but not in others. The code snippet above has to test the validity of each command until it settles on one that works within the current browser.

This simple task is complicated by the different JavaScript engines.

Eventually, I discovered jQuery and the problem of cross-browser client-side program went away. jQuery is a JavaScript library that allows a developer to write code that works across disparate browsers, without the necessity of trying multiple commands. The jQuery core library takes care of the different JavaScript implementations. For example, the code above is simplified in jQuery to

var elm = $("#Div1");

This is a simple task, yet it underscores the terseness and simplicity of jQuery. All the cross-platform code is abstracted away when I use jQuery, making my JavaScript much easier to read and maintain.

Thursday, January 23, 2014 5:37:00 PM (GMT Standard Time, UTC+00:00)