Wednesday, December 7, 2016

Underscore.js : The Best Developer Productivity Tool

If you are dealing with JavaScript/Json Objects or Arrays or Collections in your project, Underscore.js would be the best developer productivity tool. It has more than 80 + in-built utility functions to perform various operations on Javascript Objects.

At first glance, you may think that JQuery library and Underscore.js has similar functionality but JQuery library mainly concentrate on DOM manipulation whereas Underscore.js offers only utility functions to manipulate Javascript Objects.

Underscore.js offers more control on Javascript Object compare to JQuery
The file size of Underscore.js is less than 5.9 KB after compression and GZip.

You can download minimized Underscore.js from http://underscorejs.org/underscore-min.js
You can download complete utility functions from http://underscorejs.org/

Few popular utility functions

1.    pluck
var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];
_.pluck(stooges, 'name');
Output : ["moe", "larry", "curly"]

2. find
var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
Output: 2

3. filter
var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
Output: [2, 4, 6]

4. min
var numbers = [10, 5, 100, 2, 1000];
_.min(numbers);
Output : 2

5. sortBy
var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];
_.sortBy(stooges, 'name');
Output: [{name: 'curly', age: 60}, {name: 'larry', age: 50}, {name: 'moe', age: 40}];

6. countBy
_.countBy([1, 2, 3, 4, 5], function(num) {return num % 2 == 0 ? 'even': 'odd';});
Output : {odd: 3, even: 2}

Happy Coding :)

Sunday, December 4, 2016

Web API Token Based Authentication using OWIN, OAuth and Existing Login Table


REST API has become so popular with the rise of Mobile Application usage in the industry. Token Based Authentication is the best way to authenticate the user instead of cookie/session based authentication.

The following are the disadvantages of using server based session authentication
  1.  Using Sessions: On every user successfully authentication, server has to allocate session for the logged in user. So, It increases lot of overhead in the server 
  2.  Scalability: In-Proc sessions are stored in server memory , so it can not be easily scalable. 
  3. CORS: cookies don’t play well in case of multiple different domains. 

The following are the benefits of using token based authentication
  1.  Token based authentication is stateless. We are not storing any information about our user on the server or in a session. 
  2. Easy scalable to different servers 
  3. Easy to use in Mobile Application authentication No issues with CORS
You can download complete documentation from the URL : Download

You can download complete Visual Studio Source Code from the URL : Download

Happy Coding :)

Wednesday, November 30, 2016

Hybrid Mobile Application Using AngularJS, WebAPI and Ionic Framework

Hybrid Mobile applications considered as simple web application, primarily built using HTML, CSS and JavaScript. Instead of running these applications on mobile browser, it will run on thin native container. Running an application under native container will helps to access mobile native features like access camera, calendar, contacts, notifications, Geolocation, Gestures (swipe, pinch and spread) and etc.

Hybrid Application vs. Native Application

  1.  Developing Hybrid Application as simple as developing web application using HTML, CSS and JavaScript. Developing Native Application needs a lot of learning curve i.e. Developer has to learn Objective – C for IOS applications, Java for Android applications and C#.NET for windows phone applications
  2.  Performance wise Native applications are faster compare to Hybrid Applications
  3.  Native applications supports lot of inbuilt UI components for designing
  4.  Hybrid Applications use Native Container i.e. WebView in Android and UIWebView in iOS to run the application
  5. Developer has to use one of the following framework to create Hybrid Applications
  •  Ionic Framework
  •  Apache Cordova
  •  Adobe PhoneGap
Ionic Framework:

It is an open source framework to build mobile applications. It is hybrid application development framework built using AngularJS library.

1. Fully cross-platform
2. More than 70 in-built native plugins

You can download complete documentation for converting AngularJS application into Hybrid Mobile Application from the URL : Download

You can download Sample AngularJS application from the URL : Download

You can download Sample Android APK from the URL : Download


Happy Coding :)

Sunday, November 27, 2016

Design Patterns Interview Questions


The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioural

See the following sample Design Pattern Interview Questions


   Download the answers from the URL :Download

  Happy Coding :)

Thursday, November 24, 2016

Design Patterns With Real Time Examples using C#.NET ( Gang Of Four )


  1. A design pattern is a recurring solution to a standard problem
  2. It is a reusable solution to a commonly occurring problem in software design
  3. Time tested solution for Architecture problems

The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral

In this, I have explained all 23 design patterns with UML diagram and real world example.So, The real world example gives better idea about  how can we use specific design pattern when problem arise.





Download the complete design patterns PPT from the URL :Download

Download the complete design patterns Real Time Examples with Source Code : Download

Happy Coding :)

Saturday, October 15, 2016

Design Patterns Cheat Sheet ( Gang Of Four )

The following attached PDF represent quick 23 Gang Of Four Design Patterns. It is organized easy printable format and can be attach to your desk for quick reference.

In this, I have explained all 23 design patterns with UML diagram and real world example.So, The real world example gives better idea  how can we use specific design pattern when problem arise.


Download the complete design patterns PDF from the URL : Download
Download the complete design patterns Portable PDF from the URL : Download

Happy Coding :)