Tuesday, January 22, 2013

Very Useful Jquery References


The best references


Six Things Every jQuery Developer Should Know
http://msdn.microsoft.com/en-us/magazine/ee730275.aspx

Object Oriented way of Jquery
http://msdn.microsoft.com/en-us/magazine/gg476048.aspx


How to Debug Your jQuery Code
http://msdn.microsoft.com/en-us/magazine/ee819093.aspx
http://milan.adamovsky.com/2012/04/on-april-26th-2012-i-presented-this.html

Unobstrusive Javascript
http://en.wikipedia.org/wiki/Unobtrusive_JavaScript

How to Create Your Own jQuery Plugin

http://msdn.microsoft.com/en-us/magazine/ff608209.aspx

Creating Responsive Applications Using jQuery Deferred and Promises
http://msdn.microsoft.com/en-us/magazine/gg723713.aspx

Introduction to Complex UIs Using jQuery UI
http://msdn.microsoft.com/en-us/magazine/hh127352.aspx

All In One Framework
http://www.elijahmanor.com/2010/06/my-7-jquery-articles-on-script-junkie.html

 

Object Oriented, functional and closure view of Jquery

Jquery =$

Well, I have been too much into Jquery. Being C# developer by nature its always been hard to adopt the style of programming in Jquery. What differentiate more is the style and modularization we have in C#. Apparently I like Jquery and try to code it as modular as I can.

Here is quick reference of MSDN magazine issue, Script Junkies....
http://msdn.microsoft.com/en-us/magazine/gg476048.aspx

Here you will understand following few important things.
  1.  Functional way of programming Jquery
  2.  Jquery Plugins
  3.  Objects in Jquery
  4.  Object-orientation through Closures
  5.  Object-orientation through Prototypes
  6.  Inheritance In Jquery
Functional Jquery:
  1. // Function to calculate a total
  2. var CalcTotal = function(x, y) {
  3. return x + y;
  4. };
  5. // Function to add taxes
  6. var AddTaxes = function(x) {
  7. return x * 1.2;
  8. };
  9. // Function that pipelines the other two
  10. var CalcTotalPlusTaxes = function (fnCalcTotal, fnAddTaxes, x, y) {
  11. return fnAddTaxes(fnCalcTotal(x, y));
  12. };
  13. // Execution
  14. var result = CalcTotalPlusTaxes(CalcTotal, AddTaxes, 40, 60);
  15. alert(result);
How to write Jquery plugins

  1. jQuery.fn = jQuery.prototype = {
  2. init: function( selector, context ) { ... },
  3. size: function() { return this.length; },
  4. each: function( callback, args ) {
  5. return jQuery.each( this, callback, args ); },
  6. ready: function( fn ) { ... }
  7. :
  8. }
Objects in Jquery

  1. var person = new Object();
  2. person.Name = "Dino";
  3. person.LastName = "Esposito";
  4. person.BirthDate = new Date(1979,10,17)
  5. person.getAge = function() {
  6. var today = new Date();
  7. var thisDay = today.getDate();
  8. var thisMonth = today.getMonth();
  9. var thisYear = today.getFullYear();
  10. var age = thisYear-this.BirthDate.getFullYear()-1;
  11. if (thisMonth > this.BirthDate.getMonth())
  12. age = age +1;
  13. else
  14. if (thisMonth == this.BirthDate.getMonth() &&
  15. thisDay >= this.BirthDate.getDate())
  16. age = age +1;
  17. return age;
  18. }
Object-orientation through Closures

  1. var Person = function(name, lastname, birthdate)
  2. {
  3. this.Name = name;
  4. this.LastName = lastname;
  5. this.BirthDate = birthdate;
  6. this.getAge = function() {
  7. var today = new Date();
  8. var thisDay = today.getDate();
  9. var thisMonth = today.getMonth();
  10. var thisYear = today.getFullYear();
  11. var age = thisYear-this.BirthDate.getFullYear()-1;
  12. if (thisMonth > this.BirthDate.getMonth())
  13. age = age +1;
  14. else
  15. if (thisMonth == this.BirthDate.getMonth() &&
  16. thisDay >= this.BirthDate.getDate())
  17. age = age +1;
  18. return age;
  19. }
  20. }
Object-orientation through Prototypes
  1. // Pseudo constructor
  2. var Person = function(name, lastname, birthdate)
  3. {
  4. this.initialize(name, lastname, birthdate);
  5. }
  6. // Members
  7. Person.prototype.initialize(name, lastname, birthdate)
  8. {
  9. this.Name = name;
  10. this.LastName = lastname;
  11. this.BirthDate = birthdate;
  12. }
  13. Person.prototype.getAge = function()
  14. {
  15. var today = new Date();
  16. var thisDay = today.getDate();
  17. var thisMonth = today.getMonth();
  18. var thisYear = today.getFullYear();
  19. var age = thisYear-this.BirthDate.getFullYear()-1;
  20. if (thisMonth > this.BirthDate.getMonth())
  21. age = age +1;
  22. else
  23. if (thisMonth == this.BirthDate.getMonth() &&
  24. thisDay >= this.BirthDate.getDate())
  25. age = age +1;
  26. return age;
  27. }
Inheritance In Jquery
By using the prototype feature you can achieve inheritance by simply setting the prototype of a derived object to an instance of the “parent” object.
  1. Developer = function Developer(name, lastname, birthdate)
  2. {
  3. this.initialize(name, lastname, birthdate);
  4. }
  5. Developer.prototype = new Person();

Thursday, January 10, 2013

Tool to remove Forceful/Unwanted DLL from GAC Assembly

I have been searching this one for long time and thankfully I pressed a right button, Well ! I'm through.

http://abhi.dcmembers.com/blog/2009/04/17/forcefully-delete-an-assembly-from-gac/

  1. Open “regedit”
  2. Navigate to “HKEY_CLASSES_ROOT\Installer\Assemblies\Global”.
  3. Search for registered assemblies GAC.
  4. Delete the appropriate entry from this list.

Tuesday, January 8, 2013

Beginner MVC4 Web API : Learning 1


It’s been long time since I have not been writing much here. Finally I got time to write something on technology. I installed VS2012 professional and I took a first look of MVC4 framework web API. I don’t know how much application architect will see this framework to work as per business need. It depends upon the requirement in all aspects such performance, scalability, usability, availability, maintainability etc. All these factors play a crucial role in deciding the adoption of any architectural model or framework. Same goes with data architect and so on. Well my take is always a model view presenter as I’ve been developing all my application from my career start in MVP. Now it’s time to change and change is always good. Everyone wants you to know and use MVC.

I followed the tutorial online which helped me understand the basic.

Why MVC?

·         Clean URL

·         Loosely Coupled-Separation of concerns

·         Restful Service

·         Make use of Web API.Json, Jquery and Javascript and lot

·         Mobile platform

·         Best for Unit testing

·         Flexible GUI/UI design.

·         Efficient Search engine Optimization

Some known characters in MVC framework..I will not spend time talking much about the underlined definitions of MVC and all . I would rather like one to know few important key things that are must.

1)      MVC 4 framework development using Razor and Scalfold templates.

2)      MVC4 Web API using JQuery, Json and JavaScript.

3)      MVC4 Filters, Routing, bundles and Web API configuration.


If one tries to understand above construct in much better form then it’s much easier to grasp the overall learning of MVC 4 framework. Thanks GOD I started now as many revolutionary changes have been done from MVC1 to MVC4. Hopefully I neither want to go in past nor want to understand the flaws or round way of doing things.

Recommendation is to try below references to self start.



·         http://www.asp.net/mvc/mvc4

·         http://www.asp.net/web-api

·         http://www.asp.net/mvc



Guru Mantra: A one video walktrough in your phone can help you touch base technology to place you better in this world.

Download Learning Videos:


Wanna take break just Listen to this, Hotel California by eagles.