Tuesday, March 26, 2013

jQuery animation


<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("div").animate({left:'250px'},5000);
$("div").animate({right:'250px'},5000);
    $("div").animate({backgroundColor: "#aa0000",
          color: "#cff",
          width: 500},5000);
$("div").text = "aaa";
   $("div").animate({backgroundColor: "#aa0000",
          color: "#fff",
          width: 100},5000);
  });
});
</script>
</head>

<body>
<button>Start Animation</button>
<p>By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!</p>
<div style="background:#98bf21;height:100px;width:100px;position:absolute;">
</div>

</body>
</html>

How to get or set the value of controls through jQuery




How to get or set the value of controls through jQuery

from w3schools : 

Get Content - text(), html(), and val()

Three simple, but useful, jQuery methods for DOM manipulation are:
  • text() - Sets or returns the text content of selected elements
  • html() - Sets or returns the content of selected elements (including HTML markup)
  • val() - Sets or returns the value of form fields

jQuery : making a button draggable : use draggable({cancel:false})









<!DOCTYPE html>
<html>
<head>
 <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
 <script>
  $(function() {
$("#mydiv").draggable();
$("#mybutton").draggable({cancel:false});
  });
  </script>
</head>
<body>

<div id="mydiv" > sdfdsfds </div>
<input type="button" id="mybutton" value="Submit form" />
</body>
</html>

Sunday, March 17, 2013


Good list of cloud computing learning


This is list from http://weblogs.asp.net/sbehera/archive/2011/11/18/good-list-of-cloud-computing-learning.aspx


Saturday, February 23, 2013

C# Constructors



1. Constructor is special method of a class that has the same name as the class and that does not have any return value.
2. A constructor that does not take any parameter (i.e. parameter less) is called default constructor.
3. In C#, all classes (except static classes) and structs are required to have default (parameter less) constructor.
4. static classes are not required to have default constructor. But if a constructor is provided to static class, then it must be static and it must be parameter less.
              *static classes cannot have instance constructors.
              *static class constructor must be static
              *static class constructor must be parameter less.
In short static classes can have only one constructor, and it must be static and parameter less.
5. structs  CANNOT have explicit default constructor. A default constructor is always provided by compiler to structs and it not allowed to code default constructor for structs.
6. Classes can have multiple constructors, each with different signature. These are called overloaded constructors.
7. If a parametered constructor is provided for a class, then default constructor MUST also be provided. Compiler provides default constructor only when no constructors are provided to the class.
8. Abstract classes can also have constructors, and rules for abstract class constructors are same as those of any non-static class constructors.

Saturday, February 16, 2013

What is the difference between an interface and an abstract class ?
Interface    Abstract Class
You cannot use access specifiers with members of an interface. All interface members are implicitly public and cannot have any other access specifier.    Members of abstract class can have all access specifiers except private i.e. they can be internal, public, protected and protected internal but not private.
All the members of an interface are implicitly abstract (although you cannot explicitly use abstract keyword because it not allowed to use access specifiers in interface).    An abstract class can have non-abstract members.
Interface cannot have static members.    Abstract classes can have non-abstract static members.
A class can inherit one or more interfaces.     A class can inherit from only one abstract (or non-abstract ) class.
Modifying an interface results in breaking the existing clients. This is because clients must implement all interface members, and interface members are only declarations , no code or values are allowed.    Not all modifications in an abstract class break existing clients. E.g. adding a new non-abstract method to the base abstract class will not break existing clients.
Interfaces CANNOT have constructors and destructors.    Constructors and destructors ARE ALLOWED in abstract classes.
The abstract class constructors cannot be abstract or private.
Interface    Abstract Class
You cannot use access specifiers with members of an interface. All interface members are implicitly public and cannot have any other access specifier.    Members of abstract class can have all access specifiers except private i.e. they can be internal, public, protected and protected internal but not private.
All the members of an interface are implicitly abstract (although you cannot explicitly use abstract keyword because it not allowed to use access specifiers in interface).    An abstract class can have non-abstract members.
Interface cannot have static members.    Abstract classes can have non-abstract static members.
A class can inherit one or more interfaces.     A class can inherit from only one abstract (or non-abstract ) class.
Modifying an interface results in breaking the existing clients. This is because clients must implement all interface members, and interface members are only declarations , no code or values are allowed.    Not all modifications in an abstract class break existing clients. E.g. adding a new non-abstract method to the base abstract class will not break existing clients.
Interfaces CANNOT have constructors and destructors.    Constructors and destructors ARE ALLOWED in abstract classes.
The abstract class constructors cannot be abstract or private.
   
Interface    Abstract Class
You cannot use access specifiers with members of an interface. All interface members are implicitly public and cannot have any other access specifier.    Members of abstract class can have all access specifiers except private i.e. they can be internal, public, protected and protected internal but not private.
All the members of an interface are implicitly abstract (although you cannot explicitly use abstract keyword because it not allowed to use access specifiers in interface).    An abstract class can have non-abstract members.
Interface cannot have static members.    Abstract classes can have non-abstract static members.
A class can inherit one or more interfaces.     A class can inherit from only one abstract (or non-abstract ) class.
Modifying an interface results in breaking the existing clients. This is because clients must implement all interface members, and interface members are only declarations , no code or values are allowed.    Not all modifications in an abstract class break existing clients. E.g. adding a new non-abstract method to the base abstract class will not break existing clients.
Interfaces CANNOT have constructors and destructors.    Constructors and destructors ARE ALLOWED in abstract classes.
The abstract class constructors cannot be abstract or private.
   

jQuery and GridView : How to highlight current row/current cell on mouseover ?

It is particularly very simple to highlight a row /highlight a gridview cell on mouseover.

GridView can be access by its ID as a table and its row can be accessed as a "tr", its cell can be accessed as "tr td", in the simplest case.

So I can have something like following to change the color of a row on mouseover, and recover the color on mouseout :


$(document).ready(function() {
                             $("#GridView1 tr").mouseover(function() { $(this).css("background-color", "Red"); }).mouseout(function() { $(this).css("background-color", "White"); });
             
           });


The same can be done for a cell simply by changing "tr" to "tr td" :


$(document).ready(function() {
                             $("#GridView1 tr td").mouseover(function() { $(this).css("background-color", "Red"); }).mouseout(function() { $(this).css("background-color", "White"); });
             
           });



"#GridView1 tr td" can be literally interpreted as "for each td in each tr in a parent element named GridView1"

Same way code can be written for click event also:

$(document).ready(function() {
               alert("hello");
               $("#GridView1 tr").mouseover(function() { $(this).css("background-color", "Red"); }).mouseout(function() { $(this).css("background-color", "White"); });
               $("#GridView1 tr").click(function() { $(this).css("background-color", "Green"); });              
           });





This code was tested using jquery-1.7.2 :
 <script type="text/javascript" src="jquery-1.7.2.min.js"></script>


Comparing features of LangGraph vs CrewAI

LangGraph Orchestration vs CrewAI Orchestration The following table compares LangGraph and CrewAI orchestration across their menta...