Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Archive for April, 2010

Learning JavaScript tutorial – JavaScript switch Statement


Learning JavaScript tutorial – JavaScript switch Statement

JavaScript switch statement control the flow of program execution via a multiway branch. When we need execute a statement block depending on the value of a single variable; JavaScript switch Statement is the best alternative to JavaScript if Condition Statement to it handles the situation more efficiently than repeated if statements.

JavaScript switch Statement Syntax

switch (conditional expression)
{
  case condition 1:
    statement block executed if condition 1 is true(satisfied).
        break;
  case condition 2:
    statement block executed if condition 1 is true(satisfied).
        break;
  .
  .
  .
  case condition n:
    statement block executed if condition n is true(satisfied).
        break;
  default:
    statement block executed if no condition is true(satisfied).
    break;
}


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript if, if else and else if Condition Statement


Learning JavaScript tutorial – JavaScript if, if else and else if Condition Statement

Decision making based on different computations or perform actions depending on a programmer-specified condition is one of the features of the JavaScript language.

JavaScript if Condition Statement

JavaScript if Condition Statements are used to perform different actions (make decisions) based on different conditions evaluated to a Boolean true or false. JavaScript if Condition Statement help us to execute statement block conditionally.

JavaScript if Condition Statement Syntax

if (conditional expression)
  {
  statement block executed if condition is true(satisfied).
  }

Here, If the resulting value of conditional expression is true or can be evaluated to true, statement block enclosed within the Curly braces – {} is executed.

if Condition Statement flowchart
If Condition Statement flowchart


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Statements


Learning JavaScript tutorial – JavaScript Statements

A JavaScript program is simply a sequence of one or more JavaScript statements. JavaScript Statements is used to define the logic to make something happen. A statement can be used to declare a variable and assign a value. A statement can also be a function call, i.e. document.write(). JavaScript Statements are separated from each other with semicolons. The semicolon is optional in JavaScript, if you place each JavaScript statement on a separate line, JavaScript allows us to leave out the semicolons. The best practice of defining JavaScript Statements is to use semicolons, everywhere at the end of the each JavaScript statement.

JavaScript Statement Blocks

JavaScript Statement Block use Curly braces – {} to group a series of JavaScript Statements together to perform some sort of operation repeatedly or once based on desire condition. Whenever a JavaScript Statement Block occurs in JavaScript program is treated as a single statement. JavaScript Statement Block plays an important role while dealing with Conditional and Loop Statements.

<script type="text/javascript">
var iCount=0;
var iSum=0;
while(iCount<=5){
 iSum=iSum+iCount;
 iCount++;
}
alert(iSum); //alert 15
</script>


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Operator Precedence and Associativity


Learning JavaScript tutorial – JavaScript Operator Precedence and Associativity

Deciding on moving to a new web hosting company is pretty hard since there are a lot to choose from. Reading the editorial reviews always pays off.

In our last article "Learning JavaScript tutorial – JavaScript Expressions and Operators", we take a look at JavaScript Operators. JavaScript Operators have a predefined order of precedence which are used to process and evaluate a JavaScript expression. JavaScript Operator Precedence is similar to the Mathematical Operator Precedence and Associativity. Like basic algebra Operator Precedence, JavaScript multiplication and division Operator have higher precedence over addition and subtraction Operator. For example:

alert(4 + 3 * 2);  // alert ’10′

Using parentheses, we can group expressions so that we can evaluate any JavaScript expressions in an order of our choice. For example:

alert(4 + 3 * 2);  // alert ’10′
alert((4 + 3) * 2); // alert ’14′
alert((4 / 2) * 2); // alert ’4′


Read the rest of this entry »

Working with System.DateTime – Date and Time String Formatting with C#


Working with System.DateTime – Date and Time String Formatting with C#

Software Development with C# needs to work with dates and times. To work efficiently with Date and Time .NET has the System.DateTime (DateTime) namespace to help us. You can use DateTime to get DateTime values, generate new DateTime values and format DateTime values (parse strings into DateTime or DateTime in the string format).

Creating New DateTime Objects with C#

The default value of DateTime is Jan 1, 0001 at 12:00 midnight.

DateTime newDate = new DateTime();
Console.WriteLine("date: {0}", newDate); //date: 1/1/0001 12:00:00 AM

Creating New DateTime through the constructor

You can initialize the DateTime through the constructor using several pre-define options.

System.DateTime newDate = new System.DateTime(2010, 9, 5, 21, 35, 15, 777);
Console.WriteLine("date: {0}", newDate);//date: 9/5/2010 9:35:15 PM

If you need the current date and time? DateTime.Now will do it for you.

System.DateTime newDate = System.DateTime.Now;
Console.WriteLine("date: {0}", newDate);// Current Date Time will be display

Date and Time String Formatting with C#

The date and time value can be represented by either a DateTime or a DateTimeOffset value. Date and Time String Formatting fall into two categories:

  • Standard Date and Time String Formatting
  • Custom Date and Time String Formatting


Read the rest of this entry »