Tuesday, November 29, 2016

Angular JS Notes

Angular JS 1.X


(function () {
'use strict';

angular.module('myApp', [])
.controller('DIController', myFunction);

DIController.$inject = ['$scope', '$filter'];

function myFunction($scope, $filter) {
  $scope.name = "Obama Donald";

  $scope.upper = function () {
    var upCase = $filter('uppercase');
    $scope.name = upCase($scope.name);
  };
}

})();

Angular defines a concept of a so called digest cycle. This cycle can be considered as a loop, during which Angular checks if there are any changes to all the variables watched by all the $scopes. So if you have $scope.myVar defined in your controller and this variable was marked for being watched, then you are explicitly telling Angular to monitor the changes on myVar in each iteration of the loop. This "digest" is also called "dirty checking", because, in a way, it scans the scope for changes. I cannot say if it's for better or for worse than observable pattern. It depends on your needs.

What is dirty checking? The process of checking every watch to detect the changes, is called dirty checking. There could be two scenarios:
    First Scenario
  • Get a watch from list
  • Check whether item has been changed
  • If there is no change in item then
  • No Action taken, move to next item in watch list
    Second Scenario
  • Get a watch from list
  • Check whether item has been changed
  • If there is Change in an item, DOM needs to be updated, return to digest loop
In second case, loop continues till it finds no changes in the entire loop. And once it completes, DOM gets updated if required.

Note: Dirty checking will check anything changes in $scope variable and update it to the DOM. This done by angular js, you can also implement dirty checking by your own.

Friday, November 18, 2016

Microsoft 2016 Connect(); Keynote Day 1


Key Note


What is github and why people use it?

Purpose: To store your source code on the version control system and publish it on the net to share or
collaborate with others developers to develop projects. Apart from that, it also serves the purpose as resume or mini website to profolio your projects. There are some people use it as social networking tool.

Common Term
Repository
Fork a repo
Pull Request
Social Networking
Change Log

Additional Reference:
Github Introduction
Github Repositories

Tuesday, November 15, 2016

Xamarin Cartoon

My own initiative to illustrate what Microsoft Xamarin can bring to software developers.
More Info

Hacker Rank Programming Practice in 30 days:

  • Day 0: Hello, World.
  • Day 1: Data Types
  • Day 2: Operators
  • Day 3: Intro to Conditional Statements
  • Day 4: Class vs. Instance
  • Day 5: Loops
  • Day 6: Let's Review
  • Day 7: Arrays
  • Day 8: Dictionaries and Maps
  • Day 9: Recursion
  • Day 10: Binary Numbers
  • Day 11: 2D Arrays
  • Day 12: Inheritance
  • Day 13: Abstract Classes
  • Day 14: Scope
  • Day 15: Linked List
  • Day 16: Exceptions - String to Integer
  • Day 17: More Exceptions
  • Day 18: Queues and Stacks
  • Day 19: Interfaces
  • Day 20: Sorting
  • Day 21: Generics
  • Day 22: Binary Search Trees
  • Day 23: BST Level-Order Traversal
  • Day 24: More Linked Lists
  • Day 25: Running Time and Complexity
  • Day 26: Nested Logic
  • Day 27: Testing
  • Day 28: RegEx, Patterns, and Intro to Databases
  • Day 29: Bitwise AND

It was a long time since I posted on this blog.

I will start posting by tomorrow onwards. :-) 时间过得很快,一年复一年过去了。