Tuesday 30 December 2014

How to create cmd file for SVN Export operation using VBScript

Option Explicit
dim objXML2,fso,strdir,CurrentDirectory,ExportFile,LocalPath,SVNPath,colNodes,objnode,backupvalue,colNodes1
Set objXML2 = CreateObject("Microsoft.XMLDOM")
objXML2.async = "false"
strdir= WScript.Arguments.item(0) '"C:\ABC.xml"

set fso = CreateObject("Scripting.FileSystemObject")
CurrentDirectory = fso.GetAbsolutePathName(".")
Set ExportFile = fso.CreateTextFile(CurrentDirectory&"\SVNExport.cmd", True)
ExportFile.WriteLine("@echo off")
ExportFile.WriteBlankLines(1)
'ExportFile.WriteLine("start /b 1")

LocalPath = "C:\SVN Export" 'WScript.Arguments.item(1)
SVNPath = "https://svn.pointcrossblr.com/svn/Devbuild/EngineeringBuild" 'WScript.Arguments.item(2)

'ExportFile.WriteLine("LocalPath: " & LocalPath)
'ExportFile.WriteLine("SVNPath: " & SVNPath)

If (Not objXML2.load(strdir)) Then
    wscript.echo "Unable to load file '" & strdir & "'. "
    WScript.Quit(1)
End If

'Set colNodes = objXML2.selectNodes ("/PRODUCTINFO/PRODUCT")
'For Each objNode in colNodes
' If backupvalue <> "" Then
' ExportFile.WriteLine("start /b %~nx0 """ & objnode.getAttribute("NAME") & """")
' ExportFile.WriteBlankLines(1)
' else
' ExportFile.WriteLine("if not " & objnode.getAttribute("NAME") & "= """" goto :" & objnode.getAttribute("NAME"))
' ExportFile.WriteBlankLines(1)
' End If
' backupvalue = objNode.getAttribute("NAME")
' ExportFile.WriteLine("echo Export Completed")
'Next
Set colNodes1 = objXML2.selectNodes ("/PRODUCTINFO/PRODUCT")
'ExportFile.WriteBlankLines(1)
For Each objNode in colNodes1
    wscript.echo objnode.getAttribute("NAME")& " : " & objnode.getAttribute("VERSION")
' ExportFile.WriteLine(":" & objnode.getAttribute("NAME"))
ExportFile.WriteLine("echo Getting " & objnode.getAttribute("NAME") & " of version " & objnode.getAttribute("VERSION") & " from SVN")
ExportFile.WriteLine("""C:\Program Files\TortoiseSVN\bin\svn.exe"" export --force """ & SVNPath & "/" & objnode.getAttribute("NAME") & "/" & objnode.getAttribute("VERSION") & """   """ & LocalPath & "\" & objnode.getAttribute("NAME") & "\" & objnode.getAttribute("VERSION") & """" & " --username praveen.v --password PNT@123ltd --no-auth-cache --non-interactive --trust-server-cert")
Next
'get the paths for each solutions

'wscript.echo objnode.getAttribute("NAME")& " : " & objnode.getAttribute("VERSION")

ExportFile.WriteLine("echo Export Completed")
'ExportFile.WriteLine("pause")
ExportFile.close()

How to find the solution file paths from root folder using VBScript

Option Explicit 'force all variables to be declared
Const ForWriting = 2
Dim objFSO 'File System Object
Dim CurrentDirectory,objTS,localpath


set objFSO = CreateObject("Scripting.FileSystemObject")
CurrentDirectory = objFSO.GetAbsolutePathName(".")
Set objTS = objFSO.CreateTextFile(CurrentDirectory&"\SVNExport.txt", True)
localpath = WScript.Arguments.item(1) 'C:\Praveen'
Call Recurse(localpath)
objTS.Close()

Sub Recurse(strFolderPath)
    Dim objFolder
    Set objFolder = objFSO.GetFolder(strFolderPath)
    Dim objFile
    Dim objSubFolder

    For Each objFile In objFolder.Files
        'only proceed if there is an extension on the file.
        If (InStr(objFile.Name, ".") > 0) Then
            'If the file's extension is "pfx", write the path to the output file.
            If (LCase(Mid(objFile.Name, InStrRev(objFile.Name, "."))) = ".sln") Then _
                objTS.WriteLine(objfile.Path)
        End If
    Next

    For Each objSubFolder In objFolder.SubFolders
        Call Recurse(objSubFolder.Path)
    Next
End Sub

Sunday 9 November 2014

How to delete a user in Oracle 10 including all it's tablespace and datafiles

DROP USER---->
DROP USER USER_NAME CASCADE;
DROP TABLESPACE---->
DROP TABLESPACE TABLESPACE_NAME INCLUDING CONTENTS AND DATAFILES;

Thursday 6 November 2014

Query to Find Column From All Tables of Database in Oracle

Oracle
---------

select table_name from all_tab_columns where column_name='IPADDRESS';


---------------------
SQL Server 2008
---------------------

SELECT ROUTINE_NAME, ROUTINE_DEFINITION, ROUTINE_TYPE FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%ABCD%'

Tuesday 26 August 2014

.Net good materials links

This is the best video material links which is created by G venkat

C# and ASP.net and MVC and WCF.

http://www.pragimtech.com/c-sharp-video-tutorials.aspx


Discover the Design Patterns You're Already Using in the .NET Framework

Introducing Windows Communication Foundation in .NET Framework 4

Object-Oriented Programming (C# and Visual Basic)

Six important .NET concepts: Stack, heap, value types, reference types, boxing, and unboxing

A Guide to Designing and Building RESTful Web Services with WCF 3.5

Basic Security Practices for Web Applications

Building web apps without web forms

C# Tuterails link

.Net interview real time interview questions




Blog for the interview questions

http://computerauthor.blogspot.in/

Friday 25 July 2014

Skills needed for .Net experienced

Skills needed for .Net experienced
  • .Net Framework (2.0, 3.5)
  • ASP.NET (2.0)
  • C#/VB.NET
  • Object Oriented Programming
  • .NET IDE (2008)
  • Debug Tools (Fiddler, IE Dev tools, Firebug)
  • SQL Server 2K/2005/8
  • Oracle 11g
  • Web Services/WCF
  • AJAX
  • XML & XSL
  • HTML, CSS
  • Javascript
  • Jquery
  • JSON
  • Crystal Reports
  • Methodologies (AGILE Scrum)
  • VSS, SVN
  • IIS 6.0
  • Modelling Tools (Visio, Erwin)
  • Design Patterns

  • Frameworks(Entity, Spring, MVC)

Wednesday 2 July 2014

Working Nature of Garbage Collector

  • Garbage collector will divide complete managed heap into three generations internally named as
    1. Generation 0
    2. Generation 1
    3. Generation 2
  • Generation :- A generation is portion of memory from the managed 
  • Maximum number of generation allowed are only three.
  • In general always generation 2 memory size bigger than generation 1 memory size and generation 1 memory size bigger than the generation 0 memory size.
  • This can be represented by mathematically like... 


What is role of GC (Garbage Collector)?

Garbage Collector(GC):

  • Garbage collector(GC) is responsible to provide automatic memory management.
What is Automatic Memory Management:
  • Garbage collector has its own engine known as optimizing engine. which runs when required and divides objects into two categories.
    • Objects in use
    • Idled objects (known as Garbage)
  • Objects in use are kept in the memory and idled objects are destroyed from the memory.
  • This process known as Automatic Memory Management.
Why Automatic Memory Management:
  • There do not be any problem of insufficient memory
  • Burden on the programmer is reduced i.e programmer need not write code to perform memory tasks.

Wednesday 25 June 2014

What is Boxing and Unboxing? and explain in detail?

Boxing:
  • Boxing is the process of converting a variable type to reference type.
  • Supports 2 types
    • Implicit boxing
    • Explicit boxing
  • Boxing 20 times Costlier than normal initialization
Unboxing:
  • Unboxing is the process of converting a reference type to value type.
  • Supports only 1 type
    • Explicit Unboxing
  • Unboxing 4 times costlier than normal initialization
Example: Program for boxing and Unboxing:
Output:

  • Boxing is 20 times costlier than normal initialization, because whenever a boxing is done following tasks will be performed internally.
    • Runtime will search for the respective data with in the stack.
    • A copy of this value is made into heap.
    • Reference to this copy is maintained from the object variable.
  • Unboxing is 4 times costlier than normal initialization, because whenever a boxing is done following tasks will be performed internally.
    • Object referenced value is searched within the Heap.
    • A copy of this is made into stack.

What are the categories of data types in CTS and explain in details?

CTS is devided in to two categories:
  1. Values type
  2. Reference type
Value type:
  • The data types which store the data directly in to the memory locations is known as value types.
  • Memory is allocated at Compilation Time.
  • Memory allocation is Made with in the Stack i.e in contiguous memory locations
  • CLR does not provide automatic memory management.
Reference type:
  • The data type which do not store the data into there memory locations rather refers to other memory locations is known as reference types.
  • Memory is allocated at Run Time.
  • Memory allocation made with in the heap i.e Random Memory Locations.
  • CLR provides Automatic memory management.

What is CTS and explain its role?

CTS(Common Type System)

  • As we know Managed code execution process .NET supports many programming languages.
  • Every programming Language has it own data types.
  • One programming Language can not understood other Programming Languages data types.
  • But CLR will execute all programming Languages code, this is possible because CLR will contain its own data types, which is common to all the programming languages 
  • At the time of compilation all languages specific data types are converted in to CLR's Data Type.
  • This Data Type System of CLR which is common to all programming languages of .Net is known as Common Type System.
  • This common type system is divided in to two categories:
    • Value Types
    • Reference Types

What is Unmanaged Code and Unmanaged Code Execution? and what is CCW and RCW?

Unmanaged Code:
  • The code that has written before development of .Net for which MSIL is not available is not executed by CLR directly, rather CLR redirects the code to OS for Execution, which is known as Unmanaged code.
  • The code which has developed outside .Net framework is known as Unmanaged code.
  • Applications that do not run under the control of the CLR are said to be unmanaged, and certain languages such as C++ can be used to write such applications, which, for example, access low - level functions of the operating system. Background compatibility with code of VB, ASP and COM are examples of unmanaged code.
Unmanaged Code Execution:
  • The code execution process is known as Unmaged Code Exection.
  • CLR will not provide any facilities and features of .Net to Unmanaged Code Execution like Language Interoperability, Automatic Management, Common Data Type System, Exception Handling Mechanism, Code Access Security etc.
Unmanged code executed with helper of wrapper classes.

Wrapper classes are two types:
  1. CCW (COM Callable Wrapper)
  2. RCW (Runtime Callable Wrapper)
COM callable wrapper unmanaged code execution


Runtime Callable Wrapper unmanaged code execution





What is Managed Code and Managed Code execution?

Managed Code:
  • The code which MSIL is generated after Language Compiler Compilation is directly executed by CLR is known as Managed Code.
  • Any language that is written in .NET Framework is Managed code.
  • Applications which runs under the control of the CLR is known as Managed code.
  • The resource, which is with in your application domain is, managed code. The resources that are within domain are faster
Managed Code Execution:
  • The code execution process is known as Managed Code Execution.
  • CLR will provide all the facilities and features of .Net to Managed Code Execution like Language Interoperability, Automatic Management, Common Data Type System, Exception Handling Mechanism, Code Access Security etc.



What is Language Interoperability?

Language Interoperability:

  • Providing code execution support that has been written in other programming languages is known as Language Interoperability.
  • Language Interoperability is achieved using Managed and Unmanaged.


What is CLS and Explain its role?

CLS(Common Language Specification)

  • Language Specification: Every Programming Language will have some Syntactical rules used to write the code which is known as Language Specification.
  • As we know Managed code execution process .NET supports many programming languages.
  • Every programming Language has it own Language Specification.
  • One programming Language can not understood other Programming Language Specification.
  • But CLR will execute all programming Languages code, this because
    • CLR can not understand any programming Language Language Specification rather CLR has its own Language Specification (Syntactical Rules) for its MSIL.
    • Any Language Compiler should follow this Language Specification of CLR at the time of compilation and should generate MSIL, CLR's JIT Compiler will generate native code from MSIL and CLR will execute it.
  • This Language Specification of CLR is common to all programming Languages of Managed code execution of .NET and is known as CLS (Common Language Specification)
Role of CLS
  • CLS is responsible to provide language interoperability
  • This is achieved in 2 ways 
    1. Managed Code 
    2. Unmanaged Code.

What is CLR and explain its role?

CLR (Common Language Runtime):

The Common Language Runtime (CLR) is the virtual machine component of Microsoft's .NET framework and is responsible for managing the execution of .NET programs.

CLR will provide all the facilities and features of .NET to the Managed Code Execution like
  • Language Interoperarability,
  • Automatic Memory Management,
  • Common Data Type System,
  • Exception Handling Mechanism,
  • Code Access Security etc.

The CLR provides the following benefits:

  • Performance improvements.
  • The ability to easily use components developed in other languages.
  • Extensible types provided by a class library.
  • Language features such as inheritance, interfaces, and overloading for object-oriented programming.
  • Support for explicit free threading that allows creation of multithreaded, scalable applications.
  • Support for structured exception handling.
  • Support for custom attributes.
  • Garbage collection.
  • Use of delegates instead of function pointers for increased type safety and security 

What are the components of .NET Framework?



.NET Framework contains the following components:
  • CLR (Common Language Runtime)
    • CLS (Common Language Runtime)
    • CTS (Common Type System)
    • GC (Garbage Collector)
    • JIT (Just In Time) Compiler)
  • BCL(Base Class Libraries) or (Framework Class Libraries)

Thursday 12 June 2014

How many times code is compiled in .Net?

  • In .Net code compiled twice
  • In first compilation source code is compiled by respective language compiler and an intermediately code is generated known as MSIL.
  • In second compilation MSIL is converted into Native code using CLR.
MSIL : Microsoft Intermediate Language
CLR : Common Language Runtime

What is platform independency?

Code that has been generated by the language compiler compilation runs/execute on any Processor and in any Operating System than which it has been compiled, this nature is known as platform independency.

What is platform dependency?

Code that has been generated by the language compiler compilation doesn't run/execute on a different Processor and in different Operating System than which it has been compiled, this nature is known as platform dependency.

What is platform?

Platform is the combination of CPU Architecture and Operating System Architecture.

Is .NET platform indipendent?

  • .NET is platform dependent using .NET Framework but independent using Mono Framework.
  • Mono Framework is designed by the Novell Company. (For more information on Mono Framework please visit (http://www.mono-project.com)

How many languages .NET supports?

.NET is a Framework tool which supports many programming languages.


.NET Framework 2.0:  Support upto 40+ languages
.NET Framework 3.5:  Support upto 60+ languages
.NET Framework 4.0:  Supports 96+ languages

  1. According to this we are considering .Net Framework 3.5, it will supports 61 programming languages.
  2. In 61 programming languages 9 are designed by Microsoft and 52 are designed by Non Microsoft.
List of Microsoft Designed Programming Languages:
  1. C#.NET
  2. VB.NET
  3. J#.NET
  4. JSCRIPT.NET
  5. C++.NET
  6. F#.NET
  7. Windows Power Shell
  8. Iron python
  9. Iron Ruby
Note:
  • ASP.NET is not programming language.
  • ASP.NET is a web technology or server side technology.
  • ASP.NET code can be written using VB.NET or C#.NET, or J#.NET

Explain Code Execution Process in .Net?

Code Execution in .Net
  • In .Net code compiled twice
  • In first compilation source code is compiled by respective language compiler and an intermediately code is generated known as MSIL.
  • In second compilation MSIL is converted into Native code using CLR.
 
       MSIL : Microsoft Intermediate language
       CLR   : Common Language Runtime

  1. Always first compilation is slow and second compilation fast.
  2. MSIL is only CPU Independent & will run only on windows OS only using .Net framework, because .Net framework is designed for windows Operating System only.
  3. There is another company known as Novel designed separate framework known as MONO framework using this framework we can run MSIL on different Operating Systems like Linus, Solaris, Mac OS,BSD , OSX etc.


Why .Net used?


.Net is very much powerful used to build Distributed Computing Applications.
.Net Applications are used for network and Internet Computing.


Tuesday 10 June 2014

What is .Net?

What is .Net

We have various kinds of Software packages in IT fields like below

  1. Operating System --> Windows, UNIX, Linux etc
  2. Applications / Packages --> MS Office, Tally, Wings, Star Office etc
  3. Databases --> MS Access, Oracle, Sql Server, DB2, MY SQL. etc
  4. Server Technologies --> SMS Server, Share Point Portal Server, Mail Server, BizTalk Server, Microsoft Content Management Server ect.
  5. ERP Application --> SAP, CRM, Seibel, Oracle financials, MSDynamics etc.
  6. Testing Tools --> Win Runner, Win Loader, QTP etc
  7. Programming Languages --> FORTRAN, COBOL, PASCAL, C, C++, JAVA etc

Now speaking about .NET
  • .NET is not an Operating System.
  • .NET is not an Application / Package.
  • .NET is not a Database.
  • .NET is not an ERP Application.
  • .NET is not a Testing Tool.
  • .NET is not a Programming Language.
  1. .NET is a Framework tool which supports many programming languages.
  2. .NET is supports 61 programming languages. (according to .NET Framework 3.5)
  3. In 61 programming languages 9 are designed by Microsoft and 52 are designed by Non Microsoft.