Thursday, 6 June 2019

Type Script variables

Difference between var,let and const in java script and typescript
-----------------------------------------------------------------------------------
<script>
        // calling x after definition
        var x = 5;
        document.write(x, "\n");
  
        // calling y after definition 
        let y = 10;
        document.write(y, "\n");
  
        // calling var z before definition will return undefined
        document.write(z, "\n");
        var z = 2;
  
        // calling let a before definition will give error
        document.write(a);
        let a = 3;
    </script>


Hoisting in JavaScript
----------------------------

<script>

x=10;

var x;

document.write(x);// 10

</script>

Note: Type script wont support hoisting 

Type script 
--------------

Variables are declared by using any of the below keywords
1.var
2.let
3.const

1.var:
- it is used to define function scope variable.
- it is accessible any location within the function.
- it can be rendered with different values.
Example:
     
          var x=10;
                x=20; // valid

it can be shadowed
           var x= 10;
           var x= 20; // valid

var x:number = 10;
x=20; // it can be rendered different values
console.log(x); // 20

var x:number =30;// it can be shadowed
console.log(x); // 30

let y:number =10
let y:number =20; //error(can't redeclared) - it cant be shadowed

console.log(y);// it can be redndered different values



D:\TypeScriptProject>tsc main.ts

D:\TypeScriptProject>node main.js

typescript
20
30
10

Sunday, 30 April 2017

About Me





Name - Chinnababu ore

Working - Thomson reuters international services pvt ltd

Location - Bengalore
Create a WCF service using the Entity Framework and consume after hosting it in IIS
----------------------------------------------------------------------------------------------------------------
Step1:Create table

USE [Chinna]
GO

/****** Object:  Table [dbo].[Student]    Script Date: 21-10-2014 12:06:31 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Student](
[id] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](50) NULL,
[age] [int] NULL,
 CONSTRAINT [stu_pk] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

Saturday, 29 April 2017

AngularJS Intellisense in Visual Studio 2012

AngularJS Intellisense in Visual Studio 2012
-----------------------------------------------------------

Lot of people facing same problem  for to get Intellisense support for AngularJS in the Visual Studio HTML editor.
here are the steps 
Step 1:

Find the file commonHTML5Types.xsd located in the Visual Studio install directory and back it up (just in case). Mine is here:C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html
Step 2:

Download this new version of commonHTML5Types.xsd and replace the existing one .

https://drive.google.com/file/d/0B8ObCj8_2eAmSmJjU3B6aUoxcUk/view?usp=sharing

Step 3:

Restart Visual Studio and that's it. You now have all the ng-* attributes available in Intellisense. This Works On My Machinetm, so please let me know if it works on yours too.


Saturday, 18 June 2016

Dynamically invoking a method with Reflection in .NET C# Without Constructor

 var DLL = Assembly.LoadFile(@"C:\" + Component);
                string className = DLL.GetName().Name + "." + Class;
                var classInfo = DLL.GetType(className);
                var methodInfo = classInfo.GetMethod(Function);
                if (methodInfo != null)
                {
                    object result = null;
                    ParameterInfo[] parameters = methodInfo.GetParameters();
                    object classInstance = Activator.CreateInstance(classInfo, null);
                    if (parameters.Length == 0)
                    {
                        result = methodInfo.Invoke(classInstance, null);
                    }
                    else
                    {
                        string[] split_Parameters = Parameters.Split(',');

                        object[] parametersArray = new object[split_Parameters.Count()];
                        for (int i = 0; i <= split_Parameters.Count() - 1; i++)
                        {
                            string type = (parameters[i]).ParameterType.Name.ToUpper();
                            switch (type)
                            {
                                case "INT32":
                                    parametersArray[i] = Convert.ToInt32(split_Parameters[i]);
                                    break;
                                case "INT":
                                    parametersArray[i] = Convert.ToInt32(split_Parameters[i]);
                                    break;
                                case "STRING":
                                    parametersArray[i] = split_Parameters[i];
                                    break;
                                case "BOOL":
                                    parametersArray[i] = Convert.ToBoolean(split_Parameters[i]);
                                    break;
                                default:
                                    parametersArray[i] = split_Parameters[i];
                                    break;
                            }
                        }
                        result = methodInfo.Invoke(classInstance, parametersArray);
                        actionResult.Status = "Success";
                    }
                }

Saturday, 21 February 2015

http://wcftutorial.net/Images/020100_Features.jpg
Introduction to WCF
Windows Communication Foundation (Code named Indigo) is a programming platform and runtime system for building, configuring and deploying network-distributed services. It is the latest service oriented technology; Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined features of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.
http://wcftutorial.net/Images/020100_Features.jpg
Below figures shows the different technology combined to form WCF.

Friday, 7 November 2014

Extension Methods

Extension Methods:
------------------------
-It is one of the best approach to extend the functionalities of a class other than inheritance.

-Using this approach u can add new methods under an existing class even if u dont have permission to make changes on the class or the source code of the class is not available.

Exceptions & Exception Handling

Exceptions & Exception Handling:
--------------------------------------------
-Generally under every program we will be comming across errors which are of 2 types:
     -Compile Time Errors
     -Run Time Errors

-A compile time error occurs due to the syntactical mistake that occurs in a program, these are not considered to be dangerous.

Assemblies in C#.net

Assemblies:
----------------
-An Assembly is a unit of file that contains the IL Code corresponding to a project when it was compiled.

-The name of an assembly will be same as the project from which it was created.

-Assemblies are known as units of deployment because once the application development is completed what we install on the clients machines is the assemblies only.

Abstract Classes in c#.net

Abstract Classes:
----------------------
-A class which contains any abstract methods in it is known as an abstract class.

What is an Abstract Method ?
---------------------------------------
Ans: A method which doesn't contain any method body to it is known as an abstract method.
-An abstract method should be declared with the "abstract" modifier.

eg: public abstract void Add();

LINQ

1. Creates a class DataContext referring to the Database under which the table is present.
eg: CSharp7DataContext

2. Creates a seperate class referring to each table that is placed on the OR-Designer. The name of the class will be same as the table name.
eg: Emp or Students

Type Script variables

Difference between var,let and const in java script and typescript -----------------------------------------------------------------------...