Friday, August 16, 2013

Testing JavaScript

Jasmine.js:
"Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests."

chutzpah.codeplex.com
"Chutzpah is an open source JavaScript test runner which helps you integrate JavaScript unit testing into your website. It enables you to run JavaScript unit tests from the command line and from inside of Visual Studio."

"On the AngularJS team, we rely on testing and we always seek better tools to make our life easier. That's why we created
Karma - a test runner that fits all our needs."

JavaScript Promises

JavaScript Promises: by Shawn Wildermuth

A promise is a pattern for handling asynchronous operations. The problem is that essentially when you start an asynchronous operation, you need to execute some code as the operation is completed. Asynchronous code is so common that most libraries have found a solution for passing in callbacks. But there is little commonality to how each libraries does this...

a promise (is a) object that several JavaScript libraries use 
(including AngularJS, jQuery, Dojo and WinJS). 

The asynchronous operation simply returns an object called a promise.
The promise allows you to call a method called "then()" that let's you specify the function(s) to use as the callbacks.

then() function can accept two functions. The first is for the success callback; the second for the failure callback:

var $info = $("#info");

$.ajax({
    // Change URL to see error happen
    url: "/echo/json/",
    data: {
        json: JSON.stringify({
            "name": "someValue"
        })
    },
    type: "POST"
})
.then(function (response) {
    // success
    $info.text(response.name);
}, 
function () {
    // failure
    $info.text("bad things happen to good developers");
})
.always(function () {
    $info.append("...finally");
});

The Hyperloop and Hyper-Innovation

The Hyperloop and Hyper-Innovation | LinkedIn

Windows RT future?

Tablet Tribulations: Asus Dumps Windows RT While NVIDIA Hopes For The Best | TechCrunch


With Asus out, just Dell and Microsoft remain as the only Windows RT hardware providers. Samsung, HTC, HP, and Lenovo previously pulled plans for a Windows RT tablet.

This means that people want "full version" Windows (8) even if it costs $100 more...
Solution: lower size (7"-8") and price ($200-$300) of WinRT devices,
and unified apps for Win Phone & Tablets.


Is It Too Late for Windows RT Tablets?
"I don't think it's too late…but they need to do something they're not good at…trade profits for market share. It worked for the Xbox…"