Pages

Thursday, September 12, 2013

Guide to advantages of .Net Framework

1.        What are the advantages of using .NET ?
Consistent Programming Model:
Different programming languages have different approaches for doing a task. For example, accessing data with a VB application and a VC++ application is totally different. A developer has to know bothdifferent techniques to do the task. In case of .NET Environment, for the same example, displaying data from database in a grid accessing data with a VB.NET and a C# is very similar except slight syntactical differences. Both the programs use the System.Data namespace, establish a connection with the database and run a query and displays the data on a data grid.

Language Independence:
Language Independence means the developer has the independence to code one module of an application in one language and other module of same application in other language. This language interoperability can help in code reuse and improve the efficiency of the development process.

No versioning Problem - Easy Application Deployment and Maintenance:
The .NET Framework makes deployment of applications easy. Commonly, to install an application all we need to do is, copy the application along with the components it requires into a directory on the computer. The .NET handles the details of locating and loading the components an application needs, even if several versions of the same application exist on the computer. The .NET ensures that all the components the application depends on are available on the computer before the application begins to run.

Improved Security:
The .NET Framework provides several mechanisms for protecting resources and code from unauthorized users:
·            ASP.NET Web Application Security provides a way to control access to a web site by comparing authenticated permissions with File System permissions for proper authorization.
·            Code access security uses permissions to control the code accessing protected resources and operations. The computer systems are protected from suspicious mobile code and provide a way to run mobile code to safely.
·            Role-based security provides information needed to make decisions about user’s permissions.

Support for Web Services:
Web services are remote databases and programs, which access other computers to read the data files. Web services provide many built in Base Class library facilities which open up a whole new world of information for users.

Dynamic Web:
Content that changes with the user and user preferences is an example of dynamic web content. Dynamic web content is easier to create with .NET. ASP.NET and Visual Studio.NET allow developers to create dynamic web much easier than IIS and ASP technologies.

Visual Studio.NET:

Visual Studio.NET is the Microsoft application and interface for programming in .NET. Visual Studio .NET provides all the programming advantages mentioned so far. This development environment has extensive set of ready to use controls, good debugging facilities, easy and simple programming features and vast set of .NET Base Classes.


1.        Explain different features of .NET.

2.        What is .NET ?
List the advantage of .NET frame work.

Consistent Programming Model:
Different programming languages have different approaches for doing a task. For example, accessing data with a VB application and a VC++ application is totally different. A developer has to know bothdifferent techniques to do the task. In case of .NET Environment, for the same example, displaying data from database in a grid accessing data with a VB.NET and a C# is very similar except slight syntactical differences. Both the programs use the System.Data namespace, establish a connection with the database and run a query and displays the data on a data grid.

Language Independence:
Language Independence means the developer has the independence to code one module of an application in one language and other module of same application in other language. This language interoperability can help in code reuse and improve the efficiency of the development process.

No versioning Problem - Easy Application Deployment and Maintenance:
The .NET Framework makes deployment of applications easy. Commonly, to install an application all we need to do is, copy the application along with the components it requires into a directory on the computer. The .NET handles the details of locating and loading the components an application needs, even if several versions of the same application exist on the computer. The .NET ensures that all the components the application depends on are available on the computer before the application begins to run.

Improved Security:
The .NET Framework provides several mechanisms for protecting resources and code from unauthorized users:
ASP.NET Web Application Security provides a way to control access to a web site by comparing authenticated permissions with File System permissions for proper authorization
·             Code access security uses permissions to control the code accessing protected resources and operations. The computer systems are protected from suspicious mobile code and provide a way to run mobile code to safely.
·             Role-based security provides information needed to make decisions about user’s permissions.

Support for Web Services:
Web services are remote databases and programs, which access other computers to read the data files. Web services provide many built in Base Class library facilities which open up a whole new world of information for users.

Dynamic Web:
Content that changes with the user and user preferences is an example of dynamic web content. Dynamic web content is easier to create with .NET. ASP.NET and Visual Studio.NET allow developers to create dynamic web much easier than IIS and ASP technologies.

Visual Studio.NET:

Visual Studio.NET is the Microsoft application and interface for programming in .NET. Visual Studio .NET provides all the programming advantages mentioned so far. This development environment has extensive set of ready to use controls, good debugging facilities, easy and simple programming features and vast set of .NET Base Classes.

1.        Explain .NET framework?
The .NET Framework is the foundation on which you can design, develop, and deploy applications. It is the core of the .NET infrastructure. It exists as a layer between the .NET applications and the underlying operating system. The .NET Framework encapsulates much of the basic functionality, such as debugging and security services, which was earlier built into various programming languages.

2.        What is unsafe code? Explain.

Unsafe code refers to the code that is processed with low security levels. There are situations where access to pointer types becomes a necessity. For example, interfacing with the underlying operating system, accessing a memory-mapped device, or implementing a time-critical algorithm may not be possible without access to pointers. To address this need, C# provides the ability to write unsafe code. In unsafe code, it is possible to declare and operate on pointers, to perform conversions between pointers and integral types, to take the address of variables, and so forth. In a sense, it is like writing C code within a C# program. Unsafe code must be clearly marked with the modifier unsafe, so developers cannot possibly use unsafe features accidentally. When CLR finds this unsafe modifier, the execution engine works to ensure that the unsafe code cannot be executed in an untrusted environment.

3.        Explain the following:

b) JIT compiler.
JIT compilation converts IL into its native machine code. The name JIT is because it compiles portion of code as and when required at runtime.



4.        How .NET remoting different from web services and DCOM ?
The differences between .NET Remoting and Web services are listed as follows:
·             ASP.NET based Web services can only be accessed over HTTP, whereas the .NET Remoting can be used across any protocol.
·             Web services work in a stateless environment where each request results in a new object created to service the request. .NET Remoting supports state management options and can identify multiple calls from the same client.
·             Web services serialize objects through XML contained in the SOAP messages and can thus only handle items that can be fully expressed in XML. .NET Remoting relies on the existence of the metadata within assemblies that contain information about data types. This limited metadata information is passed about an object, when it is passed by reference.
·             Web services support interoperability across platforms and are good for heterogeneous environments. .NET Remoting requires the clients to be by built using .NET, which means a homogeneous environment.
The difference between .NET Remoting and DCOM is listed as follows:
·             DCOM relies on a proprietary binary protocol that not all object models support. It also wants to communicate over a range of ports that are typically blocked by firewalls. However, .NET Remoting supports different transport protocol formats and communication protocols. This allows .NET Remoting to be adaptable to the network environment in which it is being used.
1.        Write a program in C# to display “Welcome to C Sharp”. Explain the program.
The C# program is as follows:
using System;
namespace ConsoleApplication1
{
class Welcome
{
                             static void Main()
                             {
                             System.Console.WriteLine("Welcome to C Sharp");
                             Console.Read();
}
}
}

The important points to be noted in this program are:
·             Main method: Program execution begins with the Main method.
·             Input and output: The WriteLine function displays the string on the standard output device.
·             Compilation and execution: To compile the program, enter the following command:
cscWelcome.cs
To execute the program, enter the following command:
Welcome

2.        How does C# supports multiple inheritance?
C# directly does not support multiple inheritance. But we can use this feature by using interface. Interface supports multiple inheritance.
interfaceIControl
{
void Paint();
}

interfaceITextBox: IControl //ITextBox inherits IControl
{
voidSetText(string text);
}

interfaceIListBox: IControl //IListBox inherits IControl
{
voidSetItems(string[] items);
}

interfaceIComboBox: ITextBox, IListBox {}
the interface IComboBox inherits from both ITextBox and IListBox. Classes and structs can implementmultiple interfaces.
1.        Define the following :
CLR, CTS, CLS, Intermediate language.
CLR:The CLR loads and executes the code. Code management is a fundamental principle of the runtime. It also provides services such as memory management, thread management, remoting, type safety, code security, and robustness.
CTS:The CTS is a standardized set of basic data types. This system provides a way to language interoperability. An object implemented in one .NET supported language can call an object implemented in another .NET supported language.
CLS: Common Language Specification (CLS) is a set of rules for basic language features that have been defined to enhance and ensure language interoperability.




2.        Give the classification of comman data type system.

3.        What is the function of CTS ? Explain the classification of types in CTS with a diagram.
The CTS defines how types are declared, used, and managed in the runtime. It is important for language interoperability. The CTS performs the following functions:
·             Establishes a common framework that enables cross-language integration, type safety, and high performance code execution.
·             Provides an object-oriented model.
·             Defines rules that languages must follow, so that different languages can interact with each other
CTS can be classified into:
·             Value types
·             Reference types
The following diagram illustrates type classification.
Value types directly store data in the variable. Value types can be built-in type, user-defined types, or enumerations.
Reference types store a reference to the data's memory address. Reference types can be self-describing types, pointer types, or interface types. Self-describing types are further split into arrays and class types. The class types are user-defined classes, boxed value types, and delegates.
All types derive from the System.Object base type


4.        What is operator overloading? Explain with an example.
Operator overloading refers to loading an operator to perform different operations on different data types on different contexts. To overload an operator in a class, one defines a method by using the 'operator' keyword.
The following program uses operator overloading to create a complex number class ComplexAdd that defines complex addition. The program displays the imaginary and the real parts of the numbers and the addition result using an override of the ToString method.
// complexAdd.cs
using System;
public struct ComplexAdd
{
public int r;
public int img;
public Complex(int r, int img)
   {
      this.r = r;
      this.img = img;
   }
   // Declare which operator to overload
public static ComplexAdd operator +(ComplexAdd c1, ComplexAdd c2)
   {
return new ComplexAdd(c1.r + c2.r, c1.img + c2.img);}
   // Override the ToString method to display a complex number in a required format:
public override string ToString()
   {
return(String.Format("{0} + {1}i", r, img));}
public static void Main()
   {
      ComplexAdd var1 = new ComplexAdd(5,3);
      Complex var2 = new Complex(6,2);
      // Add two Complex objects (var1 and var2) through the
      // overloaded plus operator:
      ComplexAdd total = var1 + var2;
     // Print the numbers and the sum using the overridden ToString method:
Console.WriteLine("First complex number:  {0}",var1);
Console.WriteLine("Second complex number: {0}",var2);
Console.WriteLine("The sum of the two numbers: {0}",total);}}
Output
First complex number: 5 + 3i
Second complex number: 6 + 2i
The sum of the two numbers: 11 + 5i 

Tips to Start Any Internet Browser in Private Browsing Mode


Today’s Private browsing mode is the best option to protect entire privacy over internet. It avoids you to save your visit history, search history, cookies and other confidential data during browsing sessions. If you like always start your browser in private browsing mode then this feature is available in almost all leading browser like Chrome, Firefox, Opera and etc.
While a good number of people will not wish to use private-browsing mode permanently due to some personal reasons. To get started this feature in any browser, you need to sign in to your browser which you use always. Now check out the tips how to start private browsing mode always in following browser?
Google Chrome
·         At first you need to turn on Google Chrome’s incognito mode. Generally the chrome’s shortcut is located either on your desktop, start menu or taskbar. So you need to insert a command-line option to its shortcut.
·         If you are using chrome task bar shortcut on Windows 7 or 8 then you will have to right-click on the Google Chrome icon on your task bar and select Properties.
·         Under Google Chrome Properties window, click on Shortcut tab. Here insert a command “incognito” after single space to the end of the box.
·         Next click OK button after inserting this command-line.
Thus Google Chrome will now begin in incognito mode while you will start it using taskbar shortcut. If you use additional shortcuts (desktop) to begin Google Chrome then you will need to change its properties with above same method.



Mozilla Firefox
Firefox lets you to automatically turn on private-browsing mode using its options window. To do so,
·         Click on the Firefox menu button at the top side and select Options.
·         Next click on the Privacy tab under options window. Here go to History tab and select Never remember history option from drop –down list.
·         Now Firefox will use private-browsing mode but it will not present its normal private-browsing interface.
Internet Explorer
You need to add a command-line option to Internet Explorer shortcuts properties in order to enable InPrivate browsing mode automatically. The shortcuts of Internet Explorer are located either on the desktop or taskbar. To do this,
·         At first search for Internet explorer shortcut (for example taskbar) which you want to start.
·         Next right-click on it and select Properties. Within Windows 7 or 8, right-click on the Internet Explorer icon and select Properties.
·         Here you have to insert a private word to the end of the target box (see below screenshots carefully).
·         Finally click OK button.

Thus Internet Explorer will now run with InPrivate browsing mode while you start it through taskbar shortcut. If you use other shortcuts to run Internet Explorer then you need to change with private word to its properties.
Opera
Opera also provides a command-line option to switch on private-browsing mode. To do so,
·         Look for your Opera shortcut either from desktop or task bar  Next press right-click on it and select Properties.
·         Next insert newprivatetab word to the end of the target box.  
·         At last Click OK button.
Now Opera will start a private-browsing tab when you start with this shortcut.
Conclusion
Keep in mind that all above browsers are unable to store login history, websites favorites or any other type of data like visit history once you switch on private mode.  So browser private mode feature are both good thing and annoyance. In case If you like to restore any of these changes then you can remove command –line word to the shortcuts which you have added before. For Firefox browser, you have to select the Remember history option.

Monday, September 9, 2013

Introduction to Web Programming

1Differentiate between Java & Java scripts.
Java :-
Java Programming language, is an OOP Language and development environment, application environment, deployment environment. It is  standalone programming Language that do not require a web browser to execute.
Java script:
It is a contained in the HTML source of webpage. It controls document appearance and content.
It also manipulates embedded images and it also interacts with Applets. Its advantage is that it is simplified,

it doesn’t have to be compiled and the source code resides within our HTML document.

1 What are cookies? And why are cookies used for?
Cookies are small text strings you store on a user's computer. Cookies store information for tracking users in  name-value pairs. When you first visit a website it may store a cookie on your computer. Next, when you again visit the site it may read or manipulate the value of the cookie and perform an action based on it. For example, if a site allows you to customize the color of the user interface, it may set the color selected by you in a cookie on your computer and read the color value when next time you request the page of the website. The page can them be displayed in the color stored in the cookie.

2What is XML? Give the XML document.
XML is a simple, common format for representing structured information as text. You can create your own tags to define and structure data, and transmit it.  The basic syntax of XML is extremely simple. As with HTML, XML represents information as text using tags to add structure. A tag begins with a name in between angular brackets (<>). In XML, every tag must have a closing tag. An opening tag, closing tag and any content in between are collectively referred to as an element of an XML document. Elements can contain other elements but they must be properly nested. Elements can also contain text or a combination of elements and text.

Best Online Services to Sync Files between Computers Over Internet

Copy files from one computer to another is extremely tiring job. Without knowing proper methods, sometimes it can take unlimited periods of time. An easiest solution to fix this type of difficulty using syncing applications which mostly perform whole job for you in short periods of time. There are three kinds of sync solution available between two or more computers or devices for example,
  •          Particular Sync  applications
  •        Local network sharing
  •        Cloud service (Google Drive, SkyDrive, DropBox)

The major variation between these two sync solutions is that through a cloud services you will also have a backup copy reserved online. Besides those preferring the cloud solution will perhaps have to subscribe a paid account if they have to save unlimited files as backup.
Tips to Sync files between two computers Using Sync Software

SyncToy is windows OS based freeware sync software and comes from Microsoft. It lets you to synchronize files between computers with same network. The software is very customizable, user-friendly and helps users to do most processes like copying, transferring and synchronization only with few steps. Here’s how to get advantages of sync features from this software?
  •         At first, download SyncToy from the official Microsoft site and install it to your computer.
  •          Next click on Create New Folder Pair button.
  •          Now select the path of the left folder and the right folder. The left folder stands for the path to the folder that you wish to be synchronized and the right folder denotes the path to the target folder on your system.
  •          Next you will get a new screen with three possible action buttons like Synchronize, Echo and Contribute. The last two buttons only copy the new and updated files from the left folder to the right folder. While Echo button will make carbon copy or clone every delete actions from left to right.
  •          To start the syncing actions, select the Synchronize action button. Now, set a folder name for the synced folders and click on Finish button.

·         Finally, click on Run button to start the synchronization.


FreeFileSync is simple sync application in order to sync all types of files. The application comes with a folder comparison and synchronization tool that will do the complete job once the user finishes these next steps.
  • Firstly Download FreeFileSync from here.
  • Launch the application and a folder which you like to clone information from and its destination.
  • Now Compare the files and choose desired synchronization settings.
  • Next press the Synchronize button.


BitTorrent Sync is freeware sync software that comes through recognized torrent client. It lets you to sync files without difficulty and strongly between computers by the peer-to-peer protocol. The benefit of this software is that none of your files are syncing to cloud but directly to the other computer. Remind that both computers must be connected to internet during perform the syncing operation.
How to setup BitTorrent Sync Software?
·         Firstly, download BitTorrent Sync software from here.
  • When you begin this software for the first time, you have to select the path for the synced folder.
  • BitTorrent software provides you a secret code. This code will be used further on the other computer to connect the two synced folders.
  • As soon as all sync operations are configured successfully, the syncing procedure will automatically start

Note:
One more popular sync software which you may also test is known as GOODSYNC

Tips to Sync files between two computers using local network sharing
These days, it is fairly simple to have above one computer in a home. So, transferring files between them becomes vital. Sharing a folder is an easy process but not everyone familiars how to get started it. So read the steps at the bottom how to correctly share a folder on Windows OS?
·         At first, right click on the preferred folder which you want to share over network.
·         Next select Share with option from right panel and choose to share it with Specific People option. Now go to drop-down panel and select either a particular user option or everyone option. Almost, everyone option lets you to access the shared files to connected network.
·         At last click on Share option and wait until the process finishes.
·         To access the just now shared folder in the network, now search your computer’s name in the Network section and see the files within shared folder.

Tips to Sync files between two computers using Cloud Service

Dropbox is a well-known cloud based service that allows users to access most used files like photos, docs, videos from anyplace on the web. It offers free service that also supports synchronization productivy. An additional exciting feature of
 Dropbox is that it can also sync Smartphone. So, if you wish to use Dropbox on your Smartphone, the official app is available for Android or iOS
GOOGLE DRIVE
Google Drive is an integral part of Google’s search engine which now offering free cloud and DOC service together for all Gmail users. Currently Gmail desktop app comes for most every platform like Windows, Mac, Chrome OS, Android and iOS. The download link of Gmail desktop app is here.
The most remarkable feature of Google Drive lets to use free accounts with 5 GB of cloud storage. More details here.
BOX

Box is also admired online cloud storage service that supports sync features. It provides fully online service and can be used for creating and editing documents directly in the browser. The Box cloud service offers desktop app for Windows, Mac which is used only to sync files. Synchronization can also be made directly from the web browser.
You may check out the another excellent alternative as Space Monkey