Tuesday, October 6, 2015

C# : What is New in C# 6.0?


New features in C#6.0
In this post we will see the newly added features in C# 6.0. In C# 6.0 some very cool features has been added like "Auto-property Enhancements", "Primary Constructors", "Expressions as Function Body", "Use of Static", "Exception Filters", "inline declarations", "nameof Expressions", "Null-conditional Operators", "String interpolation", "Await in catch and finally".





Introduction

Here, you will find nine new cool features of C# 6.0:

  1. Auto-property Enhancements
  2. Parameters on Classes and Structs
  3. Using Static
  4. Exception Filters
  5. Null-conditional Operators
  6. Index Initializers
  7. $ sign
  8. String Interpolation
  9. nameof Expression
  10. Await in catch and finally block

Tuesday, September 15, 2015

Backbone.js – Basic Understanding of Model

Backbone.js - Introduction

Backbone.js Models

When we talk about MVC pattern, Model becomes very important part of this. It is the Model which contains application data. The authors of backbone.js have quite a clear definition of what they believe the model represents in Backbone.js.

Models are the heart of any JavaScript application, containing the interactive data as well as a large part of the logic surrounding it: conversions, validations, computed properties, and access control.




What we have till now- 

In my last post Backbone.js, We have created a HTML page named main.html in which we had included the required script files. Let's create a new js file main.js and includes this file in our main.html page.
<HTML>
 <Head>
  <title>Backbone js Tutorial</title>
 </Head>
 <Body>

  <script src="scripts/underscore-min.js"></script>
  <script src="scripts/jquery-1.11.3.min.js"></script>
  <script src="scripts/backbone-min.js"></script>
  <script src="scripts/main.js"></script>
 </Body>
</HTML>

Monday, September 14, 2015

Bacbone.js - An Introduction

Backbone.js - Introduction

What is Backbone.js ?

Backkbone.js is a JavaScript library that let us create Single-Page Applications (SPAs) in structured manner. Backbone.js is based on Model-View-Controller (MVC) design pattern. It is suitable for creating Single-Page Applications (SPAs) using RESTful services for persisting data.

Components in Backbone.js-

Unlike traditional MVC which have three components, Backbone has following main components-
  • Model
  • View
  • Collection
  • Routers

Sunday, November 16, 2014

Difference between Stored Procedures and User Defined Functions in SQL Server


Stored Procedure
Stored Procedures are pre-compile objects which are compiled for first time and saved, which executes (compiled code) whenever it is called. Stored procedure does not necessarily return data, but it can return more than one result set. It can be used to affect data (update/insert/delete), can have transactions, can have error handling, do not have restrictions about non-deterministic functions, and can call other stored procedures.

User Defined Function
User defined function is compiled and executed every time when it is called. Function attempts to return something, always, and has several restrictions - for example, you can't use DML statements, call stored procedures, call NEWID(), etc. You also cannot have error handling, transactions, or non-deterministic functions (e.g. GETDATE() in SQL Server 2000).

Differences :
  • Stored procedures compiled first time and reuse the execution plan when next time called while function compiled every time when called.
  • Stored procedure can have input parameter as well as output parameter while user defined function can have only input parameters.

Saturday, November 15, 2014

Conversion of Decimal to Binary in C#

In interviews, there are some programming questions which you will find most of the places like Write a program to reverse the string or Write a program to check string are palindrome or not etc..

In this post, I have a picked a question from that type of programming questions i.e.

Write a program for converting the decimal value to binary value?

Below is the simple method for converting a decimal value into binary value  :

Code Snippet


/// <summary>
/// Method for converting Decimal to Binary
/// </summary>
/// <param name="_value">integer value</param>
/// <returns></returns>
static string DecimalToBinary(int _value)
{
  string strBinary = string.Empty;
  while (_value >= 1)
   {
     strBinary = (_value % 2).ToString() + strBinary;
     _value = _value / 2;
   }
   return strBinary;
}
^ Scroll to Top